Friday, October 27, 2006

Windows USB Audio Device Selection

The selection of audio devices in Windows can be a little awkward. I suppose that's to be expected since it hasn't seen much change since when our bearskin clad forbearers carved images of Windows 3.1 into the cave walls. This awkwardness has only been exacerbated by new developments like USB.

Modern Windows systems are capable of handling many simultaneous audio devices. However, the only one that really matters is the default device. The default device is where all the bings and bongs of you system sounds go. It is where media players pipe their output unless told otherwise. And so on. All audio goes to the default device unless the application takes explicit steps to do otherwise.

(Brief aside: There is a default input device and a default output device which are interacted with separately in a parallel fashion. I'm only talking about output for the sake of simplicity. The input audio device selection works separately from but identically to output audio.)

You can change the selection of the default audio device through the control panel. The control panel's name is "Sounds and Audio Devices" on WinXP. The audio tab is where the setting resides. The drop downs under sound playback and sound recording will show all the sound devices currently available on your system, and when changed, set the default audio device for your system.

I know this is sort of boring. The reason I'm bringing it up is because things get more complicated once you start plugging USB audio devices (like our headsets) into the machine.

The first thing you need to know about USB audio is that when it discovers a new device it sets that device to be the default device. That means, when you plug in your new Voyager-510USB Bluetooth dongle, all your system sounds go away. When you unplug the dongle, they all come back. What's going on? They haven't actually gone away, the USB audio driver is just setting Voyager up as the default audio device. If you bring up the radio link you'll hear the system sounds just fine.

The second thing you need to know is that the selection process for the default audio device has a certain amount of memory. If you set your default audio device back to your sound card after the USB driver snatched it away the system will remember and not do it again for that particular device. However the hardware actually needs to be connected for this to work. You can't select a preference for your sound card over your USB device if the USB device isn't connected.

The third thing you need to know is what USB considers a device. Every device needs a unique identifier. If two devices have a different unique identifier, they are considered two different devices for the purposes of audio device selection, and thus present two separate opportunities for the USB audio system to change your default audio device. Some devices provide a serial number as part of the USB enumeration process, which is used as the unique identifier. Others, such as the CS50/60-USB and Voyager510-USB don't. In cases where a serial number isn't provided, the USB driver makes one up based on ancillary information. Part of that ancillary information includes the port that the device is connected to.

If you've been paying attention, you can probably guess where this is going. When you plug your device into a different port, the USB driver calculates a different unique identifier, and the USB audio system says "Ah ha! a new device" and gets another chance to change your default audio device again. This is why you sometimes get "new device discovered" messages when you plug in a USB device, even though you know you've had it for a while and have had it connected before. You are getting "new device discovered" because you just happened to connect it to a USB port you hadn't used with that device before.

The unfortunate bottom line of all of this is that there isn't much we can do. The device drivers and device selection routines are all out of our hands. And, as far as I know, default audio device selection is immune to programatic control. The only solution that we've found so far has been awareness of the issue and doing our best to help users catch on to what is happening and fix it as best they can.

0 Comments:

Post a Comment

<< Home