Re: Built-in audio hardware question
Re: Built-in audio hardware question
- Subject: Re: Built-in audio hardware question
- From: Jeff Moore <email@hidden>
- Date: Mon, 19 May 2008 14:48:53 -0700
On May 19, 2008, at 2:34 PM, Mikael Hakman wrote:
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.
This is precisely how you should be using the model UID. There's no
problem here I can see.
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?
That really depends. If you are trying as much as possible to reflect
the properties of the underlying device, then you should keep
reflecting the transport type too. Otherwise, you'll probably want to
go with kIOAudioDeviceTransportTypeVirtual, which we added in Leopard.
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.
--
Jeff Moore
Core Audio
Apple
_______________________________________________
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