cancel
Showing results for 
Search instead for 
Did you mean: 

Why does USB audio streaming break when I use 16k sampling instead of 48k sampling

douglas2
Associate II

I'm using X-CUBE-MEMSMIC1, NUCLEO-L476RG, X-NUCLEO-CCA02M2, STEVAL-MIC002V1, STM32CubeIDE and set it up as described in the X-NUCLEO-CCA02M2 Quick Start Guide.

However, I changed the solder bridges for DFSDM 4-channel as described in Table 3 of UM2631. And I changed the source code from "#define AUDIO_IN_CHANNELS 2" to "#define AUDIO_IN_CHANNELS 4".

Recording 4 channels using Audacity appears to work fine as long as AUDIO_IN_SAMPLING_FREQUENCY = 48000 in the example program

When I change to AUDIO_IN_SAMPLING_FREQUENCY = 16000 I get an error in Audacity

What is preventing me from using 16k sampling?

3 REPLIES 3

The application continues to work otherwise (i.e. does not "freeze" generally)?

Check if the descriptors reflect the change, and if the transmitted data packets are appropriately sized.

If you desire more "instant" solution, you have to contact ST directly, through FAE or web support form. This is a primarily user-driven forum with only casual ST presence.

JW

douglas2
Associate II

Thanks JW for responding.

I did start by submitting a web support form and ST suggested that I post the issue to the Community.

I'm new to USB audio, and mostly new to ST tools, but the application does not appear frozen when I use the debugger, the parts of USBD_AUDIO_CfgDesc[] that do change look appropriate (although I may have missed something that should have changed but didn't), and the device variables that control the transmitted data packets look appropriate (although I'm not sure how I can check the actual USB packets)

How would I determine who my FAE is for ST?

> I'm not sure how I can check the actual USB packets

Using an USB analyzer (some oscilloscope and/or LA can decode USB to some extent). You would observe the exchange between device and PC, and compare to "known good" examples. USB is a complex and badly defined protocol, so "it appears to be OK" is often not good enough and you have to stick to the "usual" and "known working" patterns. I'm not sure 4 channels is something I would like to pursue through USB.

On the host side, Windows is notoriously picky, does not reveal much of the real information, and I know of no good debugging tool for USB. I know some users experiment with Wireshark. Another option might be to resort to Linux, as there may be more openness and more documetation and help around, but I am no expert in that either.

I can't really help you more at this point, you are mostly on your own. I may be able to answer some concrete questions, after you've drilled down to the basics.

JW