OpenAL en SDL-Mixer

Hi,

When I tried to use OpenAL and SDL-Mixer together (SDL-Mixer for music
and OpenAL for sound effects) I was a bit suprised this actually workes.
Is it wise to do it like way ? or is it better (read: possible) to pass
the data SDL-Mixer mixes to OpenAL, so I can play MOD’s and MP3’s via
OpenAL. I was thinking about using Mix_HookMusic() of SDL-Mixer for
that. Am I on the right way ?
thanks,

Richard van Zon.

When I tried to use OpenAL and SDL-Mixer together (SDL-Mixer for music
and OpenAL for sound effects) I was a bit suprised this actually workes.

Do you have an SBLive! card? It’s possible that OpenAL and SDL are both
opening /dev/dsp, and the emu10k1 drivers are just permitting multiple
openings of the device, so SDL_mixer and OpenAL are operating with no
knowledge of the other’s existence.

In one sense, this is good, because you get the benefits of some amount of
hardware mixing…there was discussion of enabling an OpenAL backend that
would open /dev/dsp as many times as possible to offload as much mixing to
the hardware as possible, but it was never done (…hmm, might be a cool
SDL/SDL_mixer hack, too)…

I can’t imagine that will work portably, or even on every/most Linux
systems.

If you want MOD music and you need OpenAL’s spatialized audio features,
it’d be better to hook MikMod up to AL as an extension (much like
alutLoadMP3_LOKI() for MP3 playback…look in
openal/linux/src/extensions/al_ext_mp3.*) and make it a formal extension
proposal, or, less formally, use the Loki Callback Extension:

http://www.openal.org/snapshots/openal/docs/oalspecs-annote/x1849.html#AEN1877

(which you’d probably do internally anyhow).

–ryan.

Thank you Ryan,

and yes I have a SB-Live and was kinda thinking that was the reason why
it worked. Too bad not everyone has a Live then :wink:
I will try your suggestion,

Richard.

Ryan C. Gordon wrote:>>When I tried to use OpenAL and SDL-Mixer together (SDL-Mixer for music

and OpenAL for sound effects) I was a bit suprised this actually workes.

Do you have an SBLive! card? It’s possible that OpenAL and SDL are both
opening /dev/dsp, and the emu10k1 drivers are just permitting multiple
openings of the device, so SDL_mixer and OpenAL are operating with no
knowledge of the other’s existence.

In one sense, this is good, because you get the benefits of some amount of
hardware mixing…there was discussion of enabling an OpenAL backend that
would open /dev/dsp as many times as possible to offload as much mixing to
the hardware as possible, but it was never done (…hmm, might be a cool
SDL/SDL_mixer hack, too)…

I can’t imagine that will work portably, or even on every/most Linux
systems.

If you want MOD music and you need OpenAL’s spatialized audio features,
it’d be better to hook MikMod up to AL as an extension (much like
alutLoadMP3_LOKI() for MP3 playback…look in
openal/linux/src/extensions/al_ext_mp3.*) and make it a formal extension
proposal, or, less formally, use the Loki Callback Extension:

http://www.openal.org/snapshots/openal/docs/oalspecs-annote/x1849.html#AEN1877

(which you’d probably do internally anyhow).

–ryan.