[SDL] ALSA/OSS linux audio driver priorities

Sitsofe Wheeler sitsofe at yahoo.com
Tue Aug 7 12:22:52 PDT 2007


On Tue, 2007-08-07 at 17:06 +0200, Gerry JJ wrote:
> I recently found out that SDL prefers using OSS audio over ALSA audio
> in Linux.  This is a bit of a problem on systems using ALSA's software
> mixing (dmix), because ALSA's OSS emulation doesn't do any
> software-mixing at all unless the OSS-using program is run through
> aoss, which results either in no sound or blocking other apps
> (including ALSA ones) from using sound while the OSS emulation is in
> use.  (Anyone know if there's a reason ALSA can't do a proper mixing OSS
> driver btw?  Why is the aoss hack required?).  I've also noticed that
> OSS emulation can have lower audio quality than pure ALSA.

I believe this is because when you are using a modern ALSA natively it
and you do dmixing the samples are copied into the shared memory of the
first process using ALSA which then combines the samples and sends the
(single) output to the kernel. If you are using ALSA's kernel OSS
emulation then by the time the OSS emulation has the sound samples it is
effectively too late as you are already in the kernel and no longer have
access to ALSA's virtual devices/dmixing which are implemented as
libraries. Also, traditionally /dev/dsp has only been openable by one
process (there were some OSS drivers that broke this rule though). This
is speculation - try the ALSA lists of a real answer.

Some new distributions default to only shiping the SDL ALSA plugin out
of the box. For me, going straight to ALSA when running SDL programs
usually results in better results than using OSS -> aoss -> ALSA but
there are others who have very real problems with SDL ALSA output and
default SDL to a different sound method.

-- 
Sitsofe | http://sucs.org/~sits/




More information about the SDL mailing list