[linux-audio-dev] USB: Is a CLASS_INTERFACE request a kind of control transfer ?

Clemens Ladisch clemens at ladisch.de
Wed Aug 31 08:36:27 UTC 2005

Jan Holst Jensen wrote:
> I am (still) trying to implement a control panel
> feature for the U2A USB sound card.
> Now, half of the URBs sent to the device are
> CONTROL_TRANSFER blocks, but the other half are marked
> as CLASS_INTERFACE in the SnoopyPro logs. See a
> typical example below.

SnoopyPro doesn't label all packets correctly.  It seems the
bmRequestType field hasn't yet been filled when the 'down' request is
logged, so you have to look at the corresponding 'up' data.

> I have googled the net and searched the USB specs
> without getting much wiser as to what a
> CLASS_INTERFACE request is and does.

"CLASS" means that the meaning of the bRequest field is class-specific
-- in this case, defined in the USB audio specification.

To determine what the other fields mean, get the unit ID from the
upper byte of the wIndex field (sixth byte in the setup packet),
search for the unit in the descriptors, and then look up that unit
type in the USB audio spec.

> Can I send it using CONTROL_TRANSFER URBs or is yet another
> extension of the alsa driver necessary ?

With USB audio devices, all transfers (except the audio data itself)
are control transfers.

> SetupPacket:
> 0000: 21 01 00 01 00 04 01 00

bRequestType: 0x21    CLASS_INTERFACE, out
bRequest:     0x01    SET_CUR
wValue:       0x0100  control/channel? #1 (MSB) of this unit
wIndex:       0x0400  interface #0 (LSB), unit #4 (MSB)
wLength:      0x0001

I guess that unit 4 is a Selector Unit, because most other types would
require a two-byte buffer.


More information about the Linux-audio-dev mailing list