Author Topic: Handling multiple configurations in device  (Read 5317 times)

anthony.carr

  • Member
  • ***
  • Posts: 10
Handling multiple configurations in device
« on: February 27, 2014, 04:09:12 am »
Hi,

I have designed a product that is a composite HID, which includes USB audio device, HID and keyboard.
In one mode of operation the speaker works as a buzzer (controlled locally from the MPU) and in a second mode it operates as a speaker (fed with an audio stream over the USB).
The mode of operation is selected using configuration switch on the device.
Currently the device descriptor always includes the USB audio device configuration.
This has the undesired affect that when in buzzer mode the device still enumerates as a USB audio device, overriding the PC speaker.

I have been looking at incorporating a second configuration in the USB descriptor (which doesn't include the USB audio device) and using Set_Configuration to select the appropriate mode of operation.
What I am not clear about is what happens at the PC end when the configuration is changed to the non-audio device mode?
Does the PC re-enumerate to remove the audio device?

Many thanks,

TC

Tsuneo

  • Frequent Contributor
  • ****
  • Posts: 145
Re: Handling multiple configurations in device
« Reply #1 on: March 03, 2014, 11:18:05 pm »
Windows assume single configuration per each VID/PID. If you would like to alter configuration on your device, you should assign another VID/PID for the new configuration.

To switch to new configuration, your device does soft-detach / attach, to be enumerated as a new device. The problem is, this detach / attach make sound, when user enables USB plug-in/out sound. Maybe, you don’t like this behavior.

Tsuneo