USB audio interface with high frequency PCM - Page 1
Forum section: electronics / projects

author: RawCode
author_rank: Regular Contributor
timestamp: August 02, 2022, 06:57:17 pm
content: Hello everybodyI was starting an audio project when I encountered this product on the web:https://www.aliexpress.com/item/2255800529579438.htmlIt uses an STM32F4 in tandem with an FPGA to achieve a 32-bit PCM transmission of 1536 kHz or a 32-bit DSD1024 transmission. I also saw different audio interfaces with an XMOS microcontroller which achieves similar performances.The question is this: how can I develop such things?ST has an application note on how to implement a USB Audio Class 1.0, which is something, but such a class top at 24-bit/96 kHz. Other than this, I didn’t find much and I didn’t find anything about the DSD part.I know that implementing such things is not a picnic at the park, and I also know that this topic could be considered “audio-phoolery”, but I’d like to know how to develop such an interface to integrate it into my audio project. I don’t care if it’s difficult, I’d like to learn how to do it.Where can I start? Is there any documentation? Any “blueprint”?If not, how can I “upgrade” the ST’s application note from Audio Class 1.0 to Audio Class 2.0?As always, thanks in advance 😊

author: SiliconWizard
author_rank: Super Contributor
timestamp: August 02, 2022, 07:06:45 pm
content: With the STM32F4 + USB PHY (here an USB3300), you can get USB 2.0 HS and a decently powerful MCU.Not sure what this product does with the FPGA exactly - I think you should be able to implement a reasonable audio interface with just the MCU+USB PHY. Maybe it's for the number of audio I/Os? I don't quite remember the max number of I2S outputs those MCUs can handle, but it's always limited. Maybe it's also for the DSD encoding, not sure the STM32F4 would be able to handle this on its own.In any case, the part done in FPGA would not require a large FPGA. A pretty entry-level one should do the trick.As to USB Audio 2.0, I would really suggest looking at TinyUSB if you have no prior experience with implementing USB audio. It does support UAC2, it's rather easy to use, and it's also easy to port to different MCUs since it supports a number of them. (The STM32F4 is supported for USB HS.) It comes with examples for various classes.https://docs.tinyusb.org/en/latest/reference/index.html

author: RawCode
author_rank: Regular Contributor
timestamp: August 04, 2022, 04:29:32 pm
content: Thanks for the reply!As far as I understood, the FPGA is reclocking the incoming data to a more precise clock. Probably it uses an internal FIFO implemented on the FPGA, but I can't see a RAM IC on the board that I linked. Probably, as you said, it also manages the DSD decoding.Thank you also for suggesting me TinyUSB. I noticed that has a USB UAC2 example, which is ideal, but I'm seriously struggling to make it work even with the simple CDC example. Even following a tutorial online, I can't manage to compile the source in STM32CubeIDE. Do you have experience with STM32 microcontrollers and TinyUSB? If yes, have you managed to make it work with your build environment?

author: SiliconWizard
author_rank: Super Contributor
timestamp: August 04, 2022, 07:02:50 pm
content: I have use TinyUSB with the RP2040 and the NXP iMXRT1062 (both pretty different targets), but not with STM32 MCUs.In both cases, I use makefiles. I have experience with STM32 but not with STM32CubeIDE. Maybe the following will help?https://github.com/hathach/tinyusb/discussions/633

author: sam[PS]
author_rank: Contributor
timestamp: August 22, 2022, 03:56:56 pm
content: Not sure what you want to do ? Just transmit datas ? or real world DSP with ADC and DAC ? In the second case you are just asking trouble for nothing.Human ear have a dynamic range of 130dB. That is from no sound at all (never happen in real life, the most silent you'll ever get will be around 20dB spl) and up to the point of instant permanant earring damage (the pain level is around 110db spl, max recommended level is way under). So a more appropriate dynamic range to consider would be about 90dB. So about 6dB per bit that's 15bits, why do you think sony and philips used 16bit for CD ? Now let's say you really want the "full" dynamic range of 130dB (for some S&M parties maybe ?) then we are talking about 22bits. There can be argument in studio to convert in 24bits so that if the sound engineer did not set the levels exactly right you can make up for it in post. But 32bitThat is 192db of dynamic range !Now let's talk a little bit about electronic and give some orders of magnitude. A simple top quality 100\$\Omega\$ resistor in your signal path gives you a SNR of about 137dB @10vrms, best super duper shmick discret amplifier you can barely touch the 140db, best opamp IC you'l be lucky to get 130db SNR ...So not only is totally useless for audio, but it is electronically speaking nuts, you are only adding bits to quantize more precisely your analog frontend noise. This is not audiophool, it's just not audio and not electronic engineering. It's pure marketing bs.If you want better quality audio focus on making a top notch 24bit interface with true full 142db useful dynamic range. That is already one hell of a chalenge, the bigger chalenges being the front end and the sampling clock cause at 24bits the clock jiter noise is probably the main concern. The converter in itself is not much a problem as in audio most use some kind of sigma delta converter so the "bits" are calculated not directly converted, the actual conversion is most often 4bits. If you want more bit at the output it's easy to add more that's why IC manufacturer sell 32bit converters, because it's cheap and easy and marketing want it so why not. But really making just 24bits actually useful is another story, much more challenging than transferring "class 2.0 PCM audio". Unfortunately because of the truckload of misinformation on the subject doing so will hardly result in any marketing advantage because "but it's just 24bit". Selling interface to feed bats with 12extra bits of ultrasound noise seams to be the way to go to make a career in audio electronic these daysNow if we are talking about purely digital things where the signal is not gonna be converted in analog and nor into sound then ok, there can be case for intermediate computation where that can be useful but then it's just data.Just my 2cts...