Multiple audio devices

Some initial work is done on multiple audio devices for SDL 1.3.

This is only working on Mac OS X at the moment (with 9/10ths of the OSS
work done for Linux), but those that want to check it out and comment
can pull this Subversion branch:

 svn://libsdl.org/branches/SDL-ryan-multiple-audio-device/

The audio drivers that haven’t been updated won’t compile, which is most
of them at the moment.

Take a look at test/testaudioinfo.c for how to enumerate audio devices,
and test/testmultiaudio.c for a rundown of how to select a device for
playback (or select several to play from multiple sound cards at once).

Comments are welcome; the API is definitely still open to changes at
this point, and the internals are still changing under the hood anyhow.
Even when it’s solid, there’re about 25 (!) audio backends to update,
which is crazy.

–ryan.

Even when it’s solid, there’re about 25 (!) audio backends to update,
which is crazy.
without having any knowledge about audio:
why not base the new sdl audio on openAL ? openAL is already afaik cross
-platform…

1 Like

Hello Andre,

Wednesday, October 4, 2006, 12:24:38 PM, you wrote:

without having any knowledge about audio:
why not base the new sdl audio on openAL ? openAL is already afaik cross
-platform…

… because when you want to do simple 2D positional audio, OpenAL is
a giant pain in the rear.–
Best regards,
Peter mailto:@Peter_Mulholland

Even when it’s solid, there’re about 25 (!) audio backends to update,
which is crazy.
without having any knowledge about audio:
why not base the new sdl audio on openAL ? openAL is already afaik cross
-platform…

Because there aren’t any OpenAL implementations that support 25 audio
targets. :slight_smile:

–ryan.

Peter Mulholland wrote:

Hello Andre,

Wednesday, October 4, 2006, 12:24:38 PM, you wrote:

without having any knowledge about audio:
why not base the new sdl audio on openAL ? openAL is already afaik cross
-platform…

… because when you want to do simple 2D positional audio, OpenAL is
a giant pain in the rear.

How so?

Hello Ulrich,

Wednesday, October 4, 2006, 7:05:57 PM, you wrote:

How so?

Try it. For example, you can’t pan stereo samples.
Also, unless you can a) guarantee to call a function periodically or
b) start a thread, streaming stuff is a pain.–
Best regards,
Peter mailto:@Peter_Mulholland

… because when you want to do simple 2D positional audio, OpenAL is
a giant pain in the rear.

Also, I’m not prepared to answer the inevitable question:

What happens when an OpenAL implementation uses SDL for an audio output
backend, and that SDL is using OpenAL for its backend?

Don’t get me wrong, I think we could use OpenAL’s buffer queueing and
turn off all the positional audio, in which case it makes a fairly clean
SDL audio driver, but it would be done as a question of portability, and
currently SDL is far far ahead of OpenAL (and everything else) in terms
of supported platforms.

In many ways, it would be like the GGI video target…SDL would be
wrapping an API that wraps APIs that SDL also wraps elsewhere…it
doesn’t make sense to maintain that code.

–ryan.

Ryan C. Gordon wrote:

Some initial work is done on multiple audio devices for SDL 1.3.

This is only working on Mac OS X at the moment (with 9/10ths of the OSS
work done for Linux), but those that want to check it out and comment
can pull this Subversion branch:

 svn://libsdl.org/branches/SDL-ryan-multiple-audio-device/

“dsp” and “dma” work now (no ALSA yet, sorry), for you Linux people that
want to try it.

–ryan.

Some initial work is done on multiple audio devices for SDL 1.3.

This is only working on Mac OS X at the moment (with 9/10ths of the OSS
work done for Linux), but those that want to check it out and comment
can pull this Subversion branch:

 svn://libsdl.org/branches/SDL-ryan-multiple-audio-device/

“dsp” and “dma” work now (no ALSA yet, sorry), for you Linux people that
want to try it.

(Last update for awhile about this, honest…)

All the Linux drivers are working in that Subversion branch now (dsp,
dma, alsa, arts, esd, disk, and dummy)…“dsp” and “dma” support
multiple devices now, ALSA will eventually (but you can use its OSS
compatibility layer with the dsp/dma targets and get multiple devices
from your ALSA kernel drivers now).

Mac OS X also has multiple audio device support working in that branch
through CoreAudio. Some platforms (BeOS, OS/2, Dreamcast, Mac OS 9) have
been updated to (probably) compile with the 1.3 internal changes, but
can’t use multiple audio devices at the system level.

Some of the more obscure platforms–like AIX, IRIX, and, umm,
Windows–still won’t compile without updates, let alone allow multiple
outputs. The complete list is: bsd, dmedia, mint (all 5 of them), mme,
nas, nto, paudio, sun, ums, windib, windx5…so the conversion to the
new interface is almost halfway done.

–ryan.