Re: OpenAl-Soft and defaulting to PulseAudio
Chris Robinson <[email protected]>
| Newsgroups | gmane.comp.lib.openal |
|---|---|
| Message-ID | <[email protected]> |
On Thursday, August 12, 2010 8:08:07 am Edward Rudd wrote:
> Specifically when the user does not have pulse audio on their
> system, the initialization of the Pulse Audio device fails. Which due to
> a recent change in the codebase of the game causes the game to immediately
> quit. (I'm going to be fixing that, and try the next device in the list).
> Now, my thoughts/question on this is why is OpenAL-soft providing a device
> in the enumeration that is NOT installed on the users system? Shouldn't it
> filter those devices out at runtime since they can-not work on the users
> system?
Hi.
Normally, if you open the default device (ie, call alcOpenDevice(NULL) or
alcOpenDevice("")), it should go through and return the first device that can
be opened. So if PulseAudio can't open, it'll try ALSA next, followed by OSS,
etc.
If you don't have a specific device configured to be opened, it's usually best
to pass NULL/an empty string. If a specific device is configured to be used
and fails to open, it's also probably best put out a warning and attempt NULL
to open *something* (if NULL doesn't open anything, you're pretty much out of
luck, then).
FWIW, the latest OpenAL Soft in Git/SVN is better about not enumerating
PulseAudio devices when it isn't available. So if the app can't connect to a
Pulse server, it won't be enumerated and something else will be given as the
default device specifier. It also includes a device that will mix data but not
output to anything, so you should always have some workable device even if you
don't hear anything.
That said, there still will be cases where devices can be enumerated and
subsequently fail to open. Sometimes the only way to know if a given device
works is to open it and try to set it up, and sometimes certain devices will
fail depending on what is (or was recently) open. That's why if a specific
named device fails, trying NULL to get something else open is a good idea,
especially if you need a device open for the app to work.
Hope that's helpful. :)
- Chris
_______________________________________________
Openal mailing list
[email protected]
http://opensource.creative.com/mailman/listinfo/openal