[wdmaudiodev] usbaudio.sys and descriptors

  • From: Alan Davis <alan_davis@xxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Tue, 03 Nov 2015 16:22:09 +0000 (GMT)

I'm developing a small embedded audio device to talk to a windows PC via USB.

My goal is to use the built in generic audio drivers, the device has a
configuration of 2 microphone / line in inputs and 2 speakers / line out
outputs.

I've developed the descriptors as per the standard and I can get the device to
work fine with the generic drivers when it's only microphones or speakers -
audio can be recorded or played back OK. When I try to enumerate with both
microphone and speakers together in the descriptor the device fails. In this
dual mode they share the same control end point.

My configuration setup is (id):
USB OUT Endpoint -> Input Term (1) -> Feature unit (2) -> Output Term (3) ->
Speaker
Microphone -> Input Term (4) -> Output Term (5) -> USB IN Endpoint.

As far as I can tell the descriptors accurately describe the above but it isn't
recognised by windows.

Please see TDD dump below - any help appreciated to point me in the right
direction to debug this issue as I'm now stuck!


Device Descriptor:
------------------------------
0x12 bLength
0x01 bDescriptorType
0x0201 bcdUSB
0x00 bDeviceClass 0x00 bDeviceSubClass 0x00 bDeviceProtocol 0x40 bMaxPacketSize0 (64 Bytes)
0xXXXX idVendor
0xXXXX idProduct
0x0200 bcdDevice
0x01 iManufacturer ""Manufacturer"
0x02 iProduct "Product"
0x03 iSerialNumber "XXXXXX"
0x01 bNumConfigurations

Configuration Descriptor:
------------------------------
0x09 bLength
0x02 bDescriptorType
0x00B7 wTotalLength
0x03 bNumInterfaces
0x01 bConfigurationValue
0x00 iConfiguration
0xC0 bmAttributes (Self-powered Device)
0x32 bMaxPower (100 mA)

Interface Descriptor:
------------------------------
0x09 bLength
0x04 bDescriptorType
0x00 bInterfaceNumber
0x00 bAlternateSetting
0x00 bNumEndPoints
0x01 bInterfaceClass (Audio Device Class)
0x01 bInterfaceSubClass (Audio Control Interface)
0x00 bInterfaceProtocol 0x00 iInterface

AC Interface Header Descriptor:
------------------------------
0x0A bLength
0x24 bDescriptorType
0x01 bDescriptorSubtype
0x0100 bcdADC
0x003D wTotalLength
0x02 bInCollection
0x01 baInterfaceNr(1)
0x02 baInterfaceNr(2)

AC Input Terminal Descriptor:
------------------------------
0x0C bLength
0x24 bDescriptorType
0x02 bDescriptorSubtype
0x01 bTerminalID
0x0101 wTerminalType (USB Streaming)
0x00 bAssocTerminal
0x01 bNrChannels
0x0000 wChannelConfig
0x00 iChannelNames
0x00 iTerminal

AC Feature Unit Descriptor:
------------------------------
0x09 bLength
0x24 bDescriptorType
0x06 bDescriptorSubtype
0x02 bUnitID
0x01 bSourceID
0x01 bControlSize
bmaControls: 0x01 Channel(0)
0x00 Channel(1)
0x00 iFeature


AC Output Terminal Descriptor:
------------------------------
0x09 bLength
0x24 bDescriptorType
0x03 bDescriptorSubtype
0x03 bTerminalID
0x0301 wTerminalType (Speaker)
0x00 bAssocTerminal
0x02 bSourceID
0x00 iTerminal

AC Input Terminal Descriptor:
------------------------------
0x0C bLength
0x24 bDescriptorType
0x02 bDescriptorSubtype
0x04 bTerminalID
0x0603 wTerminalType (Line connector)
0x00 bAssocTerminal
0x01 bNrChannels
0x0000 wChannelConfig
0x00 iChannelNames
0x00 iTerminal

AC Output Terminal Descriptor:
------------------------------
0x09 bLength
0x24 bDescriptorType
0x03 bDescriptorSubtype
0x05 bTerminalID
0x0101 wTerminalType (USB Streaming)
0x00 bAssocTerminal
0x04 bSourceID
0x00 iTerminal

Interface Descriptor:
------------------------------
0x09 bLength
0x04 bDescriptorType
0x01 bInterfaceNumber
0x00 bAlternateSetting
0x00 bNumEndPoints
0x01 bInterfaceClass (Audio Device Class)
0x02 bInterfaceSubClass (Audio Streaming Interface)
0x00 bInterfaceProtocol 0x00 iInterface

Interface Descriptor:
------------------------------
0x09 bLength
0x04 bDescriptorType
0x01 bInterfaceNumber
0x01 bAlternateSetting
0x01 bNumEndPoints
0x01 bInterfaceClass (Audio Device Class)
0x02 bInterfaceSubClass (Audio Streaming Interface)
0x00 bInterfaceProtocol 0x00 iInterface

AS Interface Descriptor:
------------------------------
0x07 bLength
0x24 bDescriptorType
0x01 bDescriptorSubtype
0x01 bTerminalLink
0x01 bDelay
0x0001 wFormatTag (PCM)

AS Format Type 3 Descriptor:
------------------------------
0x0B bLength
0x24 bDescriptorType
0x02 bDescriptorSubtype
0x03 bFormatType
0x02 bNrChannels
0x02 bSubframeSize
0x10 bBitResolution (16 Bits/sample)
0x01 bSamFreqType (Discrete sampling frequencies)
0x00BB80 tSamFreq(1) (48000 Hz)

Endpoint Descriptor (Audio/MIDI):
------------------------------
0x09 bLength
0x05 bDescriptorType
0x01 bEndpointAddress (OUT Endpoint)
0x01 bmAttributes (Transfer: Isochronous / Synch: None / Usage: Data)
0x00C0 wMaxPacketSize (192 Bytes)
0x01 bInterval
0x00 bRefresh
0x00 bSynchAddress

AS Isochronous Data Endpoint Descriptor:
------------------------------
0x07 bLength
0x25 bDescriptorType
0x01 bDescriptorSubtype
0x00 bmAttributes
0x00 bLockDelayUnits (Undefined)
0x0000 wLockDelay

Interface Descriptor:
------------------------------
0x09 bLength
0x04 bDescriptorType
0x02 bInterfaceNumber
0x00 bAlternateSetting
0x00 bNumEndPoints
0x01 bInterfaceClass (Audio Device Class)
0x02 bInterfaceSubClass (Audio Streaming Interface)
0x00 bInterfaceProtocol 0x00 iInterface

Interface Descriptor:
------------------------------
0x09 bLength
0x04 bDescriptorType
0x02 bInterfaceNumber
0x01 bAlternateSetting
0x01 bNumEndPoints
0x01 bInterfaceClass (Audio Device Class)
0x02 bInterfaceSubClass (Audio Streaming Interface)
0x00 bInterfaceProtocol 0x00 iInterface

AS Interface Descriptor:
------------------------------
0x07 bLength
0x24 bDescriptorType
0x01 bDescriptorSubtype
0x05 bTerminalLink
0x01 bDelay
0x0001 wFormatTag (PCM)

AS Format Type 1 Descriptor:
------------------------------
0x0B bLength
0x24 bDescriptorType
0x02 bDescriptorSubtype
0x01 bFormatType
0x02 bNrChannels
0x02 bSubframeSize
0x10 bBitResolution (16 Bits/sample)
0x01 bSamFreqType (Discrete sampling frequencies)
0x00BB80 tSamFreq(1) (48000 Hz)

Endpoint Descriptor (Audio/MIDI):
------------------------------
0x09 bLength
0x05 bDescriptorType
0x82 bEndpointAddress (IN Endpoint)
0x01 bmAttributes (Transfer: Isochronous / Synch: None / Usage: Data)
0x00C0 wMaxPacketSize (192 Bytes)
0x01 bInterval
0x00 bRefresh
0x00 bSynchAddress

AS Isochronous Data Endpoint Descriptor:
------------------------------
0x07 bLength
0x25 bDescriptorType
0x01 bDescriptorSubtype
0x00 bmAttributes
0x00 bLockDelayUnits (Undefined)
0x0000 wLockDelay

String Descriptor Table
--------------------------------
Index LANGID String
0x00 0x0000 0x0409 0x01 0x0409 "XXXX"
0x02 0x0409 "XXXX"
0x03 0x0409 "XXXX"
0xEE 0x0000 Request failed with 0x0000001F

------------------------------

Other related posts: