I'm a little confused how to add support for multiple bit rates/sample rates in USB Audio Class 2.0. Compared to USB Audio Class 1.0 (which gives you an option on adding multiple rates and such), USB Audio Class 2.0 doesn't give that option. How would I change my descriptors for that? I read somewhere that you use more alternate settings but I don't know how that would help...
Here's my audio format descriptor:
audioformat.bLength = sizeof(usb_audio_format_type_1_desc_t)
audioformat.bDescriptorType = 0x01
audioformat.bDescriptorSubtype = 0x02
audioformat.bFormatType = 0x01
audioformat.bSubSlotSize = 3
audioformat.bBitResolution = 24
Thanks!
Yea so I figured it out and thus bounty doesn't really matter.
To do multiple bit rates: Have alternate settings with its corresponding audio data format descriptors/etc to support different bit rates in order; for example: Alternate Setting 0 (no endpoints), Alternate Setting 1 (with all stream/class descriptors, format descriptor supports 16 bits), Alternate Setting 2 (with all stream/class descriptors, format descriptor supports 24 bits).
To do multiple sample rates: You have to follow the USB Audio Class 2.0 doc with the CUR, MIN, MAX format and give control to the host.
For example:
As reference, LE8 is lower endian 8 bits and the defines are converting a 16 or 32 bit integer into an array of 8 bit integers formatted in lower endian.