[patch] ALSA/OSS priority

This patch makes the audio driver detection try ALSA before OSS when
both are compiled in. ALSA is preferable for various reasons, including
multi-open support.

Regards,–
Sam.
-------------- next part --------------
diff -puriN SDL-1.2.9.orig/src/audio/SDL_audio.c SDL-1.2.9/src/audio/SDL_audio.c
— SDL-1.2.9.orig/src/audio/SDL_audio.c 2004-09-17 15:20:10 +0200
+++ SDL-1.2.9/src/audio/SDL_audio.c 2006-02-28 03:05:09 +0100
@@ -43,13 +43,13 @@ static AudioBootStrap *bootstrap[] = {
#ifdef OPENBSD_AUDIO_SUPPORT
&OPENBSD_AUDIO_bootstrap,
#endif
+#ifdef ALSA_SUPPORT

  • &ALSA_bootstrap,
    +#endif
    #ifdef OSS_SUPPORT
    &DSP_bootstrap,
    &DMA_bootstrap,
    #endif
    -#ifdef ALSA_SUPPORT
  • &ALSA_bootstrap,
    -#endif
    #ifdef QNXNTOAUDIO_SUPPORT
    &QNXNTOAUDIO_bootstrap,
    #endif
    diff -puriN SDL-1.2.9.orig/src/audio/SDL_sysaudio.h SDL-1.2.9/src/audio/SDL_sysaudio.h
    — SDL-1.2.9.orig/src/audio/SDL_sysaudio.h 2004-08-21 05:21:44 +0200
    +++ SDL-1.2.9/src/audio/SDL_sysaudio.h 2006-02-28 03:05:43 +0100
    @@ -107,13 +107,13 @@ typedef struct AudioBootStrap {
    #ifdef OPENBSD_AUDIO_SUPPORT
    extern AudioBootStrap OPENBSD_AUDIO_bootstrap;
    #endif
    +#ifdef ALSA_SUPPORT
    +extern AudioBootStrap ALSA_bootstrap;
    +#endif
    #ifdef OSS_SUPPORT
    extern AudioBootStrap DSP_bootstrap;
    extern AudioBootStrap DMA_bootstrap;
    #endif
    -#ifdef ALSA_SUPPORT
    -extern AudioBootStrap ALSA_bootstrap;
    -#endif
    #ifdef QNXNTOAUDIO_SUPPORT
    extern AudioBootStrap QNXNTOAUDIO_bootstrap;
    #endif

Fedora applies a patch which prefers sound daemons (aka arts/esd) over raw
sound implementations … wonder how people feel about that … btw, i like
this patch which tries alsa before oss, but i’m not a SDL dev so i cant make
the change :wink:
-mikeOn Wednesday 01 March 2006 17:54, Sam Hocevar wrote:

This patch makes the audio driver detection try ALSA before OSS when
both are compiled in. ALSA is preferable for various reasons, including
multi-open support.

Sam Hocevar wrote:

This patch makes the audio driver detection try ALSA before OSS when
both are compiled in. ALSA is preferable for various reasons, including
multi-open support.

Hi,

Since you can set SDL_AUDIODRIVER in your application if you
desire ALSA over OSS, I’d say that it should be left as it is
for the 1.2.x series.

There is a lot of code out there that uses it in this method; changing
it could potentially cause problems.

1.3 series of SDL, sure.

My 2 cents,
Bill May
http://www.mpeg4ip.net

Sam Hocevar wrote:

This patch makes the audio driver detection try ALSA before OSS when
both are compiled in. ALSA is preferable for various reasons, including
multi-open support.

Since you can set SDL_AUDIODRIVER in your application if you
desire ALSA over OSS, I’d say that it should be left as it is
for the 1.2.x series.

Well, I know that, but it is not something an unexperienced desktop
user is going to do. That user however is going to be faced with
applications refusing to share the audio device from time to time.

There is a lot of code out there that uses it in this method; changing
it could potentially cause problems.

As you wish. But since both drivers can be conditionally compiled, I
really fail to see what kind of potential problem could occur. ALSA has
been the planned replacement for OSS for years and is now the default on
almost all Linux distributions (which is why I’m applying this patch to
the Debian package).

Regards,On Thu, Mar 02, 2006, Bill May wrote:

Sam.

Sam Hocevar wrote:

There is a lot of code out there that uses it in this method; changing
it could potentially cause problems.

As you wish. But since both drivers can be conditionally compiled, I
really fail to see what kind of potential problem could occur. ALSA has
been the planned replacement for OSS for years and is now the default on
almost all Linux distributions (which is why I’m applying this patch to
the Debian package).

Just chiming in as an application developer. Your points are good, as well.

Bill

Hello Mike,

Wednesday, March 1, 2006, 11:18:23 PM, you wrote:

MF> Fedora applies a patch which prefers sound daemons (aka arts/esd) over raw
MF> sound implementations … wonder how people feel about that … btw, i like
MF> this patch which tries alsa before oss, but i’m not a SDL dev so i cant make
MF> the change :wink:
MF> -mike

This is very annoying when distro’s do this. We have shipped two linux
games and had bug reports about very latent sound on Fedora due to
this, and also bug reports on Mandriva due to their meddling with SDL
and SDL_mixer. When we get the user to remove the distro-patched
versions and build from source, the problems disappear.–
Best regards,
Peter mailto:@Peter_Mulholland

Red Hat messing up important stuff with unneeded and/or experimental
modifications? Inconceivable! Oh wait, there was the GCC 2.96 fiasco,
the crippled KDE fiasco, the 4k stacks fiasco, the buggy backport of
NPTL on 2.4 fiasco, etc.

I really admire Red Hat for doing all those screwed up things and
still being the most reknown Linux vendor (sadly there are still many
people who think Red Hat == Linux).On 3/3/06, Peter Mulholland wrote:

Hello Mike,

Wednesday, March 1, 2006, 11:18:23 PM, you wrote:

MF> Fedora applies a patch which prefers sound daemons (aka arts/esd) over raw
MF> sound implementations … wonder how people feel about that … btw, i like
MF> this patch which tries alsa before oss, but i’m not a SDL dev so i cant make
MF> the change :wink:
MF> -mike

This is very annoying when distro’s do this. We have shipped two linux
games and had bug reports about very latent sound on Fedora due to
this, and also bug reports on Mandriva due to their meddling with SDL
and SDL_mixer. When we get the user to remove the distro-patched
versions and build from source, the problems disappear.

  • SR

Hello Simon,

Friday, March 3, 2006, 9:32:07 PM, you wrote:

SR> Red Hat messing up important stuff with unneeded and/or experimental
SR> modifications? Inconceivable! Oh wait, there was the GCC 2.96 fiasco,
SR> the crippled KDE fiasco, the 4k stacks fiasco, the buggy backport of
SR> NPTL on 2.4 fiasco, etc.

SR> I really admire Red Hat for doing all those screwed up things and
SR> still being the most reknown Linux vendor (sadly there are still many
SR> people who think Red Hat == Linux).

By far the worst currently is Mandriva. They have added some patch to
SDL_mixer (don’t know what for) that tries to write “music.raw” to
your programs current dir. If the user doesn’t have write permissions
for that dir (which is often true as our games don’t write
configs/saves to their own dir), it crashes with a floating point
exception. We have had many bug reports due to this, when the issue is
in the distro vendor’s SDL_mixer.

The fix we advise, is removing their version and installing the proper
version from libsdl.org–
Best regards,
Peter mailto:@Peter_Mulholland

you sure that’s something Mandriva is doing ? we’ve had similar problems in
Gentoo and i can assure you, we are not patching SDL_mixer to do this

in fact, if you review SDL_mixer cvs, it looks more like this is a bug in
SDL_mixer … see this comment in Gentoo’s bugzilla:
http://bugs.gentoo.org/show_bug.cgi?id=99590#c14

and then see this patch that fixes SDL_mixer-1.2.6 to behave in the same way
as the cvs version of SDL_mixer:
http://bugs.gentoo.org/attachment.cgi?id=69982&action=view

since we applied that patch, Gentoo users no longer have reported an issue of
’music.raw’ being randomly created in their $PWD
-mikeOn Friday 03 March 2006 16:45, Peter Mulholland wrote:

By far the worst currently is Mandriva. They have added some patch to
SDL_mixer (don’t know what for) that tries to write “music.raw” to
your programs current dir. If the user doesn’t have write permissions
for that dir (which is often true as our games don’t write
configs/saves to their own dir), it crashes with a floating point
exception. We have had many bug reports due to this, when the issue is
in the distro vendor’s SDL_mixer.