USB Audio class 2.0 enumeration issue

Viewed 158

I am trying to develop a USB audio device compliant to USB Audio Class version 2.0 specification. I have written the descriptors by referring to the specification as such. But, I find that the device is not enumerating correctly. The status in device manager just shows "This device cannot start (Code 10)."

Please find the configuration descriptors that I am using below:

/* Configuration descriptor */
0x09,                           /* Descriptor size */
0x02,                           /* Configuration descriptor type */
0x8A,0x00,                      /* Length of this descriptor and all sub descriptors */
0x02,                           /* Number of interfaces */
0x01,                           /* Configuration number */
0x00,                           /* Configuration string index */
0x80,                           /* Config characteristics - Bus powered */
0x32,                           /* Max power consumption of device (in 8mA unit) : 400mA */

//IAD

0x08,                           /* bLength */
0x0B,                           /* bDescriptorType */
0x00,                               /* bFirstInterface */
0x02,                           /* bInterfaceCount */
0x01,                           /* bFunctionClass */
0x00,                           /* bFunctionSubClass */
0x20,                           /* bFunctionProtocol */
0x00,                           /* iFunction */

/* Standard AC Interface Descriptor */
0x09,                           /* bLength */
0x04,                           /* bDescriptorType */
0x00,                              /* bInterfaceNumber */
0x00,                           /* bAlternateSetting */
0x00,                           /* bNumEndoints */
0x01,                           /* bInterfaceClass */
0x01,                           /* bInterfaceSubClass */
0x20,                           /* bInterfaceProtocol */
0x00,                           /* iInterface */

/* Class-Specific AC Interface Header Descriptor */
0x09,                           /* bLength */
0x24,                           /* bDescriptorType */
0x01,                           /* bDescriptorSubtype */
0x00, 0x02,                     /* bcdADC */
0x03,                           /* bCatagory MICROPHONE*/
0x2E, 0x00,                     /* wTotalLength (46 Bytes) */
0x00,                           /* bmControls */

/* Class-Specific AC Clock Source Descriptor (INTERNAL) */
0x08,                           /* bLength */
0x24,                           /* bDescriptorType */
0x0A,                           /* bDescriptorSubtype */
0x10,                           /* bClockID */
0x01,                           /* bmAttributes:
                                                D[1:0]:
                                                    00: External Clock
                                                    01: Internal Fixed Clock
                                                    10: Internal Variable Clock
                                                    11: Internal Progamable Clock
                                                D[2]:
                                                    Clock Synced to SOF
                                                D[7:3]:
                                                    Reserved (0) */
0x00,                           /* bmControls:
                                                D[1:0]:
                                                    Clock Freq Control
                                                D[3:2]:
                                                    Clock Validity Control
                                                D[7:4]:
                                                    Reserved (0) */

0x00,                           /* bAssocTerminal */
0x00,                           /* iClockSource */

/* Class-Specific AC Input Terminal Descriptor */
0x11,                           /* bLength */
0x24,                           /* bDescriptorType */
0x02,                           /* bDescriptorSubtype */
0x01,                           /* bTerminalID */
0x01, 0x02,                     /* wTerminalType */
0x00,                           /* bAssocTerminal */
0x10,                           /* bCSourceID */
0x02,                           /* bNrChannels,indicate has number of channel in cluster*/
0x03, 0x00, 0x00, 0x00,         /* bmChannelConfig,spatial positions*/
0x00,                           /* iChannelNames,index remaining channel spatial positions descripte*/
0x00, 0x00,                     /* bmControls */
0x00,                           /* iTerminal */

/* Class-Specific AC Output Terminal Descriptor*/
0x0C,                           /* bLength */
0x24,                           /* bDescriptorType */
0x03,                           /* bDescriptorSubtype */
0x02,                           /* bTerminalID */
0x01, 0x01,                     /* wTerminalType */
0x00,                           /* bAssocTerminal */
0x01,                           /* bSourceID */
0x10,                           /* bCSourceID */
0x00, 0x00,                     /* bmControls */
0x00,                           /* iTerminal */

/* Audio In Standard AS Interface Descriptor (Alt 0 - Zero Bandwidth) */
0x09,                           /* bLength */
0x04,           /* bDescriptorType */
0x01,                              /* bInterfaceNumber */
0x00,                           /* bAlternateSetting */
0x00,                           /* bNumEndpoints */
0x01,                           /* bInterfaceClass */
0x02,                           /* bInterfaceSubClass */
0x20,                           /* bInterfaceProtocol */
0x00,                           /* iInterface */

/* Audio In Standard AS Interface Descriptor (Alt 1) */
0x09,                           /* bLength */
0x04,           /* bDescriptorType */
0x01,                              /* bInterfaceNumber */
0x01,                           /* bAlternateSetting */
0x01,                           /* bNumEndpoints */
0x01,                           /* bInterfaceClass */
0x02,                           /* bInterfaceSubClass */
0x20,                           /* bInterfaceProtocol */
0x00,                           /* iInterface */

/* Audio In Class-Specific AS Interface descriptor */
0x10,                           /* bLength */
0x24,                           /* bDescriptorType */
0x01,                           /* bDescriptorSubtype */
0x02,                           /* bTerminalLink,Terminal ID of Output Terminal */
0x00,                           /* bmControls */
0x01,                           /* bFormatType */
0x01, 0x00, 0x00, 0x00,         /* bmFormats PCM*/
0x02,                           /* bNrChannels 2 channel*/
0x03, 0x00, 0x00, 0x00,         /* bmChannelConfig */
0x00,                           /* iChannelNames */

/* Audio In Class-Specific AS Type I Format Descriptor */
0x0B,                           /* Descriptor size */
0x24,                           /* Class-specific Interface Descriptor Type */
0x02,                           /* Format Type Descriptor subtype */
0x01,                           /* PCM FORMAT_TYPE_I */
0x02,                           /* Number of channels - 2 */
0x02,                           /* Subframe size - 2 bytes per audio subframe */
0x10,                           /* Bit resolution - 16 bits */
0x01,                           /* Number of samping frequencies - 1 */
0x80, 0xBB, 0x00,               /* Sampling frequency - 48000 Hz */

/* Audio In Standard AS Isochronous Data EP Descriptor */
0x07,                           /* bLength */
0x05,        /* bDescriptorType */
0x81,                           /* bEndpointAddress */
0x05,                           /* bmAttributes */
0xC8, 0x00,                     /* wMaxPacketSize 200byte*/
0x01,                           /* bInterval */

/* Superspeed Endpoint Companion Descriptor */
0x06,                           /* bLength */
0x30,       /* bDescriptorType */
0x00,                           /* bMaxBurst */
0x00,                           /* bmAttributes */
0x60, 0x00,                     /* wBytesPerInterval */

/* Audio In Class-Specific AS Isochronous Data EP Descriptor */
0x08,                           /* bLength */
0x25,                           /* bDescriptorType */
0x01,                           /* bDescriptorSubtype */
0x00,                           /* bmAttributes */
0x00,                           /* bmControls */
0x02,                           /* bLockDelayUnits */
0x08, 0x00,                     /* wLockDelay */
0 Answers
Related