Teensy 4.x USB Audio Output for +4 MEMS Microphones (PDM/I2S) to Raspberry Pi 4

tbonerod

New member
Hi everyone,

I'm currently working on a project that involves capturing audio from more than 4 digital MEMS microphones (PDM or I2S), and then sending the data in parallel and simultaneously to a Raspberry Pi 4 for further processing.

I’m aware that the standard USB Audio Output on Teensy is limited to stereo (2 channels), which presents a significant limitation for this application. However, I’ve come across a few interesting efforts to overcome this, such as the modified USB audio library project here:
👉 https://github.com/alex6679/teensy-4-usbAudio

I’ve also reviewed related discussions on this topic, which confirm the limitations but don’t seem to offer a fully working solution yet:




Before I dive deeper into trying to adapt or build upon the above solutions, I wanted to ask:

Has anyone managed to stream 4 or more audio channels over USB from a Teensy 4.x to a host like the Raspberry Pi 4?

Is there any known working patch or fork that successfully enables multi-channel USB Audio Class support on Teensy?

Are there alternative approaches you’d recommend for parallel audio data transfer to the Pi (e.g. SPI, Serial, or custom USB descriptors)?

Any help, advice, or experience would be greatly appreciated!

Thanks in advance,
 
I've contributed a bit to the https://forum.pjrc.com/index.php?th...-multi-channel-outputs-not-just-stereo.70176/ effort (which is the thread relating to https://github.com/alex6679/teensy-4-usbAudio), and it seems to be the closest to working. There appear to be issues with some Macs, but I believe Windows and Linux are OK, so there's a fighting chance a Raspberry Pi will work too.

I can only suggest you give it a try (maybe try the stock stereo code first), and report back on that thread - the more positive tests we get, the more likely it is it'll get pulled in at some point.
 
I've contributed a bit to the https://forum.pjrc.com/index.php?th...-multi-channel-outputs-not-just-stereo.70176/ effort (which is the thread relating to https://github.com/alex6679/teensy-4-usbAudio), and it seems to be the closest to working. There appear to be issues with some Macs, but I believe Windows and Linux are OK, so there's a fighting chance a Raspberry Pi will work too.

I can only suggest you give it a try (maybe try the stock stereo code first), and report back on that thread - the more positive tests we get, the more likely it is it'll get pulled in at some point.
Thanks for the reply!

That’s encouraging to hear. I’ll definitely give the teensy-4-usbAudio project a try—starting with the standard stereo USB Audio to confirm the baseline, and then moving on to test the 4-channel output. I’ll be using a Raspberry Pi 4 as the USB host under Linux, so I’ll make sure to report back on compatibility and performance in the thread. Hopefully this can help move things forward toward broader support.

On a related note, do you happen to know of any other microcontrollers or “ready-to-use” development boards (similar to the Teensy ecosystem) that might support multi-channel digital MEMS microphone input and USB audio output to a Raspberry Pi or PC? I’ve looked into the MCHStreamer by miniDSP, which seems very capable for this use case—but it’s a bit pricey for a prototyping stage. Essentially, I’m looking for an interface between several digital MEMS microphones and the Raspberry Pi that can stream 4+ channels of audio in sync over USB.

Any suggestions or insights would be very welcome!
Thanks again!
 
This looks like a relevant thread: https://forum.pjrc.com/index.php?threads/number-of-simultaneous-mics-possible.73469/. You should be able to get the maximum channel count of 8 using I²S microphones and an AudioInputI2SOct object.

I know there was a microphone array that caused all sorts of issues, and the eventual conclusion was that it just didn't work as advertised (at least with Teensy). I can't find a link to the thread right now, unfortunately.
 
Thanks again for the info!

Just to clarify, I'm not using a prebuilt microphone array. In my case, I will be working with individual digital MEMS microphones (most likely I²S), each with its own data line. Though I don’t think this changes much in terms of Teensy compatibility, I figured it was worth specifying.
The AudioInputI2SOct object does sound promising, but from what I’ve read (and based on your comments), Teensy might not offer the level of stability and robustness I’m looking for—especially for a production-grade solution where multi-channel USB audio needs to be reliable and fully supported.
Unless I can get a solid and consistent 4+ channel stream into the Raspberry Pi via USB without resorting to hacks or fragile setups, I might need to look elsewhere. It’s unfortunate, because the Teensy platform is great in so many ways.

Still, I’ll give the modified USB audio output a shot and report my findings, just in case it helps move the project forward.
Thanks again for all the input!
 
I know there was a microphone array that caused all sorts of issues, and the eventual conclusion was that it just didn't work as advertised

Indeed, avoid ICS-52000 !!!

On top of that part appearing to have been designed for lower sample rates and (probably) not working well at 44100 Hz, years ago there was an inexpensive "notwired.co" 4 mic board that just didn't work. I remember buying one and testing it, because we had a person who poured a lot of fruitless effort into that board (and created many duplicate forum topics along the way). I did get it to "work" but the mic sensitivity was so low as to be basically worthless. My impression was flux or conformal coating or other material contaminated the bottom side of the board, effectively plugging the audio input ports on the 4 mics. The 4 mics were transmitting data I could see on my scope, and I could get them to respond by physically tapping the PCB. But they has pretty much no response to even fairly loud sounds.

I still have a breadboard underneath a pile of other stuff, with my own ICS-52000 breakout boards. I haven't touched it in years since all interest in ICS-52000 seems to have faded away in recent years. Thankfully that terrible 4-mic notwired board seems to be no longer on the market and the entire website appears to have vanished.

Another underwhelming MEMS mic is SPH0645. Many people have tried it because Adafruit sells a breakout board. We have this example in the audio library showing how to get it working and deal with its unfortunate DC offset problem.

Whatever mic you choose, if your mic array will place the mics more than a couple inches (~5cm) apart, please consider problems with transmitting I2S or I2S-like signals over long distances. It can be done, but it's not necessarily easy. These signals are meant to travel relatively short distance on a PCB, not over feet or meters on cables.

Something that also isn't said as often as it probably should be is (generally speaking) MEMS mics are a compromise in quality. You get some pretty nice features, like low cost and compatibility with modern SMT manufacturing process and direct digital output from most of them. What you don't get from MEMS is excellent sound quality. Remember, manufacturer datasheets are first and foremost a sales pitch. Their one and only purpose is to convince you to buy (design in) the part. They will always emphasize the part's good quality and downplay or just sweep under the rug its weaknesses.
 
Last edited:
Back
Top