cancel
Showing results for 
Search instead for 
Did you mean: 

Cube USB library bug: descriptors are wrong in USB audio

tsuneo
Senior
Posted on September 06, 2016 at 16:30

STM32_USB_Device_Library

* @file usbd_audio.c * @version V2.4.2 * @date 11-December-2015 included in all of STM32Cube packages. 1) Audio format type conflict In this implementation, ''Type III'' format descriptor is assigned, but wFormatTag on AS interface desc is set to PCM (type III is not PCM). As Type III is not a popular one, it should be ''typo'' of Type I

line:288
/* USB Speaker Audio Type III Format Interface Descriptor */
0x0B, /* bLength */
AUDIO_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */
AUDIO_STREAMING_FORMAT_TYPE, /* bDescriptorSubtype */
AUDIO_FORMAT_TYPE_III, /* bFormatType */ <--- AUDIO_FORMAT_TYPE_I

2) bNrChannels conflict In the ''Type III Format'' (actually type I) descriptor, bNrChannels is set to 2 But in the input terminal desc, bNrChannels is 1 Also, wChannelConfig is wrong, even if it was mono

line:214
/* USB Speaker Input Terminal Descriptor */
AUDIO_INPUT_TERMINAL_DESC_SIZE, /* bLength */
AUDIO_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */
AUDIO_CONTROL_INPUT_TERMINAL, /* bDescriptorSubtype */
0x01, /* bTerminalID */
0x01, /* wTerminalType AUDIO_TERMINAL_USB_STREAMING 0x0101 */
0x01,
0x00, /* bAssocTerminal */
0x01, /* bNrChannels */ <--- 0x02
0x00, /* wChannelConfig 0x0000 Mono */ <--- 0x03, 0x00 (L/R front)
0x00,

Tsuneo #audio #usb
1 REPLY 1
Walid FTITI_O
Senior II
Posted on September 08, 2016 at 17:08

Hi chinzei.tsuneo,

Thanks for the feedbacks. I submit a request internally.

-Hannibal-