Hello,
I have implemented a custom USB device which can act as a speaker and a mic (2 interfaces). The first interface is for mic and has 2 alternate settings. The alternate setting 0 is the zero bandwidth setting and alternate setting 1 defines an IN endpoint which is used by the host for reading the data. The second interface is for speaker. This interface also has two alternate settings. The alternate setting 0 is the zero bandwidth setting and alternate setting 1 defines one OUT endpoint which is used by the host for sending the data to the device. Also, I make use of 16 bit PCM format at a rate of 48KHz.
The following procedure is used for the implementation of the project:
- When a set interface request with altsetting1 and interface 1 is received by the device, I will start the microphone interface and send data to host.
- When a set interface request with altsetting1 and interface 2 is received by the device, I will start the speaker interface and receive data from host.
The problem that I encounter here is that, whenever the device enumerates, I find that interface 1 altsetting 1 is automatically selected. This enables the microphone interface. So, Iam able to receive the data sent by the device at the host side. But, Iam not able to switch the interface number to 2 for enabling the speaker interface at a later point. I would like to understand how the host application issues SET_INTERFACE requests to the device and how the interface numbers are selected so that I can test my custom device using this application. Any sort of help is highly appreciated!!!
Thanks!!!