Re: Identification of IOAudioDevice from HAL client app
Re: Identification of IOAudioDevice from HAL client app
- Subject: Re: Identification of IOAudioDevice from HAL client app
- From: Shaun Wexler <email@hidden>
- Date: Mon, 11 Nov 2002 04:48:53 -0800
On 11/8/02 11:54 AM, "Jeff Moore" <email@hidden> wrote:
>
No there isn't any way to get the IOAudioDevice attached to a particular
>
AudioDeviceID. It's something I've thought about, but nothing is currently on
>
tap to make it happen.
We need to provide users with a way to select or change assignments to a
different audio hardware device, which can be comprised of any number of
AudioDevice(ID) in HAL, though they all may represent one piece of hardware.
I'd like to see two read-only properties added to the client side of HAL:
1. Hardware Device Group 'hdgp'. Returns pointer to array[] of
AudioDeviceID, consisting of all AudioDeviceID for a particular hardware
device, simply to allow grouping of AudioDevices without the need for a
matching method. GetPropertry returns at least one AudioDeviceID (the
inDevice's), if inDevice itself is valid. As an example, 'Apple Built-in'
would return two AudioDeviceID: one for input and one for output.
2. Transport specific reference 'trsp'. Returns (void *) to some data
specific to type of transport, to assist in matching an AudioDeviceID to a
hardware device in the IORegistry. Not sure of the best way to do this, but
it should allow for different matching schemes based on transport type.
>
Since you mentioned it as such an important part of your implementation, I
>
have to caution you that relying on the contents of a UID will fail. The
>
contents of a UID are private. There are no guarantees that any references to
>
an IOAudioDevice will ever be in that string. The contents can be anything.
>
For instance, the string can just be "Fred" and things would be fine in the
>
system.
That's what I thought, but since there's not an "official" way to do this...
>
Also, there are no guarantees that a device you are talking to with the HAL
>
will even have an IOAudioDevice object (or any other IOKit object) associated
>
with it in the first place. I strongly recommend that you abandon the need to
>
map AudioDeviceIDs back to their IOKit implementations. It will break in the
>
future.
The IDAudioDevice object is not important (to my app), just the ability to
group the AudioDeviceID's which all represent one physical device attached
to the system (or network, etc). It would be up to the HAL to determine it.
>
Finally, if you really care that much, there's nothing stopping you from
>
looking in the IORegistry yourself. That's where the HAL gets the information,
>
including the UID, in the first place.
Of course, then the task at hand would be to achieve proper matching of
AudioDeviceID to the IORegistry devices.
This could be greatly simplified by adding the two device properties...
*** What is Apple's official/recommended method? ***
In the app "Audio MIDI Setup", there is a pop-up
for "Selected Audio Device" which has to perform
the grouping of AudioDeviceID which I am describing.
I'm sure AMS uses AudioDeviceID to compile a list of device names, but when
you use the pop-up button to select a particular device... !!! There it is.
--
Shaun K. Wexler
http://www.macfoh.com
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.