Re: Built-in audio hardware question
Re: Built-in audio hardware question
- Subject: Re: Built-in audio hardware question
- From: "Mikael Hakman" <email@hidden>
- Date: Mon, 19 May 2008 23:34:34 +0200
- Organization: Datakonsulten AB
Yes, of course Jeff. My problem is that I need a way to store textual but
language-independent reference to an audio device, any device, not only
built-in. Therefore I felt forced to use model UID string, but I don't parse
it in any way. It is entered into a configuration file and used by our
utilities for all users at a particular computer - they do use different
locales.
Thanks for pointing out kAudioDevicePropertyTransportType and
kIOAudioDeviceTransportTypeBuiltIn. It looks that I will have to change what
my virtual driver returns in response to kAudioDevicePropertyTransportType
query. Right now it returns whatever the selected real device gives. Any
suggestions?
Thanks/Mikael
On Monday, May 19, 2008 8:37 PM, Jeff Moore wrote:
Actually, please don't parse the contents of the device UID or model UID
string. As the headerdoc for kAudioDevicePropertyDeviceUID says: "The
content of the UID string is a black box". While it is true that the UID
for the built-in hardware for a lot of our hardware, it is definitely not
true for all of our hardware now and there's no guarantees about what it
will be in the future.
That said, the most reliable way to determine whether the given device ID
you have is for a built-in device or not is to use the property,
kAudioDevicePropertyTransportType. The built-in devices will have
kIOAudioDeviceTransportTypeBuiltIn as the value for this property.
On May 19, 2008, at 4:10 AM, Mikael Hakman wrote:
On Sunday, May 18, 2008 8:44 AM, tahome izwah wrote:
is there any way to uniquely identify and select the built-in hardware
as an audio device? I am not talking about the *default* device (the
one selected in the Sound control panel) - I am specifically looking
for a way to select the *built-in* device no matter what device is set
in the Sound prefs.
Selecting the device by name obviously doesn't work on all systems due
to localization. What would be the best way to do this?
I'm assuming that you ask how to find, in your program code, device id
corresponding to the built-in hardware, in language (localization)
independent way. I get list of all device ids. Then in a loop I ask each
device for its model UID and compare this to the model UID I want to use
(which I read from a configuration plist). In my MBP and iMac, the
built-in output device model UID is "AppleHDA". You could also use model
instance UID which would be "AppleHDA:0" in this case. I don't know
whether this model UID is the same in MB, and in the other, older, or
future Mac computers.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden