Audio Channels - Surround?

Hi!

I’m currently trying to decide between SDL and OpenAL as my audio library.
OpenAL offers surround sound (which I may want to use later on), but I’m not
too happy with their Linux support, particularly since, to my knowledge, the
latest stable version is still unable to play stereo music.

Regarding SDL, I’m trying to figure out if it already supports surround audio.
The SDL_ OpenAudio documentation in the Wiki states that 4 and 6 channels may
be requested for surround audio. I remember patches implementing this for the
ALSA backend a few years ago, but what about other backends. For example, is
this yet supported on the Windows platform? And could I rely on SDL correctly
falling back on stereo output if no additional channels are available for a
specific system? What about SDL_mixer, does it support multichannel output
(if SDL itself does)?

Thx,
Marian.–
http://www.musgit.com | http://marian.musgit.com

Hofstadter’s law: “It always takes longer than you think,
even when you take account of Hofstadter’s law”.

I’m currently trying to decide between SDL and OpenAL as my audio library.
OpenAL offers surround sound (which I may want to use later on), but I’m not
too happy with their Linux support, particularly since, to my knowledge, the
latest stable version is still unable to play stereo music.

Are you sure about that? I’ve shipped titles with the Linux OpenAL that
counted on it not spatializing stereo buffers, but playing them as
stereo content directly on the Listener.

Regarding SDL, I’m trying to figure out if it already supports surround audio.
The SDL_ OpenAudio documentation in the Wiki states that 4 and 6 channels may
be requested for surround audio.

SDL supports it, but most drivers do not. In 1.2, there’s probably a lot
of drivers that will mishandle it if you don’t request either mono or
stereo output (causing all sorts of mixing problems), using a structure
like this:

if (requested_channels == 1)
   open_device_for_mono();
else
   open_device_for_stereo();   /* that's obviously wrong. */

1.3 already has most of this cleaned up (to at least clamp to stereo
correctly if not actually handle more-than-2 channels), but it’s not
really ready for primetime in lots of other ways.

ALSA supports surround sound on Linux with SDL. I’m pretty sure the
DirectSound target supports it on Windows. CoreAudio on the Mac can
support it but I don’t know if the SDL target does.

Unlike OpenAL, you’re going to end up writing your own mixer, though.
SDL is much lower-level when it deals with audio output.

I’m not sure what SDL_mixer (the add-on library) does, though…probably
doesn’t do more than stereo.

–ryan.

Are you sure about that? I’ve shipped titles with the Linux OpenAL that
counted on it not spatializing stereo buffers, but playing them as
stereo content directly on the Listener.

From what I can figure out, the 1.0-compliant Linux version plays all buffers
as mono (unspatialized, like the Windows implementation, but that plays them
in stereo). The packages shipped with Debian and Ubuntu certainly do (as I
can hear in my own game). Unfortunately, there doesn’t seem to be much
information about the current status or progress of OpenAL anywhere on the
web.

ALSA supports surround sound on Linux with SDL. I’m pretty sure the
DirectSound target supports it on Windows. CoreAudio on the Mac can
support it but I don’t know if the SDL target does.

Unlike OpenAL, you’re going to end up writing your own mixer, though.
SDL is much lower-level when it deals with audio output.

I’m not sure what SDL_mixer (the add-on library) does, though…probably
doesn’t do more than stereo.

Thanks. Doesn’t really sound ideal either. I guess I’ll just have to decide
which restrictions I can accept and what workarounds I want to write myself.

Thanks for the info,
Marian.On Saturday 07 April 2007 03:11:42 Ryan C. Gordon wrote:


http://www.musgit.com | http://marian.musgit.com

Hofstadter’s law: “It always takes longer than you think,
even when you take account of Hofstadter’s law”.