Composite USB-CDC and Audio Class

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Composite USB-CDC and Audio Class

跳至解决方案
3,948 次查看
mjbcswitzerland
Specialist V

Hi All

 

I am attempting to make a USB device composite with CDC and Audio class.

The audio calls and CDC configurations work on their own and the CDC works in the composite but the interfaces in the audio class don't - the host says that they are somehow incorrectly configured (the host does however sent a Setinterface to each of them).

 

The configuration descriptor defines the CDC interfaces first (as interface association descriptor  with CDC control as interface 0 and CDC data as interface 1), followed by 3 audio interfaces (audio control = 2, loud speaker = 3, microphone = 4).

 

The only thing that I am aware of that should influence the audio configuration when the interfaces are changes is in the audio control interface's function header where two audio interfaces and their first and last interface numbers are specified:
- Audio alone these are 1 and 2.

- With CDC before it (with its two interfaces) 3 and 4 are specified instead.

 

Has anyone done this or know the details as to what can go wrong?

 

Regards

 

Mark

标签 (1)
0 项奖励
回复
1 解答
3,003 次查看
mjbcswitzerland
Specialist V

Update:

Solved with an interface association descriptor wrapped around the audio interfaces.

Regards

Mark

在原帖中查看解决方案

0 项奖励
回复
3 回复数
3,004 次查看
mjbcswitzerland
Specialist V

Update:

Solved with an interface association descriptor wrapped around the audio interfaces.

Regards

Mark

0 项奖励
回复
3,006 次查看
michaelhuslig
Contributor IV

Hi Mark,

I am trying something similar and getting the same error:  "This device cannot start. (Code 10) The I/O device is configured incorrectly or the configuration parameters to the driver are incorrect."


  I am 'basically' trying to add the audio components from the current sdk example dev_composite_hid_audio_unified to the dev_composite_cdc_vcom_cdc_vcom example.  In other words, adding the audio to a dual cdc/vcom implementation on a custom board.  I tried adding the IAD:

    /* Interface Association Descriptor for audio */
    USB_IAD_DESC_SIZE, /* Size of this descriptor in bytes */
    USB_DESCRIPTOR_TYPE_INTERFACE_ASSOCIATION,    /* INTERFACE_ASSOCIATION Descriptor Type  */
    0x04,    /* The first interface number associated with this function (4 previous interfaces for vcom*2) */
    0x03,    /* The number of contiguous interfaces associated with this function */
    USB_AUDIO_CLASS,    /* The function belongs to the Audio Class  */
    USB_SUBCLASS_AUDIOCONTROL,
    0x00,    /* The function uses the No class specific protocol required Protocol  */
    0x02,    /* The Function string descriptor index */

but it doesn't help.  As far as I can tell, I have adjusted all the parameters, indexes, counts, etc. that need to be changed.  I am out of ideas.

Mike H.

0 项奖励
回复
3,005 次查看
michaelhuslig
Contributor IV

I got it to work by switching the order of the audio and cdc descriptors in the configuration descriptor.  I had used the correct parameters as far as I knew.  I also switched the audio and HID descriptors in the original audio_unified clone, changing the endpoint and interface indices as needed, and that also caused the windows error.  So the real cause is still up in the air.

Mike H.

0 项奖励
回复