[PATCH] Audio Detection Bug

When using the OSS commercial drivers under Solaris 10, SDL will not
properly initialise OSS audio support (dsp) if /dev/sound exists.
Under Solaris (as far as I understand) /dev/sound is provided as a
means of accessing a BSD style audio device, not the OSS device.

SDL assumes that if /dev/sound exists, then it must be running on a
Linux 2.4 system and should make the dsp device path /dev/sound/dsp.
This is wrong. When using the OSS commercial drivers under Solaris,
the dsp device is always referenced as /dev/dsp normally.

My proposed fix is to stat the dsp device in /dev/sound to make sure
it exists, before assuming /dev/sound/dsp as the audio device:

http://icculus.org/~eviltypeguy/SDL_audiodev.patch

I’m sure there may be a better way to do it, but the above patch is
what worked for me.–
Shawn Walker, Software and Systems Analyst
binarycrusader at gmail.com - http://binarycrusader.blogspot.com/

I’m sure there may be a better way to do it, but the above patch is
what worked for me.

Would it be better to just check for the existance of /dev/dsp first? Is
there a reason on any platform to favor /dev/sound/blah?

–ryan.

That’s what I’m not certain about. The comments in the SDL audio code
seem to suggest that /dev/sound/dsp is preferred for “24-bit audio” or
the like starting with Linux 2.4…

I agree with you though somehow I think it’s purposefully checking for
/dev/sound first for Linux platforms. Maybe if the check could be
limited to Linux builds of SDL?On 8/15/05, Ryan C. Gordon wrote:

I’m sure there may be a better way to do it, but the above patch is
what worked for me.

Would it be better to just check for the existance of /dev/dsp first? Is
there a reason on any platform to favor /dev/sound/blah?


Shawn Walker, Software and Systems Analyst
binarycrusader at gmail.com - http://binarycrusader.blogspot.com/

I agree with you though somehow I think it’s purposefully checking for
/dev/sound first for Linux platforms. Maybe if the check could be
limited to Linux builds of SDL?

It seems like your patch is mostly reinforcing what’s already there, so
if it happens to make things happy for commercial OSS on Solaris, what
the heck, let’s put it in CVS and see if anyone complains. :slight_smile:

–ryan.