[Openal] Defective ALC_ENUMERATION_EXT support on Mac OS X / Need
OpenAL community's support
E. Wing
ewmailing at gmail.com
Wed Jan 21 00:25:59 PST 2009
Not to change the subject, but I pushed some bug fixes and changes to
my Git branch. The big change is that I discovered that some devices
(like on the Powerbook) act like a combo device where the same
singular 'built-in' device corresponds to multiple devices (such as
line-in and microphone). This throws a curve ball at my original
approach and requires additional information to distinguish the
specific devices that have multiple 'data sources'.
My solution uses kAudioDevicePropertyDataSources to find the
additional information. In the case where 2 or more data sources exist
and they are settable, I append the data source name to the main
device with a ': ' to separate the strings (without the quotes).
I ignore data sources when there are less than 2 or when they are not settable.
I also discovered that 3rd party devices may not respond to a data
source query (e.g. Griffin iMic) so those cases are handled as well.
My changes seem to work, but there are corner cases to be aware of.
It appears that if the targeted device is also the User Default device
(via System Preferences), setting the data source will cause the User
Default to change if the data source is different. Strangely, changing
the user default does not happen if the User Default device is not the
targeted device.
I do not like the idea of changing the user's default device, but I
cannot find any API mention about this behavior or how to avoid it.
(Any help here?) So my work around is to save the initial data source
and later restore it in the destructor. However, there are two
additional corner cases:
First, this requires the destructor to be called, so if the program
quits abnormally/suddenly, the clean up will not happen.
Second, if the same device is opened multiple times simultaneously
with different data sources, then the latter device overrides the
previous and also may mis-interpret the initial state. Maybe the
easiest work-around for this is to prevent the same device from being
opened simultaneuously. I'm wondering if there are any Core Audio APIs
to help with this detection.
I tested on 2 PowerPC machines (12" Powerbook and G5 iMac) and 2 Intel
Machines (Macbook and iMac, both aluminum). My results show that
multiple data sources were only relevant on the PowerPC machines. So
maybe this means that this is going away?
Thanks,
Eric
More information about the Openal
mailing list