USB: Host aborts communication within or directly after enumeration Topic is solved

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
friguly
Junior Member
Posts: 6
Joined: Fri Jun 24, 2022 7:13 am

USB: Host aborts communication within or directly after enumeration

Post by friguly »

Hi folks,

I need help pinpointing a problem within or after the USB enumeration process with Win10 (using usbaudio2.sys driver).

I am developing a software for the XU208-128-QF48-C10 which should get an 8-channel audio stream via usb and via tdm, mix them, and send the result via usb back to the host and via tdm to a DAC. Additionally it should receive and send MIDI data via usb from and to the host. USB should use audio class 2 and HS for the connection.
I use the latest xud library (v2.1.0) and the sw_usb_audio_6.15.2 sample as a template.

When testing, the host issues an 'URB_FUNCTION_ABORT_PIPE' (recorded with wireshark, see below) within or after the enumeration process with no communication afterwards. I can't pinpoint why the host behaves like this, thus this post :)

Following a screenshot from Wireshark. I guess the bulk data transfer at the start comes from the flashing process:
Image

Following my usb device and config descriptors:

Code: Select all

#ifndef _USB_DESCRIPTORS_H_
#define _USB_DESCRIPTORS_H_

#include "config.h"
#include <stdint.h>
#include "descriptor_audio_def.h"
#include "descriptor_std_def.h"
#include "descriptor_values.h"
#include "usb_enum.h"

#ifndef USB_BCD_DEVICE
#define USB_BCD_DEVICE 0x0000
#warning BCD_DEVICE not defined, falling back to 0x0000
#endif

#ifndef USB_LANG_ID
#define USB_LANG_ID "\x09\x04"
#warning LANG_ID nod defined, falling back to US English
#endif

#ifndef USB_PRODUCT_ID
#define USB_PRODUCT_ID 0x0011
#warning PRODUCT_ID not defined, falling back to 0x0001
#endif

#ifndef USB_VENDOR_ID
#define USB_VENDOR_ID 0x20B1
#warning VENDOR_ID not defined, falling back to XMOS vendor ID
#endif

#define MIDI_LENGTH 92
#define RESOLUTION_BITS 32
#define MAX_FREQ 48000
#define NUM_USB_CHANS 8
#define USB_SUBSLOT_SIZE 4
// (MAX_FREQ + 7999) to guarantee rounding up
// / 8000 to calculate Packet Size per USB Microframe (125us)
// +1 to accomodate for accumulation of 'rounding error'
// (NUM_USB_CHANS * USB_SUBSLOT_SIZE) get the size of one Frame in Bytes
#define USB_MAX_PACKET_SIZE_HS ((((MAX_FREQ + 7999)/8000)+1) * (NUM_USB_CHANS * USB_SUBSLOT_SIZE))

enum USB_STRING_DESC_INDEX {
    USB_CONFIG_STR_INDEX = 1,
    USB_MANUFACTURER_STR_INDEX,
    USB_PRODUCT_STR_INDEX,
    USB_SERIAL_NO_STR_INDEX,
    USB_AUDIO_FUNCTION_STR_INDEX,
    USB_AUDIO_CTRL_IF_STR_INDEX,
    USB_AUDIO_CLOCK_SRC_STR_INDEX,
    USB_AUDIO_USB_FROM_HOST_STR_INDEX,
    USB_AUDIO_TDM_FROM_DAC_STR_INDEX,
    USB_AUDIO_USB_TO_HOST_STR_INDEX,
    USB_AUDIO_TDM_TO_DAC_STR_INDEX,
    USB_AUDIO_MIXER_STR_INDEX,
    USB_AUDIO_FROM_HOST_STREAM_ALT0_STR_INDEX,
    USB_AUDIO_FROM_HOST_STREAM_ALT1_STR_INDEX,
    USB_AUDIO_TO_HOST_STREAM_ALT0_STR_INDEX,
    USB_AUDIO_TO_HOST_STREAM_ALT1_STR_INDEX,
    USB_MIDI_FROM_HOST_JACK_STR_INDEX,
    USB_MIDI_FROM_ESP_JACK_STR_INDEX,
    USB_MIDI_TO_HOST_JACK_STR_INDEX,
    USB_MIDI_TO_ESP_JACK_STR_INDEX,
};

// USB String descriptor for the Device
static char *usb_stringDescriptors[] = {
    USB_LANG_ID,             // Language ID string (US English)
    USB_CONFIG_DESC,         // iConfiguration
    USB_MANUFACTURER_DESC,   // iManufacturer
    USB_PRODUCT_DESC,        // iProduct
    USB_SERIAL_NO_DESC,      // iSerial
    USB_AUDIO_FUNCTION_DESC,  // iFunction
    USB_AUDIO_CTRL_IF_DESC,
    USB_AUDIO_CLOCK_SRC_DESC,
    USB_AUDIO_USB_FROM_HOST_DESC,
    USB_AUDIO_TDM_FROM_DAC_DESC,
    USB_AUDIO_USB_TO_HOST_DESC,
    USB_AUDIO_TDM_TO_DAC_DESC,
    USB_AUDIO_MIXER_DESC,
    USB_AUDIO_FROM_HOST_STREAM_ALT0_DESC,
    USB_AUDIO_FROM_HOST_STREAM_ALT1_DESC,
    USB_AUDIO_TO_HOST_STREAM_ALT0_DESC,
    USB_AUDIO_TO_HOST_STREAM_ALT1_DESC,
    USB_MIDI_FROM_HOST_JACK_DESC,
    USB_MIDI_FROM_ESP_JACK_DESC,
    USB_MIDI_TO_HOST_JACK_DESC,
    USB_MIDI_TO_ESP_JACK_DESC,
};

USB_Descriptor_Dev_t devDesc_Audio = { // OK with Sample
    .bLength = sizeof(USB_Descriptor_Dev_t),
    .bDescriptorType = USB_DESCTYPE_DEVICE,
    .bcdUSB = USB_BCD_2,
    .bDeviceClass = 0xEF,
    .bDeviceSubClass = 0x02,
    .bDeviceProtocol = 0x01,
    .bMaxPacketSize0 = 64,
    .idVendor = USB_VENDOR_ID,
    .idProduct = USB_PRODUCT_ID,
    .bcdDevice = USB_BCD_DEVICE,
    .iManufacturer = USB_MANUFACTURER_STR_INDEX,
    .iProduct = USB_PRODUCT_STR_INDEX,
    .iSerialNumber = USB_SERIAL_NO_STR_INDEX,
    .bNumConfigurations = 0x02, // SAMPLE: Set to 2 such that windows does not load composite driver
};


typedef struct {
  USB_Descriptor_Cfg_t cfg_header;
  USB_Descriptor_IF_Association_t interface_association;

// Audio Control Interface
  USB_Descriptor_IF_t audio_control_std_interface;
  USB_Audio_Descriptor_IF_AC_t audio_control_class_interface;
  USB_Audio_Descriptor_Clock_Source_t bclk_source_unit;
  USB_Audio_Descriptor_Input_Terminal_t usb_from_host_input_terminal;
  USB_Audio_Descriptor_Input_Terminal_t tdm_from_adc_input_terminal_desc;
  USB_Audio_Descriptor_Output_Terminal_t usb_to_host_output_terminal;
  USB_Audio_Descriptor_Output_Terminal_t tdm_to_dac_output_terminal;
  USB_Audio_Descriptor_Mixer_t mixer_unit;

// Audio Stream Interface 1 (Host to Device)
  USB_Descriptor_IF_t audio_stream_from_host_alt0_std_interface;
  USB_Descriptor_IF_t audio_stream_from_host_alt1_std_interface;
  USB_Audio_Descriptor_IF_AS_t audio_stream_from_host_class_interface;
  USB_Audio_Descriptor_Format_1_t audio_stream_form_host_format;
  USB_Descriptor_EP_t audio_stream_from_host_std_endpoint;
  USB_Audio_Descriptor_EP_AS_t audio_stream_from_host_class_endpoint;

// Audio Stream Interface 2 (Device to Host)
  USB_Descriptor_IF_t audio_stream_to_host_alt0_std_interface;
  USB_Descriptor_IF_t audio_stream_to_host_alt1_std_interface;
  USB_Audio_Descriptor_IF_AS_t audio_stream_to_host_class_interface;
  USB_Audio_Descriptor_Format_1_t audio_stream_to_host_format;
  USB_Descriptor_EP_t audio_stream_to_host_std_endpoint;
  USB_Audio_Descriptor_EP_AS_t audio_stream_to_host_class_endpoint;

// MIDI
  uint8_t configDesc_Midi[MIDI_LENGTH];
} cfg_descriptor;

#define USB_AUDIO_CLASS_INTERFACE_LENGTH ( \
        sizeof(USB_Audio_Descriptor_IF_AC_t) \
        + sizeof(USB_Audio_Descriptor_Clock_Source_t) \
        + sizeof(USB_Audio_Descriptor_Input_Terminal_t) \
        + sizeof(USB_Audio_Descriptor_Input_Terminal_t) \
        + sizeof(USB_Audio_Descriptor_Output_Terminal_t) \
        + sizeof(USB_Audio_Descriptor_Output_Terminal_t) \
        + sizeof(USB_Audio_Descriptor_Mixer_t) \
        )

#define USB_MIDI_CLASS_AC_INTERFACE_LENGTH ( \
        sizeof(USB_MIDI_Descriptor_IF_AC_t) \
        )

#define USB_CFG_LENGTH ( \
        sizeof(USB_Descriptor_Cfg_t) \
        + sizeof(USB_Descriptor_IF_Association_t) \
        + sizeof(USB_Descriptor_IF_t) \
        + USB_AUDIO_CLASS_INTERFACE_LENGTH \
/* USB Audio IN (From Host) */ \
        + sizeof(USB_Descriptor_IF_t) \
        + sizeof(USB_Descriptor_IF_t) \
        + sizeof(USB_Audio_Descriptor_IF_AS_t) \
        + sizeof(USB_Audio_Descriptor_Format_1_t) \
        + sizeof(USB_Descriptor_EP_t) \
        + sizeof(USB_Audio_Descriptor_EP_AS_t) \
/* USB Audio Out (To Host) */ \
        + sizeof(USB_Descriptor_IF_t) \
        + sizeof(USB_Descriptor_IF_t) \
        + sizeof(USB_Audio_Descriptor_IF_AS_t) \
        + sizeof(USB_Audio_Descriptor_Format_1_t) \
        + sizeof(USB_Descriptor_EP_t) \
        + sizeof(USB_Audio_Descriptor_EP_AS_t) \
/* USB MIDI */ \
        + MIDI_LENGTH \
        )

cfg_descriptor cfgDesc_Audio = { // OK with Sample
    .cfg_header = {
            .bLength = (uint8_t)sizeof(USB_Descriptor_Cfg_t),
            .bDescriptorType = USB_DESCTYPE_CONFIGURATION,
            .wTotalLength = USB_CFG_LENGTH,
            .bNumInterfaces = USB_INTERFACE_COUNT,
            .bConfigurationValue = 1,
            .iConfiguration = USB_CONFIG_STR_INDEX,
#ifdef SELF_POWERED
            .bmAttributes = 0xC0,
#else
            .bmAttributes = 0x80,
#endif
            .bMaxPower = BMAX_POWER,
        },
    .interface_association = { // OK with Sample
            .bLength = (uint8_t)sizeof(USB_Descriptor_IF_Association_t),
            .bDescriptorType = USB_DESCTYPE_INTERFACE_ASSOCIATION,
            .bFirstInterface = 0x00,
            .bInterfaceCount = USB_INTERFACE_COUNT,
            .bFunctionClass = USB_INTERFACE_CLASS_AUDIO,
            .bFunctionSubClass = USB_INTERFACE_SUBCLASS_UNDEFINED,
            .bFunctionProtocol = USB_INTERFACE_PROTOCOL_2,
            .iFunction = USB_AUDIO_FUNCTION_STR_INDEX,
        },
    .audio_control_std_interface = { // OK with Sample
            .bLength = (uint8_t)sizeof(USB_Descriptor_IF_t),
            .bDescriptorType = USB_DESCTYPE_INTERFACE,
            .bInterfaceNumber = USB_INTERFACE_NUMBER_AUDIO_CONTROL,
            .bAlternateSetting = 0x00,  // must be 0 for AC
            .bNumEndpoints = 0x00,      // EP 0 is not counted here
            .bInterfaceClass = USB_INTERFACE_CLASS_AUDIO,
            .bInterfaceSubClass = USB_INTERFACE_SUBCLASS_CONTROL,
            .bInterfaceProtocol = USB_INTERFACE_PROTOCOL_2,
            .iInterface = USB_AUDIO_CTRL_IF_STR_INDEX,
        },
    .audio_control_class_interface = { // OK with Sample
            .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_IF_AC_t),
            .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE,
            .bDescriptorSubtype = USB_AUDIO_IF_AC_SUBTYPE_HEADER,
            .bcdADC = 0x0200, // compliant with USB2
            .bCategory = 0x0A, // Pro Audio
            .wTotalLength = USB_AUDIO_CLASS_INTERFACE_LENGTH,
            .bmControls = 0x00,
        },
    .bclk_source_unit = { // OK with Sample
            .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_Clock_Source_t),
            .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE,
            .bDescriptorSubtype = USB_AUDIO_IF_AC_SUBTYPE_CLOCK_SOURCE,
            .bClockID = USB_ID_BCLK,
            .bmAttributes = 0x00,
            .bmControls = 0x00, // SAMPLE: 0x07
            .bAssocTerminal = USB_ID_NONE,
            .iClockSource = USB_AUDIO_CLOCK_SRC_STR_INDEX,
        },
    .usb_from_host_input_terminal = { // OK with Sample
            .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_Input_Terminal_t),
            .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE,
            .bDescriptorSubtype = USB_AUDIO_IF_AC_SUBTYPE_INPUT_TERMINAL,
            .bTerminalID = USB_ID_USB_FROM_HOST,
            .wTerminalType = 0x0101, // USB Streaming
            .bAssocTerminal = 0x00,
            .bCSourceID = USB_ID_BCLK,
            .audio_cluster =
                {
                    .bNrChannels = NUM_USB_CHANS,
                    .bmChannelConfig = 0x000000FF,
                    .iChannelNames = 0,
                },
            .bmControls = 0x0000,
            .iTerminal = USB_AUDIO_USB_FROM_HOST_STR_INDEX,
        },
    .tdm_from_adc_input_terminal_desc = { // OK with Sample
            .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_Input_Terminal_t),
            .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE,
            .bDescriptorSubtype = USB_AUDIO_IF_AC_SUBTYPE_INPUT_TERMINAL,
            .bTerminalID = USB_ID_TDM_FROM_ADC,
            .wTerminalType = 0x0200, // Input undefined
            .bAssocTerminal = 0x00,
            .bCSourceID = USB_ID_BCLK,
            .audio_cluster =
                {
                    .bNrChannels = NUM_USB_CHANS,
                    .bmChannelConfig = 0x000000FF,
                    .iChannelNames = 0,
                },
            .bmControls = 0x0000,
            .iTerminal = USB_AUDIO_TDM_FROM_DAC_STR_INDEX,
    },
    .usb_to_host_output_terminal = { // OK with Sample
            .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_Output_Terminal_t),
            .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE,
            .bDescriptorSubtype = USB_AUDIO_IF_AC_SUBTYPE_OUTPUT_TERMINAL,
            .bTerminalID = USB_ID_USB_TO_HOST,
            .wTerminalType = 0x0101, // USB Streaming
            .bAssocTerminal = 0,
            .bSourceID = USB_ID_MIXER,
            .bCSourceID = USB_ID_BCLK,
            .bmControls = 0,
            .iTerminal = USB_AUDIO_USB_TO_HOST_STR_INDEX,
    },
    .tdm_to_dac_output_terminal = { // OK with Sample
            .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_Output_Terminal_t),
            .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE,
            .bDescriptorSubtype = USB_AUDIO_IF_AC_SUBTYPE_OUTPUT_TERMINAL,
            .bTerminalID = USB_ID_TDM_FROM_ADC,
            .wTerminalType = 0x0301, // Output to Speaker
            .bAssocTerminal = 0,
            .bSourceID = USB_ID_MIXER,
            .bCSourceID = USB_ID_BCLK,
            .bmControls = 0,
            .iTerminal = USB_AUDIO_TDM_TO_DAC_STR_INDEX,
    },
    .mixer_unit = {
            .bLength = sizeof(USB_Audio_Descriptor_Mixer_t),
            .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE,
            .bDescriptorSubtype = USB_AUDIO_IF_AC_SUBTYPE_MIXER_UNIT,
            .bUnitID = USB_ID_MIXER,             // Unique Unit-ID of the Terminal
            .bNrInPins = 2,           // Number of Input Pins of this unit
            .baSourceID1 = USB_ID_USB_FROM_HOST,
            .baSourceID2 = USB_ID_TDM_FROM_ADC,
            .audio_cluster = {
                    .bNrChannels = NUM_USB_CHANS,
                    .bmChannelConfig = 0x000000FF,
                    .iChannelNames = 0,
            },
            .bmMixerControlsInput1 = 0x0000000000000000,
            .bmMixerControlsInput2 = 0x0000000000000000,
            .bmControls = 0,
            .iMixer = USB_AUDIO_MIXER_STR_INDEX,
    },

/* USB Stream from Host */
    .audio_stream_from_host_alt0_std_interface = { // OK with Sample
            .bLength = (uint8_t)sizeof(USB_Descriptor_IF_t),
            .bDescriptorType = USB_DESCTYPE_INTERFACE,
            .bInterfaceNumber = USB_INTERFACE_NUMBER_AUDIO_FROM_HOST,
            .bAlternateSetting = 0,
            .bNumEndpoints = 0,
            .bInterfaceClass = USB_INTERFACE_CLASS_AUDIO,
            .bInterfaceSubClass = USB_INTERFACE_SUBCLASS_STREAMING,
            .bInterfaceProtocol = USB_INTERFACE_PROTOCOL_2,
            .iInterface = USB_AUDIO_FROM_HOST_STREAM_ALT0_STR_INDEX,
        },
    .audio_stream_from_host_alt1_std_interface = { // OK with Sample
            .bLength = (uint8_t)sizeof(USB_Descriptor_IF_t),
            .bDescriptorType = USB_DESCTYPE_INTERFACE,
            .bInterfaceNumber = USB_INTERFACE_NUMBER_AUDIO_FROM_HOST,
            .bAlternateSetting = 1,
            .bNumEndpoints = 1,
            .bInterfaceClass = USB_INTERFACE_CLASS_AUDIO,
            .bInterfaceSubClass = USB_INTERFACE_SUBCLASS_STREAMING,
            .bInterfaceProtocol = USB_INTERFACE_PROTOCOL_2,
            .iInterface = USB_AUDIO_FROM_HOST_STREAM_ALT1_STR_INDEX,
        },
    .audio_stream_from_host_class_interface = { // OK with Sample
            .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_IF_AS_t),
            .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE,
            .bDescriptorSubType = USB_AUDIO_IF_AS_SUBTYPE_GENERAL,
            .bTerminalLink = USB_ID_USB_FROM_HOST,
            .bmControls = 0x00,
            .bFormatType = 0x01,
            .bmFormats = 0x00000001,
            .audio_cluster =
                {
                    .bNrChannels = NUM_USB_CHANS,
                    .bmChannelConfig = 0x000000FF,
                    .iChannelNames = 0x00,
                },
        },
    .audio_stream_form_host_format = { // OK with Sample
         .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_Format_1_t),
         .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE,
         .bDescriptorSubtype = USB_AUDIO_IF_AS_SUBTYPE_FORMAT_TYPE,
         .bFormatType = 1,
         .bSubSlotSize = USB_SUBSLOT_SIZE,
         .bBitResolution = RESOLUTION_BITS,
        },
    .audio_stream_from_host_std_endpoint = { // OK with Sample
            .bLength = (uint8_t) sizeof(USB_Descriptor_EP_t),
            .bDescriptorType = USB_DESCTYPE_ENDPOINT,
            .bEndpointAddress = 1,
            .bmAttributes = 0x05,
            .wMaxPacketSize = (uint16_t)USB_MAX_PACKET_SIZE_HS,
            .bInterval = 1,
        },
    .audio_stream_from_host_class_endpoint = { // OK with Sample
            .bLength = (uint8_t) sizeof(USB_Audio_Descriptor_EP_AS_t),
            .bDescriptorType = USB_AUDIO_DESCTYPE_ENDPOINT,
            .bDescriptorSubtype = USB_AUDIO_IF_AS_SUBTYPE_GENERAL,
            .bmAttributes = 0x00,
            .bmControls = 0x00,
            .bLockDelayUnits = 0x02,
            .wLockDelay = 0x0008,
        },

/* USB Stream To Host */
    .audio_stream_to_host_alt0_std_interface =  { // OK with Sample
        .bLength = (uint8_t)sizeof(USB_Descriptor_IF_t),
        .bDescriptorType = USB_DESCTYPE_INTERFACE,
        .bInterfaceNumber = USB_INTERFACE_NUMBER_AUDIO_TO_HOST,
        .bAlternateSetting = 0,
        .bNumEndpoints = 0,
        .bInterfaceClass = USB_INTERFACE_CLASS_AUDIO,
        .bInterfaceSubClass = USB_INTERFACE_SUBCLASS_STREAMING,
        .bInterfaceProtocol = USB_INTERFACE_PROTOCOL_2,
        .iInterface = USB_AUDIO_TO_HOST_STREAM_ALT0_STR_INDEX,
    },
    .audio_stream_to_host_alt1_std_interface = { // OK with Sample
            .bLength = (uint8_t)sizeof(USB_Descriptor_IF_t),
            .bDescriptorType = USB_DESCTYPE_INTERFACE,
            .bInterfaceNumber = USB_INTERFACE_NUMBER_AUDIO_TO_HOST,
            .bAlternateSetting = 1,
            .bNumEndpoints = 1,
            .bInterfaceClass = USB_INTERFACE_CLASS_AUDIO,
            .bInterfaceSubClass = USB_INTERFACE_SUBCLASS_STREAMING,
            .bInterfaceProtocol = USB_INTERFACE_PROTOCOL_2,
            .iInterface = USB_AUDIO_TO_HOST_STREAM_ALT1_STR_INDEX,
    },
    .audio_stream_to_host_class_interface = { // OK with Sample
            .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_IF_AS_t),
            .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE,
            .bDescriptorSubType = USB_AUDIO_IF_AS_SUBTYPE_GENERAL,
            .bTerminalLink = USB_ID_USB_TO_HOST,
            .bmControls = 0,
            .bFormatType = 1,
            .bmFormats = 0x00000001,
            .audio_cluster =
            {
                .bNrChannels = NUM_USB_CHANS,
                .bmChannelConfig = 0x000000FF,
                .iChannelNames = 0x00,
            },
    },
    .audio_stream_to_host_format = { // OK with Sample
        .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_Format_1_t),
        .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE,
        .bDescriptorSubtype = USB_AUDIO_IF_AS_SUBTYPE_FORMAT_TYPE,
        .bFormatType = 1,
        .bSubSlotSize = USB_SUBSLOT_SIZE,
        .bBitResolution = RESOLUTION_BITS,
    },
    .audio_stream_to_host_std_endpoint = { // OK with Sample
        .bLength = (uint8_t)sizeof(USB_Descriptor_EP_t),
        .bDescriptorType = USB_DESCTYPE_ENDPOINT,
        .bEndpointAddress = 1,
        .bmAttributes = 0x05, // SAMPLE: 0x25: Iso, async, implicit feedback data endpoint
        .wMaxPacketSize = USB_MAX_PACKET_SIZE_HS,
        .bInterval = 0x01,
    },
    .audio_stream_to_host_class_endpoint = { // OK with Sample
        .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_EP_AS_t),
        .bDescriptorType = USB_AUDIO_DESCTYPE_ENDPOINT,
        .bDescriptorSubtype = USB_AUDIO_IF_AS_SUBTYPE_GENERAL,
        .bmAttributes = 0,
        .bmControls = 0,
        .bLockDelayUnits = 02,
        .wLockDelay = 0x0008,
    },
// MIDI (taken from sample)
    /* MIDI Descriptors */
    /* Table B-3: MIDI Adapter Standard AC Interface Descriptor */
        {0x09,                                /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
        0x04,                                 /* 1 bDescriptorType : INTERFACE descriptor. (field size 1 bytes) */
        USB_INTERFACE_NUMBER_MIDI_CONTROL,    /* 2 bInterfaceNumber : Index of this interface. (field size 1 bytes) */
        0x00,                                 /* 3 bAlternateSetting : Index of this setting. (field size 1 bytes) */
        0x00,                                 /* 4 bNumEndpoints : 0 endpoints. (field size 1 bytes) */
        0x01,                                 /* 5 bInterfaceClass : AUDIO. (field size 1 bytes) */
        0x01,                                 /* 6 bInterfaceSubclass : AUDIO_CONTROL. (field size 1 bytes) */
        0x00,                                 /* 7 bInterfaceProtocol : Unused. (field size 1 bytes) */
        0x00,                                 /* 8 iInterface : Unused. (field size 1 bytes) */

    /* Table B-4: MIDI Adapter Class-specific AC Interface Descriptor */
        0x09,                                 /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
        0x24,                                 /* 1 bDescriptorType : 0x24. (field size 1 bytes) */
        0x01,                                 /* 2 bDescriptorSubtype : HEADER subtype. (field size 1 bytes) */
        0x00,                                 /* 3 bcdADC : Revision of class specification - 1.0 (field size 2 bytes) */
        0x01,                                 /* 4 bcdADC */
        0x09,                                 /* 5 wTotalLength : Total size of class specific descriptors. (field size 2 bytes) */
        0x00,                                 /* 6 wTotalLength */
        0x01,                                 /* 7 bInCollection : Number of streaming interfaces. (field size 1 bytes) */
        0x01,                                 /* 8 baInterfaceNr(1) : MIDIStreaming interface 1 belongs to this AudioControl interface */

    /* Table B-5: MIDI Adapter Standard MS Interface Descriptor */
        0x09,                                 /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
        0x04,                                 /* 1 bDescriptorType : INTERFACE descriptor. (field size 1 bytes) */
        USB_INTERFACE_NUMBER_MIDI_STREAM,     /* 2 bInterfaceNumber : Index of this interface. (field size 1 bytes) */
        0x00,                                 /* 3 bAlternateSetting : Index of this alternate setting. (field size 1 bytes) */
        0x02,                                 /* 4 bNumEndpoints : 2 endpoints. (field size 1 bytes) */
        0x01,                                 /* 5 bInterfaceClass : AUDIO. (field size 1 bytes) */
        0x03,                                 /* 6 bInterfaceSubclass : MIDISTREAMING. (field size 1 bytes) */
        0x00,                                 /* 7 bInterfaceProtocol : Unused. (field size 1 bytes) */
        0x00,                                 /* 8 iInterface : Unused. (field size 1 bytes) */

    /* Table B-6: MIDI Adapter Class-specific MS Interface Descriptor */
        0x07,                                 /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
        0x24,                                 /* 1 bDescriptorType : CS_INTERFACE. (field size 1 bytes) */
        0x01,                                 /* 2 bDescriptorSubtype : MS_HEADER subtype. (field size 1 bytes) */
        0x00,                                 /* 3 BcdADC : Revision of this class specification. (field size 2 bytes) */
        0x01,                                 /* 4 BcdADC */
        0x41,                                 /* 5 wTotalLength : Total size of class-specific descriptors. (field size 2 bytes) */
        0x00,                                 /* 6 wTotalLength */

    /* Table B-7: MIDI Adapter MIDI IN Jack Descriptor (Embedded) */
        0x06,                                 /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
        0x24,                                 /* 1 bDescriptorType : CS_INTERFACE. (field size 1 bytes) */
        0x02,                                 /* 2 bDescriptorSubtype : MIDI_IN_JACK subtype. (field size 1 bytes) */
        0x01,                                 /* 3 bJackType : EMBEDDED. (field size 1 bytes) */
        0x01,                                 /* 4 bJackID : ID of this Jack. (field size 1 bytes) */
        0x00,                                 /* 5 iJack : Unused. (field size 1 bytes) */

    /* Table B-8: MIDI Adapter MIDI IN Jack Descriptor (External) */
        0x06,                                 /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
        0x24,                                 /* 1 bDescriptorType : CS_INTERFACE. (field size 1 bytes) */
        0x02,                                 /* 2 bDescriptorSubtype : MIDI_IN_JACK subtype. (field size 1 bytes) */
        0x02,                                 /* 3 bJackType : EXTERNAL. (field size 1 bytes) */
        0x02,                                 /* 4 bJackID : ID of this Jack. (field size 1 bytes) */
        USB_MIDI_FROM_ESP_JACK_STR_INDEX,     /* 5 iJack : Unused. (field size 1 bytes) */

    /* Table B-9: MIDI Adapter MIDI OUT Jack Descriptor (Embedded) */
        0x09,                                 /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
        0x24,                                 /* 1 bDescriptorType : CS_INTERFACE. (field size 1 bytes) */
        0x03,                                 /* 2 bDescriptorSubtype : MIDI_OUT_JACK subtype. (field size 1 bytes) */
        0x01,                                 /* 3 bJackType : EMBEDDED. (field size 1 bytes) */
        0x03,                                 /* 4 bJackID : ID of this Jack. (field size 1 bytes) */
        0x01,                                 /* 5 bNrInputPins : Number of Input Pins of this Jack. (field size 1 bytes) */
        0x02,                                 /* 6 BaSourceID(1) : ID of the Entity to which this Pin is connected. (field size 1 bytes) */
        0x01,                                 /* 7 BaSourcePin(1) : Output Pin number of the Entityt o which this Input Pin is connected. */
        0x00,                                 /* 8 iJack : Unused. (field size 1 bytes) */

    /* Table B-10: MIDI Adapter MIDI OUT Jack Descriptor (External) */
        0x09,                                 /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
        0x24,                                 /* 1 bDescriptorType : CS_INTERFACE. (field size 1 bytes) */
        0x03,                                 /* 2 bDescriptorSubtype : MIDI_OUT_JACK subtype. (field size 1 bytes) */
        0x02,                                 /* 3 bJackType : EXTERNAL. (field size 1 bytes) */
        0x04,                                 /* 4 bJackID : ID of this Jack. (field size 1 bytes) */
        0x01,                                 /* 5 bNrInputPins : Number of Input Pins of this Jack. (field size 1 bytes) */
        0x01,                                 /* 6 BaSourceID(1) : ID of the Entity to which this Pin is connected. (field size 1 bytes) */
        0x01,                                 /* 7 BaSourcePin(1) : Output Pin number of the Entity to which this Input Pin is connected. */
        USB_MIDI_TO_ESP_JACK_STR_INDEX,        /* 5 iJack : Unused. (field size 1 bytes) */

    /* Table B-11: MIDI Adapter Standard Bulk OUT Endpoint Descriptor */
        0x09,                                 /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
        0x05,                                 /* 1 bDescriptorType : ENDPOINT descriptor. (field size 1 bytes) */
        USB_ENDPOINT_NUMBER_MIDI_TO_HOST,            /* 2 bEndpointAddress : OUT Endpoint 3. (field size 1 bytes) */
        0x02,                                 /* 3 bmAttributes : Bulk, not shared. (field size 1 bytes) */
        0x00,                                 /* 4 wMaxPacketSize : 512 bytes per packet. (field size 2 bytes) - has to be 0x200 for compliance*/
        0x02,                                 /* 5 wMaxPacketSize */
        0x00,                                 /* 6 bInterval : Ignored for Bulk. Set to zero. (field size 1 bytes) */
        0x00,                                 /* 7 bRefresh : Unused. (field size 1 bytes) */
        0x00,                                 /* 8 bSynchAddress : Unused. (field size 1 bytes) */

    /* Table B-12: MIDI Adapter Class-specific Bulk OUT Endpoint Descriptor */
        0x05,                                 /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
        0x25,                                 /* 1 bDescriptorType : CS_ENDPOINT descriptor (field size 1 bytes) */
        0x01,                                 /* 2 bDescriptorSubtype : MS_GENERAL subtype. (field size 1 bytes) */
        0x01,                                 /* 3 bNumEmbMIDIJack : Number of embedded MIDI IN Jacks. (field size 1 bytes) */
        0x01,                                 /* 4 BaAssocJackID(1) : ID of the Embedded MIDI IN Jack. (field size 1 bytes) */

    /* Table B-13: MIDI Adapter Standard Bulk IN Endpoint Descriptor */
        0x09,                                 /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
        0x05,                                 /* 1 bDescriptorType : ENDPOINT descriptor. (field size 1 bytes) */
        USB_ENDPOINT_NUMBER_MIDI_FROM_HOST,             /* 2 bEndpointAddress : IN Endpoint 3. (field size 1 bytes) */
        0x02,                                 /* 3 bmAttributes : Bulk, not shared. (field size 1 bytes) */
        0x00,                                 /* 4 wMaxPacketSize : 512 bytes per packet. (field size 2 bytes) - has to be 0x200 for compliance*/
        0x02,                                 /* 5 wMaxPacketSize */
        0x00,                                 /* 6 bInterval : Ignored for Bulk. Set to zero. (field size 1 bytes) */
        0x00,                                 /* 7 bRefresh : Unused. (field size 1 bytes) */
        0x00,                                 /* 8 bSynchAddress : Unused. (field size 1 bytes) */

    /* Table B-14: MIDI Adapter Class-specific Bulk IN Endpoint Descriptor */
        0x05,                                 /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
        0x25,                                 /* 1 bDescriptorType : CS_ENDPOINT descriptor (field size 1 bytes) */
        0x01,                                 /* 2 bDescriptorSubtype : MS_GENERAL subtype. (field size 1 bytes) */
        0x01,                                 /* 3 bNumEmbMIDIJack : Number of embedded MIDI OUT Jacks. (field size 1 bytes) */
        0x03,                                 /* 4 BaAssocJackID(1) : ID of the Embedded MIDI OUT Jack. (field size 1 bytes) */
        },
};
Here is how I call the USB_StandardRequest which should deal with the enumeration process (taken from the abovementioned sample):

Code: Select all

        if(result == XUD_RES_ERR)
        {
                /* Return Audio 2.0 Descriptors with Null device as fallback */
                result = USB_StandardRequests(ep0_out, ep0_in,
                    (unsigned char*)&devDesc_Audio, sizeof(devDesc_Audio),
                    (unsigned char*)&cfgDesc_Audio, sizeof(cfgDesc_Audio),
                    NULL, 0,
                    NULL, 0,
                    usb_stringDescriptors,
                          sizeof(usb_stringDescriptors) / sizeof(usb_stringDescriptors[0]), &sp,
                          usbBusSpeed);

        }

My questions are:
Occurs the error during the enumeration process? If so, can you help me pinpoint where the descriptors are wrong?
Do you need any additional information?


Thanks for your help!!
Tim
View Solution
User avatar
dsteinwe
XCore Addict
Posts: 144
Joined: Wed Jun 29, 2016 8:59 am

Post by dsteinwe »

Hi,

frame no 720 to 723 looks strange. Anyhow, if you post the device (devDesc_Audio) and configuration descriptor (cfgDesc_Audio) as comma separated hex-values (i.e. 0x12, 0x01, 0x00, 0x02, 0xef, 0x02 ...), I try to analyze your descriptors.

Can you dump frame 736 instead of 735, because it contains the "URB_FUNCTION_ABORT_PIPE".

Furthermore, the dump is a little bit confusing. At the beginning there is a frame with the info "URB_BULK out" to the destination "3.2.1" (== bus 3, device 2, ep 1). That is the device, that causes the URB_FUNCTION_ABORT_PIPE. The "GET DESCRIPTOR" requests are sent to the destination "3.3.0". That is an different device! Please filter the frames with "usb.device_address == 3" for a correct dump (if device 3 is the correct one).

Next, normally a sound card have no BULK ep, if UAC is used.

Cheers,
Dieter
friguly
Junior Member
Posts: 6
Joined: Fri Jun 24, 2022 7:13 am

Post by friguly »

Thanks for your answer!

You pointed out something i didn't recognize earlier. The pipeline stall does not occur for my connection, but for the connection established for flashing the firmware. When I apply the filter as you suggested, I get the following:
Image

Here the information about the 'odd frames' 720 to 723:
Image

Here is a Listing of the Device Descriptor generated by USB Device Tree Viewer (taken today, so the device no. etc. won't match the ones in the wireshark recording):

Code: Select all

    =========================== USB Port4 ===========================

Connection Status       	: 0x01 (Device is connected)
Port Chain               		: 3-3-4-4
Properties              		: 0x01
 IsUserConnectable     	: yes
 PortIsDebugCapable     	: no
 PortHasMultiCompanions  : no
 PortConnectorIsTypeC    	: no
ConnectionIndex          	: 0x04 (Port 4)
CompanionIndex          	: 0
 CompanionHubSymLnk     	: USB#VID_2109&PID_0813#6&bec8b8d&0&4#{f18a0e88-c30c-11d0-8815-00a0c906bed8}
 CompanionPortNumber    	: 0x04 (Port 4)
 -> CompanionPortChain  	: 3-7-4-4

      ========================== Summary =========================
Vendor ID                		: 0x20B1 (XMOS Ltd.)
Product ID               		: 0x0011
USB Version              		: 2.00
Port maximum Speed       	: High-Speed (Companion Port 3-7-4-4 supports SuperSpeed)
Device maximum Speed    	: High-Speed
Device Connection Speed  	: High-Speed
Self powered            		: yes
Demanded Current        	: 480 mA
Used Endpoints          	: 3

      ======================== USB Device ========================

        +++++++++++++++++ Device Information ++++++++++++++++++
Device Description      	: USB-Verbundgerät
Device Path              		: \\?\USB#VID_20B1&PID_0011#0.0.11#{a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE)
Kernel Name             	: \Device\USBPDO-15
Device ID                		: USB\VID_20B1&PID_0011\0.0.11
Hardware IDs            	: USB\VID_20B1&PID_0011&REV_0000 USB\VID_20B1&PID_0011
Driver KeyName          	 : {36fc9e60-c465-11cf-8056-444553540000}\0051 (GUID_DEVCLASS_USB)
Driver                   		: \SystemRoot\System32\drivers\usbccgp.sys (Version: 10.0.19041.488  Date: 2020-09-12)
Driver Inf               		: C:\Windows\inf\usb.inf
Legacy BusType          	: PNPBus
Class                   		 : USB
Class GUID               		: {36fc9e60-c465-11cf-8056-444553540000} (GUID_DEVCLASS_USB)
Service                  		: usbccgp
Enumerator               	: USB
Location Info            		: Port_#0004.Hub_#0010
Location IDs            		: PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(3)#USB(4)#USB(4), ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HSP3)#USB(4)#USB(4)
Container ID             		: {36fd7add-05c7-56ec-93fe-427dbc56ba85}
Manufacturer Info       	: (Standard-USB-Hostcontroller)
Capabilities             		: 0x94 (Removable, UniqueID, SurpriseRemovalOK)
Status                   		: 0x0180600A (DN_DRIVER_LOADED, DN_STARTED, DN_DISABLEABLE, DN_REMOVABLE, DN_NT_ENUMERATOR, DN_NT_DRIVER)
Problem Code            	: 0
Address                 		: 4
HcDisableSelectiveSuspend	: 0
EnableSelectiveSuspend  	 : 0
SelectiveSuspendEnabled  	: 0
EnhancedPowerMgmtEnabled 	: 0
IdleInWorkingState       	: 0
WakeFromSleepState      	: 0
Power State              	: D3 (supported: D0, D2, D3, wake from D0, wake from D2)
 Child Device 1         		: TEST Device (USB Audio 2.0)
  Device ID              		: USB\VID_20B1&PID_0011&MI_00\8&2FAA63FD&0&0000
  Class                  		: MEDIA
  Driver KeyName         	: {4d36e96c-e325-11ce-bfc1-08002be10318}\0014 (GUID_DEVCLASS_MEDIA)
  Service               		: usbaudio2
  Location              		: 0000.0014.0000.003.004.004.000.000.000
  LocationPaths         	: PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(3)#USB(4)#USB(4)#USBMI(0)  PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(3)#USB(4)#USB(4)#USB(4)  ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HSP3)#USB(4)#USB(4)#USBMI(0)  ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HSP3)#USB(4)#USB(4)#USB(4)
  Problem               		: 10 (CM_PROB_FAILED_START)

        +++++++++++++++++ Registry USB Flags +++++++++++++++++
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\20B100110000
 osvc                    		: REG_BINARY 00 00
 NewInterfaceUsage      	: REG_DWORD 00000000 (0)

        ---------------- Connection Information ---------------
Connection Index        	: 0x04 (Port 4)
Connection Status        	: 0x01 (DeviceConnected)
Current Config Value     	: 0x01 (Configuration 1)
Device Address           	: 0x0D (13)
Is Hub                   		: 0x00 (no)
Device Bus Speed         	: 0x02 (High-Speed)
Number Of Open Pipes     	: 0x02 (2 pipes to data endpoints)
Pipe[0]                  		: EndpointID=4  Direction=OUT  ScheduleOffset=0  Type=Bulk  wMaxPacketSize=512  bInterval=0
Pipe[1]                  		: EndpointID=3  Direction=OUT  ScheduleOffset=0  Type=Bulk  wMaxPacketSize=512  bInterval=0
Data (HexDump)           	: 04 00 00 00 12 01 00 02 EF 02 01 40 B1 20 11 00   ...........@. ..
                           00 00 02 03 04 02 01 02 00 0D 00 02 00 00 00 01   ................
                           00 00 00 09 05 04 02 00 02 00 00 00 00 00 09 05   ................
                           03 02 00 02 00 00 00 00 00                        .........

        --------------- Connection Information V2 -------------
Connection Index         	: 0x04 (4)
Length                   		: 0x10 (16 bytes)
SupportedUsbProtocols    	: 0x03
 Usb110                  		: 1 (yes, port supports USB 1.1)
 Usb200                  		: 1 (yes, port supports USB 2.0)
 Usb300                 		: 0 (no, port not supports USB 3.0) -> but Companion Port 3-7-4-4 does
 ReservedMBZ             	: 0x00
Flags                    		: 0x00
 DevIsOpAtSsOrHigher     	: 0 (Device is not operating at SuperSpeed or higher)
 DevIsSsCapOrHigher     	: 0 (Device is not SuperSpeed capable or higher)
 DevIsOpAtSsPlusOrHigher	: 0 (Device is not operating at SuperSpeedPlus or higher)
 DevIsSsPlusCapOrHigher  	: 0 (Device is not SuperSpeedPlus capable or higher)
 ReservedMBZ             	: 0x00
Data (HexDump)           	: 04 00 00 00 10 00 00 00 03 00 00 00 00 00 00 00   ................

    ---------------------- Device Descriptor ----------------------
bLength                  		: 0x12 (18 bytes)
bDescriptorType          	: 0x01 (Device Descriptor)
bcdUSB                   		: 0x200 (USB Version 2.00)
bDeviceClass             	: 0xEF (Miscellaneous)
bDeviceSubClass          	: 0x02
bDeviceProtocol          	: 0x01 (IAD - Interface Association Descriptor)
bMaxPacketSize0          	: 0x40 (64 bytes)
idVendor                		: 0x20B1 (XMOS Ltd.)
idProduct                		: 0x0011
bcdDevice                		: 0x0000
iManufacturer            	: 0x02 (String Descriptor 2)
iProduct                 		: 0x03 (String Descriptor 3)
iSerialNumber            	: 0x04 (String Descriptor 4)
bNumConfigurations       	: 0x02 (2 Configurations)
Data (HexDump)           	: 12 01 00 02 EF 02 01 40 B1 20 11 00 00 00 02 03   .......@. ......
                           04 02                                             ..

    ------------------ Configuration Descriptor -------------------
bLength                  		: 0x09 (9 bytes)
bDescriptorType          	: 0x02 (Configuration Descriptor)
wTotalLength             	: 0x014E (334 bytes)
bNumInterfaces           	: 0x05 (5 Interfaces)
bConfigurationValue      	: 0x01 (Configuration 1)
iConfiguration           	: 0x01 (String Descriptor 1)
bmAttributes             	: 0xC0
 D7: Reserved, set 1     	: 0x01
 D6: Self Powered        	: 0x01 (yes)
 D5: Remote Wakeup       	: 0x00 (no)
 D4..0: Reserved, set 0  	: 0x00
MaxPower                 	: 0xF0 (480 mA)
Data (HexDump)           	: 09 02 4E 01 05 01 01 C0 F0 08 0B 00 05 01 00 20   ..N............ 
                           05 09 04 00 00 00 01 01 20 06 09 24 01 00 02 0A   ........ ..$....
                           6A 00 00 08 24 0A 01 00 00 00 07 11 24 02 02 01   j...$.......$...
                           01 00 01 08 FF 00 00 00 00 00 00 08 11 24 02 03   .............$..
                           00 02 00 01 08 FF 00 00 00 00 00 00 09 0C 24 03   ..............$.
                           04 01 01 00 06 01 00 00 0A 0C 24 03 03 01 03 00   ..........$.....
                           06 01 00 00 0B 1F 24 04 06 02 02 03 08 FF 00 00   ......$.........
                           00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
                           00 00 00 0C 09 04 01 00 00 01 02 20 0D 09 04 01   ........... ....
                           01 01 01 02 20 0E 10 24 01 02 00 01 01 00 00 00   .... ..$........
                           08 FF 00 00 00 00 06 24 02 01 04 20 07 05 01 05   .......$... ....
                           E0 00 01 08 25 01 00 00 02 08 00 09 04 02 00 00   ....%...........
                           01 02 20 0F 09 04 02 01 01 01 02 20 10 10 24 01   .. ........ ..$.
                           04 00 01 01 00 00 00 08 FF 00 00 00 00 06 24 02   ..............$.
                           01 04 20 07 05 01 05 E0 00 01 08 25 01 00 00 02   .. ........%....
                           08 00 09 04 03 00 00 01 01 00 00 09 24 01 00 01   ............$...
                           09 00 01 01 09 04 04 00 02 01 03 00 00 07 24 01   ..............$.
                           00 01 41 00 06 24 02 01 01 00 06 24 02 02 02 12   ..A..$.....$....
                           09 24 03 01 03 01 02 01 00 09 24 03 02 04 01 01   .$........$.....
                           01 14 09 05 04 02 00 02 00 00 00 05 25 01 01 01   ............%...
                           09 05 03 02 00 02 00 00 00 05 25 01 01 03         ..........%...

        ------------------- IAD Descriptor --------------------
bLength                  		: 0x08 (8 bytes)
bDescriptorType          	: 0x0B (Interface Association Descriptor)
bFirstInterface          	: 0x00 (Interface 0)
bInterfaceCount         	: 0x05 (5 Interfaces)
bFunctionClass           	: 0x01 (Audio)
bFunctionSubClass        	: 0x00 (undefined)
bFunctionProtocol       	: 0x20 (AF 2.0)
iFunction                		: 0x05 (String Descriptor 5)
Data (HexDump)           	: 08 0B 00 05 01 00 20 05                           ...... .

        ---------------- Interface Descriptor -----------------
bLength                  		: 0x09 (9 bytes)
bDescriptorType          	: 0x04 (Interface Descriptor)
bInterfaceNumber        	: 0x00 (Interface 0)
bAlternateSetting        	: 0x00
bNumEndpoints            	: 0x00 (Default Control Pipe only)
bInterfaceClass          	: 0x01 (Audio)
bInterfaceSubClass       	: 0x01 (Audio Control)
bInterfaceProtocol       	: 0x20 (Device Protocol Version 2.0)
iInterface               		: 0x06 (String Descriptor 6)
Data (HexDump)           : 09 04 00 00 00 01 01 20 06                        ....... .

        ---- Audio Control Interface Header Descriptor 2.0 ----
bLength                 		: 0x09 (9 bytes)
bDescriptorType         	: 0x24 (Audio Interface Descriptor)
bDescriptorSubtype      	 : 0x01 (Header 2.0)
bcdADC                   		: 0x0200 (2.0)
bCategory                		: 0x0A (pro-audio)
wTotalLength            	: 0x006A (106 bytes)
bmControls               	: 0x00
 D1..0: Latency         	: 0x00 (not present)
 D7..2: Reserved         	: 0x00
Data (HexDump)           	: 09 24 01 00 02 0A 6A 00 00                        .$....j..

        --- Audio Control Clock Source Unit Descriptor 2.0 ----
bLength                  		: 0x08 (8 bytes)
bDescriptorType         	: 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       	: 0x0A (Clock Source 2.0)
bClockID                		: 0x01
bmAttributes             	: 0x00
 D1..0: Clock Type       	: 0x00
 D2   : Sync to SOF     	: 0x00
 D7..3: Reserved         	: 0x00
bmControls               	: 0x00
 D1..0: Clock Frequency  	: 0x00 (not present)
 D3..2: Clock Validity   	: 0x00 (not present)
 D7..4: Reserved         	: 0x00
bAssocTerminal           	: 0x00
iClockSource             	: 0x07 (String Descriptor 7)
Data (HexDump)          	: 08 24 0A 01 00 00 00 07                           .$......

        ----- Audio Control Input Terminal Descriptor 2.0 -----
bLength                  		: 0x11 (17 bytes)
bDescriptorType          	: 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       	: 0x02 (Input Terminal 2.0)
bTerminalID              	: 0x02 (2)
wTerminalType            	: 0x0101 (USB Streaming)
bAssocTerminal           	: 0x00
bCSourceID               	: 0x01 (1)
bNrChannels              	: 0x08 (8 Channels)
bmChannelConfig          	: 0x000000FF (FL, FR, FC, LFE, BL, BR, FLC, FRC)
iChannelNames            	: 0x00 (No String Descriptor)
bmControls               	: 0x0000
 D1..0  : Copy Protect   	: 0x00 (not present)
 D3..2  : Connector      	: 0x00 (not present)
 D5..4  : Overload       	: 0x00 (not present)
 D7..6  : Cluster        	: 0x00 (not present)
 D9..8  : Underflow      	: 0x00 (not present)
 D11..10: Overflow       	: 0x00 (not present)
 D15..12: Reserved       	: 0x00
iTerminal                		: 0x08 (String Descriptor 8)
Data (HexDump)           	: 11 24 02 02 01 01 00 01 08 FF 00 00 00 00 00 00   .$..............
                           08                                                .

        ----- Audio Control Input Terminal Descriptor 2.0 -----
bLength                  		: 0x11 (17 bytes)
bDescriptorType         	: 0x24 (Audio Interface Descriptor)
bDescriptorSubtype      	: 0x02 (Input Terminal 2.0)
bTerminalID             		: 0x03 (3)
wTerminalType            	: 0x0200 (Input Undefined)
bAssocTerminal           	: 0x00
bCSourceID               	: 0x01 (1)
bNrChannels              	: 0x08 (8 Channels)
bmChannelConfig          	: 0x000000FF (FL, FR, FC, LFE, BL, BR, FLC, FRC)
iChannelNames            	: 0x00 (No String Descriptor)
bmControls               	: 0x0000
 D1..0  : Copy Protect   	: 0x00 (not present)
 D3..2  : Connector      	: 0x00 (not present)
 D5..4  : Overload       	: 0x00 (not present)
 D7..6  : Cluster        	: 0x00 (not present)
 D9..8  : Underflow     	: 0x00 (not present)
 D11..10: Overflow       	: 0x00 (not present)
 D15..12: Reserved       	: 0x00
iTerminal                		: 0x09 (String Descriptor 9)
Data (HexDump)           	: 11 24 02 03 00 02 00 01 08 FF 00 00 00 00 00 00   .$..............
                           09                                                .

        ----- Audio Control Output Terminal Descriptor 2.0 ----
bLength                  		: 0x0C (12 bytes)
bDescriptorType          	: 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       	: 0x03 (Output Terminal 2.0)
bTerminalID              	: 0x04 (4)
wTerminalType            	: 0x0101 (USB Streaming)
bAssocTerminal           	: 0x00 (0)
bSourceID                		: 0x06 (6)
bCSourceID               	: 0x01 (1)
iTerminal                		: 0x0A (String Descriptor 10)
Data (HexDump)           	: 0C 24 03 04 01 01 00 06 01 00 00 0A               .$..........

        ----- Audio Control Output Terminal Descriptor 2.0 ----
bLength                  		: 0x0C (12 bytes)
bDescriptorType          	: 0x24 (Audio Interface Descriptor)
bDescriptorSubtype      	: 0x03 (Output Terminal 2.0)
bTerminalID              	: 0x03 (3)
wTerminalType            	: 0x0301 (Speaker)
bAssocTerminal           	: 0x00 (0)
bSourceID               		: 0x06 (6)
bCSourceID               	: 0x01 (1)
iTerminal                		: 0x0B (String Descriptor 11)
Data (HexDump)           	: 0C 24 03 03 01 03 00 06 01 00 00 0B               .$..........

        ------- Audio Control Mixer Unit Descriptor 2.0 -------
bLength                  		: 0x1F (31 bytes)
bDescriptorType          	: 0x24 (Audio Interface Descriptor)
bDescriptorSubtype      	: 0x04 (Mixer Unit 2.0)
bUnitID                 		: 0x06 (ID 6)
bNrInPins               		: 0x02 (2 Input Pins)
baSourceID[1]            	: 0x02 (2)
baSourceID[2]            	: 0x03 (3)
bNrChannels             	: 0x08 (8 Channels)
bmChannelConfig          	: 0x000000FF (FL, FR, FC, LFE, BL, BR, FLC, FRC)
iChannelNames            	: 0x00 (No String Descriptor)
bmMixerControls (HexDump)	: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
                           00                                                .
bmControls               	: 0x0C
 D1..0: Cluster          	: 0x00 (not present)
 D3..2: Underflow       	: 0x03 (host programmable)
 D5..4: Overflow         	: 0x00 (not present)
 D7..6: Reserved         	: 0x0
iMixer                   		: 0x09 (String Descriptor 9)
Data (HexDump)           	: 1F 24 04 06 02 02 03 08 FF 00 00 00 00 00 00 00   .$..............
                           00 00 00 00 00 00 00 00 00 00 00 00 00 00 0C      ...............

        ---------------- Interface Descriptor -----------------
bLength                  		: 0x09 (9 bytes)
bDescriptorType          	: 0x04 (Interface Descriptor)
bInterfaceNumber         	: 0x01 (Interface 1)
bAlternateSetting       	: 0x00
bNumEndpoints           	: 0x00 (Default Control Pipe only)
bInterfaceClass          	: 0x01 (Audio)
bInterfaceSubClass       	: 0x02 (Audio Streaming)
bInterfaceProtocol       	: 0x20 (Device Protocol Version 2.0)
iInterface              		: 0x0D (String Descriptor 13)
Data (HexDump)           	: 09 04 01 00 00 01 02 20 0D                        ....... .

        ---------------- Interface Descriptor -----------------
bLength                  		: 0x09 (9 bytes)
bDescriptorType         	: 0x04 (Interface Descriptor)
bInterfaceNumber         	: 0x01 (Interface 1)
bAlternateSetting       	: 0x01
bNumEndpoints            	: 0x01 (1 Endpoint)
bInterfaceClass          	: 0x01 (Audio)
bInterfaceSubClass       	: 0x02 (Audio Streaming)
bInterfaceProtocol       	: 0x20 (Device Protocol Version 2.0)
iInterface              		: 0x0E (String Descriptor 14)
Data (HexDump)          	: 09 04 01 01 01 01 02 20 0E                        ....... .

        ------ Audio Streaming Interface Descriptor 2.0 -------
bLength                  		: 0x10 (16 bytes)
bDescriptorType         	: 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       	: 0x01 (AS General)
bTerminalLink            	: 0x02 (2)
bmControls               	: 0x00
 D1..0: Active Alt Settng	: 0x00 (not present)
 D3..2: Valid Alt Settng 	: 0x00 (not present)
 D7..4: Reserved         	: 0x00
bFormatType              	: 0x01 (FORMAT_TYPE_I)
bmFormats                	: 0x00000001 (PCM)
bNrChannels             	: 0x08 (8 channels)
bmChannelConfig          	: 0x000000FF (FL, FR, FC, LFE, BL, BR, FLC, FRC)
iChannelNames            	: 0x00 (No String Descriptor)
Data (HexDump)          	 : 10 24 01 02 00 01 01 00 00 00 08 FF 00 00 00 00   .$..............

        ----- Audio Streaming Format Type Descriptor 2.0 ------
bLength                  		: 0x06 (6 bytes)
bDescriptorType          	: 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       	: 0x02 (Format Type)
bFormatType              	: 0x01 (FORMAT_TYPE_I)
bSubslotSize             		: 0x04 (4 bytes)
bBitResolution           	: 0x20 (32 bits)
Data (HexDump)           	: 06 24 02 01 04 20                                 .$... 

        ----------------- Endpoint Descriptor -----------------
bLength                  		: 0x07 (7 bytes)
bDescriptorType          	: 0x05 (Endpoint Descriptor)
bEndpointAddress        	: 0x01 (Direction=OUT EndpointID=1)
bmAttributes             	: 0x05 (TransferType=Isochronous  SyncType=Asynchronous  EndpointType=Data)
wMaxPacketSize           	: 0x00E0
 Bits 15..13             		: 0x00 (reserved, must be zero)
 Bits 12..11             		: 0x00 (0 additional transactions per microframe -> allows 1..1024 bytes per packet)
 Bits 10..0              		: 0xE0 (224 bytes per packet)
bInterval                		: 0x01 (1 microframe -> 0.125 ms)
Data (HexDump)           	: 07 05 01 05 E0 00 01                              .......

        ----------- Audio Data Endpoint Descriptor ------------
bLength                 		: 0x08 (8 bytes)
bDescriptorType          	: 0x25 (Audio Endpoint Descriptor)
bDescriptorSubtype       	: 0x01 (General)
bmAttributes             	: 0x00
 D0   : Sampling Freq    	: 0x00 (not supported)
 D1   : Pitch            		: 0x00 (not supported)
 D6..2: Reserved        	: 0x00
 D7   : MaxPacketsOnly   	: 0x00 (no)
bLockDelayUnits          	: 0x00 (Undefined)
wLockDelay               	: 0x0802
Data (HexDump)           	: 08 25 01 00 00 02 08 00                           .%......

        ---------------- Interface Descriptor -----------------
bLength                  		: 0x09 (9 bytes)
bDescriptorType          	: 0x04 (Interface Descriptor)
bInterfaceNumber         	: 0x02 (Interface 2)
bAlternateSetting        	: 0x00
bNumEndpoints            	: 0x00 (Default Control Pipe only)
bInterfaceClass          	: 0x01 (Audio)
bInterfaceSubClass       	: 0x02 (Audio Streaming)
bInterfaceProtocol       	: 0x20 (Device Protocol Version 2.0)
iInterface               		: 0x0F (String Descriptor 15)
Data (HexDump)           	: 09 04 02 00 00 01 02 20 0F                        ....... .

        ---------------- Interface Descriptor -----------------
bLength                  		: 0x09 (9 bytes)
bDescriptorType          	: 0x04 (Interface Descriptor)
bInterfaceNumber         	: 0x02 (Interface 2)
bAlternateSetting        	: 0x01
bNumEndpoints            	: 0x01 (1 Endpoint)
bInterfaceClass          	: 0x01 (Audio)
bInterfaceSubClass       	: 0x02 (Audio Streaming)
bInterfaceProtocol       	: 0x20 (Device Protocol Version 2.0)
iInterface               		: 0x10 (String Descriptor 16)
Data (HexDump)           	: 09 04 02 01 01 01 02 20 10                        ....... .

        ------ Audio Streaming Interface Descriptor 2.0 -------
bLength                  		: 0x10 (16 bytes)
bDescriptorType          	: 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       	: 0x01 (AS General)
bTerminalLink            	: 0x04 (4)
bmControls               	: 0x00
 D1..0: Active Alt Settng	: 0x00 (not present)
 D3..2: Valid Alt Settng 	: 0x00 (not present)
 D7..4: Reserved         	: 0x00
bFormatType             	: 0x01 (FORMAT_TYPE_I)
bmFormats                	: 0x00000001 (PCM)
bNrChannels              	: 0x08 (8 channels)
bmChannelConfig          	: 0x000000FF (FL, FR, FC, LFE, BL, BR, FLC, FRC)
iChannelNames            	: 0x00 (No String Descriptor)
Data (HexDump)           	: 10 24 01 04 00 01 01 00 00 00 08 FF 00 00 00 00   .$..............

        ----- Audio Streaming Format Type Descriptor 2.0 ------
bLength                  		: 0x06 (6 bytes)
bDescriptorType          	: 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       	: 0x02 (Format Type)
bFormatType              	: 0x01 (FORMAT_TYPE_I)
bSubslotSize             		: 0x04 (4 bytes)
bBitResolution           	: 0x20 (32 bits)
Data (HexDump)           	: 06 24 02 01 04 20                                 .$... 

        ----------------- Endpoint Descriptor -----------------
bLength                  		: 0x07 (7 bytes)
bDescriptorType         	: 0x05 (Endpoint Descriptor)
bEndpointAddress         	: 0x01 (Direction=OUT EndpointID=1)
bmAttributes            	: 0x05 (TransferType=Isochronous  SyncType=Asynchronous  EndpointType=Data)
wMaxPacketSize           	: 0x00E0
 Bits 15..13             		: 0x00 (reserved, must be zero)
 Bits 12..11             		: 0x00 (0 additional transactions per microframe -> allows 1..1024 bytes per packet)
 Bits 10..0              		: 0xE0 (224 bytes per packet)
bInterval                		: 0x01 (1 microframe -> 0.125 ms)
Data (HexDump)           	: 07 05 01 05 E0 00 01                              .......

        ----------- Audio Data Endpoint Descriptor ------------
bLength                 		: 0x08 (8 bytes)
bDescriptorType         	: 0x25 (Audio Endpoint Descriptor)
bDescriptorSubtype       	: 0x01 (General)
bmAttributes             	: 0x00
 D0   : Sampling Freq    	: 0x00 (not supported)
 D1   : Pitch           		: 0x00 (not supported)
 D6..2: Reserved         	: 0x00
 D7   : MaxPacketsOnly   	: 0x00 (no)
bLockDelayUnits          	: 0x00 (Undefined)
wLockDelay               	: 0x0802
Data (HexDump)           	: 08 25 01 00 00 02 08 00                           .%......

        ---------------- Interface Descriptor -----------------
bLength                  		: 0x09 (9 bytes)
bDescriptorType          	: 0x04 (Interface Descriptor)
bInterfaceNumber         	: 0x03 (Interface 3)
bAlternateSetting        	: 0x00
bNumEndpoints            	: 0x00 (Default Control Pipe only)
bInterfaceClass          	: 0x01 (Audio)
bInterfaceSubClass       	: 0x01 (Audio Control)
bInterfaceProtocol       	: 0x00
iInterface               		: 0x00 (No String Descriptor)
Data (HexDump)           	: 09 04 03 00 00 01 01 00 00                        .........

        ------ Audio Control Interface Header Descriptor ------
bLength                  		: 0x09 (9 bytes)
bDescriptorType          	: 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       	: 0x01 (Header)
bcdADC                   		: 0x0100
wTotalLength             	: 0x0009 (9 bytes)
bInCollection           		: 0x01
baInterfaceNr[1]         	: 0x01
Data (HexDump)           	: 09 24 01 00 01 09 00 01 01                        .$.......

        ---------------- Interface Descriptor -----------------
bLength                  		: 0x09 (9 bytes)
bDescriptorType          	: 0x04 (Interface Descriptor)
bInterfaceNumber         	: 0x04 (Interface 4)
bAlternateSetting        	: 0x00
bNumEndpoints            	: 0x02 (2 Endpoints)
bInterfaceClass          	: 0x01 (Audio)
bInterfaceSubClass       	: 0x03 (MIDI Streaming)
bInterfaceProtocol       	: 0x00
iInterface               		: 0x00 (No String Descriptor)
Data (HexDump)           	: 09 04 04 00 02 01 03 00 00                        .........

        - MIDI Adapter Class specific MS Interface Descriptor -
bLength                  		: 0x07 (7 bytes)
bDescriptorType          	: 0x24 (Class Specific Interface Descriptor)
bDescriptorSubtype       	: 0x01 (MS Header)
bcdADC                   		: 0x0100
wTotalLength             	: 0x0041 (65 bytes)
Data (HexDump)           	: 07 24 01 00 01 41 00 06 24 02 01 01 00 06 24 02   .$...A..$.....$.
                           02 02 12 09 24 03 01 03 01 02 01 00 09 24 03 02   ....$........$..
                           04 01 01 01 14 09 05 04 02 00 02 00 00 00 05 25   ...............%
                           01 01 01 09 05 03 02 00 02 00 00 00 05 25 01 01   .............%..
                           03                                                .

        ---------------- MIDI IN Jack Descriptor --------------
bLength                  		: 0x06 (6 bytes)
bDescriptorType          	: 0x24 (Class Specific Interface Descriptor)
bDescriptorSubtype       	: 0x02 (MIDI_IN_JACK)
bJackType               		: 0x01 (Embedded)
bJackID                  		: 0x01 (ID=1)
iJack                    		: 0x00 (No String Descriptor)
Data (HexDump)           	: 06 24 02 01 01 00                                 .$....

        ---------------- MIDI IN Jack Descriptor --------------
bLength                  		: 0x06 (6 bytes)
bDescriptorType          	: 0x24 (Class Specific Interface Descriptor)
bDescriptorSubtype       	: 0x02 (MIDI_IN_JACK)
bJackType                		: 0x02 (External)
bJackID                  		: 0x02 (ID=2)
iJack                    		: 0x12 (String Descriptor 18)
Data (HexDump)           	: 06 24 02 02 02 12                                 .$....

        --------------- MIDI OUT Jack Descriptor --------------
bLength                  		: 0x09 (9 bytes)
bDescriptorType         	: 0x24 (Class Specific Interface Descriptor)
bDescriptorSubtype       	: 0x03 (MIDI_OUT_JACK)
bJackType                		: 0x01 (Embedded)
bJackID                  		: 0x03 (ID=3)
bNrInputPins             	: 0x01 (1 pin)
baSourceID[1]            	: 0x02 (input pin connected to entity ID=2)
baSourcePin[1]           	: 0x01 (connected to input pin number 1
iJack                    		: 0x00 (No String Descriptor)
Data (HexDump)          	: 09 24 03 01 03 01 02 01 00                        .$.......

        --------------- MIDI OUT Jack Descriptor --------------
bLength                  		: 0x09 (9 bytes)
bDescriptorType          	: 0x24 (Class Specific Interface Descriptor)
bDescriptorSubtype       	: 0x03 (MIDI_OUT_JACK)
bJackType                		: 0x02 (External)
bJackID                  		: 0x04 (ID=4)
bNrInputPins             	: 0x01 (1 pin)
baSourceID[1]            	: 0x01 (input pin connected to entity ID=1)
baSourcePin[1]           	: 0x01 (connected to input pin number 1
iJack                    		: 0x14 (String Descriptor 20)
Data (HexDump)           	: 09 24 03 02 04 01 01 01 14                        .$.......

        ----------------- Endpoint Descriptor -----------------
bLength                  		: 0x09 (9 bytes)
bDescriptorType          	: 0x05 (Endpoint Descriptor)
bEndpointAddress         	: 0x04 (Direction=OUT EndpointID=4)
bmAttributes             	: 0x02 (TransferType=Bulk)
wMaxPacketSize           	: 0x0200 (max 512 bytes)
bInterval                		: 0x00 (0 ms)
bRefresh                 		: 0x00
bSynchAddress            	: 0x00
Data (HexDump)           	: 09 05 04 02 00 02 00 00 00                        .........

        --- Class-Specific MS Bulk Data Endpoint Descriptor ---
bLength                  		: 0x05 (5 bytes)
bDescriptorType          	: 0x25 (Audio Endpoint Descriptor)
bDescriptorSubtype       	: 0x01 (MS General)
bNumEmbMIDIJack          	: 0x01 (1 embedded MIDI jack)
baAssocJackID(1)         	: 0x01 (Jack(1) ID=1)
Data (HexDump)           	: 05 25 01 01 01                                    .%...

        ----------------- Endpoint Descriptor -----------------
bLength                  		: 0x09 (9 bytes)
bDescriptorType          	: 0x05 (Endpoint Descriptor)
bEndpointAddress        	: 0x03 (Direction=OUT EndpointID=3)
bmAttributes             	: 0x02 (TransferType=Bulk)
wMaxPacketSize           	: 0x0200 (max 512 bytes)
bInterval               		: 0x00 (0 ms)
bRefresh                 		: 0x00
bSynchAddress            	: 0x00
Data (HexDump)          	: 09 05 03 02 00 02 00 00 00                        .........

        --- Class-Specific MS Bulk Data Endpoint Descriptor ---
bLength                  		: 0x05 (5 bytes)
bDescriptorType          	: 0x25 (Audio Endpoint Descriptor)
bDescriptorSubtype       	: 0x01 (MS General)
bNumEmbMIDIJack         	: 0x01 (1 embedded MIDI jack)
baAssocJackID(1)         	: 0x03 (Jack(1) ID=3)
Data (HexDump)           	: 05 25 01 01 03                                    .%...

ConfigDescriptor 2 Error : ERROR_GEN_FAILURE  (because the device is in low power state)

    ----------------- Device Qualifier Descriptor -----------------
Error                    : ERROR_GEN_FAILURE  (because the device is in low power state)

      -------------------- String Descriptors -------------------
String descriptors are not available  (because the device is in low power state)
And lastly the hex values of the descriptors as csv taken from the USB Tree View report above:

Code: Select all

 Device Desc: 
0x12, 0x01, 0x00, 0x02, 0xEF, 0x02, 0x01, 0x40, 0xB1, 0x20, 0x11, 0x00, 0x00, 0x00, 0x02, 0x03,
0x04, 0x02

Code: Select all

 Cfg Desc:
0x09, 0x02, 0x4E, 0x01, 0x05, 0x01, 0x01, 0xC0, 0xF0, 0x08, 0x0B, 0x00, 0x05, 0x01, 0x00, 0x20, 
0x05, 0x09, 0x04, 0x00, 0x00, 0x00, 0x01, 0x01, 0x20, 0x06, 0x09, 0x24, 0x01, 0x00, 0x02, 0x0A, 
0x6A, 0x00, 0x00, 0x08, 0x24, 0x0A, 0x01, 0x00, 0x00, 0x00, 0x07, 0x11, 0x24, 0x02, 0x02, 0x01, 
0x01, 0x00, 0x01, 0x08, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x11, 0x24, 0x02, 0x03, 
0x00, 0x02, 0x00, 0x01, 0x08, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x0C, 0x24, 0x03, 
0x04, 0x01, 0x01, 0x00, 0x06, 0x01, 0x00, 0x00, 0x0A, 0x0C, 0x24, 0x03, 0x03, 0x01, 0x03, 0x00, 
0x06, 0x01, 0x00, 0x00, 0x0B, 0x1F, 0x24, 0x04, 0x06, 0x02, 0x02, 0x03, 0x08, 0xFF, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x0C, 0x09, 0x04, 0x01, 0x00, 0x00, 0x01, 0x02, 0x20, 0x0D, 0x09, 0x04, 0x01, 
0x01, 0x01, 0x01, 0x02, 0x20, 0x0E, 0x10, 0x24, 0x01, 0x02, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 
0x08, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x06, 0x24, 0x02, 0x01, 0x04, 0x20, 0x07, 0x05, 0x01, 0x05, 
0xE0, 0x00, 0x01, 0x08, 0x25, 0x01, 0x00, 0x00, 0x02, 0x08, 0x00, 0x09, 0x04, 0x02, 0x00, 0x00, 
0x01, 0x02, 0x20, 0x0F, 0x09, 0x04, 0x02, 0x01, 0x01, 0x01, 0x02, 0x20, 0x10, 0x10, 0x24, 0x01, 
0x04, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x08, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x06, 0x24, 0x02, 
0x01, 0x04, 0x20, 0x07, 0x05, 0x01, 0x05, 0xE0, 0x00, 0x01, 0x08, 0x25, 0x01, 0x00, 0x00, 0x02, 
0x08, 0x00, 0x09, 0x04, 0x03, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x09, 0x24, 0x01, 0x00, 0x01, 
0x09, 0x00, 0x01, 0x01, 0x09, 0x04, 0x04, 0x00, 0x02, 0x01, 0x03, 0x00, 0x00, 0x07, 0x24, 0x01, 
0x00, 0x01, 0x41, 0x00, 0x06, 0x24, 0x02, 0x01, 0x01, 0x00, 0x06, 0x24, 0x02, 0x02, 0x02, 0x12, 
0x09, 0x24, 0x03, 0x01, 0x03, 0x01, 0x02, 0x01, 0x00, 0x09, 0x24, 0x03, 0x02, 0x04, 0x01, 0x01, 
0x01, 0x14, 0x09, 0x05, 0x04, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x25, 0x01, 0x01, 0x01, 
0x09, 0x05, 0x03, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x25, 0x01, 0x01, 0x03
With the new information regarding the device the abort_pipe function is directed at, I would deduce that the the communication with my device is successful but still does not lead to a regular package exchange (as it should with an isochronous endpoint) initialized from the host. I would think that at least one isochronous package would be sent from the host (even if not handled correctly by the device) if the enumeration was complete. Would you agree to this?

Additionally I can't see the XMOS chip when selecting audio sources or sinks in the Windows sound settings which I would expect, if the device is correctly recognized as an audio device described in my initial post.

When you say "normally a sound card has no BULK endpoint, if UAC is used", I would think that it should still work (although unusual). I didn't question this part of the design because the XMOS audio sample allows for such a configuration.

I attached the wireshark recording corresponding to the images, in case you want to analyze it further.

Thanks,
Tim
You do not have the required permissions to view the files attached to this post.
User avatar
dsteinwe
XCore Addict
Posts: 144
Joined: Wed Jun 29, 2016 8:59 am

Post by dsteinwe »

Unfortunately, my parser does not support MIDI descriptors. Therefore it fails on your configuration descriptor. But the "USB Device Tree Viewer" displays all descriptors of configuration 1 without an error. Therefore, I think your descriptors seems to be syntactically correct.

Here my parse result:

Code: Select all

Device descriptor
0	0x12, 		(18)	bLength
1	0x01, 		(1)	bDescriptorType
2	0x00, 0x02, 	(512)	bcdUSB: USB Specification Number which device complies too
4	0xef, 		(239)	bDeviceClass: Class Code (Assigned by USB Org). If equal to Zero, each interface specifies its own class code. If equal to 0xFF, the class code is vendor specified. Otherwise field is valid Class Code.
5	0x02, 		(2)	bDeviceProtocol: Protocol Code (Assigned by USB Org)
6	0x01, 		(1)	bDeviceSubClass: Subclass Code (Assigned by USB Org)
7	0x40, 		(64)	bMaxPacketSize: Maximum Packet Size for Zero Endpoint. Valid Sizes are 8, 16, 32, 64
8	0xb1, 0x20, 	(8369)	idVendor: Vendor ID (Assigned by USB Org)
10	0x11, 0x00, 	(17)	idProduct: Product ID (Assigned by Manufacturer)
12	0x00, 0x00, 	(0)	bcdDevice: Device Release Number
14	0x02, 		(2)	iManufacturer: Index of Manufacturer String Descriptor
15	0x03, 		(3)	iProduct: Index of Product String Descriptor
16	0x04, 		(4)	iSerialNumber: Index of Serial Number String Descriptor
17	0x02, 		(2)	bNumConfigurations: Number of Possible Configurations

Descriptor length: 18 bytes


Configuration descriptor
0	0x09, 		(9)	bLength
1	0x02, 		(2)	bDescriptorType
2	0x4e, 0x01, 	(334)	wTotalLength: Total length in bytes of data returned
4	0x05, 		(5)	bNumInterfaces: Number of Interfaces
5	0x01, 		(1)	bConfigurationValue: Value to use as an argument to select this configuration
6	0x01, 		(1)	iConfiguration: Index of String Descriptor describing this configuration
7	0xc0, 		(192)	bmAttributes: D7 Reserved, set to 1. (USB 1.0 Bus Powered), D6 Self Powered, D5 Remote Wakeup, D4..0 Reserved, set to 0.
8	0xf0, 		(240)	bMaxPower: Maximum Power Consumption in 2mA units

Interface association descriptor
9	0x08, 		(8)	bLength
10	0x0b, 		(11)	bDescriptorType
11	0x00, 		(0)	bFirstInterface: AudioControl number of the first interface that is associated with this function.
12	0x05, 		(5)	bInterfaceCount: Number of contiguous interfaces that are associated with this function.
13	0x01, 		(1)	bFunctionClass: AUDIO_FUNCTION Function Class code (assigned by this specification). See Appendix A.1, “Audio Function Class Code”.
14	0x00, 		(0)	bFunctionSubClass: FUNCTION_SUBCLASS_UNDEFINED Function Subclass code. Currently not used. See Appendix A.2, “Audio Function Subclass Codes”.
15	0x20, 		(32)	bFunctionProtocol: AF_VERSION_02_00 Function Protocol code. Indicates the current version of the specification. See Appendix A.3, “Audio Function Protocol Codes”.
16	0x05, 		(5)	iFunction: Index of String Descriptor describing this interface

Standard audio interface descriptor
17	0x09, 		(9)	bLength
18	0x04, 		(4)	bDescriptorType
19	0x00, 		(0)	bInterfaceNumber: Number of AudioControl interface
20	0x00, 		(0)	bAlternateSetting: Value used to select alternative setting
21	0x00, 		(0)	bNumEndpoints: Number of Endpoints used for this interface
22	0x01, 		(1)	bDeviceClass: Class Code (Assigned by USB Org). If equal to Zero, each interface specifies its own class code. If equal to 0xFF, the class code is vendor specified. Otherwise field is valid Class Code.
23	0x01, 		(1)	bDeviceSubClass: Subclass Code (Assigned by USB Org)
24	0x20, 		(32)	bDeviceProtocol: Protocol Code (Assigned by USB Org)
25	0x06, 		(6)	iInterface: Index of String Descriptor describing this interface

Standard audio interface header descriptor
26	0x09, 		(9)	bLength
27	0x24, 		(36)	bDescriptorType
28	0x01, 		(1)	bDescriptorSubtype
29	0x00, 0x02, 	(512)	bcdADC: Audio Device Class Specification Release Number in Binary-Coded Decimal.
31	0x0a, 		(10)	bCategory: Constant, indicating the primary use of this audio function, as intended by the manufacturer. See Appendix A.7, “Audio Function Category Codes.”.
32	0x6a, 0x00, 	(106)	wTotalLength: Total number of bytes returned for the class-specific AudioControl interface descriptor. Includes the combined length of this descriptor header and all Clock Source, Unit and TerminalDesc descriptors.
34	0x00, 		(0)	bmControls: D1..0: Latency Control, D7..2: Reserved. Must be set to 0.

Clock source descriptor
35	0x08, 		(8)	bLength
36	0x24, 		(36)	bDescriptorType
37	0x0a, 		(10)	bDescriptorSubtype
38	0x01, 		(1)	bClockId: Constant uniquely identifying the ClockSelector Entity within the audio function. This bit is used in all requests to address this Entity.
39	0x00, 		(0)	bmAttributes: D1..0: Clock Type: (00: External Clock, 01: Internal fixed Clock, 10: Internal variable Clock, 11: Internal programmable Clock), D2: Clock synchronized to SOF, D7..3: Reserved. Must be set to 0.
40	0x00, 		(0)	bmControls: D1..0: Clock Frequency Control, D3..2: Clock Validity Control, D7..4: Reserved. Must be set to 0.
41	0x00, 		(0)	bAssocTerminal: TerminalDesc ID of the TerminalDesc that is associated with this Clock Source. 0 means no association
42	0x07, 		(7)	iClockSource: Index of a string descriptor, describing the Clock Source Entity.

Input terminal descriptor
43	0x11, 		(17)	bLength
44	0x24, 		(36)	bDescriptorType
45	0x02, 		(2)	bDescriptorSubtype
46	0x02, 		(2)	bTerminalId: Constant uniquely identifying the terminal. This bit is used in all requests to address this Entity.
47	0x01, 0x01, 	(257)	wTerminalType: A TerminalDesc dealing with a signal carried over an endpoint in an AudioStreaming interface.
49	0x00, 		(0)	bAssocTerminal: ID of the Input TerminalDesc to which this Input TerminalDesc is associated.
50	0x01, 		(1)	bCSourceID: ID of the Clock Entity to which this InputTerminal is connected.
51	0x08, 		(8)	bNrChannels: Number of logical input channels in the TerminalDescs input audio channel cluster
52	0xff, 0x00, 0x00, 0x00, 	(255)	bmChannelConfig: Describes the spatial location of the logical channels.
56	0x00, 		(0)	iChannelNames: Index of a string descriptor, describing the name of the first logical channel
57	0x00, 0x00, 	(0)	bmControls: D1..0: Copy Protect Control, D3..2: Connector Control, D5..4: Overload Control, D7..6: Cluster Control, D9..8: Underflow Control, D11..10: Overflow Control, D15..12: Reserved. Must be set to 0
59	0x08, 		(8)	iInputTerminal: Index of a string descriptor, describing the terminal.

Input terminal descriptor
60	0x11, 		(17)	bLength
61	0x24, 		(36)	bDescriptorType
62	0x02, 		(2)	bDescriptorSubtype
63	0x03, 		(3)	bTerminalId: Constant uniquely identifying the terminal. This bit is used in all requests to address this Entity.
64	0x00, 0x02, 	(512)	wTerminalType: A TerminalDesc dealing with a signal carried over an endpoint in an AudioStreaming interface.
66	0x00, 		(0)	bAssocTerminal: ID of the Input TerminalDesc to which this Input TerminalDesc is associated.
67	0x01, 		(1)	bCSourceID: ID of the Clock Entity to which this InputTerminal is connected.
68	0x08, 		(8)	bNrChannels: Number of logical input channels in the TerminalDescs input audio channel cluster
69	0xff, 0x00, 0x00, 0x00, 	(255)	bmChannelConfig: Describes the spatial location of the logical channels.
73	0x00, 		(0)	iChannelNames: Index of a string descriptor, describing the name of the first logical channel
74	0x00, 0x00, 	(0)	bmControls: D1..0: Copy Protect Control, D3..2: Connector Control, D5..4: Overload Control, D7..6: Cluster Control, D9..8: Underflow Control, D11..10: Overflow Control, D15..12: Reserved. Must be set to 0
76	0x09, 		(9)	iInputTerminal: Index of a string descriptor, describing the terminal.

Output terminal descriptor
77	0x0c, 		(12)	bLength
78	0x24, 		(36)	bDescriptorType
79	0x03, 		(3)	bDescriptorSubtype
80	0x04, 		(4)	bTerminalId: Constant uniquely identifying the terminal. This bit is used in all requests to address this Entity.
81	0x01, 0x01, 	(257)	wTerminalType: A TerminalDesc dealing with a signal carried over an endpoint in an AudioStreaming interface.
83	0x00, 		(0)	bAssocTerminal: ID of the Output TerminalDesc to which this Input TerminalDesc is associated.
84	0x06, 		(6)	bSourceID: ID of the Unit or TerminalDesc to which this TerminalDesc is connected.
85	0x01, 		(1)	bCSourceID: ID of the Clock Entity to which this InputTerminal is connected.
86	0x00, 0x00, 	(0)	bmControls: D1..0: Copy Protect Control, D3..2: Connector Control, D5..4: Overload Control, D7..6: Cluster Control, D9..8: Underflow Control, D11..10: Overflow Control, D15..12: Reserved. Must be set to 0
88	0x0a, 		(10)	iOutputTerminal: Index of a string descriptor, describing the terminal.

Output terminal descriptor
89	0x0c, 		(12)	bLength
90	0x24, 		(36)	bDescriptorType
91	0x03, 		(3)	bDescriptorSubtype
92	0x03, 		(3)	bTerminalId: Constant uniquely identifying the terminal. This bit is used in all requests to address this Entity.
93	0x01, 0x03, 	(769)	wTerminalType: A TerminalDesc dealing with a signal carried over an endpoint in an AudioStreaming interface.
95	0x00, 		(0)	bAssocTerminal: ID of the Output TerminalDesc to which this Input TerminalDesc is associated.
96	0x06, 		(6)	bSourceID: ID of the Unit or TerminalDesc to which this TerminalDesc is connected.
97	0x01, 		(1)	bCSourceID: ID of the Clock Entity to which this InputTerminal is connected.
98	0x00, 0x00, 	(0)	bmControls: D1..0: Copy Protect Control, D3..2: Connector Control, D5..4: Overload Control, D7..6: Cluster Control, D9..8: Underflow Control, D11..10: Overflow Control, D15..12: Reserved. Must be set to 0
100	0x0b, 		(11)	iOutputTerminal: Index of a string descriptor, describing the terminal.

Mixer unit descriptor
101	0x1f, 		(31)	bLength
102	0x24, 		(36)	bDescriptorType
103	0x04, 		(4)	bDescriptorSubtype
104	0x06, 		(6)	bUnitID: Constant uniquely identifying the Unit within the audio function. This value is used in all requests to address this Unit.
105	0x02, 		(2)	bNrInPins: Number of Input Pins of this Unit: p
106	0x02, 		(2)	baSourceId: ID of the Unit or Terminal to which the first Input Pin of this Mixed Unit is connected
107	0x03, 		(3)	baSourceId: ID of the Unit or Terminal to which the first Input Pin of this Mixed Unit is connected
108	0x08, 0xff, 0x00, 0x00, 	(4294967048)	bmChannelConfig: Describes the spatial location of the logical channels.
112	0x00, 		(0)	iChannelNames: Index of a string descriptor, describing the name of the first logical channel.
113	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
114	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
115	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
116	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
117	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
118	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
119	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
120	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
121	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
122	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
123	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
124	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
125	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
126	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
127	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
128	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
129	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
130	0x00, 		(0)	bmControls: D1..0: Cluster Control, D3..2: Underflow Control, D5..4: Overflow Control, D7..6: Reserved. Must be set to 0.
131	0x0c, 		(12)	iMixer: Index of String Descriptor Describing this interface

Standard audio interface descriptor
132	0x09, 		(9)	bLength
133	0x04, 		(4)	bDescriptorType
134	0x01, 		(1)	bInterfaceNumber: Number of AudioControl interface
135	0x00, 		(0)	bAlternateSetting: Value used to select alternative setting
136	0x00, 		(0)	bNumEndpoints: Number of Endpoints used for this interface
137	0x01, 		(1)	bDeviceClass: Class Code (Assigned by USB Org). If equal to Zero, each interface specifies its own class code. If equal to 0xFF, the class code is vendor specified. Otherwise field is valid Class Code.
138	0x02, 		(2)	bDeviceSubClass: Subclass Code (Assigned by USB Org)
139	0x20, 		(32)	bDeviceProtocol: Protocol Code (Assigned by USB Org)
140	0x0d, 		(13)	iInterface: Index of String Descriptor describing this interface

Standard audio interface descriptor
141	0x09, 		(9)	bLength
142	0x04, 		(4)	bDescriptorType
143	0x01, 		(1)	bInterfaceNumber: Number of AudioControl interface
144	0x01, 		(1)	bAlternateSetting: Value used to select alternative setting
145	0x01, 		(1)	bNumEndpoints: Number of Endpoints used for this interface
146	0x01, 		(1)	bDeviceClass: Class Code (Assigned by USB Org). If equal to Zero, each interface specifies its own class code. If equal to 0xFF, the class code is vendor specified. Otherwise field is valid Class Code.
147	0x02, 		(2)	bDeviceSubClass: Subclass Code (Assigned by USB Org)
148	0x20, 		(32)	bDeviceProtocol: Protocol Code (Assigned by USB Org)
149	0x0e, 		(14)	iInterface: Index of String Descriptor describing this interface

Audio streaming header descriptor
150	0x10, 		(16)	bLength
151	0x24, 		(36)	bDescriptorType
152	0x01, 		(1)	bDescriptorSubtype
153	0x02, 		(2)	bTerminalLink: The Terminal ID of the Terminal to which this interface is connected.
154	0x00, 		(0)	bmControls: D1..0: Active Alternate Setting Control, D3..2: Valid Alternate Settings Control, D7..4: Reserved. Must be set to 0.
155	0x01, 		(1)	bFormatType: Constant identifying the Format Type the AudioStreaming interface is using.
156	0x01, 0x00, 0x00, 0x00, 	(1)	bFormats: The Audio Data Format(s) that can be used to communicate with this interface. See the USB Audio Data Formats document for further details.
160	0x08, 		(8)	bNrChannels: Number of physical channels in the AS Interface audio channel cluster.
161	0xff, 0x00, 0x00, 0x00, 	(255)	bmChannelConfig: Describes the spatial location of the physical channels.
165	0x00, 		(0)	iChannelNames: Index of a string descriptor, describing the name of the first physical channel.

Audio streaming format descriptor
166	0x06, 		(6)	bLength
167	0x24, 		(36)	bDescriptorType
168	0x02, 		(2)	bDescriptorSubtype
169	0x01, 		(1)	bFormatType: FORMAT_TYPE_I. Constant identifying the Format Type the AudioStreaming interface is using.
170	0x04, 		(4)	bSubSlotSize: The number of bytes occupied by one audio subslot. Can be 1, 2, 3 or 4.
171	0x20, 		(32)	bBitResoultion: The number of effectively used bits from the available bits in an audio subslot.

Endpoint descriptor
172	0x07, 		(7)	bLength
173	0x05, 		(5)	bDescriptorType
174	0x01, 		(1)	bEndpointAddress: The address of the endpoint on the USB device described by this descriptor. The address is encoded as follows: Bit 3...0: The endpoint number, Bit 6...4: Reserved, reset to zero, Bit 7: Direction, ignored for control endpoints 0 = OUT endpoint
175	0x05, 		(5)	bmAttributes: This field describes the endpoints attributes when it is configured using the bConfigurationValue. Bits 1..0: Transfer Type, 00 = Control, 01 = Isochronous, 10 = Bulk, 11 = Interrupt. If not an isochronous endpoint, bits 5..2 are reserved and must be set to zero. If isochronous, they are defined as follows: Bits 3..2: Synchronization Type: 00 = No Synchronization, 01 = Asynchronous, 10 = Adaptive, 11 = Synchronous. Bits 5..4: Usage Type, 00 = Data endpoint, 01 = Feedback endpoint, 10 = Implicit feedback Data endpoint, 11 = Reserved.Refer to Chapter 5 for more information. All other bits are reserved and must be reset to zero. Reserved bits must be ignored by the host.
176	0xe0, 0x00, 	(224)	wMaxPacketSize: Maximum packet size this endpoint is capable of sending or receiving when this configuration is selected.
178	0x01, 		(1)	bInterval: Interval for polling endpoint for data transfers.

Audio data endpoint descriptor
179	0x08, 		(8)	bLength
180	0x25, 		(37)	bDescriptorType
181	0x01, 		(1)	bDescriptorSubtype
182	0x00, 		(0)	bmAttributes: Bit D7 indicates a requirement for wMaxPacketSize packets. D7: MaxPacketsOnly
183	0x00, 		(0)	bmControls: D1..0: Pitch Control, D3..2: Data Overrun Control, D5..4: Data Underrun Control, D7..6: Reserved. Must be set to 0.
184	0x02, 		(2)	bLockDelayUnits: Indicates the units used for the wLockDelay field: 0 = Undefined, 1 = Milliseconds, 2 = Decoded PCM samples, other = Reserved.
185	0x08, 0x00, 	(8)	wLockDelay: Indicates the time it takes this endpoint to reliably lock its internal clock recovery circuitry. Units used depend on the value of the bLockDelayUnits field.

Standard audio interface descriptor
187	0x09, 		(9)	bLength
188	0x04, 		(4)	bDescriptorType
189	0x02, 		(2)	bInterfaceNumber: Number of AudioControl interface
190	0x00, 		(0)	bAlternateSetting: Value used to select alternative setting
191	0x00, 		(0)	bNumEndpoints: Number of Endpoints used for this interface
192	0x01, 		(1)	bDeviceClass: Class Code (Assigned by USB Org). If equal to Zero, each interface specifies its own class code. If equal to 0xFF, the class code is vendor specified. Otherwise field is valid Class Code.
193	0x02, 		(2)	bDeviceSubClass: Subclass Code (Assigned by USB Org)
194	0x20, 		(32)	bDeviceProtocol: Protocol Code (Assigned by USB Org)
195	0x0f, 		(15)	iInterface: Index of String Descriptor describing this interface

Standard audio interface descriptor
196	0x09, 		(9)	bLength
197	0x04, 		(4)	bDescriptorType
198	0x02, 		(2)	bInterfaceNumber: Number of AudioControl interface
199	0x01, 		(1)	bAlternateSetting: Value used to select alternative setting
200	0x01, 		(1)	bNumEndpoints: Number of Endpoints used for this interface
201	0x01, 		(1)	bDeviceClass: Class Code (Assigned by USB Org). If equal to Zero, each interface specifies its own class code. If equal to 0xFF, the class code is vendor specified. Otherwise field is valid Class Code.
202	0x02, 		(2)	bDeviceSubClass: Subclass Code (Assigned by USB Org)
203	0x20, 		(32)	bDeviceProtocol: Protocol Code (Assigned by USB Org)
204	0x10, 		(16)	iInterface: Index of String Descriptor describing this interface

Audio streaming header descriptor
205	0x10, 		(16)	bLength
206	0x24, 		(36)	bDescriptorType
207	0x01, 		(1)	bDescriptorSubtype
208	0x04, 		(4)	bTerminalLink: The Terminal ID of the Terminal to which this interface is connected.
209	0x00, 		(0)	bmControls: D1..0: Active Alternate Setting Control, D3..2: Valid Alternate Settings Control, D7..4: Reserved. Must be set to 0.
210	0x01, 		(1)	bFormatType: Constant identifying the Format Type the AudioStreaming interface is using.
211	0x01, 0x00, 0x00, 0x00, 	(1)	bFormats: The Audio Data Format(s) that can be used to communicate with this interface. See the USB Audio Data Formats document for further details.
215	0x08, 		(8)	bNrChannels: Number of physical channels in the AS Interface audio channel cluster.
216	0xff, 0x00, 0x00, 0x00, 	(255)	bmChannelConfig: Describes the spatial location of the physical channels.
220	0x00, 		(0)	iChannelNames: Index of a string descriptor, describing the name of the first physical channel.

Audio streaming format descriptor
221	0x06, 		(6)	bLength
222	0x24, 		(36)	bDescriptorType
223	0x02, 		(2)	bDescriptorSubtype
224	0x01, 		(1)	bFormatType: FORMAT_TYPE_I. Constant identifying the Format Type the AudioStreaming interface is using.
225	0x04, 		(4)	bSubSlotSize: The number of bytes occupied by one audio subslot. Can be 1, 2, 3 or 4.
226	0x20, 		(32)	bBitResoultion: The number of effectively used bits from the available bits in an audio subslot.

Endpoint descriptor
227	0x07, 		(7)	bLength
228	0x05, 		(5)	bDescriptorType
229	0x01, 		(1)	bEndpointAddress: The address of the endpoint on the USB device described by this descriptor. The address is encoded as follows: Bit 3...0: The endpoint number, Bit 6...4: Reserved, reset to zero, Bit 7: Direction, ignored for control endpoints 0 = OUT endpoint
230	0x05, 		(5)	bmAttributes: This field describes the endpoints attributes when it is configured using the bConfigurationValue. Bits 1..0: Transfer Type, 00 = Control, 01 = Isochronous, 10 = Bulk, 11 = Interrupt. If not an isochronous endpoint, bits 5..2 are reserved and must be set to zero. If isochronous, they are defined as follows: Bits 3..2: Synchronization Type: 00 = No Synchronization, 01 = Asynchronous, 10 = Adaptive, 11 = Synchronous. Bits 5..4: Usage Type, 00 = Data endpoint, 01 = Feedback endpoint, 10 = Implicit feedback Data endpoint, 11 = Reserved.Refer to Chapter 5 for more information. All other bits are reserved and must be reset to zero. Reserved bits must be ignored by the host.
231	0xe0, 0x00, 	(224)	wMaxPacketSize: Maximum packet size this endpoint is capable of sending or receiving when this configuration is selected.
233	0x01, 		(1)	bInterval: Interval for polling endpoint for data transfers.

Audio data endpoint descriptor
234	0x08, 		(8)	bLength
235	0x25, 		(37)	bDescriptorType
236	0x01, 		(1)	bDescriptorSubtype
237	0x00, 		(0)	bmAttributes: Bit D7 indicates a requirement for wMaxPacketSize packets. D7: MaxPacketsOnly
238	0x00, 		(0)	bmControls: D1..0: Pitch Control, D3..2: Data Overrun Control, D5..4: Data Underrun Control, D7..6: Reserved. Must be set to 0.
239	0x02, 		(2)	bLockDelayUnits: Indicates the units used for the wLockDelay field: 0 = Undefined, 1 = Milliseconds, 2 = Decoded PCM samples, other = Reserved.
240	0x08, 0x00, 	(8)	wLockDelay: Indicates the time it takes this endpoint to reliably lock its internal clock recovery circuitry. Units used depend on the value of the bLockDelayUnits field.

Standard audio interface descriptor
242	0x09, 		(9)	bLength
243	0x04, 		(4)	bDescriptorType
244	0x03, 		(3)	bInterfaceNumber: Number of AudioControl interface
245	0x00, 		(0)	bAlternateSetting: Value used to select alternative setting
246	0x00, 		(0)	bNumEndpoints: Number of Endpoints used for this interface
247	0x01, 		(1)	bDeviceClass: Class Code (Assigned by USB Org). If equal to Zero, each interface specifies its own class code. If equal to 0xFF, the class code is vendor specified. Otherwise field is valid Class Code.
248	0x01, 		(1)	bDeviceSubClass: Subclass Code (Assigned by USB Org)
249	0x00, 		(0)	bDeviceProtocol: Protocol Code (Assigned by USB Org)
250	0x00, 		(0)	iInterface: Index of String Descriptor describing this interface

Standard audio interface header descriptor
251	0x09, 		(9)	bLength
252	0x24, 		(36)	bDescriptorType
253	0x01, 		(1)	bDescriptorSubtype
254	0x00, 0x01, 	(256)	bcdADC: Audio Device Class Specification Release Number in Binary-Coded Decimal.
256	0x09, 		(9)	bCategory: Constant, indicating the primary use of this audio function, as intended by the manufacturer. See Appendix A.7, “Audio Function Category Codes.”.
257	0x00, 0x01, 	(256)	wTotalLength: Total number of bytes returned for the class-specific AudioControl interface descriptor. Includes the combined length of this descriptor header and all Clock Source, Unit and TerminalDesc descriptors.
259	0x01, 		(1)	bmControls: D1..0: Latency Control, D7..2: Reserved. Must be set to 0.

Standard audio interface descriptor
260	0x09, 		(9)	bLength
261	0x04, 		(4)	bDescriptorType
262	0x04, 		(4)	bInterfaceNumber: Number of AudioControl interface
263	0x00, 		(0)	bAlternateSetting: Value used to select alternative setting
264	0x02, 		(2)	bNumEndpoints: Number of Endpoints used for this interface
265	0x01, 		(1)	bDeviceClass: Class Code (Assigned by USB Org). If equal to Zero, each interface specifies its own class code. If equal to 0xFF, the class code is vendor specified. Otherwise field is valid Class Code.
266	0x03, 		(3)	bDeviceSubClass: Subclass Code (Assigned by USB Org)
267	0x00, 		(0)	bDeviceProtocol: Protocol Code (Assigned by USB Org)
268	0x00, 		(0)	iInterface: Index of String Descriptor describing this interface

Unknown descriptor
269	0x07, 		(7)	bLength
270	0x24, 		(36)	???
271	0x01, 		(1)	???
272	0x00, 		(0)	???
273	0x01, 		(1)	???
274	0x41, 		(65)	???
275	0x00, 		(0)	???

Unknown descriptorit is
276	0x06, 		(6)	bLength
277	0x24, 		(36)	???
278	0x02, 		(2)	???
279	0x01, 		(1)	???
280	0x01, 		(1)	???
281	0x00, 		(0)	???

Unknown descriptor
282	0x06, 		(6)	bLength
283	0x24, 		(36)	???
284	0x02, 		(2)	???
285	0x02, 		(2)	???
286	0x02, 		(2)	???
287	0x12, 		(18)	???

Unknown descriptor
288	0x09, 		(9)	bLength
289	0x24, 		(36)	???
290	0x03, 		(3)	???
291	0x01, 		(1)	???
292	0x03, 		(3)	???
293	0x01, 		(1)	???
294	0x02, 		(2)	???
295	0x01, 		(1)	???
296	0x00, 		(0)	???

Unknown descriptor
297	0x09, 		(9)	bLength
298	0x24, 		(36)	???
299	0x03, 		(3)	???
300	0x02, 		(2)	???
301	0x04, 		(4)	???
302	0x01, 		(1)	???
303	0x01, 		(1)	???
304	0x01, 		(1)	???
305	0x14, 		(20)	???

Endpoint descriptor
306	0x09, 		(9)	bLength
307	0x05, 		(5)	bDescriptorType
308	0x04, 		(4)	bEndpointAddress: The address of the endpoint on the USB device described by this descriptor. The address is encoded as follows: Bit 3...0: The endpoint number, Bit 6...4: Reserved, reset to zero, Bit 7: Direction, ignored for control endpoints 0 = OUT endpoint
309	0x02, 		(2)	bmAttributes: This field describes the endpoints attributes when it is configured using the bConfigurationValue. Bits 1..0: Transfer Type, 00 = Control, 01 = Isochronous, 10 = Bulk, 11 = Interrupt. If not an isochronous endpoint, bits 5..2 are reserved and must be set to zero. If isochronous, they are defined as follows: Bits 3..2: Synchronization Type: 00 = No Synchronization, 01 = Asynchronous, 10 = Adaptive, 11 = Synchronous. Bits 5..4: Usage Type, 00 = Data endpoint, 01 = Feedback endpoint, 10 = Implicit feedback Data endpoint, 11 = Reserved.Refer to Chapter 5 for more information. All other bits are reserved and must be reset to zero. Reserved bits must be ignored by the host.
310	0x00, 0x02, 	(512)	wMaxPacketSize: Maximum packet size this endpoint is capable of sending or receiving when this configuration is selected.
312	0x00, 		(0)	bInterval: Interval for polling endpoint for data transfers.
313	0x00, 		(0)	bRefresh
314	0x00, 		(0)	bSynchAddress

Unknown descriptor
315	0x05, 		(5)	bLength
316	0x25, 		(37)	???
317	0x01, 		(1)	???
318	0x01, 		(1)	???
319	0x01, 		(1)	???

Endpoint descriptor
320	0x09, 		(9)	bLength
321	0x05, 		(5)	bDescriptorType
322	0x03, 		(3)	bEndpointAddress: The address of the endpoint on the USB device described by this descriptor. The address is encoded as follows: Bit 3...0: The endpoint number, Bit 6...4: Reserved, reset to zero, Bit 7: Direction, ignored for control endpoints 0 = OUT endpoint
323	0x02, 		(2)	bmAttributes: This field describes the endpoints attributes when it is configured using the bConfigurationValue. Bits 1..0: Transfer Type, 00 = Control, 01 = Isochronous, 10 = Bulk, 11 = Interrupt. If not an isochronous endpoint, bits 5..2 are reserved and must be set to zero. If isochronous, they are defined as follows: Bits 3..2: Synchronization Type: 00 = No Synchronization, 01 = Asynchronous, 10 = Adaptive, 11 = Synchronous. Bits 5..4: Usage Type, 00 = Data endpoint, 01 = Feedback endpoint, 10 = Implicit feedback Data endpoint, 11 = Reserved.Refer to Chapter 5 for more information. All other bits are reserved and must be reset to zero. Reserved bits must be ignored by the host.
324	0x00, 0x02, 	(512)	wMaxPacketSize: Maximum packet size this endpoint is capable of sending or receiving when this configuration is selected.
326	0x00, 		(0)	bInterval: Interval for polling endpoint for data transfers.
327	0x00, 		(0)	bRefresh
328	0x00, 		(0)	bSynchAddress

Unknown descriptor
329	0x05, 		(5)	bLength
330	0x25, 		(37)	???
331	0x01, 		(1)	???
332	0x01, 		(1)	???
333	0x03, 		(3)	???

Descriptor length: 334 bytes
The parser says, you have two configurations. Do you really have two?

Windows USB Audio 2.0 Drivers says, that
An audio function must implement exactly one AudioControl Interface Descriptor (ADC-2 4.7) and one or more AudioStreaming Interface Descriptors (ADC-2 4.9). A function with an audio control interface but no streaming interface is not supported.
Your configuration descriptor 1 uses two AudioControl Interface Descriptors. That may be an issue, why your sound card may not be compatible to the the windows uac2 default driver -- but I'm not sure!

Further, the MS doc says
The bTerminalLink field must refer to a Terminal Entity in the topology and its value must be identical in all alternate settings of an AS interface.
Your descriptor uses two different links. You may validate that.

So far, I can't explain, why you get this weird "unknown type 7f" frames. It causes the host not the device. Can you omit the last descriptor, because the USB Device Tree Viewer says, it is a "MS Bulk Data Endpoint Descriptor"? Maybe, that the "unknwon type 7f" frames are a specific response to this descriptor.

Currently, it's late and I'm out of ideas. If possible, connect your device to a Linux host. The kernel log is more verbose in most cases, if the descriptor is buggy or the usb communication fails.

HTH,
Dieter
User avatar
dsteinwe
XCore Addict
Posts: 144
Joined: Wed Jun 29, 2016 8:59 am

Post by dsteinwe »

Ok, the MS in "Class-Specific MS Interface Descriptor" means MIDIStreaming not Microsoft (found in the USB MIDI spec) and matches the section 5.3.2 of this spec. Therefore, ignore the section from my previous post:
So far, I can't explain, why you get this weird "unknown type 7f" frames. It causes the host not the device. Can you omit the last descriptor, because the USB Device Tree Viewer says, it is a "MS Bulk Data Endpoint Descriptor"? Maybe, that the "unknwon type 7f" frames are a specific response to this descriptor.
If my descriptor didn't work, I shortened it until it worked again. This allowed me to identify and correct the critical section in the configuration descriptor. This could also potentially be a strategy for solving your problem.

Today, I have seen, that the website "Windows USB Audio 2.0 Drivers" contains a "Troubleshooting" section. This may also help you.
friguly
Junior Member
Posts: 6
Joined: Fri Jun 24, 2022 7:13 am

Post by friguly »

Thanks for your help!
Ok, the MS in "Class-Specific MS Interface Descriptor" means MIDIStreaming not Microsoft (found in the USB MIDI spec) and matches the section 5.3.2 of this spec. Therefore, ignore the section from my previous post
I am not sure, where you are referencing to.

Your parser is correct. There is a 2nd configuration descriptor solely to deal with the MIDI data transfer. This stems from the xmos sample which states: `.bNumConfigurations = 0x02 /* Set to 2 such that windows does not load composite driver */`.
But as you pointed out, windows only supports devices with one config. Therefore I removed the MIDI portion of the descriptor entirely for now.
Further, the MS doc says: "The bTerminalLink field must refer to a Terminal Entity in the topology and its value must be identical in all alternate settings of an AS interface." Your descriptor uses two different links. You may validate that
Your quote comes from the section "Class specific AS interface descriptors". Each alternate Setting within an audio streaming interface should refer to the same bTerminalLink. Since I have 2 different Audio Streaming Interfaces (one from device to host and vice versa), I have 2 different bTerminalLinks. This should be compliant with the windows specification.

I read through the link you posted and checked for other differences. I added a control for clock source sampling frequency to the clock source entity since this is required by the windows driver. Additionally the linux kernel logs pointed out, that two endpoints had the same ID. I corrected that aswell. Otherwise I think my descriptor looks fine.

Here the new full descriptor as described in USB Tree View and then as Hex if you want to analyze if further:

Code: Select all


    =========================== USB Port4 ===========================

Connection Status        : 0x01 (Device is connected)
Port Chain               : 3-3-2-4
Properties               : 0x01
 IsUserConnectable       : yes
 PortIsDebugCapable      : no
 PortHasMultiCompanions  : no
 PortConnectorIsTypeC    : no
ConnectionIndex          : 0x04 (Port 4)
CompanionIndex           : 0
 CompanionHubSymLnk      : USB#VID_2109&PID_0813#6&bec8b8d&0&2#{f18a0e88-c30c-11d0-8815-00a0c906bed8}
 CompanionPortNumber     : 0x04 (Port 4)
 -> CompanionPortChain   : 3-7-2-4

      ========================== Summary =========================
Vendor ID                : 0x20B1 (XMOS Ltd.)
Product ID               : 0x0011
USB Version              : 2.00
Port maximum Speed       : High-Speed (Companion Port 3-7-2-4 supports SuperSpeed)
Device maximum Speed     : High-Speed
Device Connection Speed  : High-Speed
Self powered             : yes
Demanded Current         : 480 mA
Used Endpoints           : 1

      ======================== USB Device ========================

        +++++++++++++++++ Device Information ++++++++++++++++++
Device Description       : USB-Verbundgerät
Device Path              : \\?\USB#VID_20B1&PID_0011#0.0.11#{a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE)
Kernel Name              : \Device\USBPDO-12
Device ID                : USB\VID_20B1&PID_0011\0.0.11
Hardware IDs             : USB\VID_20B1&PID_0011&REV_0000 USB\VID_20B1&PID_0011
Driver KeyName           : {36fc9e60-c465-11cf-8056-444553540000}\0051 (GUID_DEVCLASS_USB)
Driver                   : \SystemRoot\System32\drivers\usbccgp.sys (Version: 10.0.19041.488  Date: 2020-09-12)
Driver Inf               : C:\Windows\inf\usb.inf
Legacy BusType           : PNPBus
Class                    : USB
Class GUID               : {36fc9e60-c465-11cf-8056-444553540000} (GUID_DEVCLASS_USB)
Service                  : usbccgp
Enumerator               : USB
Location Info            : Port_#0004.Hub_#0010
Location IDs             : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(3)#USB(2)#USB(4), ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HSP3)#USB(2)#USB(4)
Container ID             : {36fd7add-05c7-56ec-93fe-427dbc56ba85}
Manufacturer Info        : (Standard-USB-Hostcontroller)
Capabilities             : 0x94 (Removable, UniqueID, SurpriseRemovalOK)
Status                   : 0x0180600A (DN_DRIVER_LOADED, DN_STARTED, DN_DISABLEABLE, DN_REMOVABLE, DN_NT_ENUMERATOR, DN_NT_DRIVER)
Problem Code             : 0
Address                  : 4
HcDisableSelectiveSuspend: 0
EnableSelectiveSuspend   : 0
SelectiveSuspendEnabled  : 0
EnhancedPowerMgmtEnabled : 0
IdleInWorkingState       : 0
WakeFromSleepState       : 0
Power State              : D0 (supported: D0, D2, D3, wake from D0, wake from D2)
 Child Device 1          : TEST Device (USB Audio 2.0)
  Device ID              : USB\VID_20B1&PID_0011&MI_00\8&2FAA63FD&0&0000
  Class                  : MEDIA
  Driver KeyName         : {4d36e96c-e325-11ce-bfc1-08002be10318}\0014 (GUID_DEVCLASS_MEDIA)
  Service                : usbaudio2
  Location               : 0000.0014.0000.003.002.004.000.000.000
  LocationPaths          : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(3)#USB(2)#USB(4)#USBMI(0)  PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(3)#USB(2)#USB(4)#USB(4)  ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HSP3)#USB(2)#USB(4)#USBMI(0)  ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HSP3)#USB(2)#USB(4)#USB(4)
  Problem                : 10 (CM_PROB_FAILED_START)

        +++++++++++++++++ Registry USB Flags +++++++++++++++++
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\20B100110000
 osvc                    : REG_BINARY 00 00
 NewInterfaceUsage       : REG_DWORD 00000000 (0)

        ---------------- Connection Information ---------------
Connection Index         : 0x04 (Port 4)
Connection Status        : 0x01 (DeviceConnected)
Current Config Value     : 0x01 (Configuration 1)
Device Address           : 0x09 (9)
Is Hub                   : 0x00 (no)
Device Bus Speed         : 0x02 (High-Speed)
Number Of Open Pipes     : 0x00 (0 pipes to data endpoints)
Data (HexDump)           : 04 00 00 00 12 01 00 02 EF 02 01 40 B1 20 11 00   ...........@. ..
                           00 00 02 03 04 01 01 02 00 09 00 00 00 00 00 01   ................
                           00 00 00                                          ...

        --------------- Connection Information V2 -------------
Connection Index         : 0x04 (4)
Length                   : 0x10 (16 bytes)
SupportedUsbProtocols    : 0x03
 Usb110                  : 1 (yes, port supports USB 1.1)
 Usb200                  : 1 (yes, port supports USB 2.0)
 Usb300                  : 0 (no, port not supports USB 3.0) -> but Companion Port 3-7-2-4 does
 ReservedMBZ             : 0x00
Flags                    : 0x00
 DevIsOpAtSsOrHigher     : 0 (Device is not operating at SuperSpeed or higher)
 DevIsSsCapOrHigher      : 0 (Device is not SuperSpeed capable or higher)
 DevIsOpAtSsPlusOrHigher : 0 (Device is not operating at SuperSpeedPlus or higher)
 DevIsSsPlusCapOrHigher  : 0 (Device is not SuperSpeedPlus capable or higher)
 ReservedMBZ             : 0x00
Data (HexDump)           : 04 00 00 00 10 00 00 00 03 00 00 00 00 00 00 00   ................

    ---------------------- Device Descriptor ----------------------
bLength                  : 0x12 (18 bytes)
bDescriptorType          : 0x01 (Device Descriptor)
bcdUSB                   : 0x200 (USB Version 2.00)
bDeviceClass             : 0xEF (Miscellaneous)
bDeviceSubClass          : 0x02
bDeviceProtocol          : 0x01 (IAD - Interface Association Descriptor)
bMaxPacketSize0          : 0x40 (64 bytes)
idVendor                 : 0x20B1 (XMOS Ltd.)
idProduct                : 0x0011
bcdDevice                : 0x0000
iManufacturer            : 0x02 (String Descriptor 2)
 Language 0x0409         : "TestManufactuere"
iProduct                 : 0x03 (String Descriptor 3)
 Language 0x0409         : "TEST Device"
iSerialNumber            : 0x04 (String Descriptor 4)
 Language 0x0409         : "0.0.11"
bNumConfigurations       : 0x01 (1 Configuration)
Data (HexDump)           : 12 01 00 02 EF 02 01 40 B1 20 11 00 00 00 02 03   .......@. ......
                           04 01                                             ..

    ------------------ Configuration Descriptor -------------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x02 (Configuration Descriptor)
wTotalLength             : 0x00F2 (242 bytes)
bNumInterfaces           : 0x03 (3 Interfaces)
bConfigurationValue      : 0x01 (Configuration 1)
iConfiguration           : 0x01 (String Descriptor 1)
 Language 0x0409         : "CONFIG descriptors"
bmAttributes             : 0xC0
 D7: Reserved, set 1     : 0x01
 D6: Self Powered        : 0x01 (yes)
 D5: Remote Wakeup       : 0x00 (no)
 D4..0: Reserved, set 0  : 0x00
MaxPower                 : 0xF0 (480 mA)
Data (HexDump)           : 09 02 F2 00 03 01 01 C0 F0 08 0B 00 03 01 00 20   ............... 
                           05 09 04 00 00 00 01 01 20 06 09 24 01 00 02 0A   ........ ..$....
                           6A 00 00 08 24 0A 01 00 01 00 07 11 24 02 02 01   j...$.......$...
                           01 00 01 08 FF 00 00 00 00 00 00 08 11 24 02 03   .............$..
                           00 02 00 01 08 FF 00 00 00 00 00 00 09 0C 24 03   ..............$.
                           04 01 01 00 06 01 00 00 0A 0C 24 03 03 01 03 00   ..........$.....
                           06 01 00 00 0B 1F 24 04 06 02 02 03 08 FF 00 00   ......$.........
                           00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
                           00 00 00 0C 09 04 01 00 00 01 02 20 0D 09 04 01   ........... ....
                           01 01 01 02 20 0E 10 24 01 02 00 01 01 00 00 00   .... ..$........
                           08 FF 00 00 00 00 06 24 02 01 04 20 07 05 01 05   .......$... ....
                           C0 00 01 08 25 01 00 00 02 08 00 09 04 02 00 00   ....%...........
                           01 02 20 0F 09 04 02 01 01 01 02 20 10 10 24 01   .. ........ ..$.
                           04 00 01 01 00 00 00 08 FF 00 00 00 00 06 24 02   ..............$.
                           01 04 20 07 05 02 05 C0 00 01 08 25 01 00 00 02   .. ........%....
                           00 08                                             ..

        ------------------- IAD Descriptor --------------------
bLength                  : 0x08 (8 bytes)
bDescriptorType          : 0x0B (Interface Association Descriptor)
bFirstInterface          : 0x00 (Interface 0)
bInterfaceCount          : 0x03 (3 Interfaces)
bFunctionClass           : 0x01 (Audio)
bFunctionSubClass        : 0x00 (undefined)
bFunctionProtocol        : 0x20 (AF 2.0)
iFunction                : 0x05 (String Descriptor 5)
 Language 0x0409         : "Audio Function :)"
Data (HexDump)           : 08 0B 00 03 01 00 20 05                           ...... .

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x00 (Interface 0)
bAlternateSetting        : 0x00
bNumEndpoints            : 0x00 (Default Control Pipe only)
bInterfaceClass          : 0x01 (Audio)
bInterfaceSubClass       : 0x01 (Audio Control)
bInterfaceProtocol       : 0x20 (Device Protocol Version 2.0)
iInterface               : 0x06 (String Descriptor 6)
 Language 0x0409         : "CTRL_IF_DESC"
Data (HexDump)           : 09 04 00 00 00 01 01 20 06                        ....... .

        ---- Audio Control Interface Header Descriptor 2.0 ----
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x01 (Header 2.0)
bcdADC                   : 0x0200 (2.0)
bCategory                : 0x0A (pro-audio)
wTotalLength             : 0x006A (106 bytes)
bmControls               : 0x00
 D1..0: Latency          : 0x00 (not present)
 D7..2: Reserved         : 0x00
Data (HexDump)           : 09 24 01 00 02 0A 6A 00 00                        .$....j..

        --- Audio Control Clock Source Unit Descriptor 2.0 ----
bLength                  : 0x08 (8 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x0A (Clock Source 2.0)
bClockID                 : 0x01
bmAttributes             : 0x00
 D1..0: Clock Type       : 0x00
 D2   : Sync to SOF      : 0x00
 D7..3: Reserved         : 0x00
bmControls               : 0x01
 D1..0: Clock Frequency  : 0x01 (read only)
 D3..2: Clock Validity   : 0x00 (not present)
 D7..4: Reserved         : 0x00
bAssocTerminal           : 0x00
iClockSource             : 0x07 (String Descriptor 7)
 Language 0x0409         : "ClOcK_SoUrCe"
Data (HexDump)           : 08 24 0A 01 00 01 00 07                           .$......

        ----- Audio Control Input Terminal Descriptor 2.0 -----
bLength                  : 0x11 (17 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x02 (Input Terminal 2.0)
bTerminalID              : 0x02 (2)
wTerminalType            : 0x0101 (USB Streaming)
bAssocTerminal           : 0x00
bCSourceID               : 0x01 (1)
bNrChannels              : 0x08 (8 Channels)
bmChannelConfig          : 0x000000FF (FL, FR, FC, LFE, BL, BR, FLC, FRC)
iChannelNames            : 0x00 (No String Descriptor)
bmControls               : 0x0000
 D1..0  : Copy Protect   : 0x00 (not present)
 D3..2  : Connector      : 0x00 (not present)
 D5..4  : Overload       : 0x00 (not present)
 D7..6  : Cluster        : 0x00 (not present)
 D9..8  : Underflow      : 0x00 (not present)
 D11..10: Overflow       : 0x00 (not present)
 D15..12: Reserved       : 0x00
iTerminal                : 0x08 (String Descriptor 8)
 Language 0x0409         : "From host"
Data (HexDump)           : 11 24 02 02 01 01 00 01 08 FF 00 00 00 00 00 00   .$..............
                           08                                                .

        ----- Audio Control Input Terminal Descriptor 2.0 -----
bLength                  : 0x11 (17 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x02 (Input Terminal 2.0)
bTerminalID              : 0x03 (3)
wTerminalType            : 0x0200 (Input Undefined)
bAssocTerminal           : 0x00
bCSourceID               : 0x01 (1)
bNrChannels              : 0x08 (8 Channels)
bmChannelConfig          : 0x000000FF (FL, FR, FC, LFE, BL, BR, FLC, FRC)
iChannelNames            : 0x00 (No String Descriptor)
bmControls               : 0x0000
 D1..0  : Copy Protect   : 0x00 (not present)
 D3..2  : Connector      : 0x00 (not present)
 D5..4  : Overload       : 0x00 (not present)
 D7..6  : Cluster        : 0x00 (not present)
 D9..8  : Underflow      : 0x00 (not present)
 D11..10: Overflow       : 0x00 (not present)
 D15..12: Reserved       : 0x00
iTerminal                : 0x09 (String Descriptor 9)
 Language 0x0409         : "From tdm"
Data (HexDump)           : 11 24 02 03 00 02 00 01 08 FF 00 00 00 00 00 00   .$..............
                           09                                                .

        ----- Audio Control Output Terminal Descriptor 2.0 ----
bLength                  : 0x0C (12 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x03 (Output Terminal 2.0)
bTerminalID              : 0x04 (4)
wTerminalType            : 0x0101 (USB Streaming)
bAssocTerminal           : 0x00 (0)
bSourceID                : 0x06 (6)
bCSourceID               : 0x01 (1)
iTerminal                : 0x0A (String Descriptor 10)
 Language 0x0409         : "TOOOO HOOOOST!"
Data (HexDump)           : 0C 24 03 04 01 01 00 06 01 00 00 0A               .$..........

        ----- Audio Control Output Terminal Descriptor 2.0 ----
bLength                  : 0x0C (12 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x03 (Output Terminal 2.0)
bTerminalID              : 0x03 (3)
wTerminalType            : 0x0301 (Speaker)
bAssocTerminal           : 0x00 (0)
bSourceID                : 0x06 (6)
bCSourceID               : 0x01 (1)
iTerminal                : 0x0B (String Descriptor 11)
 Language 0x0409         : "TOOOO DAAAAC!"
Data (HexDump)           : 0C 24 03 03 01 03 00 06 01 00 00 0B               .$..........

        ------- Audio Control Mixer Unit Descriptor 2.0 -------
bLength                  : 0x1F (31 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x04 (Mixer Unit 2.0)
bUnitID                  : 0x06 (ID 6)
bNrInPins                : 0x02 (2 Input Pins)
baSourceID[1]            : 0x02 (2)
baSourceID[2]            : 0x03 (3)
bNrChannels              : 0x08 (8 Channels)
bmChannelConfig          : 0x000000FF (FL, FR, FC, LFE, BL, BR, FLC, FRC)
iChannelNames            : 0x00 (No String Descriptor)
bmMixerControls (HexDump): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
                           00                                                .
bmControls               : 0x0C
 D1..0: Cluster          : 0x00 (not present)
 D3..2: Underflow        : 0x03 (host programmable)
 D5..4: Overflow         : 0x00 (not present)
 D7..6: Reserved         : 0x0
iMixer                   : 0x09 (String Descriptor 9)
 Language 0x0409         : "From tdm"
Data (HexDump)           : 1F 24 04 06 02 02 03 08 FF 00 00 00 00 00 00 00   .$..............
                           00 00 00 00 00 00 00 00 00 00 00 00 00 00 0C      ...............

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x01 (Interface 1)
bAlternateSetting        : 0x00
bNumEndpoints            : 0x00 (Default Control Pipe only)
bInterfaceClass          : 0x01 (Audio)
bInterfaceSubClass       : 0x02 (Audio Streaming)
bInterfaceProtocol       : 0x20 (Device Protocol Version 2.0)
iInterface               : 0x0D (String Descriptor 13)
 Language 0x0409         : "Nothing to see here"
Data (HexDump)           : 09 04 01 00 00 01 02 20 0D                        ....... .

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x01 (Interface 1)
bAlternateSetting        : 0x01
bNumEndpoints            : 0x01 (1 Endpoint)
bInterfaceClass          : 0x01 (Audio)
bInterfaceSubClass       : 0x02 (Audio Streaming)
bInterfaceProtocol       : 0x20 (Device Protocol Version 2.0)
iInterface               : 0x0E (String Descriptor 14)
 Language 0x0409         : "Here comes the action"
Data (HexDump)           : 09 04 01 01 01 01 02 20 0E                        ....... .

        ------ Audio Streaming Interface Descriptor 2.0 -------
bLength                  : 0x10 (16 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x01 (AS General)
bTerminalLink            : 0x02 (2)
bmControls               : 0x00
 D1..0: Active Alt Settng: 0x00 (not present)
 D3..2: Valid Alt Settng : 0x00 (not present)
 D7..4: Reserved         : 0x00
bFormatType              : 0x01 (FORMAT_TYPE_I)
bmFormats                : 0x00000001 (PCM)
bNrChannels              : 0x08 (8 channels)
bmChannelConfig          : 0x000000FF (FL, FR, FC, LFE, BL, BR, FLC, FRC)
iChannelNames            : 0x00 (No String Descriptor)
Data (HexDump)           : 10 24 01 02 00 01 01 00 00 00 08 FF 00 00 00 00   .$..............

        ----- Audio Streaming Format Type Descriptor 2.0 ------
bLength                  : 0x06 (6 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x02 (Format Type)
bFormatType              : 0x01 (FORMAT_TYPE_I)
bSubslotSize             : 0x04 (4 bytes)
bBitResolution           : 0x20 (32 bits)
Data (HexDump)           : 06 24 02 01 04 20                                 .$... 

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x01 (Direction=OUT EndpointID=1)
bmAttributes             : 0x05 (TransferType=Isochronous  SyncType=Asynchronous  EndpointType=Data)
wMaxPacketSize           : 0x00C0
 Bits 15..13             : 0x00 (reserved, must be zero)
 Bits 12..11             : 0x00 (0 additional transactions per microframe -> allows 1..1024 bytes per packet)
 Bits 10..0              : 0xC0 (192 bytes per packet)
bInterval                : 0x01 (1 microframe -> 0.125 ms)
Data (HexDump)           : 07 05 01 05 C0 00 01                              .......

        ----------- Audio Data Endpoint Descriptor ------------
bLength                  : 0x08 (8 bytes)
bDescriptorType          : 0x25 (Audio Endpoint Descriptor)
bDescriptorSubtype       : 0x01 (General)
bmAttributes             : 0x00
 D0   : Sampling Freq    : 0x00 (not supported)
 D1   : Pitch            : 0x00 (not supported)
 D6..2: Reserved         : 0x00
 D7   : MaxPacketsOnly   : 0x00 (no)
bLockDelayUnits          : 0x00 (Undefined)
wLockDelay               : 0x0802
Data (HexDump)           : 08 25 01 00 00 02 08 00                           .%......

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x02 (Interface 2)
bAlternateSetting        : 0x00
bNumEndpoints            : 0x00 (Default Control Pipe only)
bInterfaceClass          : 0x01 (Audio)
bInterfaceSubClass       : 0x02 (Audio Streaming)
bInterfaceProtocol       : 0x20 (Device Protocol Version 2.0)
iInterface               : 0x0F (String Descriptor 15)
 Language 0x0409         : "Also nothing to see here"
Data (HexDump)           : 09 04 02 00 00 01 02 20 0F                        ....... .

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x02 (Interface 2)
bAlternateSetting        : 0x01
bNumEndpoints            : 0x01 (1 Endpoint)
bInterfaceClass          : 0x01 (Audio)
bInterfaceSubClass       : 0x02 (Audio Streaming)
bInterfaceProtocol       : 0x20 (Device Protocol Version 2.0)
iInterface               : 0x10 (String Descriptor 16)
 Language 0x0409         : "Here goes the action..."
Data (HexDump)           : 09 04 02 01 01 01 02 20 10                        ....... .

        ------ Audio Streaming Interface Descriptor 2.0 -------
bLength                  : 0x10 (16 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x01 (AS General)
bTerminalLink            : 0x04 (4)
bmControls               : 0x00
 D1..0: Active Alt Settng: 0x00 (not present)
 D3..2: Valid Alt Settng : 0x00 (not present)
 D7..4: Reserved         : 0x00
bFormatType              : 0x01 (FORMAT_TYPE_I)
bmFormats                : 0x00000001 (PCM)
bNrChannels              : 0x08 (8 channels)
bmChannelConfig          : 0x000000FF (FL, FR, FC, LFE, BL, BR, FLC, FRC)
iChannelNames            : 0x00 (No String Descriptor)
Data (HexDump)           : 10 24 01 04 00 01 01 00 00 00 08 FF 00 00 00 00   .$..............

        ----- Audio Streaming Format Type Descriptor 2.0 ------
bLength                  : 0x06 (6 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x02 (Format Type)
bFormatType              : 0x01 (FORMAT_TYPE_I)
bSubslotSize             : 0x04 (4 bytes)
bBitResolution           : 0x20 (32 bits)
Data (HexDump)           : 06 24 02 01 04 20                                 .$... 

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x02 (Direction=OUT EndpointID=2)
bmAttributes             : 0x05 (TransferType=Isochronous  SyncType=Asynchronous  EndpointType=Data)
wMaxPacketSize           : 0x00C0
 Bits 15..13             : 0x00 (reserved, must be zero)
 Bits 12..11             : 0x00 (0 additional transactions per microframe -> allows 1..1024 bytes per packet)
 Bits 10..0              : 0xC0 (192 bytes per packet)
bInterval                : 0x01 (1 microframe -> 0.125 ms)
Data (HexDump)           : 07 05 02 05 C0 00 01                              .......

        ----------- Audio Data Endpoint Descriptor ------------
bLength                  : 0x08 (8 bytes)
bDescriptorType          : 0x25 (Audio Endpoint Descriptor)
bDescriptorSubtype       : 0x01 (General)
bmAttributes             : 0x00
 D0   : Sampling Freq    : 0x00 (not supported)
 D1   : Pitch            : 0x00 (not supported)
 D6..2: Reserved         : 0x00
 D7   : MaxPacketsOnly   : 0x00 (no)
bLockDelayUnits          : 0x00 (Undefined)
wLockDelay               : 0x0002
Data (HexDump)           : 08 25 01 00 00 02 00 08                           .%......

    --------- Device Qualifier Descriptor (for Full-Speed) --------
bLength                  : 0x0A (10 bytes)
bDescriptorType          : 0x06 (Device_qualifier Descriptor)
bcdUSB                   : 0x200 (USB Version 2.00)
bDeviceClass             : 0xEF (Miscellaneous)
bDeviceSubClass          : 0x02
bDeviceProtocol          : 0x01 (IAD - Interface Association Descriptor)
bMaxPacketSize0          : 0x40 (64 Bytes)
bNumConfigurations       : 0x01 (1 other-speed configuration)
bReserved                : 0x00
Data (HexDump)           : 0A 06 00 02 EF 02 01 40 01 00                     .......@..

    ------------ Other Speed Configuration Descriptor -------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x07 (Other_speed_configuration Descriptor)
wTotalLength             : 0x00F2 (242 bytes)
bNumInterfaces           : 0x03 (3 Interfaces)
bConfigurationValue      : 0x01 (Configuration 1)
iConfiguration           : 0x01 (String Descriptor 1)
 Language 0x0409         : "CONFIG descriptors"
bmAttributes             : 0xC0
 D7: Reserved, set 1     : 0x01
 D6: Self Powered        : 0x01 (yes)
 D5: Remote Wakeup       : 0x00 (no)
 D4..0: Reserved, set 0  : 0x00
MaxPower                 : 0xF0 (480 mA)
Data (HexDump)           : 09 07 F2 00 03 01 01 C0 F0 08 0B 00 03 01 00 20   ............... 
                           05 09 04 00 00 00 01 01 20 06 09 24 01 00 02 0A   ........ ..$....
                           6A 00 00 08 24 0A 01 00 01 00 07 11 24 02 02 01   j...$.......$...
                           01 00 01 08 FF 00 00 00 00 00 00 08 11 24 02 03   .............$..
                           00 02 00 01 08 FF 00 00 00 00 00 00 09 0C 24 03   ..............$.
                           04 01 01 00 06 01 00 00 0A 0C 24 03 03 01 03 00   ..........$.....
                           06 01 00 00 0B 1F 24 04 06 02 02 03 08 FF 00 00   ......$.........
                           00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
                           00 00 00 0C 09 04 01 00 00 01 02 20 0D 09 04 01   ........... ....
                           01 01 01 02 20 0E 10 24 01 02 00 01 01 00 00 00   .... ..$........
                           08 FF 00 00 00 00 06 24 02 01 04 20 07 05 01 05   .......$... ....
                           C0 00 01 08 25 01 00 00 02 08 00 09 04 02 00 00   ....%...........
                           01 02 20 0F 09 04 02 01 01 01 02 20 10 10 24 01   .. ........ ..$.
                           04 00 01 01 00 00 00 08 FF 00 00 00 00 06 24 02   ..............$.
                           01 04 20 07 05 02 05 C0 00 01 08 25 01 00 00 02   .. ........%....
                           00 08                                             ..

        ------------------- IAD Descriptor --------------------
bLength                  : 0x08 (8 bytes)
bDescriptorType          : 0x0B (Interface Association Descriptor)
bFirstInterface          : 0x00 (Interface 0)
bInterfaceCount          : 0x03 (3 Interfaces)
bFunctionClass           : 0x01 (Audio)
bFunctionSubClass        : 0x00 (undefined)
bFunctionProtocol        : 0x20 (AF 2.0)
iFunction                : 0x05 (String Descriptor 5)
 Language 0x0409         : "Audio Function :)"
Data (HexDump)           : 08 0B 00 03 01 00 20 05                           ...... .

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x00 (Interface 0)
bAlternateSetting        : 0x00
bNumEndpoints            : 0x00 (Default Control Pipe only)
bInterfaceClass          : 0x01 (Audio)
bInterfaceSubClass       : 0x01 (Audio Control)
bInterfaceProtocol       : 0x20 (Device Protocol Version 2.0)
iInterface               : 0x06 (String Descriptor 6)
 Language 0x0409         : "CTRL_IF_DESC"
Data (HexDump)           : 09 04 00 00 00 01 01 20 06                        ....... .

        ---- Audio Control Interface Header Descriptor 2.0 ----
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x01 (Header 2.0)
bcdADC                   : 0x0200 (2.0)
bCategory                : 0x0A (pro-audio)
wTotalLength             : 0x006A (106 bytes)
bmControls               : 0x00
 D1..0: Latency          : 0x00 (not present)
 D7..2: Reserved         : 0x00
Data (HexDump)           : 09 24 01 00 02 0A 6A 00 00                        .$....j..

        --- Audio Control Clock Source Unit Descriptor 2.0 ----
bLength                  : 0x08 (8 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x0A (Clock Source 2.0)
bClockID                 : 0x01
bmAttributes             : 0x00
 D1..0: Clock Type       : 0x00
 D2   : Sync to SOF      : 0x00
 D7..3: Reserved         : 0x00
bmControls               : 0x01
 D1..0: Clock Frequency  : 0x01 (read only)
 D3..2: Clock Validity   : 0x00 (not present)
 D7..4: Reserved         : 0x00
bAssocTerminal           : 0x00
iClockSource             : 0x07 (String Descriptor 7)
 Language 0x0409         : "ClOcK_SoUrCe"
Data (HexDump)           : 08 24 0A 01 00 01 00 07                           .$......

        ----- Audio Control Input Terminal Descriptor 2.0 -----
bLength                  : 0x11 (17 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x02 (Input Terminal 2.0)
bTerminalID              : 0x02 (2)
wTerminalType            : 0x0101 (USB Streaming)
bAssocTerminal           : 0x00
bCSourceID               : 0x01 (1)
bNrChannels              : 0x08 (8 Channels)
bmChannelConfig          : 0x000000FF (FL, FR, FC, LFE, BL, BR, FLC, FRC)
iChannelNames            : 0x00 (No String Descriptor)
bmControls               : 0x0000
 D1..0  : Copy Protect   : 0x00 (not present)
 D3..2  : Connector      : 0x00 (not present)
 D5..4  : Overload       : 0x00 (not present)
 D7..6  : Cluster        : 0x00 (not present)
 D9..8  : Underflow      : 0x00 (not present)
 D11..10: Overflow       : 0x00 (not present)
 D15..12: Reserved       : 0x00
iTerminal                : 0x08 (String Descriptor 8)
 Language 0x0409         : "From host"
Data (HexDump)           : 11 24 02 02 01 01 00 01 08 FF 00 00 00 00 00 00   .$..............
                           08                                                .

        ----- Audio Control Input Terminal Descriptor 2.0 -----
bLength                  : 0x11 (17 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x02 (Input Terminal 2.0)
bTerminalID              : 0x03 (3)
wTerminalType            : 0x0200 (Input Undefined)
bAssocTerminal           : 0x00
bCSourceID               : 0x01 (1)
bNrChannels              : 0x08 (8 Channels)
bmChannelConfig          : 0x000000FF (FL, FR, FC, LFE, BL, BR, FLC, FRC)
iChannelNames            : 0x00 (No String Descriptor)
bmControls               : 0x0000
 D1..0  : Copy Protect   : 0x00 (not present)
 D3..2  : Connector      : 0x00 (not present)
 D5..4  : Overload       : 0x00 (not present)
 D7..6  : Cluster        : 0x00 (not present)
 D9..8  : Underflow      : 0x00 (not present)
 D11..10: Overflow       : 0x00 (not present)
 D15..12: Reserved       : 0x00
iTerminal                : 0x09 (String Descriptor 9)
 Language 0x0409         : "From tdm"
Data (HexDump)           : 11 24 02 03 00 02 00 01 08 FF 00 00 00 00 00 00   .$..............
                           09                                                .

        ----- Audio Control Output Terminal Descriptor 2.0 ----
bLength                  : 0x0C (12 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x03 (Output Terminal 2.0)
bTerminalID              : 0x04 (4)
wTerminalType            : 0x0101 (USB Streaming)
bAssocTerminal           : 0x00 (0)
bSourceID                : 0x06 (6)
bCSourceID               : 0x01 (1)
iTerminal                : 0x0A (String Descriptor 10)
 Language 0x0409         : "TOOOO HOOOOST!"
Data (HexDump)           : 0C 24 03 04 01 01 00 06 01 00 00 0A               .$..........

        ----- Audio Control Output Terminal Descriptor 2.0 ----
bLength                  : 0x0C (12 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x03 (Output Terminal 2.0)
bTerminalID              : 0x03 (3)
wTerminalType            : 0x0301 (Speaker)
bAssocTerminal           : 0x00 (0)
bSourceID                : 0x06 (6)
bCSourceID               : 0x01 (1)
iTerminal                : 0x0B (String Descriptor 11)
 Language 0x0409         : "TOOOO DAAAAC!"
Data (HexDump)           : 0C 24 03 03 01 03 00 06 01 00 00 0B               .$..........

        ------- Audio Control Mixer Unit Descriptor 2.0 -------
bLength                  : 0x1F (31 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x04 (Mixer Unit 2.0)
bUnitID                  : 0x06 (ID 6)
bNrInPins                : 0x02 (2 Input Pins)
baSourceID[1]            : 0x02 (2)
baSourceID[2]            : 0x03 (3)
bNrChannels              : 0x08 (8 Channels)
bmChannelConfig          : 0x000000FF (FL, FR, FC, LFE, BL, BR, FLC, FRC)
iChannelNames            : 0x00 (No String Descriptor)
bmMixerControls (HexDump): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
                           00                                                .
bmControls               : 0x0C
 D1..0: Cluster          : 0x00 (not present)
 D3..2: Underflow        : 0x03 (host programmable)
 D5..4: Overflow         : 0x00 (not present)
 D7..6: Reserved         : 0x0
iMixer                   : 0x09 (String Descriptor 9)
 Language 0x0409         : "From tdm"
Data (HexDump)           : 1F 24 04 06 02 02 03 08 FF 00 00 00 00 00 00 00   .$..............
                           00 00 00 00 00 00 00 00 00 00 00 00 00 00 0C      ...............

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x01 (Interface 1)
bAlternateSetting        : 0x00
bNumEndpoints            : 0x00 (Default Control Pipe only)
bInterfaceClass          : 0x01 (Audio)
bInterfaceSubClass       : 0x02 (Audio Streaming)
bInterfaceProtocol       : 0x20 (Device Protocol Version 2.0)
iInterface               : 0x0D (String Descriptor 13)
 Language 0x0409         : "Nothing to see here"
Data (HexDump)           : 09 04 01 00 00 01 02 20 0D                        ....... .

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x01 (Interface 1)
bAlternateSetting        : 0x01
bNumEndpoints            : 0x01 (1 Endpoint)
bInterfaceClass          : 0x01 (Audio)
bInterfaceSubClass       : 0x02 (Audio Streaming)
bInterfaceProtocol       : 0x20 (Device Protocol Version 2.0)
iInterface               : 0x0E (String Descriptor 14)
 Language 0x0409         : "Here comes the action"
Data (HexDump)           : 09 04 01 01 01 01 02 20 0E                        ....... .

        ------ Audio Streaming Interface Descriptor 2.0 -------
bLength                  : 0x10 (16 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x01 (AS General)
bTerminalLink            : 0x02 (2)
bmControls               : 0x00
 D1..0: Active Alt Settng: 0x00 (not present)
 D3..2: Valid Alt Settng : 0x00 (not present)
 D7..4: Reserved         : 0x00
bFormatType              : 0x01 (FORMAT_TYPE_I)
bmFormats                : 0x00000001 (PCM)
bNrChannels              : 0x08 (8 channels)
bmChannelConfig          : 0x000000FF (FL, FR, FC, LFE, BL, BR, FLC, FRC)
iChannelNames            : 0x00 (No String Descriptor)
Data (HexDump)           : 10 24 01 02 00 01 01 00 00 00 08 FF 00 00 00 00   .$..............

        ----- Audio Streaming Format Type Descriptor 2.0 ------
bLength                  : 0x06 (6 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x02 (Format Type)
bFormatType              : 0x01 (FORMAT_TYPE_I)
bSubslotSize             : 0x04 (4 bytes)
bBitResolution           : 0x20 (32 bits)
Data (HexDump)           : 06 24 02 01 04 20                                 .$... 

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x01 (Direction=OUT EndpointID=1)
bmAttributes             : 0x05 (TransferType=Isochronous  SyncType=Asynchronous  EndpointType=Data)
wMaxPacketSize           : 0x00C0 (192 bytes)
bInterval                : 0x01 (1 ms)
Data (HexDump)           : 07 05 01 05 C0 00 01                              .......

        ----------- Audio Data Endpoint Descriptor ------------
bLength                  : 0x08 (8 bytes)
bDescriptorType          : 0x25 (Audio Endpoint Descriptor)
bDescriptorSubtype       : 0x01 (General)
bmAttributes             : 0x00
 D0   : Sampling Freq    : 0x00 (not supported)
 D1   : Pitch            : 0x00 (not supported)
 D6..2: Reserved         : 0x00
 D7   : MaxPacketsOnly   : 0x00 (no)
bLockDelayUnits          : 0x00 (Undefined)
wLockDelay               : 0x0802
Data (HexDump)           : 08 25 01 00 00 02 08 00                           .%......

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x02 (Interface 2)
bAlternateSetting        : 0x00
bNumEndpoints            : 0x00 (Default Control Pipe only)
bInterfaceClass          : 0x01 (Audio)
bInterfaceSubClass       : 0x02 (Audio Streaming)
bInterfaceProtocol       : 0x20 (Device Protocol Version 2.0)
iInterface               : 0x0F (String Descriptor 15)
 Language 0x0409         : "Also nothing to see here"
Data (HexDump)           : 09 04 02 00 00 01 02 20 0F                        ....... .

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x02 (Interface 2)
bAlternateSetting        : 0x01
bNumEndpoints            : 0x01 (1 Endpoint)
bInterfaceClass          : 0x01 (Audio)
bInterfaceSubClass       : 0x02 (Audio Streaming)
bInterfaceProtocol       : 0x20 (Device Protocol Version 2.0)
iInterface               : 0x10 (String Descriptor 16)
 Language 0x0409         : "Here goes the action..."
Data (HexDump)           : 09 04 02 01 01 01 02 20 10                        ....... .

        ------ Audio Streaming Interface Descriptor 2.0 -------
bLength                  : 0x10 (16 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x01 (AS General)
bTerminalLink            : 0x04 (4)
bmControls               : 0x00
 D1..0: Active Alt Settng: 0x00 (not present)
 D3..2: Valid Alt Settng : 0x00 (not present)
 D7..4: Reserved         : 0x00
bFormatType              : 0x01 (FORMAT_TYPE_I)
bmFormats                : 0x00000001 (PCM)
bNrChannels              : 0x08 (8 channels)
bmChannelConfig          : 0x000000FF (FL, FR, FC, LFE, BL, BR, FLC, FRC)
iChannelNames            : 0x00 (No String Descriptor)
Data (HexDump)           : 10 24 01 04 00 01 01 00 00 00 08 FF 00 00 00 00   .$..............

        ----- Audio Streaming Format Type Descriptor 2.0 ------
bLength                  : 0x06 (6 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x02 (Format Type)
bFormatType              : 0x01 (FORMAT_TYPE_I)
bSubslotSize             : 0x04 (4 bytes)
bBitResolution           : 0x20 (32 bits)
Data (HexDump)           : 06 24 02 01 04 20                                 .$... 

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x02 (Direction=OUT EndpointID=2)
bmAttributes             : 0x05 (TransferType=Isochronous  SyncType=Asynchronous  EndpointType=Data)
wMaxPacketSize           : 0x00C0 (192 bytes)
bInterval                : 0x01 (1 ms)
Data (HexDump)           : 07 05 02 05 C0 00 01                              .......

        ----------- Audio Data Endpoint Descriptor ------------
bLength                  : 0x08 (8 bytes)
bDescriptorType          : 0x25 (Audio Endpoint Descriptor)
bDescriptorSubtype       : 0x01 (General)
bmAttributes             : 0x00
 D0   : Sampling Freq    : 0x00 (not supported)
 D1   : Pitch            : 0x00 (not supported)
 D6..2: Reserved         : 0x00
 D7   : MaxPacketsOnly   : 0x00 (no)
bLockDelayUnits          : 0x00 (Undefined)
wLockDelay               : 0x0002
Data (HexDump)           : 08 25 01 00 00 02 00 08                           .%......

      -------------------- String Descriptors -------------------
             ------ String Descriptor 0 ------
bLength                  : 0x04 (4 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language ID[0]           : 0x0409 (English - United States)
Data (HexDump)           : 04 03 09 04                                       ....
             ------ String Descriptor 1 ------
bLength                  : 0x26 (38 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "CONFIG descriptors"
Data (HexDump)           : 26 03 43 00 4F 00 4E 00 46 00 49 00 47 00 20 00   &.C.O.N.F.I.G. .
                           64 00 65 00 73 00 63 00 72 00 69 00 70 00 74 00   d.e.s.c.r.i.p.t.
                           6F 00 72 00 73 00                                 o.r.s.
             ------ String Descriptor 2 ------
bLength                  : 0x22 (34 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "TestManufactuere"
Data (HexDump)           : 22 03 54 00 65 00 73 00 74 00 4D 00 61 00 6E 00   ".T.e.s.t.M.a.n.
                           75 00 66 00 61 00 63 00 74 00 75 00 65 00 72 00   u.f.a.c.t.u.e.r.
                           65 00                                             e.
             ------ String Descriptor 3 ------
bLength                  : 0x18 (24 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "TEST Device"
Data (HexDump)           : 18 03 54 00 45 00 53 00 54 00 20 00 44 00 65 00   ..T.E.S.T. .D.e.
                           76 00 69 00 63 00 65 00                           v.i.c.e.
             ------ String Descriptor 4 ------
bLength                  : 0x0E (14 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "0.0.11"
Data (HexDump)           : 0E 03 30 00 2E 00 30 00 2E 00 31 00 31 00         ..0...0...1.1.
             ------ String Descriptor 5 ------
bLength                  : 0x24 (36 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "Audio Function :)"
Data (HexDump)           : 24 03 41 00 75 00 64 00 69 00 6F 00 20 00 46 00   $.A.u.d.i.o. .F.
                           75 00 6E 00 63 00 74 00 69 00 6F 00 6E 00 20 00   u.n.c.t.i.o.n. .
                           3A 00 29 00                                       :.).
             ------ String Descriptor 6 ------
bLength                  : 0x1A (26 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "CTRL_IF_DESC"
Data (HexDump)           : 1A 03 43 00 54 00 52 00 4C 00 5F 00 49 00 46 00   ..C.T.R.L._.I.F.
                           5F 00 44 00 45 00 53 00 43 00                     _.D.E.S.C.
             ------ String Descriptor 7 ------
bLength                  : 0x1A (26 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "ClOcK_SoUrCe"
Data (HexDump)           : 1A 03 43 00 6C 00 4F 00 63 00 4B 00 5F 00 53 00   ..C.l.O.c.K._.S.
                           6F 00 55 00 72 00 43 00 65 00                     o.U.r.C.e.
             ------ String Descriptor 8 ------
bLength                  : 0x14 (20 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "From host"
Data (HexDump)           : 14 03 46 00 72 00 6F 00 6D 00 20 00 68 00 6F 00   ..F.r.o.m. .h.o.
                           73 00 74 00                                       s.t.
             ------ String Descriptor 9 ------
bLength                  : 0x12 (18 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "From tdm"
Data (HexDump)           : 12 03 46 00 72 00 6F 00 6D 00 20 00 74 00 64 00   ..F.r.o.m. .t.d.
                           6D 00                                             m.
             ------ String Descriptor 10 ------
bLength                  : 0x1E (30 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "TOOOO HOOOOST!"
Data (HexDump)           : 1E 03 54 00 4F 00 4F 00 4F 00 4F 00 20 00 48 00   ..T.O.O.O.O. .H.
                           4F 00 4F 00 4F 00 4F 00 53 00 54 00 21 00         O.O.O.O.S.T.!.
             ------ String Descriptor 11 ------
bLength                  : 0x1C (28 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "TOOOO DAAAAC!"
Data (HexDump)           : 1C 03 54 00 4F 00 4F 00 4F 00 4F 00 20 00 44 00   ..T.O.O.O.O. .D.
                           41 00 41 00 41 00 41 00 43 00 21 00               A.A.A.A.C.!.
             ------ String Descriptor 12 ------
bLength                  : 0x16 (22 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "Mixit baby"
Data (HexDump)           : 16 03 4D 00 69 00 78 00 69 00 74 00 20 00 62 00   ..M.i.x.i.t. .b.
                           61 00 62 00 79 00                                 a.b.y.
             ------ String Descriptor 13 ------
bLength                  : 0x28 (40 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "Nothing to see here"
Data (HexDump)           : 28 03 4E 00 6F 00 74 00 68 00 69 00 6E 00 67 00   (.N.o.t.h.i.n.g.
                           20 00 74 00 6F 00 20 00 73 00 65 00 65 00 20 00    .t.o. .s.e.e. .
                           68 00 65 00 72 00 65 00                           h.e.r.e.
             ------ String Descriptor 14 ------
bLength                  : 0x2C (44 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "Here comes the action"
Data (HexDump)           : 2C 03 48 00 65 00 72 00 65 00 20 00 63 00 6F 00   ,.H.e.r.e. .c.o.
                           6D 00 65 00 73 00 20 00 74 00 68 00 65 00 20 00   m.e.s. .t.h.e. .
                           61 00 63 00 74 00 69 00 6F 00 6E 00               a.c.t.i.o.n.
             ------ String Descriptor 15 ------
bLength                  : 0x32 (50 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "Also nothing to see here"
Data (HexDump)           : 32 03 41 00 6C 00 73 00 6F 00 20 00 6E 00 6F 00   2.A.l.s.o. .n.o.
                           74 00 68 00 69 00 6E 00 67 00 20 00 74 00 6F 00   t.h.i.n.g. .t.o.
                           20 00 73 00 65 00 65 00 20 00 68 00 65 00 72 00    .s.e.e. .h.e.r.
                           65 00                                             e.
             ------ String Descriptor 16 ------
bLength                  : 0x30 (48 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "Here goes the action..."
Data (HexDump)           : 30 03 48 00 65 00 72 00 65 00 20 00 67 00 6F 00   0.H.e.r.e. .g.o.
                           65 00 73 00 20 00 74 00 68 00 65 00 20 00 61 00   e.s. .t.h.e. .a.
                           63 00 74 00 69 00 6F 00 6E 00 2E 00 2E 00 2E 00   c.t.i.o.n.......
             ------ String Descriptor 17 ------
bLength                  : 0x1E (30 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "Jack FROM host"
Data (HexDump)           : 1E 03 4A 00 61 00 63 00 6B 00 20 00 46 00 52 00   ..J.a.c.k. .F.R.
                           4F 00 4D 00 20 00 68 00 6F 00 73 00 74 00         O.M. .h.o.s.t.
             ------ String Descriptor 18 ------
bLength                  : 0x1C (28 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "Jack FROM esp"
Data (HexDump)           : 1C 03 4A 00 61 00 63 00 6B 00 20 00 46 00 52 00   ..J.a.c.k. .F.R.
                           4F 00 4D 00 20 00 65 00 73 00 70 00               O.M. .e.s.p.
             ------ String Descriptor 19 ------
bLength                  : 0x1A (26 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "Jack to host"
Data (HexDump)           : 1A 03 4A 00 61 00 63 00 6B 00 20 00 74 00 6F 00   ..J.a.c.k. .t.o.
                           20 00 68 00 6F 00 73 00 74 00                      .h.o.s.t.
             ------ String Descriptor 20 ------
bLength                  : 0x18 (24 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "Jack to esp"
Data (HexDump)           : 18 03 4A 00 61 00 63 00 6B 00 20 00 74 00 6F 00   ..J.a.c.k. .t.o.
                           20 00 65 00 73 00 70 00                            .e.s.p.

Code: Select all

Device Desc
0x12, 0x01, 0x00, 0x02, 0xEF, 0x02, 0x01, 0x40, 0xB1, 0x20, 0x11, 0x00, 0x00, 0x00, 0x02, 0x03, 0x04, 0x01

Code: Select all

CFG Desc
0x09, 0x02, 0xF2, 0x00, 0x03, 0x01, 0x01, 0xC0, 0xF0, 0x08, 0x0B, 0x00, 0x03, 0x01, 0x00, 0x20, 
0x05, 0x09, 0x04, 0x00, 0x00, 0x00, 0x01, 0x01, 0x20, 0x06, 0x09, 0x24, 0x01, 0x00, 0x02, 0x0A,  
0x6A, 0x00, 0x00, 0x08, 0x24, 0x0A, 0x01, 0x00, 0x01, 0x00, 0x07, 0x11, 0x24, 0x02, 0x02, 0x01,  
0x01, 0x00, 0x01, 0x08, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x11, 0x24, 0x02, 0x03,  
0x00, 0x02, 0x00, 0x01, 0x08, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x0C, 0x24, 0x03,  
0x04, 0x01, 0x01, 0x00, 0x06, 0x01, 0x00, 0x00, 0x0A, 0x0C, 0x24, 0x03, 0x03, 0x01, 0x03, 0x00,  
0x06, 0x01, 0x00, 0x00, 0x0B, 0x1F, 0x24, 0x04, 0x06, 0x02, 0x02, 0x03, 0x08, 0xFF, 0x00, 0x00,  
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  
0x00, 0x00, 0x00, 0x0C, 0x09, 0x04, 0x01, 0x00, 0x00, 0x01, 0x02, 0x20, 0x0D, 0x09, 0x04, 0x01,  
0x01, 0x01, 0x01, 0x02, 0x20, 0x0E, 0x10, 0x24, 0x01, 0x02, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,  
0x08, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x06, 0x24, 0x02, 0x01, 0x04, 0x20, 0x07, 0x05, 0x01, 0x05,  
0xC0, 0x00, 0x01, 0x08, 0x25, 0x01, 0x00, 0x00, 0x02, 0x08, 0x00, 0x09, 0x04, 0x02, 0x00, 0x00,  
0x01, 0x02, 0x20, 0x0F, 0x09, 0x04, 0x02, 0x01, 0x01, 0x01, 0x02, 0x20, 0x10, 0x10, 0x24, 0x01,  
0x04, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x08, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x06, 0x24, 0x02,  
0x01, 0x04, 0x20, 0x07, 0x05, 0x02, 0x05, 0xC0, 0x00, 0x01, 0x08, 0x25, 0x01, 0x00, 0x00, 0x02,  
0x00, 0x08
When connecting the chip to linux, the enumeration seems to be fine. Here the dmesg output (after I corrected the endpoint address):

Code: Select all

[ 1520.638646] usb 3-3.2.1: reset high-speed USB device number 66 using xhci_hcd
[ 1520.741812] usb 3-3.2.1: device firmware changed
[ 1520.743113] usb 3-3.2.1: USB disconnect, device number 66
[ 1520.828389] usb 3-3.2.1: new high-speed USB device number 69 using xhci_hcd
[ 1520.928778] usb 3-3.2.1: New USB device found, idVendor=20b1, idProduct=f7d4, bcdDevice=10.06
[ 1520.928783] usb 3-3.2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=5
[ 1520.928785] usb 3-3.2.1: Product: XMOS XTAG-3
[ 1520.928787] usb 3-3.2.1: Manufacturer: XMOS
[ 1520.928788] usb 3-3.2.1: SerialNumber: XD00BwaVTQW5BYwl
[ 1523.900885] usb 3-3.2.4: USB disconnect, device number 68
[ 1524.121710] usb 3-3.2.4: new high-speed USB device number 70 using xhci_hcd
[ 1524.222290] usb 3-3.2.4: New USB device found, idVendor=20b1, idProduct=0011, bcdDevice= 0.00
[ 1524.222297] usb 3-3.2.4: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[ 1524.222300] usb 3-3.2.4: Product: TEST Device
[ 1524.222303] usb 3-3.2.4: Manufacturer: TestManufactuere
[ 1524.222305] usb 3-3.2.4: SerialNumber: 0.0.11

Regarding the wireshark capture, I'll append 2 captures (linux and windows) since this will give more detailed information than just screenshots. The device to filter for is named in the filename. The windows capture has not changed at all while the linux capture does a successful enumeration (as far as I can tell) and 'hangs up' when trying to set an interface.

From here on, I will remove one of the audio streaming interfaces and some entities in the control descriptor and report back, if and when things change.

Have a nice day
Tim
You do not have the required permissions to view the files attached to this post.
User avatar
dsteinwe
XCore Addict
Posts: 144
Joined: Wed Jun 29, 2016 8:59 am

Post by dsteinwe »

Ok, the MS in "Class-Specific MS Interface Descriptor" means MIDIStreaming not Microsoft (found in the USB MIDI spec) and matches the section 5.3.2 of this spec. Therefore, ignore the section from my previous post
I am not sure, where you are referencing to.
Simply ignore it.
Your parser is correct. There is a 2nd configuration descriptor solely to deal with the MIDI data transfer. This stems from the xmos sample which states: `.bNumConfigurations = 0x02 /* Set to 2 such that windows does not load composite driver */`.
But as you pointed out, windows only supports devices with one config. Therefore I removed the MIDI portion of the descriptor entirely for now.
My parser has found only one configuration descriptor. The MIDI part was just an further interface inside the first descriptor. AFAIK is this valid. Nevertheless, I would now omit the MIDI part to identify the error more easily.
Your quote comes from the section "Class specific AS interface descriptors". Each alternate Setting within an audio streaming interface should refer to the same bTerminalLink. Since I have 2 different Audio Streaming Interfaces (one from device to host and vice versa), I have 2 different bTerminalLinks. This should be compliant with the windows specification.
I agree, that's not the issue.

I read through the link you posted and checked for other differences. I added a control for clock source sampling frequency to the clock source entity since this is required by the windows driver. Additionally the linux kernel logs pointed out, that two endpoints had the same ID. I corrected that aswell. Otherwise I think my descriptor looks fine.

Here the new full descriptor as described in USB Tree View and then as Hex if you want to analyze if further:
My parser only verifies the syntax, but it doesn't validate the descriptor semantically (yet). Your current hex dump produces following output:

Code: Select all

Configuration descriptor
0	0x09, 		(9)	bLength
1	0x02, 		(2)	bDescriptorType
2	0xf2, 0x00, 	(242)	wTotalLength: Total length in bytes of data returned
4	0x03, 		(3)	bNumInterfaces: Number of Interfaces
5	0x01, 		(1)	bConfigurationValue: Value to use as an argument to select this configuration
6	0x01, 		(1)	iConfiguration: Index of String Descriptor describing this configuration
7	0xc0, 		(192)	bmAttributes: D7 Reserved, set to 1. (USB 1.0 Bus Powered), D6 Self Powered, D5 Remote Wakeup, D4..0 Reserved, set to 0.
8	0xf0, 		(240)	bMaxPower: Maximum Power Consumption in 2mA units

Interface association descriptor
9	0x08, 		(8)	bLength
10	0x0b, 		(11)	bDescriptorType
11	0x00, 		(0)	bFirstInterface: AudioControl number of the first interface that is associated with this function.
12	0x03, 		(3)	bInterfaceCount: Number of contiguous interfaces that are associated with this function.
13	0x01, 		(1)	bFunctionClass: AUDIO_FUNCTION Function Class code (assigned by this specification). See Appendix A.1, “Audio Function Class Code”.
14	0x00, 		(0)	bFunctionSubClass: FUNCTION_SUBCLASS_UNDEFINED Function Subclass code. Currently not used. See Appendix A.2, “Audio Function Subclass Codes”.
15	0x20, 		(32)	bFunctionProtocol: AF_VERSION_02_00 Function Protocol code. Indicates the current version of the specification. See Appendix A.3, “Audio Function Protocol Codes”.
16	0x05, 		(5)	iFunction: Index of String Descriptor describing this interface

Standard audio interface descriptor
17	0x09, 		(9)	bLength
18	0x04, 		(4)	bDescriptorType
19	0x00, 		(0)	bInterfaceNumber: Number of AudioControl interface
20	0x00, 		(0)	bAlternateSetting: Value used to select alternative setting
21	0x00, 		(0)	bNumEndpoints: Number of Endpoints used for this interface
22	0x01, 		(1)	bDeviceClass: Class Code (Assigned by USB Org). If equal to Zero, each interface specifies its own class code. If equal to 0xFF, the class code is vendor specified. Otherwise field is valid Class Code.
23	0x01, 		(1)	bDeviceSubClass: Subclass Code (Assigned by USB Org)
24	0x20, 		(32)	bDeviceProtocol: Protocol Code (Assigned by USB Org)
25	0x06, 		(6)	iInterface: Index of String Descriptor describing this interface

Standard audio interface header descriptor
26	0x09, 		(9)	bLength
27	0x24, 		(36)	bDescriptorType
28	0x01, 		(1)	bDescriptorSubtype
29	0x00, 0x02, 	(512)	bcdADC: Audio Device Class Specification Release Number in Binary-Coded Decimal.
31	0x0a, 		(10)	bCategory: Constant, indicating the primary use of this audio function, as intended by the manufacturer. See Appendix A.7, “Audio Function Category Codes.”.
32	0x6a, 0x00, 	(106)	wTotalLength: Total number of bytes returned for the class-specific AudioControl interface descriptor. Includes the combined length of this descriptor header and all Clock Source, Unit and TerminalDesc descriptors.
34	0x00, 		(0)	bmControls: D1..0: Latency Control, D7..2: Reserved. Must be set to 0.

Clock source descriptor
35	0x08, 		(8)	bLength
36	0x24, 		(36)	bDescriptorType
37	0x0a, 		(10)	bDescriptorSubtype
38	0x01, 		(1)	bClockId: Constant uniquely identifying the ClockSelector Entity within the audio function. This bit is used in all requests to address this Entity.
39	0x00, 		(0)	bmAttributes: D1..0: Clock Type: (00: External Clock, 01: Internal fixed Clock, 10: Internal variable Clock, 11: Internal programmable Clock), D2: Clock synchronized to SOF, D7..3: Reserved. Must be set to 0.
40	0x01, 		(1)	bmControls: D1..0: Clock Frequency Control, D3..2: Clock Validity Control, D7..4: Reserved. Must be set to 0.
41	0x00, 		(0)	bAssocTerminal: TerminalDesc ID of the TerminalDesc that is associated with this Clock Source. 0 means no association
42	0x07, 		(7)	iClockSource: Index of a string descriptor, describing the Clock Source Entity.

Input terminal descriptor
43	0x11, 		(17)	bLength
44	0x24, 		(36)	bDescriptorType
45	0x02, 		(2)	bDescriptorSubtype
46	0x02, 		(2)	bTerminalId: Constant uniquely identifying the terminal. This bit is used in all requests to address this Entity.
47	0x01, 0x01, 	(257)	wTerminalType: A TerminalDesc dealing with a signal carried over an endpoint in an AudioStreaming interface.
49	0x00, 		(0)	bAssocTerminal: ID of the Input TerminalDesc to which this Input TerminalDesc is associated.
50	0x01, 		(1)	bCSourceID: ID of the Clock Entity to which this InputTerminal is connected.
51	0x08, 		(8)	bNrChannels: Number of logical input channels in the TerminalDescs input audio channel cluster
52	0xff, 0x00, 0x00, 0x00, 	(255)	bmChannelConfig: Describes the spatial location of the logical channels.
56	0x00, 		(0)	iChannelNames: Index of a string descriptor, describing the name of the first logical channel
57	0x00, 0x00, 	(0)	bmControls: D1..0: Copy Protect Control, D3..2: Connector Control, D5..4: Overload Control, D7..6: Cluster Control, D9..8: Underflow Control, D11..10: Overflow Control, D15..12: Reserved. Must be set to 0
59	0x08, 		(8)	iInputTerminal: Index of a string descriptor, describing the terminal.

Input terminal descriptor
60	0x11, 		(17)	bLength
61	0x24, 		(36)	bDescriptorType
62	0x02, 		(2)	bDescriptorSubtype
63	0x03, 		(3)	bTerminalId: Constant uniquely identifying the terminal. This bit is used in all requests to address this Entity.
64	0x00, 0x02, 	(512)	wTerminalType: A TerminalDesc dealing with a signal carried over an endpoint in an AudioStreaming interface.
66	0x00, 		(0)	bAssocTerminal: ID of the Input TerminalDesc to which this Input TerminalDesc is associated.
67	0x01, 		(1)	bCSourceID: ID of the Clock Entity to which this InputTerminal is connected.
68	0x08, 		(8)	bNrChannels: Number of logical input channels in the TerminalDescs input audio channel cluster
69	0xff, 0x00, 0x00, 0x00, 	(255)	bmChannelConfig: Describes the spatial location of the logical channels.
73	0x00, 		(0)	iChannelNames: Index of a string descriptor, describing the name of the first logical channel
74	0x00, 0x00, 	(0)	bmControls: D1..0: Copy Protect Control, D3..2: Connector Control, D5..4: Overload Control, D7..6: Cluster Control, D9..8: Underflow Control, D11..10: Overflow Control, D15..12: Reserved. Must be set to 0
76	0x09, 		(9)	iInputTerminal: Index of a string descriptor, describing the terminal.

Output terminal descriptor
77	0x0c, 		(12)	bLength
78	0x24, 		(36)	bDescriptorType
79	0x03, 		(3)	bDescriptorSubtype
80	0x04, 		(4)	bTerminalId: Constant uniquely identifying the terminal. This bit is used in all requests to address this Entity.
81	0x01, 0x01, 	(257)	wTerminalType: A TerminalDesc dealing with a signal carried over an endpoint in an AudioStreaming interface.
83	0x00, 		(0)	bAssocTerminal: ID of the Output TerminalDesc to which this Input TerminalDesc is associated.
84	0x06, 		(6)	bSourceID: ID of the Unit or TerminalDesc to which this TerminalDesc is connected.
85	0x01, 		(1)	bCSourceID: ID of the Clock Entity to which this InputTerminal is connected.
86	0x00, 0x00, 	(0)	bmControls: D1..0: Copy Protect Control, D3..2: Connector Control, D5..4: Overload Control, D7..6: Cluster Control, D9..8: Underflow Control, D11..10: Overflow Control, D15..12: Reserved. Must be set to 0
88	0x0a, 		(10)	iOutputTerminal: Index of a string descriptor, describing the terminal.

Output terminal descriptor
89	0x0c, 		(12)	bLength
90	0x24, 		(36)	bDescriptorType
91	0x03, 		(3)	bDescriptorSubtype
92	0x03, 		(3)	bTerminalId: Constant uniquely identifying the terminal. This bit is used in all requests to address this Entity.
93	0x01, 0x03, 	(769)	wTerminalType: A TerminalDesc dealing with a signal carried over an endpoint in an AudioStreaming interface.
95	0x00, 		(0)	bAssocTerminal: ID of the Output TerminalDesc to which this Input TerminalDesc is associated.
96	0x06, 		(6)	bSourceID: ID of the Unit or TerminalDesc to which this TerminalDesc is connected.
97	0x01, 		(1)	bCSourceID: ID of the Clock Entity to which this InputTerminal is connected.
98	0x00, 0x00, 	(0)	bmControls: D1..0: Copy Protect Control, D3..2: Connector Control, D5..4: Overload Control, D7..6: Cluster Control, D9..8: Underflow Control, D11..10: Overflow Control, D15..12: Reserved. Must be set to 0
100	0x0b, 		(11)	iOutputTerminal: Index of a string descriptor, describing the terminal.

Mixer unit descriptor
101	0x1f, 		(31)	bLength
102	0x24, 		(36)	bDescriptorType
103	0x04, 		(4)	bDescriptorSubtype
104	0x06, 		(6)	bUnitID: Constant uniquely identifying the Unit within the audio function. This value is used in all requests to address this Unit.
105	0x02, 		(2)	bNrInPins: Number of Input Pins of this Unit: p
106	0x02, 		(2)	baSourceId: ID of the Unit or Terminal to which the first Input Pin of this Mixed Unit is connected
107	0x03, 		(3)	baSourceId: ID of the Unit or Terminal to which the first Input Pin of this Mixed Unit is connected
108	0x08, 0xff, 0x00, 0x00, 	(4294967048)	bmChannelConfig: Describes the spatial location of the logical channels.
112	0x00, 		(0)	iChannelNames: Index of a string descriptor, describing the name of the first logical channel.
113	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
114	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
115	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
116	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
117	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
118	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
119	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
120	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
121	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
122	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
123	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
124	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
125	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
126	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
127	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
128	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
129	0x00, 		(0)	bmMixerControls: Bit map indicating which Mixer Controls are programmable.
130	0x00, 		(0)	bmControls: D1..0: Cluster Control, D3..2: Underflow Control, D5..4: Overflow Control, D7..6: Reserved. Must be set to 0.
131	0x0c, 		(12)	iMixer: Index of String Descriptor Describing this interface

Standard audio interface descriptor
132	0x09, 		(9)	bLength
133	0x04, 		(4)	bDescriptorType
134	0x01, 		(1)	bInterfaceNumber: Number of AudioControl interface
135	0x00, 		(0)	bAlternateSetting: Value used to select alternative setting
136	0x00, 		(0)	bNumEndpoints: Number of Endpoints used for this interface
137	0x01, 		(1)	bDeviceClass: Class Code (Assigned by USB Org). If equal to Zero, each interface specifies its own class code. If equal to 0xFF, the class code is vendor specified. Otherwise field is valid Class Code.
138	0x02, 		(2)	bDeviceSubClass: Subclass Code (Assigned by USB Org)
139	0x20, 		(32)	bDeviceProtocol: Protocol Code (Assigned by USB Org)
140	0x0d, 		(13)	iInterface: Index of String Descriptor describing this interface

Standard audio interface descriptor
141	0x09, 		(9)	bLength
142	0x04, 		(4)	bDescriptorType
143	0x01, 		(1)	bInterfaceNumber: Number of AudioControl interface
144	0x01, 		(1)	bAlternateSetting: Value used to select alternative setting
145	0x01, 		(1)	bNumEndpoints: Number of Endpoints used for this interface
146	0x01, 		(1)	bDeviceClass: Class Code (Assigned by USB Org). If equal to Zero, each interface specifies its own class code. If equal to 0xFF, the class code is vendor specified. Otherwise field is valid Class Code.
147	0x02, 		(2)	bDeviceSubClass: Subclass Code (Assigned by USB Org)
148	0x20, 		(32)	bDeviceProtocol: Protocol Code (Assigned by USB Org)
149	0x0e, 		(14)	iInterface: Index of String Descriptor describing this interface

Audio streaming header descriptor
150	0x10, 		(16)	bLength
151	0x24, 		(36)	bDescriptorType
152	0x01, 		(1)	bDescriptorSubtype
153	0x02, 		(2)	bTerminalLink: The Terminal ID of the Terminal to which this interface is connected.
154	0x00, 		(0)	bmControls: D1..0: Active Alternate Setting Control, D3..2: Valid Alternate Settings Control, D7..4: Reserved. Must be set to 0.
155	0x01, 		(1)	bFormatType: Constant identifying the Format Type the AudioStreaming interface is using.
156	0x01, 0x00, 0x00, 0x00, 	(1)	bFormats: The Audio Data Format(s) that can be used to communicate with this interface. See the USB Audio Data Formats document for further details.
160	0x08, 		(8)	bNrChannels: Number of physical channels in the AS Interface audio channel cluster.
161	0xff, 0x00, 0x00, 0x00, 	(255)	bmChannelConfig: Describes the spatial location of the physical channels.
165	0x00, 		(0)	iChannelNames: Index of a string descriptor, describing the name of the first physical channel.

Audio streaming format descriptor
166	0x06, 		(6)	bLength
167	0x24, 		(36)	bDescriptorType
168	0x02, 		(2)	bDescriptorSubtype
169	0x01, 		(1)	bFormatType: FORMAT_TYPE_I. Constant identifying the Format Type the AudioStreaming interface is using.
170	0x04, 		(4)	bSubSlotSize: The number of bytes occupied by one audio subslot. Can be 1, 2, 3 or 4.
171	0x20, 		(32)	bBitResoultion: The number of effectively used bits from the available bits in an audio subslot.

Endpoint descriptor
172	0x07, 		(7)	bLength
173	0x05, 		(5)	bDescriptorType
174	0x01, 		(1)	bEndpointAddress: The address of the endpoint on the USB device described by this descriptor. The address is encoded as follows: Bit 3...0: The endpoint number, Bit 6...4: Reserved, reset to zero, Bit 7: Direction, ignored for control endpoints 0 = OUT endpoint
175	0x05, 		(5)	bmAttributes: This field describes the endpoints attributes when it is configured using the bConfigurationValue. Bits 1..0: Transfer Type, 00 = Control, 01 = Isochronous, 10 = Bulk, 11 = Interrupt. If not an isochronous endpoint, bits 5..2 are reserved and must be set to zero. If isochronous, they are defined as follows: Bits 3..2: Synchronization Type: 00 = No Synchronization, 01 = Asynchronous, 10 = Adaptive, 11 = Synchronous. Bits 5..4: Usage Type, 00 = Data endpoint, 01 = Feedback endpoint, 10 = Implicit feedback Data endpoint, 11 = Reserved.Refer to Chapter 5 for more information. All other bits are reserved and must be reset to zero. Reserved bits must be ignored by the host.
176	0xc0, 0x00, 	(192)	wMaxPacketSize: Maximum packet size this endpoint is capable of sending or receiving when this configuration is selected.
178	0x01, 		(1)	bInterval: Interval for polling endpoint for data transfers.

Audio data endpoint descriptor
179	0x08, 		(8)	bLength
180	0x25, 		(37)	bDescriptorType
181	0x01, 		(1)	bDescriptorSubtype
182	0x00, 		(0)	bmAttributes: Bit D7 indicates a requirement for wMaxPacketSize packets. D7: MaxPacketsOnly
183	0x00, 		(0)	bmControls: D1..0: Pitch Control, D3..2: Data Overrun Control, D5..4: Data Underrun Control, D7..6: Reserved. Must be set to 0.
184	0x02, 		(2)	bLockDelayUnits: Indicates the units used for the wLockDelay field: 0 = Undefined, 1 = Milliseconds, 2 = Decoded PCM samples, other = Reserved.
185	0x08, 0x00, 	(8)	wLockDelay: Indicates the time it takes this endpoint to reliably lock its internal clock recovery circuitry. Units used depend on the value of the bLockDelayUnits field.

Standard audio interface descriptor
187	0x09, 		(9)	bLength
188	0x04, 		(4)	bDescriptorType
189	0x02, 		(2)	bInterfaceNumber: Number of AudioControl interface
190	0x00, 		(0)	bAlternateSetting: Value used to select alternative setting
191	0x00, 		(0)	bNumEndpoints: Number of Endpoints used for this interface
192	0x01, 		(1)	bDeviceClass: Class Code (Assigned by USB Org). If equal to Zero, each interface specifies its own class code. If equal to 0xFF, the class code is vendor specified. Otherwise field is valid Class Code.
193	0x02, 		(2)	bDeviceSubClass: Subclass Code (Assigned by USB Org)
194	0x20, 		(32)	bDeviceProtocol: Protocol Code (Assigned by USB Org)
195	0x0f, 		(15)	iInterface: Index of String Descriptor describing this interface

Standard audio interface descriptor
196	0x09, 		(9)	bLength
197	0x04, 		(4)	bDescriptorType
198	0x02, 		(2)	bInterfaceNumber: Number of AudioControl interface
199	0x01, 		(1)	bAlternateSetting: Value used to select alternative setting
200	0x01, 		(1)	bNumEndpoints: Number of Endpoints used for this interface
201	0x01, 		(1)	bDeviceClass: Class Code (Assigned by USB Org). If equal to Zero, each interface specifies its own class code. If equal to 0xFF, the class code is vendor specified. Otherwise field is valid Class Code.
202	0x02, 		(2)	bDeviceSubClass: Subclass Code (Assigned by USB Org)
203	0x20, 		(32)	bDeviceProtocol: Protocol Code (Assigned by USB Org)
204	0x10, 		(16)	iInterface: Index of String Descriptor describing this interface

Audio streaming header descriptor
205	0x10, 		(16)	bLength
206	0x24, 		(36)	bDescriptorType
207	0x01, 		(1)	bDescriptorSubtype
208	0x04, 		(4)	bTerminalLink: The Terminal ID of the Terminal to which this interface is connected.
209	0x00, 		(0)	bmControls: D1..0: Active Alternate Setting Control, D3..2: Valid Alternate Settings Control, D7..4: Reserved. Must be set to 0.
210	0x01, 		(1)	bFormatType: Constant identifying the Format Type the AudioStreaming interface is using.
211	0x01, 0x00, 0x00, 0x00, 	(1)	bFormats: The Audio Data Format(s) that can be used to communicate with this interface. See the USB Audio Data Formats document for further details.
215	0x08, 		(8)	bNrChannels: Number of physical channels in the AS Interface audio channel cluster.
216	0xff, 0x00, 0x00, 0x00, 	(255)	bmChannelConfig: Describes the spatial location of the physical channels.
220	0x00, 		(0)	iChannelNames: Index of a string descriptor, describing the name of the first physical channel.

Audio streaming format descriptor
221	0x06, 		(6)	bLength
222	0x24, 		(36)	bDescriptorType
223	0x02, 		(2)	bDescriptorSubtype
224	0x01, 		(1)	bFormatType: FORMAT_TYPE_I. Constant identifying the Format Type the AudioStreaming interface is using.
225	0x04, 		(4)	bSubSlotSize: The number of bytes occupied by one audio subslot. Can be 1, 2, 3 or 4.
226	0x20, 		(32)	bBitResoultion: The number of effectively used bits from the available bits in an audio subslot.

Endpoint descriptor
227	0x07, 		(7)	bLength
228	0x05, 		(5)	bDescriptorType
229	0x02, 		(2)	bEndpointAddress: The address of the endpoint on the USB device described by this descriptor. The address is encoded as follows: Bit 3...0: The endpoint number, Bit 6...4: Reserved, reset to zero, Bit 7: Direction, ignored for control endpoints 0 = OUT endpoint
230	0x05, 		(5)	bmAttributes: This field describes the endpoints attributes when it is configured using the bConfigurationValue. Bits 1..0: Transfer Type, 00 = Control, 01 = Isochronous, 10 = Bulk, 11 = Interrupt. If not an isochronous endpoint, bits 5..2 are reserved and must be set to zero. If isochronous, they are defined as follows: Bits 3..2: Synchronization Type: 00 = No Synchronization, 01 = Asynchronous, 10 = Adaptive, 11 = Synchronous. Bits 5..4: Usage Type, 00 = Data endpoint, 01 = Feedback endpoint, 10 = Implicit feedback Data endpoint, 11 = Reserved.Refer to Chapter 5 for more information. All other bits are reserved and must be reset to zero. Reserved bits must be ignored by the host.
231	0xc0, 0x00, 	(192)	wMaxPacketSize: Maximum packet size this endpoint is capable of sending or receiving when this configuration is selected.
233	0x01, 		(1)	bInterval: Interval for polling endpoint for data transfers.

Audio data endpoint descriptor
234	0x08, 		(8)	bLength
235	0x25, 		(37)	bDescriptorType
236	0x01, 		(1)	bDescriptorSubtype
237	0x00, 		(0)	bmAttributes: Bit D7 indicates a requirement for wMaxPacketSize packets. D7: MaxPacketsOnly
238	0x00, 		(0)	bmControls: D1..0: Pitch Control, D3..2: Data Overrun Control, D5..4: Data Underrun Control, D7..6: Reserved. Must be set to 0.
239	0x02, 		(2)	bLockDelayUnits: Indicates the units used for the wLockDelay field: 0 = Undefined, 1 = Milliseconds, 2 = Decoded PCM samples, other = Reserved.
240	0x00, 0x08, 	(2048)	wLockDelay: Indicates the time it takes this endpoint to reliably lock its internal clock recovery circuitry. Units used depend on the value of the bLockDelayUnits field.

Descriptor length: 242 bytes
It looks fine at the first glance.

Indeed, it's confusing, that wireshark still dumps this weird error. I never had this case. Under Linux there are the first uac control requests logged. That's a good start point for debugging and/or logging in your code.
Alinavox
Junior Member
Posts: 6
Joined: Sun Feb 04, 2018 11:58 pm

Post by Alinavox »

Hi folks, I need help pinpointing a problem within or after the USB enumeration process with Win10 (using usbaudio2.sys driver). I am developing a software for the XU208-128-QF48-C10 which should get an 8-channel audio stream via usb and via tdm, mix them, and send the result via usb back to the host and via tdm to a DAC. Additionally it should receive and send MIDI data via usb from and to the host. USB should use audio class 2 and HS for the connection. I use the latest xud library (v2.1.0) and the sw_usb_audio_6.15.2 sample as a template. When testing, the host issues an 'URB_FUNCTION_ABORT_PIPE' (recorded with wireshark, see below) within or after the enumeration process with no communication afterwards. I can't pinpoint why the host behaves like this, thus this post :) Following a screenshot from Wireshark. I guess the bulk data transfer at the start comes from the flashing process: Following my usb device and config descriptors: Code: Select all#ifndef _USB_DESCRIPTORS_H_ #define _USB_DESCRIPTORS_H_ #include "config.h" #include &lt;stdint.h&gt; #include "descriptor_audio_def.h" #include "descriptor_std_def.h" #include "descriptor_values.h" #include "usb_enum.h" #ifndef USB_BCD_DEVICE #define USB_BCD_DEVICE 0x0000 #warning BCD_DEVICE not defined, falling back to 0x0000 #endif #ifndef USB_LANG_ID #define USB_LANG_ID "\x09\x04" #warning LANG_ID nod defined, falling back to US English #endif #ifndef USB_PRODUCT_ID #define USB_PRODUCT_ID 0x0011 #warning PRODUCT_ID not defined, falling back to 0x0001 #endif #ifndef USB_VENDOR_ID #define USB_VENDOR_ID 0x20B1 #warning VENDOR_ID not defined, falling back to XMOS vendor ID #endif #define MIDI_LENGTH 92 #define RESOLUTION_BITS 32 #define MAX_FREQ 48000 #define NUM_USB_CHANS 8 #define USB_SUBSLOT_SIZE 4 // (MAX_FREQ + 7999) to guarantee rounding up // / 8000 to calculate Packet Size per USB Microframe (125us) // +1 to accomodate for accumulation of 'rounding error' // (NUM_USB_CHANS * USB_SUBSLOT_SIZE) get the size of one Frame in Bytes #define USB_MAX_PACKET_SIZE_HS ((((MAX_FREQ + 7999)/8000)+1) * (NUM_USB_CHANS * USB_SUBSLOT_SIZE)) enum USB_STRING_DESC_INDEX { USB_CONFIG_STR_INDEX = 1, USB_MANUFACTURER_STR_INDEX, USB_PRODUCT_STR_INDEX, USB_SERIAL_NO_STR_INDEX, USB_AUDIO_FUNCTION_STR_INDEX, USB_AUDIO_CTRL_IF_STR_INDEX, USB_AUDIO_CLOCK_SRC_STR_INDEX, USB_AUDIO_USB_FROM_HOST_STR_INDEX, USB_AUDIO_TDM_FROM_DAC_STR_INDEX, USB_AUDIO_USB_TO_HOST_STR_INDEX, USB_AUDIO_TDM_TO_DAC_STR_INDEX, USB_AUDIO_MIXER_STR_INDEX, USB_AUDIO_FROM_HOST_STREAM_ALT0_STR_INDEX, USB_AUDIO_FROM_HOST_STREAM_ALT1_STR_INDEX, USB_AUDIO_TO_HOST_STREAM_ALT0_STR_INDEX, USB_AUDIO_TO_HOST_STREAM_ALT1_STR_INDEX, USB_MIDI_FROM_HOST_JACK_STR_INDEX, USB_MIDI_FROM_ESP_JACK_STR_INDEX, USB_MIDI_TO_HOST_JACK_STR_INDEX, USB_MIDI_TO_ESP_JACK_STR_INDEX, }; // USB String descriptor for the Device static char *usb_stringDescriptors[] = { USB_LANG_ID, // Language ID string (US English) USB_CONFIG_DESC, // iConfiguration USB_MANUFACTURER_DESC, // iManufacturer USB_PRODUCT_DESC, // iProduct USB_SERIAL_NO_DESC, // iSerial USB_AUDIO_FUNCTION_DESC, // iFunction USB_AUDIO_CTRL_IF_DESC, USB_AUDIO_CLOCK_SRC_DESC, USB_AUDIO_USB_FROM_HOST_DESC, USB_AUDIO_TDM_FROM_DAC_DESC, USB_AUDIO_USB_TO_HOST_DESC, USB_AUDIO_TDM_TO_DAC_DESC, USB_AUDIO_MIXER_DESC, USB_AUDIO_FROM_HOST_STREAM_ALT0_DESC, USB_AUDIO_FROM_HOST_STREAM_ALT1_DESC, USB_AUDIO_TO_HOST_STREAM_ALT0_DESC, USB_AUDIO_TO_HOST_STREAM_ALT1_DESC, USB_MIDI_FROM_HOST_JACK_DESC, USB_MIDI_FROM_ESP_JACK_DESC, USB_MIDI_TO_HOST_JACK_DESC, USB_MIDI_TO_ESP_JACK_DESC, }; USB_Descriptor_Dev_t devDesc_Audio = { // OK with Sample .bLength = sizeof(USB_Descriptor_Dev_t), .bDescriptorType = USB_DESCTYPE_DEVICE, .bcdUSB = USB_BCD_2, .bDeviceClass = 0xEF, .bDeviceSubClass = 0x02, .bDeviceProtocol = 0x01, .bMaxPacketSize0 = 64, .idVendor = USB_VENDOR_ID, .idProduct = USB_PRODUCT_ID, .bcdDevice = USB_BCD_DEVICE, .iManufacturer = USB_MANUFACTURER_STR_INDEX, .iProduct = USB_PRODUCT_STR_INDEX, .iSerialNumber = USB_SERIAL_NO_STR_INDEX, .bNumConfigurations = 0x02, // SAMPLE: Set to 2 such that windows does not load composite driver }; typedef struct { USB_Descriptor_Cfg_t cfg_header; USB_Descriptor_IF_Association_t interface_association; // Audio Control Interface USB_Descriptor_IF_t audio_control_std_interface; USB_Audio_Descriptor_IF_AC_t audio_control_class_interface; USB_Audio_Descriptor_Clock_Source_t bclk_source_unit; USB_Audio_Descriptor_Input_Terminal_t usb_from_host_input_terminal; USB_Audio_Descriptor_Input_Terminal_t tdm_from_adc_input_terminal_desc; USB_Audio_Descriptor_Output_Terminal_t usb_to_host_output_terminal; USB_Audio_Descriptor_Output_Terminal_t tdm_to_dac_output_terminal; USB_Audio_Descriptor_Mixer_t mixer_unit; // Audio Stream Interface 1 (Host to Device) USB_Descriptor_IF_t audio_stream_from_host_alt0_std_interface; USB_Descriptor_IF_t audio_stream_from_host_alt1_std_interface; USB_Audio_Descriptor_IF_AS_t audio_stream_from_host_class_interface; USB_Audio_Descriptor_Format_1_t audio_stream_form_host_format; USB_Descriptor_EP_t audio_stream_from_host_std_endpoint; USB_Audio_Descriptor_EP_AS_t audio_stream_from_host_class_endpoint; // Audio Stream Interface 2 (Device to Host) USB_Descriptor_IF_t audio_stream_to_host_alt0_std_interface; USB_Descriptor_IF_t audio_stream_to_host_alt1_std_interface; USB_Audio_Descriptor_IF_AS_t audio_stream_to_host_class_interface; USB_Audio_Descriptor_Format_1_t audio_stream_to_host_format; USB_Descriptor_EP_t audio_stream_to_host_std_endpoint; USB_Audio_Descriptor_EP_AS_t audio_stream_to_host_class_endpoint; // MIDI uint8_t configDesc_Midi[MIDI_LENGTH]; } cfg_descriptor; #define USB_AUDIO_CLASS_INTERFACE_LENGTH ( \ sizeof(USB_Audio_Descriptor_IF_AC_t) \ + sizeof(USB_Audio_Descriptor_Clock_Source_t) \ + sizeof(USB_Audio_Descriptor_Input_Terminal_t) \ + sizeof(USB_Audio_Descriptor_Input_Terminal_t) \ + sizeof(USB_Audio_Descriptor_Output_Terminal_t) \ + sizeof(USB_Audio_Descriptor_Output_Terminal_t) \ + sizeof(USB_Audio_Descriptor_Mixer_t) \ ) #define USB_MIDI_CLASS_AC_INTERFACE_LENGTH ( \ sizeof(USB_MIDI_Descriptor_IF_AC_t) \ ) #define USB_CFG_LENGTH ( \ sizeof(USB_Descriptor_Cfg_t) \ + sizeof(USB_Descriptor_IF_Association_t) \ + sizeof(USB_Descriptor_IF_t) \ + USB_AUDIO_CLASS_INTERFACE_LENGTH \ /* USB Audio IN (From Host) */ \ + sizeof(USB_Descriptor_IF_t) \ + sizeof(USB_Descriptor_IF_t) \ + sizeof(USB_Audio_Descriptor_IF_AS_t) \ + sizeof(USB_Audio_Descriptor_Format_1_t) \ + sizeof(USB_Descriptor_EP_t) \ + sizeof(USB_Audio_Descriptor_EP_AS_t) \ /* USB Audio Out (To Host) */ \ + sizeof(USB_Descriptor_IF_t) \ + sizeof(USB_Descriptor_IF_t) \ + sizeof(USB_Audio_Descriptor_IF_AS_t) \ + sizeof(USB_Audio_Descriptor_Format_1_t) \ + sizeof(USB_Descriptor_EP_t) \ + sizeof(USB_Audio_Descriptor_EP_AS_t) \ /* USB MIDI */ \ + MIDI_LENGTH \ ) cfg_descriptor cfgDesc_Audio = { // OK with Sample .cfg_header = { .bLength = (uint8_t)sizeof(USB_Descriptor_Cfg_t), .bDescriptorType = USB_DESCTYPE_CONFIGURATION, .wTotalLength = USB_CFG_LENGTH, .bNumInterfaces = USB_INTERFACE_COUNT, .bConfigurationValue = 1, .iConfiguration = USB_CONFIG_STR_INDEX, #ifdef SELF_POWERED .bmAttributes = 0xC0, #else .bmAttributes = 0x80, #endif .bMaxPower = BMAX_POWER, }, .interface_association = { // OK with Sample .bLength = (uint8_t)sizeof(USB_Descriptor_IF_Association_t), .bDescriptorType = USB_DESCTYPE_INTERFACE_ASSOCIATION, .bFirstInterface = 0x00, .bInterfaceCount = USB_INTERFACE_COUNT, .bFunctionClass = USB_INTERFACE_CLASS_AUDIO, .bFunctionSubClass = USB_INTERFACE_SUBCLASS_UNDEFINED, .bFunctionProtocol = USB_INTERFACE_PROTOCOL_2, .iFunction = USB_AUDIO_FUNCTION_STR_INDEX, }, .audio_control_std_interface = { // OK with Sample .bLength = (uint8_t)sizeof(USB_Descriptor_IF_t), .bDescriptorType = USB_DESCTYPE_INTERFACE, .bInterfaceNumber = USB_INTERFACE_NUMBER_AUDIO_CONTROL, .bAlternateSetting = 0x00, // must be 0 for AC .bNumEndpoints = 0x00, // EP 0 is not counted here .bInterfaceClass = USB_INTERFACE_CLASS_AUDIO, .bInterfaceSubClass = USB_INTERFACE_SUBCLASS_CONTROL, .bInterfaceProtocol = USB_INTERFACE_PROTOCOL_2, .iInterface = USB_AUDIO_CTRL_IF_STR_INDEX, }, .audio_control_class_interface = { // OK with Sample .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_IF_AC_t), .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE, .bDescriptorSubtype = USB_AUDIO_IF_AC_SUBTYPE_HEADER, .bcdADC = 0x0200, // compliant with USB2 .bCategory = 0x0A, // Pro Audio .wTotalLength = USB_AUDIO_CLASS_INTERFACE_LENGTH, .bmControls = 0x00, }, .bclk_source_unit = { // OK with Sample .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_Clock_Source_t), .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE, .bDescriptorSubtype = USB_AUDIO_IF_AC_SUBTYPE_CLOCK_SOURCE, .bClockID = USB_ID_BCLK, .bmAttributes = 0x00, .bmControls = 0x00, // SAMPLE: 0x07 .bAssocTerminal = USB_ID_NONE, .iClockSource = USB_AUDIO_CLOCK_SRC_STR_INDEX, }, .usb_from_host_input_terminal = { // OK with Sample .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_Input_Terminal_t), .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE, .bDescriptorSubtype = USB_AUDIO_IF_AC_SUBTYPE_INPUT_TERMINAL, .bTerminalID = USB_ID_USB_FROM_HOST, .wTerminalType = 0x0101, // USB Streaming .bAssocTerminal = 0x00, .bCSourceID = USB_ID_BCLK, .audio_cluster = { .bNrChannels = NUM_USB_CHANS, .bmChannelConfig = 0x000000FF, .iChannelNames = 0, }, .bmControls = 0x0000, .iTerminal = USB_AUDIO_USB_FROM_HOST_STR_INDEX, }, .tdm_from_adc_input_terminal_desc = { // OK with Sample .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_Input_Terminal_t), .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE, .bDescriptorSubtype = USB_AUDIO_IF_AC_SUBTYPE_INPUT_TERMINAL, .bTerminalID = USB_ID_TDM_FROM_ADC, .wTerminalType = 0x0200, // Input undefined .bAssocTerminal = 0x00, .bCSourceID = USB_ID_BCLK, .audio_cluster = { .bNrChannels = NUM_USB_CHANS, .bmChannelConfig = 0x000000FF, .iChannelNames = 0, }, .bmControls = 0x0000, .iTerminal = USB_AUDIO_TDM_FROM_DAC_STR_INDEX, }, .usb_to_host_output_terminal = { // OK with Sample .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_Output_Terminal_t), .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE, .bDescriptorSubtype = USB_AUDIO_IF_AC_SUBTYPE_OUTPUT_TERMINAL, .bTerminalID = USB_ID_USB_TO_HOST, .wTerminalType = 0x0101, // USB Streaming .bAssocTerminal = 0, .bSourceID = USB_ID_MIXER, .bCSourceID = USB_ID_BCLK, .bmControls = 0, .iTerminal = USB_AUDIO_USB_TO_HOST_STR_INDEX, }, .tdm_to_dac_output_terminal = { // OK with Sample .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_Output_Terminal_t), .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE, .bDescriptorSubtype = USB_AUDIO_IF_AC_SUBTYPE_OUTPUT_TERMINAL, .bTerminalID = USB_ID_TDM_FROM_ADC, .wTerminalType = 0x0301, // Output to Speaker .bAssocTerminal = 0, .bSourceID = USB_ID_MIXER, .bCSourceID = USB_ID_BCLK, .bmControls = 0, .iTerminal = USB_AUDIO_TDM_TO_DAC_STR_INDEX, }, .mixer_unit = { .bLength = sizeof(USB_Audio_Descriptor_Mixer_t), .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE, .bDescriptorSubtype = USB_AUDIO_IF_AC_SUBTYPE_MIXER_UNIT, .bUnitID = USB_ID_MIXER, // Unique Unit-ID of the Terminal .bNrInPins = 2, // Number of Input Pins of this unit .baSourceID1 = USB_ID_USB_FROM_HOST, .baSourceID2 = USB_ID_TDM_FROM_ADC, .audio_cluster = { .bNrChannels = NUM_USB_CHANS, .bmChannelConfig = 0x000000FF, .iChannelNames = 0, }, .bmMixerControlsInput1 = 0x0000000000000000, .bmMixerControlsInput2 = 0x0000000000000000, .bmControls = 0, .iMixer = USB_AUDIO_MIXER_STR_INDEX, }, /* USB Stream from Host */ .audio_stream_from_host_alt0_std_interface = { // OK with Sample .bLength = (uint8_t)sizeof(USB_Descriptor_IF_t), .bDescriptorType = USB_DESCTYPE_INTERFACE, .bInterfaceNumber = USB_INTERFACE_NUMBER_AUDIO_FROM_HOST, .bAlternateSetting = 0, .bNumEndpoints = 0, .bInterfaceClass = USB_INTERFACE_CLASS_AUDIO, .bInterfaceSubClass = USB_INTERFACE_SUBCLASS_STREAMING, .bInterfaceProtocol = USB_INTERFACE_PROTOCOL_2, .iInterface = USB_AUDIO_FROM_HOST_STREAM_ALT0_STR_INDEX, }, .audio_stream_from_host_alt1_std_interface = { // OK with Sample .bLength = (uint8_t)sizeof(USB_Descriptor_IF_t), .bDescriptorType = USB_DESCTYPE_INTERFACE, .bInterfaceNumber = USB_INTERFACE_NUMBER_AUDIO_FROM_HOST, .bAlternateSetting = 1, .bNumEndpoints = 1, .bInterfaceClass = USB_INTERFACE_CLASS_AUDIO, .bInterfaceSubClass = USB_INTERFACE_SUBCLASS_STREAMING, .bInterfaceProtocol = USB_INTERFACE_PROTOCOL_2, .iInterface = USB_AUDIO_FROM_HOST_STREAM_ALT1_STR_INDEX, }, .audio_stream_from_host_class_interface = { // OK with Sample .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_IF_AS_t), .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE, .bDescriptorSubType = USB_AUDIO_IF_AS_SUBTYPE_GENERAL, .bTerminalLink = USB_ID_USB_FROM_HOST, .bmControls = 0x00, .bFormatType = 0x01, .bmFormats = 0x00000001, .audio_cluster = { .bNrChannels = NUM_USB_CHANS, .bmChannelConfig = 0x000000FF, .iChannelNames = 0x00, }, }, .audio_stream_form_host_format = { // OK with Sample .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_Format_1_t), .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE, .bDescriptorSubtype = USB_AUDIO_IF_AS_SUBTYPE_FORMAT_TYPE, .bFormatType = 1, .bSubSlotSize = USB_SUBSLOT_SIZE, .bBitResolution = RESOLUTION_BITS, }, .audio_stream_from_host_std_endpoint = { // OK with Sample .bLength = (uint8_t) sizeof(USB_Descriptor_EP_t), .bDescriptorType = USB_DESCTYPE_ENDPOINT, .bEndpointAddress = 1, .bmAttributes = 0x05, .wMaxPacketSize = (uint16_t)USB_MAX_PACKET_SIZE_HS, .bInterval = 1, }, .audio_stream_from_host_class_endpoint = { // OK with Sample .bLength = (uint8_t) sizeof(USB_Audio_Descriptor_EP_AS_t), .bDescriptorType = USB_AUDIO_DESCTYPE_ENDPOINT, .bDescriptorSubtype = USB_AUDIO_IF_AS_SUBTYPE_GENERAL, .bmAttributes = 0x00, .bmControls = 0x00, .bLockDelayUnits = 0x02, .wLockDelay = 0x0008, }, /* USB Stream To Host */ .audio_stream_to_host_alt0_std_interface = { // OK with Sample .bLength = (uint8_t)sizeof(USB_Descriptor_IF_t), .bDescriptorType = USB_DESCTYPE_INTERFACE, .bInterfaceNumber = USB_INTERFACE_NUMBER_AUDIO_TO_HOST, .bAlternateSetting = 0, .bNumEndpoints = 0, .bInterfaceClass = USB_INTERFACE_CLASS_AUDIO, .bInterfaceSubClass = USB_INTERFACE_SUBCLASS_STREAMING, .bInterfaceProtocol = USB_INTERFACE_PROTOCOL_2, .iInterface = USB_AUDIO_TO_HOST_STREAM_ALT0_STR_INDEX, }, .audio_stream_to_host_alt1_std_interface = { // OK with Sample .bLength = (uint8_t)sizeof(USB_Descriptor_IF_t), .bDescriptorType = USB_DESCTYPE_INTERFACE, .bInterfaceNumber = USB_INTERFACE_NUMBER_AUDIO_TO_HOST, .bAlternateSetting = 1, .bNumEndpoints = 1, .bInterfaceClass = USB_INTERFACE_CLASS_AUDIO, .bInterfaceSubClass = USB_INTERFACE_SUBCLASS_STREAMING, .bInterfaceProtocol = USB_INTERFACE_PROTOCOL_2, .iInterface = USB_AUDIO_TO_HOST_STREAM_ALT1_STR_INDEX, }, .audio_stream_to_host_class_interface = { // OK with Sample .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_IF_AS_t), .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE, .bDescriptorSubType = USB_AUDIO_IF_AS_SUBTYPE_GENERAL, .bTerminalLink = USB_ID_USB_TO_HOST, .bmControls = 0, .bFormatType = 1, .bmFormats = 0x00000001, .audio_cluster = { .bNrChannels = NUM_USB_CHANS, .bmChannelConfig = 0x000000FF, .iChannelNames = 0x00, }, }, .audio_stream_to_host_format = { // OK with Sample .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_Format_1_t), .bDescriptorType = USB_AUDIO_DESCTYPE_INTERFACE, .bDescriptorSubtype = USB_AUDIO_IF_AS_SUBTYPE_FORMAT_TYPE, .bFormatType = 1, .bSubSlotSize = USB_SUBSLOT_SIZE, .bBitResolution = RESOLUTION_BITS, }, .audio_stream_to_host_std_endpoint = { // OK with Sample .bLength = (uint8_t)sizeof(USB_Descriptor_EP_t), .bDescriptorType = USB_DESCTYPE_ENDPOINT, .bEndpointAddress = 1, .bmAttributes = 0x05, // SAMPLE: 0x25: Iso, async, implicit feedback data endpoint .wMaxPacketSize = USB_MAX_PACKET_SIZE_HS, .bInterval = 0x01, }, .audio_stream_to_host_class_endpoint = { // OK with Sample .bLength = (uint8_t)sizeof(USB_Audio_Descriptor_EP_AS_t), .bDescriptorType = USB_AUDIO_DESCTYPE_ENDPOINT, .bDescriptorSubtype = USB_AUDIO_IF_AS_SUBTYPE_GENERAL, .bmAttributes = 0, .bmControls = 0, .bLockDelayUnits = 02, .wLockDelay = 0x0008, }, // MIDI (taken from sample) /* MIDI Descriptors */ /* Table B-3: MIDI Adapter Standard AC Interface Descriptor */ {0x09, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */ 0x04, /* 1 bDescriptorType : INTERFACE descriptor. (field size 1 bytes) */ USB_INTERFACE_NUMBER_MIDI_CONTROL, /* 2 bInterfaceNumber : Index of this interface. (field size 1 bytes) */ 0x00, /* 3 bAlternateSetting : Index of this setting. (field size 1 bytes) */ 0x00, /* 4 bNumEndpoints : 0 endpoints. (field size 1 bytes) */ 0x01, /* 5 bInterfaceClass : AUDIO. (field size 1 bytes) */ 0x01, /* 6 bInterfaceSubclass : AUDIO_CONTROL. (field size 1 bytes) */ 0x00, /* 7 bInterfaceProtocol : Unused. (field size 1 bytes) */ 0x00, /* 8 iInterface : Unused. (field size 1 bytes) */ /* Table B-4: MIDI Adapter Class-specific AC Interface Descriptor */ 0x09, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */ 0x24, /* 1 bDescriptorType : 0x24. (field size 1 bytes) */ 0x01, /* 2 bDescriptorSubtype : HEADER subtype. (field size 1 bytes) */ 0x00, /* 3 bcdADC : Revision of class specification - 1.0 (field size 2 bytes) */ 0x01, /* 4 bcdADC */ 0x09, /* 5 wTotalLength : Total size of class specific descriptors. (field size 2 bytes) */ 0x00, /* 6 wTotalLength */ 0x01, /* 7 bInCollection : Number of streaming interfaces. (field size 1 bytes) */ 0x01, /* 8 baInterfaceNr(1) : MIDIStreaming interface 1 belongs to this AudioControl interface */ /* Table B-5: MIDI Adapter Standard MS Interface Descriptor */ 0x09, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */ 0x04, /* 1 bDescriptorType : INTERFACE descriptor. (field size 1 bytes) */ USB_INTERFACE_NUMBER_MIDI_STREAM, /* 2 bInterfaceNumber : Index of this interface. (field size 1 bytes) */ 0x00, /* 3 bAlternateSetting : Index of this alternate setting. (field size 1 bytes) */ 0x02, /* 4 bNumEndpoints : 2 endpoints. (field size 1 bytes) */ 0x01, /* 5 bInterfaceClass : AUDIO. (field size 1 bytes) */ 0x03, /* 6 bInterfaceSubclass : MIDISTREAMING. (field size 1 bytes) */ 0x00, /* 7 bInterfaceProtocol : Unused. (field size 1 bytes) */ 0x00, /* 8 iInterface : Unused. (field size 1 bytes) */ /* Table B-6: MIDI Adapter Class-specific MS Interface Descriptor */ 0x07, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */ 0x24, /* 1 bDescriptorType : CS_INTERFACE. (field size 1 bytes) */ 0x01, /* 2 bDescriptorSubtype : MS_HEADER subtype. (field size 1 bytes) */ 0x00, /* 3 BcdADC : Revision of this class specification. (field size 2 bytes) */ 0x01, /* 4 BcdADC */ 0x41, /* 5 wTotalLength : Total size of class-specific descriptors. (field size 2 bytes) */ 0x00, /* 6 wTotalLength */ /* Table B-7: MIDI Adapter MIDI IN Jack Descriptor (Embedded) */ 0x06, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */ 0x24, /* 1 bDescriptorType : CS_INTERFACE. (field size 1 bytes) */ 0x02, /* 2 bDescriptorSubtype : MIDI_IN_JACK subtype. (field size 1 bytes) */ 0x01, /* 3 bJackType : EMBEDDED. (field size 1 bytes) */ 0x01, /* 4 bJackID : ID of this Jack. (field size 1 bytes) */ 0x00, /* 5 iJack : Unused. (field size 1 bytes) */ /* Table B-8: MIDI Adapter MIDI IN Jack Descriptor (External) */ 0x06, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */ 0x24, /* 1 bDescriptorType : CS_INTERFACE. (field size 1 bytes) */ 0x02, /* 2 bDescriptorSubtype : MIDI_IN_JACK subtype. (field size 1 bytes) */ 0x02, /* 3 bJackType : EXTERNAL. (field size 1 bytes) */ 0x02, /* 4 bJackID : ID of this Jack. (field size 1 bytes) */ USB_MIDI_FROM_ESP_JACK_STR_INDEX, /* 5 iJack : Unused. (field size 1 bytes) */ /* Table B-9: MIDI Adapter MIDI OUT Jack Descriptor (Embedded) */ 0x09, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */ 0x24, /* 1 bDescriptorType : CS_INTERFACE. (field size 1 bytes) */ 0x03, /* 2 bDescriptorSubtype : MIDI_OUT_JACK subtype. (field size 1 bytes) */ 0x01, /* 3 bJackType : EMBEDDED. (field size 1 bytes) */ 0x03, /* 4 bJackID : ID of this Jack. (field size 1 bytes) */ 0x01, /* 5 bNrInputPins : Number of Input Pins of this Jack. (field size 1 bytes) */ 0x02, /* 6 BaSourceID(1) : ID of the Entity to which this Pin is connected. (field size 1 bytes) */ 0x01, /* 7 BaSourcePin(1) : Output Pin number of the Entityt o which this Input Pin is connected. */ 0x00, /* 8 iJack : Unused. (field size 1 bytes) */ /* Table B-10: MIDI Adapter MIDI OUT Jack Descriptor (External) */ 0x09, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */ 0x24, /* 1 bDescriptorType : CS_INTERFACE. (field size 1 bytes) */ 0x03, /* 2 bDescriptorSubtype : MIDI_OUT_JACK subtype. (field size 1 bytes) */ 0x02, /* 3 bJackType : EXTERNAL. (field size 1 bytes) */ 0x04, /* 4 bJackID : ID of this Jack. (field size 1 bytes) */ 0x01, /* 5 bNrInputPins : Number of Input Pins of this Jack. (field size 1 bytes) */ 0x01, /* 6 BaSourceID(1) : ID of the Entity to which this Pin is connected. (field size 1 bytes) */ 0x01, /* 7 BaSourcePin(1) : Output Pin number of the Entity to which this Input Pin is connected. */ USB_MIDI_TO_ESP_JACK_STR_INDEX, /* 5 iJack : Unused. (field size 1 bytes) */ /* Table B-11: MIDI Adapter Standard Bulk OUT Endpoint Descriptor */ 0x09, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */ 0x05, /* 1 bDescriptorType : ENDPOINT descriptor. (field size 1 bytes) */ USB_ENDPOINT_NUMBER_MIDI_TO_HOST, /* 2 bEndpointAddress : OUT Endpoint 3. (field size 1 bytes) */ 0x02, /* 3 bmAttributes : Bulk, not shared. (field size 1 bytes) */ 0x00, /* 4 wMaxPacketSize : 512 bytes per packet. (field size 2 bytes) - has to be 0x200 for compliance*/ 0x02, /* 5 wMaxPacketSize */ 0x00, /* 6 bInterval : Ignored for Bulk. Set to zero. (field size 1 bytes) */ 0x00, /* 7 bRefresh : Unused. (field size 1 bytes) */ 0x00, /* 8 bSynchAddress : Unused. (field size 1 bytes) */ /* Table B-12: MIDI Adapter Class-specific Bulk OUT Endpoint Descriptor */ 0x05, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */ 0x25, /* 1 bDescriptorType : CS_ENDPOINT descriptor (field size 1 bytes) */ 0x01, /* 2 bDescriptorSubtype : MS_GENERAL subtype. (field size 1 bytes) */ 0x01, /* 3 bNumEmbMIDIJack : Number of embedded MIDI IN Jacks. (field size 1 bytes) */ 0x01, /* 4 BaAssocJackID(1) : ID of the Embedded MIDI IN Jack. (field size 1 bytes) */ /* Table B-13: MIDI Adapter Standard Bulk IN Endpoint Descriptor */ 0x09, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */ 0x05, /* 1 bDescriptorType : ENDPOINT descriptor. (field size 1 bytes) */ USB_ENDPOINT_NUMBER_MIDI_FROM_HOST, /* 2 bEndpointAddress : IN Endpoint 3. (field size 1 bytes) */ 0x02, /* 3 bmAttributes : Bulk, not shared. (field size 1 bytes) */ 0x00, /* 4 wMaxPacketSize : 512 bytes per packet. (field size 2 bytes) - has to be 0x200 for compliance*/ 0x02, /* 5 wMaxPacketSize */ 0x00, /* 6 bInterval : Ignored for Bulk. Set to zero. (field size 1 bytes) */ 0x00, /* 7 bRefresh : Unused. (field size 1 bytes) */ 0x00, /* 8 bSynchAddress : Unused. (field size 1 bytes) */ /* Table B-14: MIDI Adapter Class-specific Bulk IN Endpoint Descriptor */ 0x05, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */ 0x25, /* 1 bDescriptorType : CS_ENDPOINT descriptor (field size 1 bytes) */ 0x01, /* 2 bDescriptorSubtype : MS_GENERAL subtype. (field size 1 bytes) */ 0x01, /* 3 bNumEmbMIDIJack : Number of embedded MIDI OUT Jacks. (field size 1 bytes) */ 0x03, /* 4 BaAssocJackID(1) : ID of the Embedded MIDI OUT Jack. (field size 1 bytes) */ }, };

You it is serious?
friguly
Junior Member
Posts: 6
Joined: Fri Jun 24, 2022 7:13 am

Post by friguly »

Sorry for the late response! :)

@Alinavox: Can you be more precise in what you mean?
----------------------------------------------------------------------------
I played with the descriptors and with the endpoint0 replies a bit and ended up trying to get a simple device to work which just forwards an audio streams from the host to a speaker. The audio stream should be 8 channel PCM with 32 bit resolution and a sample rate of 48KHz. I focused on a linux host for now, because there I got the most verbose output.

The usb descriptor I wrote is the following:

Code: Select all

    =========================== USB Port4 ===========================

Connection Status        : 0x01 (Device is connected)
Port Chain               : 3-3-2-4
Properties               : 0x01
 IsUserConnectable       : yes
 PortIsDebugCapable      : no
 PortHasMultiCompanions  : no
 PortConnectorIsTypeC    : no
ConnectionIndex          : 0x04 (Port 4)
CompanionIndex           : 0
 CompanionHubSymLnk      : USB#VID_2109&PID_0813#6&bec8b8d&0&2#{f18a0e88-c30c-11d0-8815-00a0c906bed8}
 CompanionPortNumber     : 0x04 (Port 4)
 -> CompanionPortChain   : 3-7-2-4

      ========================== Summary =========================
Vendor ID                : 0x20B1 (XMOS Ltd.)
Product ID               : 0x000B
USB Version              : 2.00
Port maximum Speed       : High-Speed (Companion Port 3-7-2-4 supports SuperSpeed)
Device maximum Speed     : High-Speed
Device Connection Speed  : High-Speed
Self powered             : no
Demanded Current         : 500 mA
Used Endpoints           : 1

      ======================== USB Device ========================

        +++++++++++++++++ Device Information ++++++++++++++++++
Device Description       : USB-Verbundgerät
Device Path              : \\?\USB#VID_20B1&PID_000B#0_0_11#{a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE)
Kernel Name              : \Device\USBPDO-10
Device ID                : USB\VID_20B1&PID_000B\0_0_11
Hardware IDs             : USB\VID_20B1&PID_000B&REV_0100 USB\VID_20B1&PID_000B
Driver KeyName           : {36fc9e60-c465-11cf-8056-444553540000}\0067 (GUID_DEVCLASS_USB)
Driver                   : \SystemRoot\System32\drivers\usbccgp.sys (Version: 10.0.19041.1806  Date: 2022-06-30)
Driver Inf               : C:\Windows\inf\usb.inf
Legacy BusType           : PNPBus
Class                    : USB
Class GUID               : {36fc9e60-c465-11cf-8056-444553540000} (GUID_DEVCLASS_USB)
Service                  : usbccgp
Enumerator               : USB
Location Info            : Port_#0004.Hub_#0006
Location IDs             : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(3)#USB(2)#USB(4), ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HSP3)#USB(2)#USB(4)
Container ID             : {aa06c6be-3946-51c4-8817-563814626d6f}
Manufacturer Info        : (Standard-USB-Hostcontroller)
Capabilities             : 0x94 (Removable, UniqueID, SurpriseRemovalOK)
Status                   : 0x0180600A (DN_DRIVER_LOADED, DN_STARTED, DN_DISABLEABLE, DN_REMOVABLE, DN_NT_ENUMERATOR, DN_NT_DRIVER)
Problem Code             : 0
Address                  : 4
HcDisableSelectiveSuspend: 0
EnableSelectiveSuspend   : 0
SelectiveSuspendEnabled  : 0
EnhancedPowerMgmtEnabled : 0
IdleInWorkingState       : 0
WakeFromSleepState       : 0
Power State              : D3 (supported: D0, D2, D3, wake from D0, wake from D2)
 Child Device 1          : TEST Device (USB Audio 2.0)
  Device ID              : USB\VID_20B1&PID_000B&MI_00\8&3AD8D781&0&0000
  Class                  : MEDIA
  Driver KeyName         : {4d36e96c-e325-11ce-bfc1-08002be10318}\0023 (GUID_DEVCLASS_MEDIA)
  Service                : usbaudio2
  Location               : 0000.0014.0000.003.002.004.000.000.000
  LocationPaths          : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(3)#USB(2)#USB(4)#USBMI(0)  PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(3)#USB(2)#USB(4)#USB(4)  ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HSP3)#USB(2)#USB(4)#USBMI(0)  ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HSP3)#USB(2)#USB(4)#USB(4)
  Problem                : 10 (CM_PROB_FAILED_START)

        +++++++++++++++++ Registry USB Flags +++++++++++++++++
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\20B1000B0100
 osvc                    : REG_BINARY 00 00

        ---------------- Connection Information ---------------
Connection Index         : 0x04 (Port 4)
Connection Status        : 0x01 (DeviceConnected)
Current Config Value     : 0x01 (Configuration 1)
Device Address           : 0x14 (20)
Is Hub                   : 0x00 (no)
Device Bus Speed         : 0x02 (High-Speed)
Number Of Open Pipes     : 0x00 (0 pipes to data endpoints)
Data (HexDump)           : 04 00 00 00 12 01 00 02 EF 02 01 40 B1 20 0B 00   ...........@. ..
                           00 01 02 03 04 01 01 02 00 14 00 00 00 00 00 01   ................
                           00 00 00                                          ...

        --------------- Connection Information V2 -------------
Connection Index         : 0x04 (4)
Length                   : 0x10 (16 bytes)
SupportedUsbProtocols    : 0x03
 Usb110                  : 1 (yes, port supports USB 1.1)
 Usb200                  : 1 (yes, port supports USB 2.0)
 Usb300                  : 0 (no, port not supports USB 3.0) -> but Companion Port 3-7-2-4 does
 ReservedMBZ             : 0x00
Flags                    : 0x00
 DevIsOpAtSsOrHigher     : 0 (Device is not operating at SuperSpeed or higher)
 DevIsSsCapOrHigher      : 0 (Device is not SuperSpeed capable or higher)
 DevIsOpAtSsPlusOrHigher : 0 (Device is not operating at SuperSpeedPlus or higher)
 DevIsSsPlusCapOrHigher  : 0 (Device is not SuperSpeedPlus capable or higher)
 ReservedMBZ             : 0x00
Data (HexDump)           : 04 00 00 00 10 00 00 00 03 00 00 00 00 00 00 00   ................

    ---------------------- Device Descriptor ----------------------
bLength                  : 0x12 (18 bytes)
bDescriptorType          : 0x01 (Device Descriptor)
bcdUSB                   : 0x200 (USB Version 2.00)
bDeviceClass             : 0xEF (Miscellaneous)
bDeviceSubClass          : 0x02
bDeviceProtocol          : 0x01 (IAD - Interface Association Descriptor)
bMaxPacketSize0          : 0x40 (64 bytes)
idVendor                 : 0x20B1 (XMOS Ltd.)
idProduct                : 0x000B
bcdDevice                : 0x0100
iManufacturer            : 0x02 (String Descriptor 2)
iProduct                 : 0x03 (String Descriptor 3)
iSerialNumber            : 0x04 (String Descriptor 4)
bNumConfigurations       : 0x01 (1 Configuration)
Data (HexDump)           : 12 01 00 02 EF 02 01 40 B1 20 0B 00 00 01 02 03   .......@. ......
                           04 01                                             ..

    ------------------ Configuration Descriptor -------------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x02 (Configuration Descriptor)
wTotalLength             : 0x007F (127 bytes)
bNumInterfaces           : 0x02 (2 Interfaces)
bConfigurationValue      : 0x01 (Configuration 1)
iConfiguration           : 0x00 (No String Descriptor)
bmAttributes             : 0x80
 D7: Reserved, set 1     : 0x01
 D6: Self Powered        : 0x00 (no)
 D5: Remote Wakeup       : 0x00 (no)
 D4..0: Reserved, set 0  : 0x00
MaxPower                 : 0xFA (500 mA)
Data (HexDump)           : 09 02 7F 00 02 01 00 80 FA 08 0B 00 02 01 00 20   ............... 
                           05 09 04 00 00 00 01 01 20 06 09 24 01 00 02 08   ........ ..$....
                           2E 00 00 08 24 0A 29 00 01 00 07 11 24 02 02 01   ....$.).....$...
                           01 00 29 08 FF 00 00 00 00 00 00 08 0C 24 03 15   ..)..........$..
                           01 03 00 02 29 00 00 0B 09 04 01 00 00 01 02 20   ....).......... 
                           0D 09 04 01 01 01 01 02 20 0E 10 24 01 02 00 01   ........ ..$....
                           01 00 00 00 08 FF 00 00 00 00 06 24 02 01 04 20   ...........$... 
                           07 05 01 05 C0 00 02 08 25 01 00 00 02 08 00      ........%......

        ------------------- IAD Descriptor --------------------
bLength                  : 0x08 (8 bytes)
bDescriptorType          : 0x0B (Interface Association Descriptor)
bFirstInterface          : 0x00 (Interface 0)
bInterfaceCount          : 0x02 (2 Interfaces)
bFunctionClass           : 0x01 (Audio)
bFunctionSubClass        : 0x00 (undefined)
bFunctionProtocol        : 0x20 (AF 2.0)
iFunction                : 0x05 (String Descriptor 5)
Data (HexDump)           : 08 0B 00 02 01 00 20 05                           ...... .

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x00 (Interface 0)
bAlternateSetting        : 0x00
bNumEndpoints            : 0x00 (Default Control Pipe only)
bInterfaceClass          : 0x01 (Audio)
bInterfaceSubClass       : 0x01 (Audio Control)
bInterfaceProtocol       : 0x20 (Device Protocol Version 2.0)
iInterface               : 0x06 (String Descriptor 6)
Data (HexDump)           : 09 04 00 00 00 01 01 20 06                        ....... .

        ---- Audio Control Interface Header Descriptor 2.0 ----
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x01 (Header 2.0)
bcdADC                   : 0x0200 (2.0)
bCategory                : 0x08 (I/O box)
wTotalLength             : 0x002E (46 bytes)
bmControls               : 0x00
 D1..0: Latency          : 0x00 (not present)
 D7..2: Reserved         : 0x00
Data (HexDump)           : 09 24 01 00 02 08 2E 00 00                        .$.......

        --- Audio Control Clock Source Unit Descriptor 2.0 ----
bLength                  : 0x08 (8 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x0A (Clock Source 2.0)
bClockID                 : 0x29
bmAttributes             : 0x00
 D1..0: Clock Type       : 0x00
 D2   : Sync to SOF      : 0x00
 D7..3: Reserved         : 0x00
bmControls               : 0x01
 D1..0: Clock Frequency  : 0x01 (read only)
 D3..2: Clock Validity   : 0x00 (not present)
 D7..4: Reserved         : 0x00
bAssocTerminal           : 0x00
iClockSource             : 0x07 (String Descriptor 7)
Data (HexDump)           : 08 24 0A 29 00 01 00 07                           .$.)....

        ----- Audio Control Input Terminal Descriptor 2.0 -----
bLength                  : 0x11 (17 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x02 (Input Terminal 2.0)
bTerminalID              : 0x02 (2)
wTerminalType            : 0x0101 (USB Streaming)
bAssocTerminal           : 0x00
bCSourceID               : 0x29 (41)
bNrChannels              : 0x08 (8 Channels)
bmChannelConfig          : 0x000000FF (FL, FR, FC, LFE, BL, BR, FLC, FRC)
iChannelNames            : 0x00 (No String Descriptor)
bmControls               : 0x0000
 D1..0  : Copy Protect   : 0x00 (not present)
 D3..2  : Connector      : 0x00 (not present)
 D5..4  : Overload       : 0x00 (not present)
 D7..6  : Cluster        : 0x00 (not present)
 D9..8  : Underflow      : 0x00 (not present)
 D11..10: Overflow       : 0x00 (not present)
 D15..12: Reserved       : 0x00
iTerminal                : 0x08 (String Descriptor 8)
Data (HexDump)           : 11 24 02 02 01 01 00 29 08 FF 00 00 00 00 00 00   .$.....)........
                           08                                                .

        ----- Audio Control Output Terminal Descriptor 2.0 ----
bLength                  : 0x0C (12 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x03 (Output Terminal 2.0)
bTerminalID              : 0x15 (21)
wTerminalType            : 0x0301 (Speaker)
bAssocTerminal           : 0x00 (0)
bSourceID                : 0x02 (2)
bCSourceID               : 0x29 (41)
iTerminal                : 0x0B (String Descriptor 11)
Data (HexDump)           : 0C 24 03 15 01 03 00 02 29 00 00 0B               .$......)...

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x01 (Interface 1)
bAlternateSetting        : 0x00
bNumEndpoints            : 0x00 (Default Control Pipe only)
bInterfaceClass          : 0x01 (Audio)
bInterfaceSubClass       : 0x02 (Audio Streaming)
bInterfaceProtocol       : 0x20 (Device Protocol Version 2.0)
iInterface               : 0x0D (String Descriptor 13)
Data (HexDump)           : 09 04 01 00 00 01 02 20 0D                        ....... .

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x01 (Interface 1)
bAlternateSetting        : 0x01
bNumEndpoints            : 0x01 (1 Endpoint)
bInterfaceClass          : 0x01 (Audio)
bInterfaceSubClass       : 0x02 (Audio Streaming)
bInterfaceProtocol       : 0x20 (Device Protocol Version 2.0)
iInterface               : 0x0E (String Descriptor 14)
Data (HexDump)           : 09 04 01 01 01 01 02 20 0E                        ....... .

        ------ Audio Streaming Interface Descriptor 2.0 -------
bLength                  : 0x10 (16 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x01 (AS General)
bTerminalLink            : 0x02 (2)
bmControls               : 0x00
 D1..0: Active Alt Settng: 0x00 (not present)
 D3..2: Valid Alt Settng : 0x00 (not present)
 D7..4: Reserved         : 0x00
bFormatType              : 0x01 (FORMAT_TYPE_I)
bmFormats                : 0x00000001 (PCM)
bNrChannels              : 0x08 (8 channels)
bmChannelConfig          : 0x000000FF (FL, FR, FC, LFE, BL, BR, FLC, FRC)
iChannelNames            : 0x00 (No String Descriptor)
Data (HexDump)           : 10 24 01 02 00 01 01 00 00 00 08 FF 00 00 00 00   .$..............

        ----- Audio Streaming Format Type Descriptor 2.0 ------
bLength                  : 0x06 (6 bytes)
bDescriptorType          : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype       : 0x02 (Format Type)
bFormatType              : 0x01 (FORMAT_TYPE_I)
bSubslotSize             : 0x04 (4 bytes)
bBitResolution           : 0x20 (32 bits)
Data (HexDump)           : 06 24 02 01 04 20                                 .$... 

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x01 (Direction=OUT EndpointID=1)
bmAttributes             : 0x05 (TransferType=Isochronous  SyncType=Asynchronous  EndpointType=Data)
wMaxPacketSize           : 0x00C0
 Bits 15..13             : 0x00 (reserved, must be zero)
 Bits 12..11             : 0x00 (0 additional transactions per microframe -> allows 1..1024 bytes per packet)
 Bits 10..0              : 0xC0 (192 bytes per packet)
bInterval                : 0x02 (2 microframes -> 0.25 ms)
Data (HexDump)           : 07 05 01 05 C0 00 02                              .......

        ----------- Audio Data Endpoint Descriptor ------------
bLength                  : 0x08 (8 bytes)
bDescriptorType          : 0x25 (Audio Endpoint Descriptor)
bDescriptorSubtype       : 0x01 (General)
bmAttributes             : 0x00
 D0   : Sampling Freq    : 0x00 (not supported)
 D1   : Pitch            : 0x00 (not supported)
 D6..2: Reserved         : 0x00
 D7   : MaxPacketsOnly   : 0x00 (no)
bLockDelayUnits          : 0x00 (Undefined)
wLockDelay               : 0x0802
Data (HexDump)           : 08 25 01 00 00 02 08 00                           .%......

    ----------------- Device Qualifier Descriptor -----------------
Error                    : ERROR_GEN_FAILURE  (because the device is in low power state)

      -------------------- String Descriptors -------------------
String descriptors are not available  (because the device is in low power state)
Again as Hex:

Code: Select all

Device Desc:
0x12, 0x01, 0x00, 0x02, 0xEF, 0x02, 0x01, 0x40, 0xB1, 0x20,
0x0B, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x01

Config Desc:
0x09, 0x02, 0x7F, 0x00, 0x02, 0x01, 0x00, 0x80, 0xFA, 0x08,
0x0B, 0x00, 0x02, 0x01, 0x00, 0x20, 0x05, 0x09, 0x04, 0x00,
0x00, 0x00, 0x01, 0x01, 0x20, 0x06, 0x09, 0x24, 0x01, 0x00,
0x02, 0x08, 0x2E, 0x00, 0x00, 0x08, 0x24, 0x0A, 0x29, 0x00,
0x01, 0x00, 0x07, 0x11, 0x24, 0x02, 0x02, 0x01, 0x01, 0x00,
0x29, 0x08, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
0x0C, 0x24, 0x03, 0x15, 0x01, 0x03, 0x00, 0x02, 0x29, 0x00,
0x00, 0x0B, 0x09, 0x04, 0x01, 0x00, 0x00, 0x01, 0x02, 0x20,
0x0D, 0x09, 0x04, 0x01, 0x01, 0x01, 0x01, 0x02, 0x20, 0x0E,
0x10, 0x24, 0x01, 0x02, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
0x08, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x06, 0x24, 0x02, 0x01,
0x04, 0x20, 0x07, 0x05, 0x01, 0x05, 0xC0, 0x00, 0x02, 0x08,
0x25, 0x01, 0x00, 0x00, 0x02, 0x08, 0x00
With this configuration, the linux kernel log showed no errors or warnings: (filtered for usb device 3-3.2.4)

Code: Select all

[ 7056.526722] usb 3-3.2.4: USB disconnect, device number 13
[ 7056.751144] usb 3-3.2.4: new high-speed USB device number 15 using xhci_hcd
[ 7056.854936] usb 3-3.2.4: New USB device found, idVendor=20b1, idProduct=000b, bcdDevice= 1.00
[ 7056.854946] usb 3-3.2.4: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[ 7056.854949] usb 3-3.2.4: Product: TEST Device
[ 7056.854951] usb 3-3.2.4: Manufacturer: TestManufactuere
[ 7056.854953] usb 3-3.2.4: SerialNumber: 0 0 11
I can select the device as an audio sink: (I use alsa and pipewire, but pactl gives valid output)

Code: Select all

❯ pactl list short sinks
56	alsa_output.pci-0000_01_00.1.hdmi-stereo-extra2	PipeWire	s32le 2ch 48000Hz	SUSPENDED
57	alsa_output.usb-ESS_Technology_ESS_USB_Audio-00.analog-stereo	PipeWire	s32le 2ch 48000Hz	SUSPENDED
60	alsa_output.usb-Sennheiser_Sennheiser_3D_G4ME1-00.analog-stereo	PipeWire	s16le 2ch 48000Hz	SUSPENDED
62	alsa_output.pci-0000_00_1b.0.analog-stereo	PipeWire	s32le 2ch 48000Hz	SUSPENDED
308	alsa_output.usb-TestManufactuere_TEST_Device_0_0_11-00.analog-surround-71	PipeWire	s32le 8ch 48000Hz	SUSPENDED
But when I select the device as audio sink and stream to it, there is still no data transferred. I select the device as audio sink with a running playback at seconds 17 and 56 of the linux wireshark recording (attached).
From this I take that the enumeration is successful, but somehow there is still no audio transferred. And since there is not even an initial isochronous package from the host, I think there is still something wrong with the descriptor.

Although I focus on linux for now:
Under Windows, the enumeration still seems to fail, because the device is not listed as an audio sink. A wireshark recording with the same firmware is also attached.

Has someone had this problem before and knows the root of this behavior?
You do not have the required permissions to view the files attached to this post.
friguly
Junior Member
Posts: 6
Joined: Fri Jun 24, 2022 7:13 am

Post by friguly »

And I have to post an update:
When I changed the number of audio channels from 8 to 2, I got an isochronous data transfer.
Now I will try to add a connection from the device to the host to create a loopback of the transferred audio.

The corresponding wireshark file is attached.
You do not have the required permissions to view the files attached to this post.