# Foss Digital Audio Mixer

**URL:** <https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881>\
**Category:** Related Projects\
**Created:** [August 1, 2024, 12:03pm UTC](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881 "2024-08-01T12:03:43Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Baggypants](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/baggypants/32/1911_2.png) [@Baggypants](https://discourse.zynthian.org/u/Baggypants)\
**Post date:** [August 1, 2024, 12:03pm UTC](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881/1 "2024-08-01T12:03:43Z")

</div>

This is essentially a foss usb audio interface isn’t it?

[![](https://img.youtube.com/vi/NjZu_C1M4Yk/maxresdefault.jpg "Building a FOSS digital audio mixer") ](https://www.youtube.com/watch?v=NjZu_C1M4Yk)

---

<div class="post-metadata">

**Author:** ![wyleu](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/wyleu/32/514_2.png) [@wyleu](https://discourse.zynthian.org/u/wyleu)\
**Post date:** [August 1, 2024, 12:20pm UTC](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881/2 "2024-08-01T12:20:59Z")

</div>

Lots of people arriving at the same desires…

> **[SGTL5000 | Ultra-Low-Power Audio Codec](https://www.nxp.com/products/audio-and-radio/audio-converters/ultra-low-power-audio-codec:SGTL5000)**
>
> The NXP SGTL5000 is a low-power stereo codec is designed to provide a comprehensive audio solution for portable products.

---

<div class="post-metadata">

**Author:** ![Baggypants](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/baggypants/32/1911_2.png) [@Baggypants](https://discourse.zynthian.org/u/Baggypants)\
**Post date:** [August 1, 2024, 12:58pm UTC](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881/3 "2024-08-01T12:58:06Z")

</div>

He talks about submitting patches regarding that in the vid.

Also, from your link

> [@](#):
>
> Digital I/O
> 
> ```
> I2S port to allow routing to applications processor
> Standard sample rates supported: 8 ks, 16 ks, 32 ks, 48 ks, 9.6 kHz, 11.25 khz, 22.05 ks, 44.1 ks
> 
> ```

---

<div class="post-metadata">

**Author:** ![wyleu](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/wyleu/32/514_2.png) [@wyleu](https://discourse.zynthian.org/u/wyleu)\
**Post date:** [August 1, 2024, 1:11pm UTC](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881/4 "2024-08-01T13:11:56Z")

</div>

D’oh… Saw the 44.1 and expected them to be in order…  
Bad wyleu, naughty wyleu…

---

<div class="post-metadata">

**Author:** ![riban](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/riban/32/2331_2.png) [@riban](https://discourse.zynthian.org/u/riban)\
**Post date:** [August 1, 2024, 2:35pm UTC](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881/5 "2024-08-01T14:35:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Baggypants](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/baggypants/32/1911_2.png) [@Baggypants](https://discourse.zynthian.org/u/Baggypants)\
**Post date:** [August 1, 2024, 4:02pm UTC](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881/6 "2024-08-01T16:02:59Z")

</div>

> [@riban](#):
>
> It wasn’t clear to me from the video whether he had the multi-channel audio working as a class compiant USB device.

Stereo at the moment, but it’s on the todo

> **[Martijn Braam (@martijnbraam@fosstodon.org)](https://fosstodon.org/@martijnbraam/112886979271299865)**
>
> @Baggypants@mstdn.social it basically already is. It needs a few patches to the Teensy audio lib to make it an actual multi-channel audio interface but for this project it was fine with stereo USB audio.

> **[Martijn Braam (@martijnbraam@fosstodon.org)](https://fosstodon.org/@martijnbraam/112887598755920311)**
>
> @Baggypants@mstdn.social yeah, I think it can be either an UAC1 or UAC2 device depending on how it's set up, both work fine in Linux

---

<div class="post-metadata">

**Author:** ![C0d3man](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/c0d3man/32/9_2.png) [@C0d3man](https://discourse.zynthian.org/u/C0d3man)\
**Post date:** [August 1, 2024, 5:26pm UTC](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881/7 "2024-08-01T17:26:36Z")

</div>

Same platform as [MicroDexed](https://www.parasitstudio.de/projects/microdexed/)  
😉

---

<div class="post-metadata">

**Author:** ![le51](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/le51/32/1706_2.png) [@le51](https://discourse.zynthian.org/u/le51)\
**Post date:** [August 2, 2024, 7:58am UTC](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881/8 "2024-08-02T07:58:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![le51](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/le51/32/1706_2.png) [@le51](https://discourse.zynthian.org/u/le51)\
**Post date:** [August 2, 2024, 8:01am UTC](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881/9 "2024-08-02T08:01:49Z")

</div>

I still have To build mine, I’ve got all the parts but I’m not in a tinkering mood these days.

---

<div class="post-metadata">

**Author:** ![C0d3man](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/c0d3man/32/9_2.png) [@C0d3man](https://discourse.zynthian.org/u/C0d3man)\
**Post date:** [August 2, 2024, 8:29am UTC](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881/10 "2024-08-02T08:29:49Z")

</div>

Yeah, that’s very interesting for creating such small mixers. And this is also the place where [Hi-Z inputs](https://discourse.zynthian.org/t/guitar-processing/6227) becomes interesting.

---

<div class="post-metadata">

**Author:** ![C0d3man](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/c0d3man/32/9_2.png) [@C0d3man](https://discourse.zynthian.org/u/C0d3man)\
**Post date:** [August 2, 2024, 8:32am UTC](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881/11 "2024-08-02T08:32:59Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![MartijnBraam](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/martijnbraam/32/12110_2.png) [@MartijnBraam](https://discourse.zynthian.org/u/MartijnBraam)\
**Post date:** [August 2, 2024, 12:01pm UTC](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881/12 "2024-08-02T12:01:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Baggypants](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/baggypants/32/1911_2.png) [@Baggypants](https://discourse.zynthian.org/u/Baggypants)\
**Post date:** [August 2, 2024, 12:52pm UTC](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881/13 "2024-08-02T12:52:08Z")

</div>

Thank you so much Martijn for taking the time to register and post!

---

<div class="post-metadata">

**Author:** ![riban](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/riban/32/2331_2.png) [@riban](https://discourse.zynthian.org/u/riban)\
**Post date:** [August 2, 2024, 1:33pm UTC](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881/14 "2024-08-02T13:33:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![MartijnBraam](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/martijnbraam/32/12110_2.png) [@MartijnBraam](https://discourse.zynthian.org/u/MartijnBraam)\
**Post date:** [August 2, 2024, 1:49pm UTC](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881/15 "2024-08-02T13:49:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![riban](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/riban/32/2331_2.png) [@riban](https://discourse.zynthian.org/u/riban)\
**Post date:** [August 2, 2024, 2:19pm UTC](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881/16 "2024-08-02T14:19:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![le51](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/le51/32/1706_2.png) [@le51](https://discourse.zynthian.org/u/le51)\
**Post date:** [August 3, 2024, 9:56am UTC](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881/17 "2024-08-03T09:56:18Z")

</div>

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.

> [@MartijnBraam](#):
>
> Running i2s directly for more than a few cm is not really recommended.

I’m using Dupont wires, but I don’t think that’s the issue in my case, because, alone, pcm5102 works without any problem.

---

<div class="post-metadata">

**Author:** ![wanthalf](https://discourse.zynthian.org/letter_avatar_proxy/v4/letter/w/ed655f/32.png) [@wanthalf](https://discourse.zynthian.org/u/wanthalf)\
**Post date:** [October 7, 2024, 11:09am UTC](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881/18 "2024-10-07T11:09:51Z")

</div>

While looking at the Teensy, I noticed [basic support for the CS42448](https://oshpark.com/shared_projects/gVFy0fWQ) (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](https://www.aliexpress.com/item/4001131584424.html?spm=a2g0o.order_list.order_list_main.352.619a1802mVcyfy)” 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).

---

<div class="post-metadata">

**Author:** ![le51](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/le51/32/1706_2.png) [@le51](https://discourse.zynthian.org/u/le51)\
**Post date:** [October 8, 2024, 9:22am UTC](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881/19 "2024-10-08T09:22:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![riban](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/riban/32/2331_2.png) [@riban](https://discourse.zynthian.org/u/riban)\
**Post date:** [October 8, 2024, 9:48am UTC](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881/20 "2024-10-08T09:48:11Z")

</div>

> [@le51](#):
>
> support of the Codec by Teensy is done through TDM

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](https://riban.square.site/) which _could_ yield useful results for zynthian, but that could be some time off yet.

[Next page](https://discourse.zynthian.org/t/foss-digital-audio-mixer/9881.md?page=2)
