Constructing a digital audio mixer
Digital audio mixers have at all times been the magical tech from the long run after I began messing with audio mixers. Again then the price of these mixers was extraordinarily far out of attain for residence use, into the hundreds of euros.
Costs for digital mixing has come down so much, it is now potential to make use of tablets as management interface as a substitute of getting bodily controls which drives down the value so much. I have been utilizing a borrowed Behringer X-air 18 for some time which is priced round €650. That mixer had to return into manufacturing so now I am mixer-less once more.
Trying on the choices
There’s an annoying problem with audio mixers. To get a mixer that has a variety of options you additionally must get a variety of channels. I used a variety of the routing and processing options of the X-air 18 however I solely used 4 of the channels. If I change to a smaller/cheaper model within the X-air sequence just like the X-air 12 I nonetheless have means too many channels however I lose the multichannel usb audio interface a part of it. Even the smallest model nonetheless takes up 2 rack items with options I do not want.
Going to the competitors of the X-air sequence would not assist both. There’s solely considerably dearer and bigger choices or extra restricted {hardware}. This leaves me as soon as once more with the final possibility: construct it myself.
Teensy Audio Library
Whereas choices for {hardware} with audio I/O I got here throughout the Teensy 4.1. This can be a microcontroller board that has built-in 10/100 ethernet and has a number of digital audio interfaces. Extra importantly it already has a really good library referred to as the Teensy Audio Library for creating digital audio pipelines with it.
The {hardware} has a local USB interface that already has the libraries obtainable to make the Teensy act like an USB audio interface. It additionally has two i2s/tdm interfaces for hooking up DAC/ADC chips. It’s in all probability potential to create a 16-in 16-out mixer with this chip.
So I ordered the Teensy and began creating the software program. The audio pipeline is definitely designed utilizing the online editor for the audio library to generate the pipeline code:
This creates a fundamental audio mixer with 6 inputs and 4 outputs. Since I haven’t got any further {hardware} but the event is completed purely utilizing the stereo USB enter and output.
Each enter channel has a biquad
block which implements a parametric 4-band EQ. Then an amp
block to do dynamics along with the detected sign stage from the rms
blocks. This creates a quite simple channel strips with a compressor and EQ.
The second a part of the pipeline is a completely linked 6×4 matrix of mixers. This permits routing any of the inputs to any of the outputs with sign ranges managed by the faders on the mixer.
After the mixer matrix there’s amp
blocks once more for the output quantity faders and rms
blocks for the output VU meters.
Community management
So suprisingly the complete DSP audio pipeline half was the simple a part of the undertaking. Simply loading the generated code into the Teensy was sufficient to get audio working via the {hardware} after setting some default values within the blocks and hardcoding some values for the routing matrix. However a mixer you possibly can’t management or monitor is just not a really helpful mixer.
I wish to management the mixer over a community connection as a result of I obtained used to with the ability to open the mixer interface on any PC right here to regulate my audio routing, in my case the audio output of a number of computer systems is routed to the mixer to get a combination to my headphones.
I additionally do not wish to hardcode the management software I might have to put in writing for this mixer for this particular {hardware} so I’ve designed a community protocol that on connection describes the performance and routing matrix to the management software and the management software dynamically creates a visible interface for it.
The management software is a Python GTK3 software and the Teensy facet has a c++ class that implements this community protocol on high of the Teensy native ethernet controller. The community management code is absolutely separated from the audio code and with a couple of #ifdef
s can in all probability be made extra common than that.
The community library (I’ve referred to as it Mixolydian) broadcasts the existance of the mixer utilizing mDNS so the shoppers can uncover it and present a pleasant listing of detected {hardware} within the UI. It has a TCP protocol for controlling the mixer that permits a number of shoppers to be linked on the identical time and seeing the adjustments in actual time. It additionally has a separate UDP protocol for sending over actual time audio meters.
With this collectively there’s now the parts to make a digital audio mixer on any platform and add within the networking class to have a management software for it.
So why flexibility
The problem with making a 4 channel digital mixer is just not everybody wants the identical 4 channels. I want USB alerts and a number of outputs. You would possibly want 5 analog inputs as a substitute and AES/EBU out solely. So as a substitute of constructing the precise mixer I want I made the opensource base to make any digital mixer. The protocol accounts for mixers which can be considerably bigger than what I made on a Teensy, the onerous restrict is 65535 connections in whole (inputs and outputs mixed).
For the reason that Teensy has a number of i2s interfaces that are simply damaged out into ribbon connectors and it has some further SPDIF {hardware} it’s potential to make a considerably modular tiny digital mixer from this. The one factor you want is plugging in modules and connecting it collectively in firmware.
There’s a variety of choices with this {hardware}. I wish to put an 8×8 mixer right into a 1U rack case with some led bar-graphs within the entrance. You may as well make a 2-channel microphone interface in a desktop case with all {hardware} controls.
S/PDIF connectivity
So after I obtained USB alerts working as a proof of idea I wished to get some extra audio channels to make it an really helpful audio mixer. I’ve ordered the Teensy audio defend which offers an unbalanced stereo enter and output however whereas that’s transport via Europe I wish to get some extra improvement in.
Then I remembered I’ve an previous Behringer Ultramatch Professional within the dusty racks of decommissioned {hardware}. This can be a stereo enter/output DAC/ADC that has S/PDIF and AES/EBU connectivity in a single rack unit.
This can be a good unit for debugging because it has many blinkenlights for exhibiting the standing of the connection. Fortunately getting the audio output from the mixer working via this was very straightforward. I simply added the spdif
output block to the audio graph and soldered a cable to pin 14 of the Teensy wired on to the RCA enter of the Ultramatch. Instantly I had audio working to my headphones plugged into the Ultramatch.
The second half was getting the analog inputs of the Ultramatch wired as two mono enter busses on the mixer so I can plug in microphones. The audio library has a pleasant enter block referred to as spdif_async
that takes in any spdif sign and resamples it to match the clock of the Teensy audio pipeline.
Sadly this wasn’t so simple as simply soldering down a wire to pin 15 and getting it working. It seems that this pin expects a TTL stage S/PDIF sign whereas the Ultramatch outputs a coax S/PDIF sign that’s 0.5v peak-to-peak. After making an attempt to breadboard collectively some converter circuits I noticed that the AES output is meant to be 5V peak-to-peak. I’ve touched the new wire from an XLR cable to pin 15 of the Teensy and all of the sudden I had an S/PDIF lock and enter sign within the mixer. That is with out connecting up floor or the chilly sign from the connection.
I’ve now soldered down this single wire and taped every thing down, it is wildly out of spec however works for improvement 🙂
Subsequent steps
So brief time period there’s a couple of issues to do. As soon as I get the Teensy audio defend I am going to be capable of get audio I/O working utilizing one of many i2s ports on the Teensy and I can put this multi functional of these 1U rack undertaking instances with good connectors.
To make this a bit extra good and built-in {and professional} I am engaged on a PCB design that carries a Teensy module and exposes the audio connections on pinheaders and seperate PCBs for connecting CODEC chips to that for audio enter and output and possibly some 48V phantom energy. I am undecided but of the design however the good factor about opensource designs is you possibly can at all times modify it to what you want.
In the long run this wants to modify away from the very nice audio library to transcend the 16bit 44.1KHz limitation of the library. The pattern charge is just not that problematic however clipping alerts in a 16-bit integer audio pipeline is simply means too straightforward.
Hopefully that is the beginning of a small open supply digital audio mixer ecosystem and a few extra individuals will construct digital audio mixers 😀