This is essentially a foss usb audio interface isn’t it?
Lots of people arriving at the same desires…
He talks about submitting patches regarding that in the vid.
Also, from your link
D’oh… Saw the 44.1 and expected them to be in order…
Bad wyleu, naughty wyleu…
Yep! It is an exercise in interfacing CODECs to microprocessors and then the microprocssor to USB. It wasn’t clear to me from the video whether he had the multi-channel audio working as a class compiant USB device. The Teensy is cool (STM32 based) with some good libs including the audio libs that include pitch shift, time stretch, etc. As a simple USB audio interface it could be quite cool. As he mentioned, the quantity of I2S ports on each processor dictates the quantity of channels although maybe (I haven’t checked) the Teensy I2S port supports TDM with more channels. A quick search shows this statement from a user:
The Teensy 4.x supports 16 Channel TDM output or input on two I2S interfaces, if that’s ok (so, in sum 2x 16 channels input + 2x channels output)
No other hardware (but the TDM Hardware) needed.
Stereo at the moment, but it’s on the todo
Same platform as MicroDexed
I know Teensy creator has experienced TDM mode with Cirrus Logic cs42448 chip.
Later a forum user did the same with pcm3168.
Both were simple setup with close to no input/output filters.
I still have To build mine, I’ve got all the parts but I’m not in a tinkering mood these days.
Yeah, that’s very interesting for creating such small mixers. And this is also the place where Hi-Z inputs becomes interesting.
I am currently working on converting the DSP routine of Synth_Dexed for sound generation completely to fixed-point math, so that the code also runs well on an ESP32 without FPU. But that’s another story. T_4.1 does not have a problem with floats
Hey author of the video here, great to find another audio community
The Teensy 4.1 is very nice for audio projects since it has some DSP instructions, an FPU and with 600Mhz it has plenty of CPU power to run fancy algorithms. (It’s also an NXP soc, not STM32)
It’s a bit annoying that the Teensy Audio Lib is limited to 44.1k/16, but that’s only that lib. The hardware accepts way more and in my builds I’ve already patched various parts of the audio lib to run at 48Khz. There was also a project that was working to rewriting the audio lib to work with floats instead but I don’t think that has gotten very far.
It’s possible to make a class compliant audio interface with this with multiple channels but I just haven’t needed it yet. There’s patches floating around for enabling TDM on all the i2s channel pins of the chip which gives you 64 inputs if you can encode the audio from the codecs correctly.
I have a Icebreaker dev board here to try to use a FPGA to do audio routing between codecs and the TDM interface which would make it possible to make a very nice and extensible mixing system. In my case I only need a single phantom powered microphone channel and my other devices are all line level so with a modular system it would be cool to just build the exact mixer you need from cheap I/O cards.
Thank you so much Martijn for taking the time to register and post!
Hey @MartijnBraam! Welcome onboard. It is great to see you here.
First, an apology! I mistook the Teensy for another board. Indeed, the Teensy is NXP based.
I like the idea of building an open hardware multichannel USB audio interface. I have toyed with the idea several times in the past but never found the time to implement something. The idea of a modular input / output stage sounds cool (though possibly more expensive and requiring more spave). The ability to add as many input / outputs as required with the desired i/o dynamics, e.g. balanced / unbalances, input impeadance, phantom, etc. would be cool. Presenting as a class compliant USB interface would make it easy to interface. Adding some audio processing would also be good but, one may run out of processing if you are handling lots of inputs / outputs. Possibly the ability to add processing based on the available processing. Gate, dynamics, summing, etc. could be good.
I don’t think this necessarily fits neatly within Zynthian (although could be a good replacement external audio interface) and I would like to see better use of the RPi5 I2S interfaces. It would be good if RPi I2S could be configured for TDM, but I am pretty sure it can’t (yet).
Choice of CODEC / ADC/DAC chip is important. Often, the feature rich ones (particularly from Cirrus) get discontinued and replaced with chips with reduced features.
For small quantities the modular audio interface is quite attractive. Due to manufacturing with JLCPCB the cost of the balanced I/O modules is very cheap and since the minimum order quantity is 5 it becomes cheaper to just make a 10-in 10-out interface that way. The only cost increase from going modular is adding a few connectors and the FPGA itself, the FPGA can also be pretty cheap because it barely has to do anything.
The SGTL5000 codec I’ve used for this hardware is not a particularly great one. The main reasons I picked it is because it’s the same one as on the Teensy audio shield and I know that one works. It also has the build in headphone driver which saved me from designing one for the monitoring output.
It’s not a good codec though, the specs are already pretty low, especially for it’s price and the audio quality of the headphone output is not that great. It also has a few silicon erretas that massively increase it’s noise floor. For my modular board I’ve designed everything around the the PCM5100 DAC and the PCM1808 ADC and that solution is already a tenth of the cost of the integrated SGTL5000 because it drops all the features I don’t use. These chips also have a significantly better signal to noise ratio and there’s the pin compatible parts to boost specs if required (PCM5100 is 100dB snr, the 5101 is 106 and the 5102 is 112).
I don’t think you’d easily run out of CPU power on the Teensy for processing. I’d like to have some built-in dynamics for the board but haven’t really worked on that yet. But the library already provides things like convolution reverbs that run quite fast which suprised me. And since it’s FOSS you can decide to just spend a lot of CPU time on a few channels with fancy processing and have a bunch more channels for simple audio I/O instead of having a fixed solution like most products.
For interfacing with a Rpi it’s most likely possible to do toslink or adat between the interface for a fully digital path, that’s already supported by the NXP chip and for simple toslink input only a few cents of parts are required. I don’t remember of the top of my head if the pi can do any toslink output but a simple board that converts i2s to toslink is also pretty easy. Running i2s directly for more than a few cm is not really recommended.
It was the idea of getting multichannel audio into the RPi that I was considering. It is pretty easy getting stereo in and out. That is what we already do with the PCM5242 DAC & PCM1862/63 ADC. RPi5’s RP1 chip has several I2S interfaces (although some share pins) which seem to allow up to 6 bi-directional channels of audio. What I was saying earlier was that it would be cool if some future implementation would support TDM and higher bit rate to allow more channels of audio.
Hi @MartijnBraam very nice project, FOSS and HW is really appreciated
Yes, I agree, pcm5102 and pcm1808 is a good combo for building an affordable with good performance codec.
Unfortunately I didn’t get two dev boards bought on Aliexpress to work together.
I’m using Dupont wires, but I don’t think that’s the issue in my case, because, alone, pcm5102 works without any problem.
While looking at the Teensy, I noticed basic support for the CS42448 (slightly more advanced user HW designs can be found by searching the web). Since I don’t feel like building my own PCBs, I came across a “6 in 8 out CS42448 multi-channel decoding electronic 4 frequency divider board” on Aliexpress, but I have not found time to experiment with it yet. Anyway, compared to Paul’s design it does not implement the CAT811T reset chip (whose purpose remains unknown to me) nor the additional PCM1808 DAC needed to upgrade the CS42448 from 6in/8out to the full 8in/8out. And it is equipped just with the tiny 3.5mm jacks (one for each pair of channels as unbalanced I/O only).
I own this affordable board. Sadly, the socket header is 2.0 mm pitched
I’ve asked for the schematic, wich I received, but I can’t get my hand on it anymore (again)
But yeah it’s a perfect candidate for multichannel audio on a RBPi 5.
Note that the support of the Codec by Teensy is done through TDM and not via multichannel I2S.
This would be a challenge to directly interface with RPi. There are several I2S interfaces on the RPi5 but I don’t think it natively supports TDM*. We want (need) a way to get multiple channels of audio directly into the RPi5 and its I2S interfaces look like the best option.
Raspberry Pi datasheet only describes the I2S interface and is rather ambiguous. It may be possible to use all 10 channels (is that stereo or mono channels?) in simplex or duplex??? Best case would be 20 inputs and 20 outputs but I fear not. Worst case is 6 inputs or outputs. I think the truth lies between them.
*The info for the I2S interface licenced by Raspberry Pi in their RP1 chip seems to suggest it does support TDM. Maybe this could be available with some Linux driver enhancement.
There is much work to make this viable and investment of both time and money to validate what is possible and what is achievable. I may be looking at audio interfaces for another project which could yield useful results for zynthian, but that could be some time off yet.