practical use of UID for USB devices
practical use of UID for USB devices
- Subject: practical use of UID for USB devices
- From: Chris Silverberg <email@hidden>
- Date: Thu, 29 Sep 2005 11:25:03 -0700
Hi folks,
I work on a VoIP application and use CoreAudio API's for device
capture and selection. In our preferences window, the user can
select their input and output devices, and I save the user's
selection by storing the kAudioDevicePropertyDeviceUID property.
This works pretty well, but there is a problem.
For USB devices, the UID varies based on which USB port the user
selects. For example, if I connect my Plantronics headset to my
PowerBook, depending on which port I plug into, I will get one of the
following UIDs:
AppleUSBAudioEngine:Plantronics:Plantronics headset:1b100000:2
AppleUSBAudioEngine:Plantronics:Plantronics headset:3b100000:2
Clearly the second to last component of the string identifies the USB
port. Although I'm sure this is useful in certain scenarios, it
pretty much prevents the software from being able to save the user's
selected device in a reliable mannor. With two USB ports on the side
of a PowerBook, it's going to be somewhat random which port a user
will use to plug in.
So, does anyone have any advice on how to handle this? Two choices
come to mind... first, I could use
kAudioDevicePropertyDeviceNameCFString instead of the UID which would
probably solve the problem in most or all cases. Secondly, I could
try to match the UID intelligently so that I ignore the difference
between USB ports, but that seems a bit messy and subject to break in
the future.
Is this simply a design flaw with the UID property?
thanks,
Chris
_______________________________________________
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