Bug 125542 - audio/oss does not return propper SNDCTL_DSP_GETBLKSIZE size
Summary: audio/oss does not return propper SNDCTL_DSP_GETBLKSIZE size
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Jung-uk Kim
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-12 17:00 UTC by Martin Laabs
Modified: 2008-11-17 19:27 UTC (History)
0 users

See Also:


Attachments
file.txt (8.87 KB, text/plain)
2008-07-12 17:00 UTC, Martin Laabs
no flags Details
getblksize.c (808 bytes, text/plain; charset="iso-8859-1")
2008-07-15 17:42 UTC, Jung-uk Kim
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Laabs 2008-07-12 17:00:03 UTC
I'm using the "ich" OSS driver for my soundcard because the freebsd driver does not support changing the mic input to the auxiliary channel.
Now - many programs (i.e. xwave, teamspeak, skype) rely on the SNDCTL_DSP_GETBLKSIZE ioctl that is handled incorrect by the OSS-driver which returns an "Invalid argument" error. (At least the ich driver)

I attached my dmesg output and a little test program.

Thank you,
 Martin L.

Fix: use the original sound_ich driver and forgo the features of the oss driver

Patch attached with submission follows:
How-To-Repeat: Install OSS and try the following test-program: (or try to use xwave for playback or recording)

#include <sys/ioctl.h>
#include <fcntl.h>
#include <sys/soundcard.h>
#include <stdio.h>
#include <errno.h>

main()
{
        int             audio;
        int             size = 0;
        int             ioctl_retval;

        audio = open("/dev/dsp", O_RDONLY);
        if (audio == -1)
                printf("open(\"/dev/dsp\",O_RDONLY): %s\n", strerror(errno));
        printf("audio: %d\n", audio);

        ioctl_retval = ioctl(audio, SNDCTL_DSP_GETBLKSIZE, &size);

        printf("SNDCTL_DSP_GETBLKSIZE: %i\n", size);
        if (ioctl_retval == -1)
                printf("ioctl(audio, SNDCTL_DSP_GETBLKSIZE, &size): %s\n", strer

        close(audio);
        return 0;
}
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2008-07-12 17:00:17 UTC
Responsible Changed
From-To: freebsd-ports-bugs->jkim

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2008-07-15 17:36:24 UTC
jkim        2008-07-15 16:36:13 UTC

  FreeBSD ports repository

  Modified files:
    audio/oss            Makefile 
  Added files:
    audio/oss/files      patch-kernel-framework-audio-audio_core.c 
  Log:
  Work around SNDCTL_DSP_GETBLKSIZE API incompatibility.
  
  PR:             ports/125542
  
  Revision  Changes    Path
  1.26      +1 -0      ports/audio/oss/Makefile
  1.1       +12 -0     ports/audio/oss/files/patch-kernel-framework-audio-audio_core.c (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 3 Jung-uk Kim freebsd_committer freebsd_triage 2008-07-15 17:42:50 UTC
On Monday 14 July 2008 08:20 pm, Jung-uk Kim wrote:
> This is one of the incompatibilities between FreeBSD vs. OSS API.
>
> soundcard.h from FreeBSD:
>
> #define SNDCTL_DSP_GETBLKSIZE	_IOR('P', 4, int)
>
> soundcard.h from OSS:
>
> #define SNDCTL_DSP_GETBLKSIZE	__SIOWR('P', 4, int)
>
> Note FreeBSD version is read-only and OSS version is not.  It seems
> OSS version is wrong but it is an obsolete API:
>
> http://manuals.opensound.com/developer/SNDCTL_DSP_GETBLKSIZE.html
>
> You have two choices here.  Compile your appliacations with
> include/soundcard.h from OSS distribution or use
> SNDCTL_DSP_GET[IO]SPACE as recommeneded in the manual.  The latter
> is obviously better choice and there is no incompatibility between
> the two versions.

I just committed a fix.  FYI, my test program is attached.

Thanks for the report!

Jung-uk Kim
Comment 4 Jung-uk Kim freebsd_committer freebsd_triage 2008-11-17 19:26:17 UTC
State Changed
From-To: open->closed

The fix was committed long ago.