Implementing USB Audio / HID - Page 1
Forum section: electronics / general

author: MLM
author_rank: Contributor
timestamp: June 18, 2013, 02:42:54 am
content: I have been interested in making a USB 3.5mm mixer with multiple input/output channels but have not been able to find the starting point or dev board that will be able to accomplish this task. Most of the existing audio mixers cost hundreds of dollars and I am looking for a relatively low cost DIY solution.I recently got acheapy USB sound card(ebay search "usb sound card") from China just to see what is going on and they seem to be able to implement this in a tiny, super low cost solution. I am not sure if those cards are classified as a HID or just Audio device or if that is the spec that Windows uses to auto identify a microphone or speaker but that is what I am looking for.Most of my experience comes from FPGA's (Digilent Basys2 and Atlys) and I think that the Digilent SDK can is only good for transferring bits and not emulating a USB device. This of course would probably be possible through the I/O.I am going to be using this mixer / interface on a Windows machine but it would be nice if it used some specification of USB to be compatible with all OS without an external driver (Plug and Play).Relatively recently, I saw theTeensyused in a project to make a custom game controller. I do not see any documentation on implementing an audio device besides theMIDI articlebut maybe theUSB serial featureis able to send the audio stream data.Also I know for sure that the Teensy 2.0++ can be a HID Keyboard, Mice, Joystick and MIDI, but I want to know if the Teensy 3.0 has this same capability as well.The only reason I mention the Teensy so much is that it is the only board I have heard of that can be a custom USB device but I would be willing to go to any other solution.Here are some resources that I have found:Windows USB Drivers:http://msdn.microsoft.com/en-us/library/windows/hardware/ff538820(v=vs.85).aspxWindows Audio Control:http://msdn.microsoft.com/en-us/library/windows/hardware/gg462991.aspxTeensy Serial Article:http://www.pjrc.com/teensy/td_serial.htmlTeensy Keyboard Article:http://www.pjrc.com/teensy/td_keyboard.html

author: vvanders
author_rank: Regular Contributor
timestamp: June 18, 2013, 03:00:19 am
content: TI makes a few USB audio DAC chips that'll output in I2S but they're only a single stereo pair.

author: lgbeno
author_rank: Frequent Contributor
timestamp: June 18, 2013, 03:02:04 am
content: Have you looked at TI PCM2707? It's in a lot of semi cheap USB audio cards.

author: MLM
author_rank: Contributor
timestamp: June 18, 2013, 03:06:42 am
content: Quote from: vvanders on June 18, 2013, 03:00:19 amQuote from: lgbeno on June 18, 2013, 03:02:04 amAs soon as vvanders responded I pulled up that exact data sheet (PCM2707). Looks like there are only outputs on that chip which only works for half the interface.Thanks for the lead!

author: ve7xen
author_rank: Super Contributor
timestamp: June 18, 2013, 07:54:59 am
content: TI also makes PCM29xx series which are CODECs. I don't think they make any with I2S both in and out, but I'm not 100% sure.To clarify things a bit, USB has 'device classes' which specify the interface for certain standard types of gizmos. For example HID is the class used for human interface devices, this class provides for keyboards, mice, and is generic enough that it's often used for simple I/O. USB Audio Class devices implement audio transfer, but nothing else. For that reason, many of these controllers implement both Audio and HID classes, usually so you can attach buttons to the DAC and control the volume in the OS via HID. The way USB is designed, a single device can implement several classes simultaneously.All of these 'standard' classes are defined in the USB specification, which you can download from usb.org. It's not easy reading, but everything you need is there. If you are interested in a more readable, but still fairly technical overview of USB, this one is quite good:http://www.beyondlogic.org/usbnutshell/usb1.shtmlAs far as practical applications, there are some real problems with the Audio Class 1.0 spec that make it difficult to use:For some reason most OSs only implement the clock mode which requires the device to synchronize with the PC's clock based on the 1ms USB frame timing. This is tricky to implement correctly on the device side, and results in having to use a pretty shitty clock there too.I don't remember why this limitation surfaces (I think it's due to frame size and the fact that only a single frame can be sent per 1ms USB poll), but it's only capable of full-duplex at 48khz/24bit maximum. 96khz works in half-duplex. Also 24-bit might not actually be 24-bit in Windows, IIRCAudio Class 2 is much better, but only Linux (and maybe OSX, but I don't use Apple products) has implemented it, and it's quite a lot more complicated so AFAIK there aren't any premade chips or anything for it yet (probably also driven by the lack of OS vendor support). I think there are ways to hack the commercial drivers available into working with your hardware...but meh... There are some projects / parts out there though. I think XMOS has a specific audio devkit with UAC2 code available. If not, I know the DIYAudio community was working on something. There is SDR-Widget/Audio-Widget which I mentioned in another thread, an AVR32 open-source solution (does UAC1 too). If you look around you can find some people making USB->I2S modules that can do UAC2 too, I know there's a company using them as the basis for a modular signal processing solution, but I can't remember the name right now. Somethnig Brick maybe.If all you want is basic I2S in/out, I have done it with the STM32F105 (I think...whichever is the lowest that has the I2S peripheral). ST's software package include an Audio Class 1.0 example that works well enough out of the box, and with Win7 or Linux/OSX you can configure it to use an external clock and it works fine, which isn't generally possible with the ASICs (WinXP didn't support this mode, IIRC). That makes it a pretty good basis for a decent fidelity system, but you're still limited to 48KHz if you want full-duplex. It should be possible to make a UAC2 firmware for this chip, but I never got around to it. I have a board layout and might still have my hacked up ST firmware for a half-duplex board using this chip, if you're interested. Haven't touched it in a while, but it worked fine.Finally, I think this would be a serious challenge to implement on a midrange 8-bit micro like the AVR in the Teensy. I2S is a fairly high bandwidth interface, and these chips don't generally have a peripheral to handle it. Getting the timing right would be hard (you'd probably have to abuse both timers and the SPI peripheral to do it), and just consuming the data quickly enough would be a fair challenge also, depending on how the USB peripheral works. Only 8K of RAM also means you don't have much buffer available, and tightens your timing requirements. A single packet on the USB with 1ms of audio data would take up almost 1/4 of your RAM. And forget about trying to send data back at the same time.

author: amyk
author_rank: Super Contributor
timestamp: June 18, 2013, 10:38:03 am
content: The cheap USB ones are based on a single-chip SoC that usually has an 8051 core with a USB controller and DAC, so maybe an AVR isn't that far off.

author: andersm
author_rank: Super Contributor
timestamp: June 18, 2013, 12:12:05 pm
content: Quote from: ve7xen on June 18, 2013, 07:54:59 amUSB Audio does specify some basic controls like mute and volume, which is how the OS's built-in volume control widgets work.TI's TUSB3200A used to be a common audio streaming solution, it's a 8051 core with a USB codec interface supporting up to 8 channels IIRC. It also has a very capable audio clock generator made it a popular option for low-jitter streaming. On the downsides it's a bit of a pain to program for and the SDK is basically a lightly commented code dump. It's also been downgraded to NRND status with no direct replacement.

author: ve7xen
author_rank: Super Contributor
timestamp: June 18, 2013, 03:53:45 pm
content: Quote from: andersm on June 18, 2013, 12:12:05 pmInteresting. It's been a while since I perused that spec. I wonder why all of the TI ones with controls implement HID for it.

author: MLM
author_rank: Contributor
timestamp: June 18, 2013, 07:42:22 pm
content: Quote from: ve7xen on June 18, 2013, 07:54:59 amThanks for the USB HID vs Class clarification.I am not looking for ultimate fidelity or high bitrate audio just something without noise or whining. I am using Windows 8 but I am sure that anything that working on Windows 7 will work fine on 8. The XMOS article says "Audio Class 2.0 has been fully supported in Apple OSX since version 10.6.4. [...] Audio Class 2.0 is not supported natively by Windows operating systems, a driver is required to be installed." but I think UAC 1.0 will be the way to go in this project.Just learned what Full and Half duplex means...Full Duplex: Send AND Recievce Data at the same timeHalf Duplex: Send OR Receive Data one at a timeThe XMOS setup looks nice but it looks like it only comes in BGA fromDigikey-U16A-128-QF124used in the block diagram for sale but similarXS1-U16A-128 products are available for $21-$28.The dev boards also look pretty pricey in order to use the chips in a nice form factor.TheDIYAudio article: Open-source USB interface: Audio Widget. The hardware seem to be sold out or expensive ($100 or more). The code is openly available ongoogle codeso maybe a Atmel AT32UC3A3 dev board with that code could work (not sure on prices of those boards).TheCP2114 Audio Bridgefrom Silicon labs looks like it would work with lots of Codec and DAC chips so it would be a matter of finding the right one.Here is a nice articleexplaining the chip. It says it can be used for USB Digital Audio Out (Audio Playback Device) and USB Digital Audio In (Microphone/Recording Device) but can only do 16 bit audio."USB Audio Class 1.0" (UAC 1.0) is returning some promising google results. This might be a cool thing to implement or find in VHDL on a FPGA but I am sooo uneducated on this spec.I am also looking for some chips with a 8051 core with a USB codec as amyk mentioned to see what they can offer.Other Resources:DIYAudio SDR widgetXMOS USB Audio ArticleCP2114 Audio Bridge

author: ve7xen
author_rank: Super Contributor
timestamp: June 18, 2013, 08:29:30 pm
content: I haven't followed this arena for a while, so take my information with a grain of salt. IIRC XMOS include a Windows UAC2 driver in their development kit for the CPUs. There are also a couple private ones that supposedly work by hacking the .inf files. I couldn't get this to work with my SDR-Widget.SDR-Widget PCB sets are occasionally sold, you get the PCB and the difficult to source ES9023 DAC for around $35. The rest of the parts add up to around $80. This gets you a better than -110dB THD+N DAC/ADC that can do 192KHz/24bit in UAC2 mode. It's not 'audiophile' grade in that it doesn't use fancy capacitors or anything, but specs and testing prove it out as low distortion and low noise. The only hard part of the build is soldering the AVR32.If you're happy with UAC1 and are going for a simple low-noise output that SiLabs part looks interesting. I wasn't aware of that one. It supports a CODEC, and there are some pretty good ones out there from Wolfson and others, or it can probably be used with a separate DAC and ADC (don't have time to check the datasheet at the moment). Bonus, it's cheap and readily available. Though really the low-effort PCM29xx option does a fine job for basic needs.

author: amyk
author_rank: Super Contributor
timestamp: June 19, 2013, 11:43:24 am
content: Quote from: MLM on June 18, 2013, 07:42:22 pmThere's literally dozens of companies making these, mostly in China... here's someNuvoton W681308http://www.cmedia.com.tw/ProductsIndex.aspx?ClassifySerno=26http://www.sonix.com.tw/sonix/family.do?f=4http://www.tenx.com.tw/<- The cheapest USB sound cards seem to be based on their chips, there are tons of complaints about the sound quality but that's because the manufacturers are so cheap thatthey omit things like DC blocking capsand any other filtering/decoupling.

author: MLM
author_rank: Contributor
timestamp: June 19, 2013, 09:43:32 pm
content: Quote from: amyk on June 19, 2013, 11:43:24 amThanks for links!I am still undecided on how I will go about tackling this project. Most of those chips only have a max of 2 ADC and 2 DAC so I would have to use multiple chips in order to get 4 channels. TheMAX9880Ais an example of this type of codec...My goal is to create a 4 channel 24 bit(maybe 16 bit) i/o 3.5mm audio interface that is Plug and Play(USB Audio Class 1).My solution seems to be a microcontroller with USB Audio Class example or support for USB isochronous interface where I can feed the 4 streams and assemble the packets to go in or out of the device.

author: ve7xen
author_rank: Super Contributor
timestamp: June 20, 2013, 12:25:45 am
content: I don't think you'll get 4 channels out of UAC1, the required frame size is too large for 'CD quality' sample rates and bit depth.UAC2 can probably do it, just keep in mind you need 2 I2S interfaces then.You could also do it by integrating a USB hub into your design (you can use UAC1, then), but you might have sync issues.

author: mariush
author_rank: Super Contributor
timestamp: June 20, 2013, 01:49:46 am
content: In case anyone's curious, here's the insides of one of those $2-3 usb soundcards, based on a C-Media IC (the chip is laser engraved, but really hard to see without some good light and can't be bothered right now)I bought it with the idea to use it for the microphone, because the tv tuner I have is an old design that uses sound card's line in feature to get the sound from tuner to system, and the sound card can only record from one source at one time. So I couldn't use microphone in games while having the TV tuner running on the second monitor.Well turns out the recording quality is horrible, really hard to adjust microphone sensitivity, output is hissy (too high amplification maybe preset on usb stick) and lacks any kind of sensible filtering (isn't smart enough to isolate my voice and remove sound from speakers on desk and so on)I remember i checked the datasheet for the IC when I opened this thing for the first time and the layout is based on the application note in the datasheet, nothing different.Warning, pictures are large 3000x something...

author: ve7xen
author_rank: Super Contributor
timestamp: June 20, 2013, 03:33:15 am
content: Yeah, I tried to find one of these cheap modules with a line-in (rather than mic input) to use for digital ham modes, and didn't have much luck. Most of them are high-gain mic inputs only, and many will only do 8Khz on the input too.The outputs aren't completely useless though, better than a lot of onboard sound, especially on laptops.

author: MLM
author_rank: Contributor
timestamp: June 20, 2013, 04:29:37 am
content: Quote from: ve7xen on June 20, 2013, 12:25:45 amA hub is just fine as long as the naming scheme of the device can remain the same. I am not sure on how to set the name of the device yet or have read this feature in any datasheets or readings yet (may not be possible)...Quote from: mariush on June 20, 2013, 01:49:46 amThe cards I got look almost identical except I have some black hard guck on the bottom so I can't see the main chip at all. I have the same problem with hissy, whiny output on speaker line and the volume control on 1 was normal and 100 was ear splitting. Mic seemed reasonable but my testing was limited and I just got a refund on those hunks of crap.--I am looking at thePCM3168Aaudio codec chip at the moment but I am not sure exactly how the whole thing works. I think you can use SPI to change settings, send commands and get all of the data from the lines but I am unsure if it is full-duplex. The features that grab me are 24 Bit, 8 DAC soo that is 4 channel stereo output, and 6 ADC sothat will work for 4 mono microphones (which mics usually are mono....)that will only work for 3 stereo inputs (chip out of the picture).That codec would require a microcontroller or FPGA middle man and then a USB isochronous interface chip to send it off to the PC. ve7xen mentioned that UAC1 probably doesn't have the bandwidth from a single device so I may need to have several USB isochronous chips connected to a USB hub chip which then goes to the PC.

author: ve7xen
author_rank: Super Contributor
timestamp: June 20, 2013, 05:52:06 am
content: I think you will have problems trying to use the same CODEC with independent USB chips. All of these chips that I'm aware of only run in master clock mode, which means they will all be recovering their own clock to drive the CODEC with (which expects a single synchronous clock for all channels). I doubt these clocks will sync up well enough that this will actually work properly. They may be out of sync enough that you actually have issues keeping things in sync between them. I know they all sync from USB's 1ms frame timing, which I believe can potentially be generated differently for each device depending on which root port it's on etc. You'd probably need independent stereo CODECs (or DAC/ADC pairs) for each USB channel if you go this route, or at least it would be the easier place to start. Depending on the details this can also cause real-world problems in that playback to the different devices will run at different speeds and drift out of sync / cause audio glitches. If you plan to implement your own UAC->I2S core and have a microcontroller for each channel you could use slave clock mode to handle this, but there are still the OS-side sync issues. This mode is actually quite a bit simpler to implement on the micro because you don't have to do clock recovery and sync with the PC.I think this synchronous clocking requirement is the main reason there are not many multichannel USB sound cards out there, and why almost all of them that do exist implement their own protocol so they can generate the clock themselves. UAC2 can handle this, but lack of OS vendor support and uptake means the existing proprietary protocols are still winning out for now anyway.Unless you're a reasonable firmware developer (and with the SDR-Widget code to examine this is much easier than when I was looking into it) willing to implement UAC2, these clocking issues could be a serious problem in practical use, especially if you actually want the audio coming out to be in sync for e.g. multichannel surround sound. The problems get thornier when you start trying to *actually* synchronize several independent (to the OS) audio devices in the OS.Anyway good luck, I still have some interest in this stuff and would like to see more experimenting, especially with some of the cheap Chinese USB chips. Maybe they can do some cool stuff, everyone seems stuck on the PCM2xxx series which are quite boring by now.I pulled my dev board for the STM32->I2S project out of the 'dead projects' box and hooked it up. Works, and sounds great when it's not clipping the output, not sure what's up there but I don't think it's the I2S interface, might be clipping the input to my amp, it doesn't occur if I turn it down from full scale. I need to try it with another DAC. Only 96KHz/16bit, half-duplex, just output. Doesn't support any other clocks in slave mode because of my fixed divider clock arrangement. I managed to find my hackish source (mostly ST's demo source with a few modification) if you want somewhere to start from. I am using STM32F105 and WM8524 (simple, cheap and not horrible) on my demo board.

author: andersm
author_rank: Super Contributor
timestamp: June 20, 2013, 10:26:49 am
content: Quote from: ve7xen on June 20, 2013, 12:25:45 amThe max frame size for full-speed isochronous is 1023 bytes, which allows for 10 channels of 16-bit 48kHz audio.

author: amyk
author_rank: Super Contributor
timestamp: June 20, 2013, 12:40:56 pm
content: Quote from: mariush on June 20, 2013, 01:49:46 amNotice the missing output coupling caps that have been bypassed with 0-ohm resistors, and general lack of supply filtering... it'd probably perform a lot better with those parts present.

author: MLM
author_rank: Contributor
timestamp: June 20, 2013, 02:27:27 pm
content: Quote from: ve7xen on June 20, 2013, 05:52:06 amI actually do have aSTM32F303VCT6 Discovery board(Cortex M4) but I am not sure if your code would be compatible and I am not very versed in this board (I just ran the demo project basically). I am guessingthis is the STM32->I2S code projects.I am not looking for a seperate USB isochronous interface if the board supports isochronous transfer or has a nice demo to work off of. The looking for a chip is just to make USB easier if needed. If anyone knows a list of good boards that support this kind of thing then that would be greatly appreciated.Also found thisAudio Class from mBedwhich are ARM boards so I think it cold work on the STM32F303 board I have (unsure of transfer type).Quote from: andersm on June 20, 2013, 10:26:49 amHere is acool article I found on Isochonous transfer. It does say full-speed isochronous is 1023 bytes so I can confirm whatandersmsaid. 24 bit is 3 bytes. 3 (byte length) * 48 (each ms, speed) * 4 (channels) = 576 bytes which fits in the 1023 byte limit. Also max of 7 channels at 24 Bit 48KHz.Update:I think that is just a mono channel??? so in order to get stereo it would need to support 8. Looks like the limits force a USB hub setup or 16 bit audio.----Other Resources:Fundamentals of USB AudioHow to transfer data to USB isochronous endpoints

author: C
author_rank: Super Contributor
timestamp: June 20, 2013, 06:35:51 pm
content: The ST STM32F4 discovery board has some audio chips on it.Edit: has software examplesC

author: ve7xen
author_rank: Super Contributor
timestamp: June 20, 2013, 10:42:51 pm
content: Quote from: andersm on June 20, 2013, 10:26:49 amYeah you're right, I was misremembering the limitation. I should've known better, knowing 24-bit 96KHz is possible. You can do 8 channels of 16-bit audio. 24-bit isn't doable at 48khz (1152b).QuoteWith the USB library code ST provides (for the Cortex M3 chips anyway) are some examples. One of them is UAC streaming, it works out of the box with a certain DAC they have coded control stuff for. I basically just ripped all of that stuff out and modified it a bit to do asynchronous mode and it works with a simple no-config-interface DAC. My modifications are very minimal, I'm sure if that example exists also for the F3 series you'd have no trouble getting basic stereo output going. Multichannel and full-duplex would be a bit trickier.

author: joseph.anand
author_rank: Regular Contributor
timestamp: July 04, 2013, 11:30:04 am
content: Well not sure what you're exact requirement is. I have been working on this for quite sometime now and the only suitable way is for you to implement UAC2. A easier solution would be to use two TI 290Xc series chips running of a single USB hub.I initially tried working with the Microchip development kit (but the firmware is crap, drops packets and the source code is pathetic). However I've realised of late that the most time-efficient and easiest solution is to use one of the many multi-channel codecs available from TI, AD, etc, and try interfacing to either a Raspberry Pi, or a Beaglebone black over the I2S port. Linux kernel support is available for most of these I2S devices (they normally use TDM) . If you want a device to interface to your PC, then you can try to implement the code to configure the Beaglebone black as an USB Audio device (UAC2).

author: MLM
author_rank: Contributor
timestamp: July 04, 2013, 08:04:15 pm
content: Quote from: joseph.anand on July 04, 2013, 11:30:04 amI've come to the same conclusion (as a plan). I am going to use 4CS4270chips and some sort of FPGA or microcontroller to interface the chips to the PC. My problem is that there doesn't seem to be much information on which boards support UAC1, UAC2, isochronous transfers, or USB communication in general...

author: thinlayer
author_rank: Contributor
timestamp: July 09, 2013, 01:58:46 pm
content: USB on FPGA can be a huge pain in the arse. Suggest an external MCU for the USB, something with a nice canned USB (pref USB Audio) then a parallel or other interface to FPGA.Have you looked at PSOC. I'm sure there is a USB Audio block in PSOC Creator or app note about it somewhere. I'm pretty sure there is a reference design too, but it's mono with low bitrate.

author: joseph.anand
author_rank: Regular Contributor
timestamp: July 10, 2013, 09:11:33 am
content: Most microcontrollers will not support USB 2.0 High speed (their clock speeds are too low to handle) which is what you will need to be able to implement UAC2. Instead try using the Beaglebone/Beaglebone black (https://groups.google.com/d/topic/beagleboard/qdLcceqH3ms). Also avoid using multiple codecs and decide on one that supports multiple audio input/outputs like the Analog Device's AD193x series (http://www.analog.com/en/codec-afe-mxfe/audio-codecs/ad1937/products/product.html) or the TI's PCM3168A .Quote from: MLM on July 04, 2013, 08:04:15 pm

author: ve7xen
author_rank: Super Contributor
timestamp: July 10, 2013, 09:47:18 am
content: USB2-HS is not required for UAC2.

author: MLM
author_rank: Contributor
timestamp: July 10, 2013, 02:02:29 pm
content: Quote from: joseph.anand on July 10, 2013, 09:11:33 amMultiple people have mentioned the Beaglebone Black but I have found no information on using it as a USB peripheral, UAC 1.0. Maybe it is because I do not have it in hand or used it before but could someone explain how to implement this functionality. I am guessing you have to use the USB client port on the bottom.

author: elektrinis
author_rank: Regular Contributor
timestamp: September 25, 2020, 04:41:33 pm
content: Old topic. Anyone managed to pull off an easy multichannel I2S solution?I am interested in a 5.1 audio amp with I2S class-D power stages, so no analog signals inside.

author: EverydayMuffin
author_rank: Regular Contributor
timestamp: September 26, 2020, 01:49:56 pm
content: Quote from: elektrinis on September 25, 2020, 04:41:33 pmI would think the XMOS xcore-200 devices would be perfect for this application?https://www.xmos.ai/xcore-200/

author: ua1arn
author_rank: Newbie
timestamp: September 27, 2020, 12:43:55 pm
content: I can share own USB descriptors as example...https://github.com/ua1arn/hftrx/blob/master/src/usb/usbd_descriptors.cAt OUT direction no feedback methods utilized, only resampling.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: September 27, 2020, 05:59:55 pm
content: Have you thought about using a complete Linux PC as your sound device?With USB OTG it can be used as a USB device to your windows USB Host, and there is all kinds of software for audio manipulation for Linux available. You can do most software development on a regular Linux box, or emulator or VM in Windows.A potential problem with with any digital audio is latency. An AES/EBU or S/Pdif stream has very low latency, but when you add buffering of data, extra buffers for changing protocols such as going to USB, and buffers needed to do actual filtering, then they all add up.Relating to this question also "minidsp" popped up in my memory:https://www.minidsp.com/It's just an example, other companies make similar products.

author: ve7xen
author_rank: Super Contributor
timestamp: October 01, 2020, 12:01:21 am
content: Quote from: elektrinis on September 25, 2020, 04:41:33 pmYou can buy an XMOS solution off the shelf from DIYINHK for examplehttps://www.diyinhk.com/shop/eol-product/101-xmos-multichannel-high-quality-usb-tofrom-i2sdsd-spdif-pcb.htmlImplementing the XMOS reference code for UAC2 if you wanted to design your own isn't too terribly difficult either.

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 02, 2020, 04:07:30 pm
content: The OP can also refer to this thread:https://www.eevblog.com/forum/microcontrollers/usb-audio-class-2-0-on-a-microcontroller/