[Openal] Handling device changes on Vista
Chris Robinson
chris.kcat at gmail.com
Tue Apr 14 03:03:09 PDT 2009
On Tuesday 14 April 2009 2:12:11 am Niklas Frykholm wrote:
> What is the recommended way of handling sound device changes (new
> devices being created, old devices being removed) when using OpenAL?
>
> This issue is especially important on Windows Vista where new devices
> can appear when a uses plugs in his headphones. (I.e. a game may start
> with headphones unplugged and find no devices, then when the headphones
> are plugged in a new device appears.)
As you suspect, there is no mechanism within OpenAL for detecting device
changes. You can use the OS's sound system to detect changes, but there's no
guarantee that OpenAL will immediately reflect those changes. Currently, the
best way to get OpenAL to update it's device list is to completely unload the
library, then reload it.
There is a proposed extension, here
<http://icculus.org/alextreg/wiki/ALC_EXT_disconnect>, that would deal with
this, though it's not finalized. For the record, my only remaining issue with
it is the lack of a new function call to explicitly allow the re-probing of
devices (changing behavior of an existing function call with no opt-in method
doesn't sit well with me).
More information about the Openal
mailing list