OPEN SOURCE BOUNTY: volumeInput(); similar to volume();

Status
Not open for further replies.

JayShoe

Well-known member
Hello,

I'm offering a $300 reward to anyone who will successfully provide/commit a patch to the audio library so that I can call volumeInput(); and receive the volume level from windows (and I guess any other OS that follows the USB spec). This is similar to the volume(); call that currently exists but for the input level. If you figure this out I'd bet its a total of 3 lines of code.

usb-audio-input-volume.png

Additional details on this bounty is discussed here:
https://forum.pjrc.com/threads/5566...volume-setting?p=249074&viewfull=1#post249074

Please let me know if anyone is interested!

Jay
 
I may be completely wrong here:

I took a look at this earlier this evening.
The volume control is done by means of a "Feature Unit Audio Class Descriptor".
The problem is, this is only valid for so-called "Input Terminal"s. This is what the "Input Terminal Audio Class Descriptor" is for. However, this describes the direction Host->Device, and not vice versa.

So I don't think what you want is possible.

I just looked at this for the very first time and I may be wrong!?! In this case I would like to know how to do it.
There are mixers described etc. Perhaps it's possible with these?

USB is complicated...

A document that may be useful:
https://www.silabs.com/documents/public/application-notes/AN295.pdf
 
If anyone works on this, we please also consider what sort of numerical range is normally used by "typical" USB audio devices.

Linux prints a warning (syslog message) about the range we have now....
 
There is a utility called Thesycon USB Descriptor Dumper which might help us figure out what descriptors are common among soundcards. This might help us.

Here is a dump from the popular Cmedia CM6206-LX USB Audio Chip.

Code:
Information for device USB Sound Device         (VID=0x0D8C PID=0x0102):

Connection Information:
------------------------------
Device current bus speed: FullSpeed
Device supports USB 1.1 specification
Device supports USB 2.0 specification
Device address: 0x0002
Current configuration value: 0x01
Number of open pipes: 1

Device Descriptor:
------------------------------
0x12	bLength
0x01	bDescriptorType
0x0110	bcdUSB
0x00	bDeviceClass      
0x00	bDeviceSubClass   
0x00	bDeviceProtocol   
0x08	bMaxPacketSize0   (8 bytes)
0x0D8C	idVendor
0x0102	idProduct
0x0010	bcdDevice
0x00	iManufacturer
0x02	iProduct     
0x00	iSerialNumber
0x01	bNumConfigurations

Configuration Descriptor:
------------------------------
0x09	bLength
0x02	bDescriptorType
0x0216	wTotalLength   (534 bytes)
0x04	bNumInterfaces
0x01	bConfigurationValue
0x00	iConfiguration
0x80	bmAttributes   (Bus-powered Device)
0xFA	bMaxPower      (500 mA)

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

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

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

AC Input Terminal Descriptor:
------------------------------
0x0C	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x04	bTerminalID
0x0201	wTerminalType   (Microphone)
0x00	bAssocTerminal
0x02	bNrChannels   (2 channels)
0x0003	wChannelConfig
0x00	iChannelNames
0x00	iTerminal

AC Feature Unit Descriptor:
------------------------------
0x0A	bLength
0x24	bDescriptorType
0x06	bDescriptorSubtype
0x08	bUnitID
0x04	bSourceID
0x01	bControlSize
bmaControls: 
 0x01	Channel(0) - Mute
 0x02	Channel(1) - Volume
 0x02	Channel(2) - Volume
0x00	iFeature


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


AC Mixer Unit Descriptor:
------------------------------
0x19	bLength
0x24	bDescriptorType
0x04	bDescriptorSubtype
0x0C	bUnitID
0x03	bBrInPins
0x01	baSourceID(1)
0x09	baSourceID(2)
0x0B	baSourceID(3)
0x08	bNrChannels
0x063F	wChannelConfig
0x00	iChannelNames
bmControls:
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 
0x00	iMixer

AC Feature Unit Descriptor:
------------------------------
0x10	bLength
0x24	bDescriptorType
0x06	bDescriptorSubtype
0x0D	bUnitID
0x0C	bSourceID
0x01	bControlSize
bmaControls: 
 0x01	Channel(0) - Mute
 0x02	Channel(1) - Volume
 0x02	Channel(2) - Volume
 0x02	Channel(3) - Volume
 0x02	Channel(4) - Volume
 0x02	Channel(5) - Volume
 0x02	Channel(6) - Volume
 0x02	Channel(7) - Volume
 0x02	Channel(8) - Volume
0x00	iFeature


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

AC Mixer Unit Descriptor:
------------------------------
0x0D	bLength
0x24	bDescriptorType
0x04	bDescriptorSubtype
0x11	bUnitID
0x02	bBrInPins
0x09	baSourceID(1)
0x0B	baSourceID(2)
0x02	bNrChannels
0x0003	wChannelConfig
0x00	iChannelNames
bmControls:
0x00 
0x00	iMixer

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

AC Selector Unit Descriptor:
------------------------------
0x0A	bLength
0x24	bDescriptorType
0x05	bDescriptorSubtype
0x07	bUnitID
0x04	bBrInPins
0x08	baSourceID(1)
0x0F	baSourceID(2)
0x10	baSourceID(3)
0x02	baSourceID(4)
0x00	iSelector

AC Input Terminal Descriptor:
------------------------------
0x0C	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x06	bTerminalID
0x0603	wTerminalType   (Line connector)
0x00	bAssocTerminal
0x02	bNrChannels   (2 channels)
0x0003	wChannelConfig
0x00	iChannelNames
0x00	iTerminal

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


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


AC Input Terminal Descriptor:
------------------------------
0x0C	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x05	bTerminalID
0x0605	wTerminalType   (S/PDIF interface)
0x00	bAssocTerminal
0x02	bNrChannels   (2 channels)
0x0003	wChannelConfig
0x00	iChannelNames
0x00	iTerminal

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


AC Feature Unit Descriptor:
------------------------------
0x0A	bLength
0x24	bDescriptorType
0x06	bDescriptorSubtype
0x10	bUnitID
0x05	bSourceID
0x01	bControlSize
bmaControls: 
 0x01	Channel(0) - Mute
 0x00	Channel(1)
 0x00	Channel(2)
0x00	iFeature


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

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

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

AS Format Type 1 Descriptor:
------------------------------
0x0E	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x01	bFormatType   (FORMAT_TYPE_1)
0x08	bNrChannels   (8 channels)
0x02	bSubframeSize
0x10	bBitResolution   (16 bits per sample)
0x02	bSamFreqType   (Discrete sampling frequencies)
0x00AC44 	tSamFreq(1)   (44100 Hz)
0x00BB80 	tSamFreq(2)   (48000 Hz)

Endpoint Descriptor (Audio/MIDI 1.0):
------------------------------
0x09	bLength
0x05	bDescriptorType
0x06	bEndpointAddress  (OUT endpoint 6)
0x09	bmAttributes      (Transfer: Isochronous / Synch: Adaptive / Usage: Data)
0x0310	wMaxPacketSize    (1 x 784 bytes)
0x01	bInterval         (1 frames)
0x00	bRefresh
0x00	bSynchAddress

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

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

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

AS Format Type 1 Descriptor:
------------------------------
0x0E	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x01	bFormatType   (FORMAT_TYPE_1)
0x02	bNrChannels   (2 channels)
0x02	bSubframeSize
0x10	bBitResolution   (16 bits per sample)
0x02	bSamFreqType   (Discrete sampling frequencies)
0x00AC44 	tSamFreq(1)   (44100 Hz)
0x00BB80 	tSamFreq(2)   (48000 Hz)

Endpoint Descriptor (Audio/MIDI 1.0):
------------------------------
0x09	bLength
0x05	bDescriptorType
0x06	bEndpointAddress  (OUT endpoint 6)
0x09	bmAttributes      (Transfer: Isochronous / Synch: Adaptive / Usage: Data)
0x00C4	wMaxPacketSize    (1 x 196 bytes)
0x01	bInterval         (1 frames)
0x00	bRefresh
0x00	bSynchAddress

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

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

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

AS Format Type 1 Descriptor:
------------------------------
0x0E	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x01	bFormatType   (FORMAT_TYPE_1)
0x04	bNrChannels   (4 channels)
0x02	bSubframeSize
0x10	bBitResolution   (16 bits per sample)
0x02	bSamFreqType   (Discrete sampling frequencies)
0x00AC44 	tSamFreq(1)   (44100 Hz)
0x00BB80 	tSamFreq(2)   (48000 Hz)

Endpoint Descriptor (Audio/MIDI 1.0):
------------------------------
0x09	bLength
0x05	bDescriptorType
0x06	bEndpointAddress  (OUT endpoint 6)
0x09	bmAttributes      (Transfer: Isochronous / Synch: Adaptive / Usage: Data)
0x0188	wMaxPacketSize    (1 x 392 bytes)
0x01	bInterval         (1 frames)
0x00	bRefresh
0x00	bSynchAddress

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

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

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

AS Format Type 1 Descriptor:
------------------------------
0x0E	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x01	bFormatType   (FORMAT_TYPE_1)
0x06	bNrChannels   (6 channels)
0x02	bSubframeSize
0x10	bBitResolution   (16 bits per sample)
0x02	bSamFreqType   (Discrete sampling frequencies)
0x00AC44 	tSamFreq(1)   (44100 Hz)
0x00BB80 	tSamFreq(2)   (48000 Hz)

Endpoint Descriptor (Audio/MIDI 1.0):
------------------------------
0x09	bLength
0x05	bDescriptorType
0x06	bEndpointAddress  (OUT endpoint 6)
0x09	bmAttributes      (Transfer: Isochronous / Synch: Adaptive / Usage: Data)
0x0248	wMaxPacketSize    (1 x 584 bytes)
0x01	bInterval         (1 frames)
0x00	bRefresh
0x00	bSynchAddress

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

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

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

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

Endpoint Descriptor (Audio/MIDI 1.0):
------------------------------
0x09	bLength
0x05	bDescriptorType
0x06	bEndpointAddress  (OUT endpoint 6)
0x09	bmAttributes      (Transfer: Isochronous / Synch: Adaptive / Usage: Data)
0x0188	wMaxPacketSize    (1 x 392 bytes)
0x01	bInterval         (1 frames)
0x00	bRefresh
0x00	bSynchAddress

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

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

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

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

AS Format Type 1 Descriptor:
------------------------------
0x0E	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x01	bFormatType   (FORMAT_TYPE_1)
0x02	bNrChannels   (2 channels)
0x02	bSubframeSize
0x10	bBitResolution   (16 bits per sample)
0x02	bSamFreqType   (Discrete sampling frequencies)
0x00AC44 	tSamFreq(1)   (44100 Hz)
0x00BB80 	tSamFreq(2)   (48000 Hz)

Endpoint Descriptor (Audio/MIDI 1.0):
------------------------------
0x09	bLength
0x05	bDescriptorType
0x85	bEndpointAddress  (IN endpoint 5)
0x05	bmAttributes      (Transfer: Isochronous / Synch: Asynchronous / Usage: Data)
0x00C8	wMaxPacketSize    (1 x 200 bytes)
0x01	bInterval         (1 frames)
0x00	bRefresh
0x00	bSynchAddress

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

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

HID Descriptor:
------------------------------
0x09	bLength
0x21	bDescriptorType
0x0100	bcdHID
0x00	bCountryCode
0x01	bNumDescriptors
0x22	bDescriptorType   (Report descriptor)
0x0032	bDescriptorLength

Endpoint Descriptor:
------------------------------
0x07	bLength
0x05	bDescriptorType
0x81	bEndpointAddress  (IN endpoint 1)
0x03	bmAttributes      (Transfer: Interrupt / Synch: None / Usage: Data)
0x0003	wMaxPacketSize    (1 x 3 bytes)
0x01	bInterval         (1 frames)

Microsoft OS Descriptor is not available. Error code: 0x0000001F

String Descriptor Table
--------------------------------
Index  LANGID  String
0x00   0x0000  
0x02   0x0000  "USB Sound Device        "

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

Connection path for device: 
USB xHCI Compliant Host Controller
Root Hub
USB Sound Device         (VID=0x0D8C PID=0x0102) Port: 2

Running on: Windows 10 or greater (Build Version 19041)

Brought to you by TDD v2.15.0, Jun  8 2020, 17:18:07

Here is a dump from the CM119 audio chip.

Code:
Information for device C-Media USB Audio Device    (VID=0x0D8C PID=0x0008):

Connection Information:
------------------------------
Device current bus speed: FullSpeed
Device supports USB 1.1 specification
Device supports USB 2.0 specification
Device address: 0x0004
Current configuration value: 0x01
Number of open pipes: 1

Device Descriptor:
------------------------------
0x12	bLength
0x01	bDescriptorType
0x0110	bcdUSB
0x00	bDeviceClass      
0x00	bDeviceSubClass   
0x00	bDeviceProtocol   
0x40	bMaxPacketSize0   (64 bytes)
0x0D8C	idVendor
0x0008	idProduct
0x0100	bcdDevice
0x00	iManufacturer
0x01	iProduct        "C-Media USB Audio Device   "
0x00	iSerialNumber
0x01	bNumConfigurations

Configuration Descriptor:
------------------------------
0x09	bLength
0x02	bDescriptorType
0x00FD	wTotalLength   (253 bytes)
0x04	bNumInterfaces
0x01	bConfigurationValue
0x00	iConfiguration
0xA0	bmAttributes   (Bus-powered Device, Remote-Wakeup)
0x32	bMaxPower      (100 mA)

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

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

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

AC Input Terminal Descriptor:
------------------------------
0x0C	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x02	bTerminalID
0x0201	wTerminalType   (Microphone)
0x00	bAssocTerminal
0x01	bNrChannels   (1 channels)
0x0001	wChannelConfig
0x00	iChannelNames
0x00	iTerminal

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

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

AC Selector Unit Descriptor:
------------------------------
0x07	bLength
0x24	bDescriptorType
0x05	bDescriptorSubtype
0x08	bUnitID
0x01	bBrInPins
0x0A	baSourceID(1)
0x00	iSelector

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


AC Feature Unit Descriptor:
------------------------------
0x09	bLength
0x24	bDescriptorType
0x06	bDescriptorSubtype
0x0A	bUnitID
0x02	bSourceID
0x01	bControlSize
bmaControls: 
 0x43	Channel(0) - Mute / Volume / Automatic Gain
 0x00	Channel(1)
0x00	iFeature


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


AC Mixer Unit Descriptor:
------------------------------
0x0D	bLength
0x24	bDescriptorType
0x04	bDescriptorSubtype
0x0F	bUnitID
0x02	bBrInPins
0x01	baSourceID(1)
0x0D	baSourceID(2)
0x02	bNrChannels
0x0003	wChannelConfig
0x00	iChannelNames
bmControls:
0x00 
0x00	iMixer

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

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

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

AS Format Type 1 Descriptor:
------------------------------
0x0E	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x01	bFormatType   (FORMAT_TYPE_1)
0x02	bNrChannels   (2 channels)
0x02	bSubframeSize
0x10	bBitResolution   (16 bits per sample)
0x02	bSamFreqType   (Discrete sampling frequencies)
0x00BB80 	tSamFreq(1)   (48000 Hz)
0x00AC44 	tSamFreq(2)   (44100 Hz)

Endpoint Descriptor (Audio/MIDI 1.0):
------------------------------
0x09	bLength
0x05	bDescriptorType
0x01	bEndpointAddress  (OUT endpoint 1)
0x09	bmAttributes      (Transfer: Isochronous / Synch: Adaptive / Usage: Data)
0x00C8	wMaxPacketSize    (1 x 200 bytes)
0x01	bInterval         (1 frames)
0x00	bRefresh
0x00	bSynchAddress

AS Isochronous Data Endpoint Descriptor:
------------------------------
0x07	bLength
0x25	bDescriptorType
0x01	bDescriptorSubtype
0x01	bmAttributes   (Sampling Frequency)
0x01	bLockDelayUnits   (milliseconds)
0x0001	wLockDelay

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

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

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

AS Format Type 1 Descriptor:
------------------------------
0x0E	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x01	bFormatType   (FORMAT_TYPE_1)
0x01	bNrChannels   (1 channels)
0x02	bSubframeSize
0x10	bBitResolution   (16 bits per sample)
0x02	bSamFreqType   (Discrete sampling frequencies)
0x00BB80 	tSamFreq(1)   (48000 Hz)
0x00AC44 	tSamFreq(2)   (44100 Hz)

Endpoint Descriptor (Audio/MIDI 1.0):
------------------------------
0x09	bLength
0x05	bDescriptorType
0x82	bEndpointAddress  (IN endpoint 2)
0x05	bmAttributes      (Transfer: Isochronous / Synch: Asynchronous / Usage: Data)
0x0064	wMaxPacketSize    (1 x 100 bytes)
0x01	bInterval         (1 frames)
0x00	bRefresh
0x00	bSynchAddress

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

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

HID Descriptor:
------------------------------
0x09	bLength
0x21	bDescriptorType
0x0100	bcdHID
0x00	bCountryCode
0x01	bNumDescriptors
0x22	bDescriptorType   (Report descriptor)
0x0032	bDescriptorLength

Endpoint Descriptor:
------------------------------
0x07	bLength
0x05	bDescriptorType
0x83	bEndpointAddress  (IN endpoint 3)
0x03	bmAttributes      (Transfer: Interrupt / Synch: None / Usage: Data)
0x0004	wMaxPacketSize    (1 x 4 bytes)
0x20	bInterval         (32 frames)

Microsoft OS Descriptor is not available. Error code: 0x0000001F

String Descriptor Table
--------------------------------
Index  LANGID  String
0x00   0x0000  0x0409 
0x01   0x0409  "C-Media USB Audio Device   "

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

Connection path for device: 
USB xHCI Compliant Host Controller
Root Hub
C-Media USB Audio Device    (VID=0x0D8C PID=0x0008) Port: 2

Running on: Windows 10 or greater (Build Version 19041)

Brought to you by TDD v2.15.0, Jun  8 2020, 17:18:07

Here is a dump from the Teensy 4.1.

Code:
Information for device Teensy MIDI/Audio (VID=0x16C0 PID=0x048A):

Connection Information:
------------------------------
Device current bus speed: HighSpeed
Device supports USB 1.1 specification
Device supports USB 2.0 specification
Device address: 0x0006
Current configuration value: 0x01
Number of open pipes: 5

Device Descriptor:
------------------------------
0x12	bLength
0x01	bDescriptorType
0x0200	bcdUSB
0x00	bDeviceClass      
0x00	bDeviceSubClass   
0x00	bDeviceProtocol   
0x40	bMaxPacketSize0   (64 bytes)
0x16C0	idVendor
0x048A	idProduct
0x0280	bcdDevice
0x01	iManufacturer
0x02	iProduct     
0x03	iSerialNumber
0x01	bNumConfigurations

Device Qualifier Descriptor:
------------------------------
0x0A	bLength
0x06	bDescriptorType
0x0200	bcdUSB
0x00	bDeviceClass      
0x00	bDeviceSubClass   
0x00	bDeviceProtocol   
0x40	bMaxPacketSize0   (64 bytes)
0x01	bNumConfigurations 
0x00	bReserved 

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

Interface Association Descriptor:
------------------------------
0x08	bLength
0x0B	bDescriptorType
0x00	bFirstInterface
0x02	bInterfaceCount
0x02	bFunctionClass      (Communication Device Class)
0x02	bFunctionSubClass   (Abstract Control Model - ACM)
0x01	bFunctionProtocol   (ITU-T V.250)
0x00	iFunction

Interface Descriptor:
------------------------------
0x09	bLength
0x04	bDescriptorType
0x00	bInterfaceNumber
0x00	bAlternateSetting
0x01	bNumEndPoints
0x02	bInterfaceClass      (Communication Device Class)
0x02	bInterfaceSubClass   (Abstract Control Model - ACM)
0x01	bInterfaceProtocol   (ITU-T V.250)
0x00	iInterface

CDC Header Functional Descriptor:
------------------------------
0x05	bFunctionalLength
0x24	bDescriptorType
0x00	bDescriptorSubtype
0x0110	bcdCDC

CDC Call Management Functional Descriptor:
------------------------------
0x05	bFunctionalLength
0x24	bDescriptorType
0x01	bDescriptorSubtype
0x01	bmCapabilities
0x01	bDataInterface

CDC Abstract Control Management Functional Descriptor:
------------------------------
0x04	bFunctionalLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x06	bmCapabilities

CDC Union Functional Descriptor:
------------------------------
0x05	bFunctionalLength
0x24	bDescriptorType
0x06	bDescriptorSubtype
0x00	bControlInterface
0x01	bSubordinateInterface(0)

Endpoint Descriptor:
------------------------------
0x07	bLength
0x05	bDescriptorType
0x82	bEndpointAddress  (IN endpoint 2)
0x03	bmAttributes      (Transfer: Interrupt / Synch: None / Usage: Data)
0x0010	wMaxPacketSize    (1 x 16 bytes)
0x05	bInterval         (16 microframes)

Interface Descriptor:
------------------------------
0x09	bLength
0x04	bDescriptorType
0x01	bInterfaceNumber
0x00	bAlternateSetting
0x02	bNumEndPoints
0x0A	bInterfaceClass      (CDC Data)
0x00	bInterfaceSubClass   
0x00	bInterfaceProtocol   
0x00	iInterface

Endpoint Descriptor:
------------------------------
0x07	bLength
0x05	bDescriptorType
0x03	bEndpointAddress  (OUT endpoint 3)
0x02	bmAttributes      (Transfer: Bulk / Synch: None / Usage: Data)
0x0200	wMaxPacketSize    (512 bytes)
0x00	bInterval         

Endpoint Descriptor:
------------------------------
0x07	bLength
0x05	bDescriptorType
0x83	bEndpointAddress  (IN endpoint 3)
0x02	bmAttributes      (Transfer: Bulk / Synch: None / Usage: Data)
0x0200	wMaxPacketSize    (512 bytes)
0x00	bInterval         

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

MS Interface Header Descriptor:
------------------------------
0x07	bLength
0x24	bDescriptorType
0x01	bDescriptorSubtype
0x0100	bcdMSC
0x0025	wTotalLength   (37 bytes)

MS MIDI IN Jack Descriptor:
------------------------------
0x06	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x01	bJackType
0x01	bJackID
0x00	iJack

MS MIDI IN Jack Descriptor:
------------------------------
0x06	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x02	bJackType
0x02	bJackID
0x00	iJack

MS MIDI OUT Jack Descriptor:
------------------------------
0x09	bLength
0x24	bDescriptorType
0x03	bDescriptorSubtype
0x01	bJackType
0x03	bJackID
0x01	bNrInputPins
0x02	baSourceID(1)
0x01	baSourcePin(1)
0x00	iJack

MS MIDI OUT Jack Descriptor:
------------------------------
0x09	bLength
0x24	bDescriptorType
0x03	bDescriptorSubtype
0x02	bJackType
0x04	bJackID
0x01	bNrInputPins
0x01	baSourceID(1)
0x01	baSourcePin(1)
0x00	iJack

Endpoint Descriptor (Audio/MIDI 1.0):
------------------------------
0x09	bLength
0x05	bDescriptorType
0x04	bEndpointAddress  (OUT endpoint 4)
0x02	bmAttributes      (Transfer: Bulk / Synch: None / Usage: Data)
0x0200	wMaxPacketSize    (512 bytes)
0x00	bInterval         
0x00	bRefresh
0x00	bSynchAddress

MS Bulk Data Endpoint Descriptor:
------------------------------
0x05	bLength
0x25	bDescriptorType
0x01	bDescriptorSubtype
0x01	bNumEmbMIDIJack
0x01	baAssocJackID(1)

Endpoint Descriptor (Audio/MIDI 1.0):
------------------------------
0x09	bLength
0x05	bDescriptorType
0x84	bEndpointAddress  (IN endpoint 4)
0x02	bmAttributes      (Transfer: Bulk / Synch: None / Usage: Data)
0x0200	wMaxPacketSize    (512 bytes)
0x00	bInterval         
0x00	bRefresh
0x00	bSynchAddress

MS Bulk Data Endpoint Descriptor:
------------------------------
0x05	bLength
0x25	bDescriptorType
0x01	bDescriptorSubtype
0x01	bNumEmbMIDIJack
0x03	baAssocJackID(1)

Interface Association Descriptor:
------------------------------
0x08	bLength
0x0B	bDescriptorType
0x03	bFirstInterface
0x03	bInterfaceCount
0x01	bFunctionClass      (Audio Device Class)
0x01	bFunctionSubClass   (Audio Control Interface)
0x00	bFunctionProtocol   (Audio Protocol undefined)
0x00	iFunction

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

AC Interface Header Descriptor:
------------------------------
0x0A	bLength
0x24	bDescriptorType
0x01	bDescriptorSubtype
0x0100	bcdADC
0x003E	wTotalLength   (62 bytes)
0x02	bInCollection
0x04	baInterfaceNr(1)
0x05	baInterfaceNr(2)

AC Input Terminal Descriptor:
------------------------------
0x0C	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x01	bTerminalID
0x0602	wTerminalType   (Digital audio interface)
0x00	bAssocTerminal
0x02	bNrChannels   (2 channels)
0x0003	wChannelConfig
0x00	iChannelNames
0x00	iTerminal

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

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

AC Feature Unit Descriptor:
------------------------------
0x0A	bLength
0x24	bDescriptorType
0x06	bDescriptorSubtype
0x31	bUnitID
0x03	bSourceID
0x01	bControlSize
bmaControls: 
 0x01	Channel(0) - Mute
 0x02	Channel(1) - Volume
 0x02	Channel(2) - Volume
0x00	iFeature


AC Output Terminal Descriptor:
------------------------------
0x09	bLength
0x24	bDescriptorType
0x03	bDescriptorSubtype
0x04	bTerminalID
0x0602	wTerminalType   (Digital audio interface)
0x00	bAssocTerminal
0x31	bSourceID
0x00	iTerminal

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

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

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

AS Format Type 1 Descriptor:
------------------------------
0x0B	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x01	bFormatType   (FORMAT_TYPE_1)
0x02	bNrChannels   (2 channels)
0x02	bSubframeSize
0x10	bBitResolution   (16 bits per sample)
0x01	bSamFreqType   (Discrete sampling frequencies)
0x00AC44 	tSamFreq(1)   (44100 Hz)

Endpoint Descriptor (Audio/MIDI 1.0):
------------------------------
0x09	bLength
0x05	bDescriptorType
0x85	bEndpointAddress  (IN endpoint 5)
0x09	bmAttributes      (Transfer: Isochronous / Synch: Adaptive / Usage: Data)
0x00B4	wMaxPacketSize    (1 x 180 bytes)
0x04	bInterval         (8 microframes)
0x00	bRefresh
0x00	bSynchAddress

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

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

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

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

AS Format Type 1 Descriptor:
------------------------------
0x0B	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x01	bFormatType   (FORMAT_TYPE_1)
0x02	bNrChannels   (2 channels)
0x02	bSubframeSize
0x10	bBitResolution   (16 bits per sample)
0x01	bSamFreqType   (Discrete sampling frequencies)
0x00AC44 	tSamFreq(1)   (44100 Hz)

Endpoint Descriptor (Audio/MIDI 1.0):
------------------------------
0x09	bLength
0x05	bDescriptorType
0x05	bEndpointAddress  (OUT endpoint 5)
0x05	bmAttributes      (Transfer: Isochronous / Synch: Asynchronous / Usage: Data)
0x00B4	wMaxPacketSize    (1 x 180 bytes)
0x04	bInterval         (8 microframes)
0x00	bRefresh
0x86	bSynchAddress

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

Endpoint Descriptor (Audio/MIDI 1.0):
------------------------------
0x09	bLength
0x05	bDescriptorType
0x86	bEndpointAddress  (IN endpoint 6)
0x11	bmAttributes      (Transfer: Isochronous / Synch: None / Usage: Feedback)
0x0004	wMaxPacketSize    (1 x 4 bytes)
0x04	bInterval         (8 microframes)
0x07	bRefresh
0x00	bSynchAddress


------------------------------
Other Speed Configuration Descriptor:
------------------------------
0x09	bLength
0x07	bDescriptorType
0x0155	wTotalLength   (341 bytes)
0x06	bNumInterfaces
0x01	bConfigurationValue
0x00	iConfiguration
0xC0	bmAttributes   (Self-powered Device)
0x32	bMaxPower      (100 mA)

Interface Association Descriptor:
------------------------------
0x08	bLength
0x0B	bDescriptorType
0x00	bFirstInterface
0x02	bInterfaceCount
0x02	bFunctionClass      (Communication Device Class)
0x02	bFunctionSubClass   (Abstract Control Model - ACM)
0x01	bFunctionProtocol   (ITU-T V.250)
0x00	iFunction

Interface Descriptor:
------------------------------
0x09	bLength
0x04	bDescriptorType
0x00	bInterfaceNumber
0x00	bAlternateSetting
0x01	bNumEndPoints
0x02	bInterfaceClass      (Communication Device Class)
0x02	bInterfaceSubClass   (Abstract Control Model - ACM)
0x01	bInterfaceProtocol   (ITU-T V.250)
0x00	iInterface

CDC Header Functional Descriptor:
------------------------------
0x05	bFunctionalLength
0x24	bDescriptorType
0x00	bDescriptorSubtype
0x0110	bcdCDC

CDC Call Management Functional Descriptor:
------------------------------
0x05	bFunctionalLength
0x24	bDescriptorType
0x01	bDescriptorSubtype
0x01	bmCapabilities
0x01	bDataInterface

CDC Abstract Control Management Functional Descriptor:
------------------------------
0x04	bFunctionalLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x06	bmCapabilities

CDC Union Functional Descriptor:
------------------------------
0x05	bFunctionalLength
0x24	bDescriptorType
0x06	bDescriptorSubtype
0x00	bControlInterface
0x01	bSubordinateInterface(0)

Endpoint Descriptor:
------------------------------
0x07	bLength
0x05	bDescriptorType
0x82	bEndpointAddress  (IN endpoint 2)
0x03	bmAttributes      (Transfer: Interrupt / Synch: None / Usage: Data)
0x0010	wMaxPacketSize    (1 x 16 bytes)
0x10	bInterval         (16 frames)

Interface Descriptor:
------------------------------
0x09	bLength
0x04	bDescriptorType
0x01	bInterfaceNumber
0x00	bAlternateSetting
0x02	bNumEndPoints
0x0A	bInterfaceClass      (CDC Data)
0x00	bInterfaceSubClass   
0x00	bInterfaceProtocol   
0x00	iInterface

Endpoint Descriptor:
------------------------------
0x07	bLength
0x05	bDescriptorType
0x03	bEndpointAddress  (OUT endpoint 3)
0x02	bmAttributes      (Transfer: Bulk / Synch: None / Usage: Data)
0x0040	wMaxPacketSize    (64 bytes)
0x00	bInterval         

Endpoint Descriptor:
------------------------------
0x07	bLength
0x05	bDescriptorType
0x83	bEndpointAddress  (IN endpoint 3)
0x02	bmAttributes      (Transfer: Bulk / Synch: None / Usage: Data)
0x0040	wMaxPacketSize    (64 bytes)
0x00	bInterval         

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

MS Interface Header Descriptor:
------------------------------
0x07	bLength
0x24	bDescriptorType
0x01	bDescriptorSubtype
0x0100	bcdMSC
0x0025	wTotalLength   (37 bytes)

MS MIDI IN Jack Descriptor:
------------------------------
0x06	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x01	bJackType
0x01	bJackID
0x00	iJack

MS MIDI IN Jack Descriptor:
------------------------------
0x06	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x02	bJackType
0x02	bJackID
0x00	iJack

MS MIDI OUT Jack Descriptor:
------------------------------
0x09	bLength
0x24	bDescriptorType
0x03	bDescriptorSubtype
0x01	bJackType
0x03	bJackID
0x01	bNrInputPins
0x02	baSourceID(1)
0x01	baSourcePin(1)
0x00	iJack

MS MIDI OUT Jack Descriptor:
------------------------------
0x09	bLength
0x24	bDescriptorType
0x03	bDescriptorSubtype
0x02	bJackType
0x04	bJackID
0x01	bNrInputPins
0x01	baSourceID(1)
0x01	baSourcePin(1)
0x00	iJack

Endpoint Descriptor (Audio/MIDI 1.0):
------------------------------
0x09	bLength
0x05	bDescriptorType
0x04	bEndpointAddress  (OUT endpoint 4)
0x02	bmAttributes      (Transfer: Bulk / Synch: None / Usage: Data)
0x0040	wMaxPacketSize    (64 bytes)
0x00	bInterval         
0x00	bRefresh
0x00	bSynchAddress

MS Bulk Data Endpoint Descriptor:
------------------------------
0x05	bLength
0x25	bDescriptorType
0x01	bDescriptorSubtype
0x01	bNumEmbMIDIJack
0x01	baAssocJackID(1)

Endpoint Descriptor (Audio/MIDI 1.0):
------------------------------
0x09	bLength
0x05	bDescriptorType
0x84	bEndpointAddress  (IN endpoint 4)
0x02	bmAttributes      (Transfer: Bulk / Synch: None / Usage: Data)
0x0040	wMaxPacketSize    (64 bytes)
0x00	bInterval         
0x00	bRefresh
0x00	bSynchAddress

MS Bulk Data Endpoint Descriptor:
------------------------------
0x05	bLength
0x25	bDescriptorType
0x01	bDescriptorSubtype
0x01	bNumEmbMIDIJack
0x03	baAssocJackID(1)

Interface Association Descriptor:
------------------------------
0x08	bLength
0x0B	bDescriptorType
0x03	bFirstInterface
0x03	bInterfaceCount
0x01	bFunctionClass      (Audio Device Class)
0x01	bFunctionSubClass   (Audio Control Interface)
0x00	bFunctionProtocol   (Audio Protocol undefined)
0x00	iFunction

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

AC Interface Header Descriptor:
------------------------------
0x0A	bLength
0x24	bDescriptorType
0x01	bDescriptorSubtype
0x0100	bcdADC
0x003E	wTotalLength   (62 bytes)
0x02	bInCollection
0x04	baInterfaceNr(1)
0x05	baInterfaceNr(2)

AC Input Terminal Descriptor:
------------------------------
0x0C	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x01	bTerminalID
0x0602	wTerminalType   (Digital audio interface)
0x00	bAssocTerminal
0x02	bNrChannels   (2 channels)
0x0003	wChannelConfig
0x00	iChannelNames
0x00	iTerminal

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

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

AC Feature Unit Descriptor:
------------------------------
0x0A	bLength
0x24	bDescriptorType
0x06	bDescriptorSubtype
0x31	bUnitID
0x03	bSourceID
0x01	bControlSize
bmaControls: 
 0x01	Channel(0) - Mute
 0x02	Channel(1) - Volume
 0x02	Channel(2) - Volume
0x00	iFeature


AC Output Terminal Descriptor:
------------------------------
0x09	bLength
0x24	bDescriptorType
0x03	bDescriptorSubtype
0x04	bTerminalID
0x0602	wTerminalType   (Digital audio interface)
0x00	bAssocTerminal
0x31	bSourceID
0x00	iTerminal

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

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

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

AS Format Type 1 Descriptor:
------------------------------
0x0B	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x01	bFormatType   (FORMAT_TYPE_1)
0x02	bNrChannels   (2 channels)
0x02	bSubframeSize
0x10	bBitResolution   (16 bits per sample)
0x01	bSamFreqType   (Discrete sampling frequencies)
0x00AC44 	tSamFreq(1)   (44100 Hz)

Endpoint Descriptor (Audio/MIDI 1.0):
------------------------------
0x09	bLength
0x05	bDescriptorType
0x85	bEndpointAddress  (IN endpoint 5)
0x09	bmAttributes      (Transfer: Isochronous / Synch: Adaptive / Usage: Data)
0x00B4	wMaxPacketSize    (1 x 180 bytes)
0x01	bInterval         (1 frames)
0x00	bRefresh
0x00	bSynchAddress

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

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

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

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

AS Format Type 1 Descriptor:
------------------------------
0x0B	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x01	bFormatType   (FORMAT_TYPE_1)
0x02	bNrChannels   (2 channels)
0x02	bSubframeSize
0x10	bBitResolution   (16 bits per sample)
0x01	bSamFreqType   (Discrete sampling frequencies)
0x00AC44 	tSamFreq(1)   (44100 Hz)

Endpoint Descriptor (Audio/MIDI 1.0):
------------------------------
0x09	bLength
0x05	bDescriptorType
0x05	bEndpointAddress  (OUT endpoint 5)
0x05	bmAttributes      (Transfer: Isochronous / Synch: Asynchronous / Usage: Data)
0x00B4	wMaxPacketSize    (1 x 180 bytes)
0x01	bInterval         (1 frames)
0x00	bRefresh
0x86	bSynchAddress

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

Endpoint Descriptor (Audio/MIDI 1.0):
------------------------------
0x09	bLength
0x05	bDescriptorType
0x86	bEndpointAddress  (IN endpoint 6)
0x11	bmAttributes      (Transfer: Isochronous / Synch: None / Usage: Feedback)
0x0003	wMaxPacketSize    (1 x 3 bytes)
0x01	bInterval         (1 frames)
0x05	bRefresh
0x00	bSynchAddress

Microsoft OS Descriptor is not available. Error code: 0x0000001F

String Descriptor Table
--------------------------------
Index  LANGID  String
0x00   0x0000  
0x01   0x0000  "Teensyduino"
0x02   0x0000  "Teensy MIDI/Audio"
0x03   0x0000  "7681380"

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

Connection path for device: 
USB xHCI Compliant Host Controller
Root Hub
Teensy MIDI/Audio (VID=0x16C0 PID=0x048A) Port: 2

Running on: Windows 10 or greater (Build Version 19041)

Brought to you by TDD v2.15.0, Jun  8 2020, 17:18:07
 
Hey Frank,

the direction Host->Device

The "host" is the PC right? I am looking for information to flow from the PC -> Teensy.

To test this functionality without breaking anything I think it makes sense to create a new AC Input Terminal Descriptor for "Line In".

AC_Feature_Unit_Line_In.png

This line in can have a Terminal Unit, Mixer Unit, Processing Unit, and a Feature Unit. I think we are interested in the Terminal and the Feature Unit types.

Input_Terminal_Descriptor.png

We can use this document to determine the Descriptor Types and Subtypes, etc. USB Device Class Definition for Terminal Types

Input_Terminal_Types.png

So I think this is what we want for the LINE IN Terminal.

Code:
AC Input Terminal Descriptor:
------------------------------
0x0C	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x06	bTerminalID
0x0603	wTerminalType   (Line connector)
0x00	bAssocTerminal
0x02	bNrChannels   (2 channels)
0x0003	wChannelConfig
0x00	iChannelNames
0x00	iTerminal


====
Now we need the Feature Unit.

page 58 of http://dl.project-voodoo.org/usb-audio-spec/USB Audio v2.0/Audio20 final.pdf
The bSourceID field is used to describe the connectivity for this Feature Unit. It contains the ID of the
Unit or Terminal to which this Feature Unit is connected via its Input Pin.

Feature_Unit_Descriptor.png

So I think this is what we will want for our feature unit.

Code:
AC Feature Unit Descriptor:
------------------------------
0x0A	bLength
0x24	bDescriptorType
0x02	bDescriptorSubtype
0x0F	bUnitID
0x06	bSourceID
0x01	bControlSize
bmaControls: 
 0x01	Channel(0) - Mute
 0x02	Channel(1) - Volume
 0x02	Channel(2) - Volume
0x00	iFeature

I think that might do it. What do you think?
 
Note, I found where the descriptor definitions are.

Maybe I can simply add my feature to this, and maybe I can start getting something to work. Will try when I have a moment!

https://github.com/PaulStoffregen/cores/blob/master/teensy4/usb_desc.c

Code:
	// Volume feature descriptor
	10,					// bLength
	0x24, 				// bDescriptorType = CS_INTERFACE
	0x06, 				// bDescriptorSubType = FEATURE_UNIT
	0x31, 				// bUnitID
	0x03, 				// bSourceID (Input Terminal)
	0x01, 				// bControlSize (each channel is 1 byte, 3 channels)
	0x01, 				// bmaControls(0) Master: Mute
	0x02, 				// bmaControls(1) Left: Volume
	0x02, 				// bmaControls(2) Right: Volume
	0x00,				// iFeature
 
Status
Not open for further replies.
Back
Top