Author Topic: Digital audio mixer  (Read 7105 times)

0 Members and 1 Guest are viewing this topic.

Offline colinzaTopic starter

  • Contributor
  • Posts: 14
  • Country: za
Digital audio mixer
« on: June 30, 2017, 06:30:41 am »
Hi all

First poster here, long time watcher of the videos.

I've been playing with a project idea to build a digital audio mixer and wanted to see if anyone had some tips on going about designing such a beast.

I want this mixer to have a couple of audio inputs and some outputs and be able to mix each input into each output flexibly as well as adding some stuff like compressor/limiting and an equaliser. Doing this in pure analog seems like a nightmare, and also difficult to add digital control to all of those elements because I'd like to be able to configure the mixing over ethernet or a nice HMI.

So I feel like that leaves me with doing most of it in software, which is great. So then I was thinking of having the Teensy 3.5/6 be the main workhorse for some real-time DSP, that or trying to get it all into a raspberry pi (or maybe asus tinkerboard because the rockchip silicon has a bit more lightning in it) and just mixing through Jackd.

Then there's the matter of getting that audio in and back out again with minimal latency or distortion, I was initially looking at options for the best SPI/I2C/I2S DAC's and ADC's but then I came across the so called "Codec" chips like the TLV320AIC, WM8731 and PCM3060. I can't really decide on the best one to use, so it's mostly down to availability which for me crosses out the WM8731 because I can only find them on giant Uno style shields here.

Anyway, those all provide some kind of serial bus and then I imagine for the Linux SOC based setup I'd need to build some kind of driver which ALSA can use and perhaps even build some other interface that provides the audio to the soc via USB - that all sounds like a horrible pain which leans me back towards the teensy idea.

Basically, I've gotten a bit lost in the weeds and hope someone has a good idea for architecting audio stuff  :-[
 

Offline hamster_nz

  • Super Contributor
  • ***
  • Posts: 2812
  • Country: nz
Re: Digital audio mixer
« Reply #1 on: June 30, 2017, 06:59:24 am »
I am having some issues in seeing what your inputs and your outputs are (both audio and user interface), and the level of audio performance and latency you want. Is it just for playback, or for live gigging?

If you combine that with your desired feature list you should have a clearer spec for the required hardware.
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Offline alexanderbrevig

  • Frequent Contributor
  • **
  • Posts: 700
  • Country: no
  • Musician, developer and EE hobbyist
    • alexanderbrevig.com
Re: Digital audio mixer
« Reply #2 on: June 30, 2017, 07:27:26 am »
It's funny, I've been thinking about a similar project for a while.
You should decide on some specs.

Inputs: line level, microphone preamp, phantom power, balanced or unbalanced?
Outputs: line level, balanced or unbalanced, headphone amplifier, speaker amplifier?

The next requirement has to do with what you use for processing and that's the acceptable system latency.
Once things get into the digital domain it's relatively easy. One thing I would encourage is to have the compressor and EQ "blocks" on at all time so that signals propagate through the system in phase (or close to it, at least).

For a couple of inputs and outputs, I think the Teensy 3.6 should be capable. However you should probably be prepared to avoid the Arduino libraries and build it using interrupts and DMA.


FYI for a super simple solution, with compression and EQ there's something like this: https://datasheets.maximintegrated.com/en/ds/MAX98090.pdf
I did not get around to try it, but I guess the quality is OK for some applications.

NB: not at all an expert, but I've been through some R&D and experimentation with the same idea - as I needed it back then. Since then I've changed my mixing console and have more than enough so not invested in the project any more.
 

Offline colinzaTopic starter

  • Contributor
  • Posts: 14
  • Country: za
Re: Digital audio mixer
« Reply #3 on: June 30, 2017, 07:31:22 am »
I'd basically like a device which allows me to do both. My current setup takes audio into a mixing desk from my desktop PC combined with my guitar stuff. What annoys me with this desk is that there's only one output which means having to switch the output between my monitors and my headphones.

This trivial problem is a great excuse to try invent a problem with solutions way outside of my experience  ;D

My inputs are all analog "line-in" - I already have studio grade pre-amps and DACs so I don't need to worry about decoding SPDIF or HDMI or whatever. What I used to have was a compressor/limiter which was great until one of its channels broke, so I want those functions back too.

Basically I'm thinking of a noob version of something like http://www.music-group.com/Categories/Behringer/Signal-Processors/Equalizers/DEQ2496/p/P0146 and http://www.music-group.com/Categories/Behringer/Signal-Processors/Multi-Effects-Processors/FX2000/p/P0A3P shoved into one box
 

Offline hamster_nz

  • Super Contributor
  • ***
  • Posts: 2812
  • Country: nz
Re: Digital audio mixer
« Reply #4 on: June 30, 2017, 07:49:24 am »
I have a couple of these codec boards in an ESD bag somewhere. https://www.tindie.com/products/kuupaz/fe-pi-audio-z-v1/

I was going to do some experiments with multichannel audio, but haven't got any further than putting one on a Raspberry Pi. Works fine. :)

The codec chip on that looks to be low cost simple way to provide a stereo I2C audio in/out.
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Offline colinzaTopic starter

  • Contributor
  • Posts: 14
  • Country: za
Re: Digital audio mixer
« Reply #5 on: June 30, 2017, 07:54:31 am »
FYI for a super simple solution, with compression and EQ there's something like this: https://datasheets.maximintegrated.com/en/ds/MAX98090.pdf

Thanks for all the advice.

That Max chip looks pretty fair, not pro-audio grade but probably totally fine for me. Sadly I can only find it in TQFN, but I guess that's vaguely workable with a standard soldering iron. But I really like the idea of ordering a sample of that just as a starting point.
 

Offline diyaudio

  • Frequent Contributor
  • **
  • !
  • Posts: 683
  • Country: za
Re: Digital audio mixer
« Reply #6 on: June 30, 2017, 08:56:27 am »
Hi all

First poster here, long time watcher of the videos.

I've been playing with a project idea to build a digital audio mixer and wanted to see if anyone had some tips on going about designing such a beast.

I want this mixer to have a couple of audio inputs and some outputs and be able to mix each input into each output flexibly as well as adding some stuff like compressor/limiting and an equaliser. Doing this in pure analog seems like a nightmare, and also difficult to add digital control to all of those elements because I'd like to be able to configure the mixing over ethernet or a nice HMI.

So I feel like that leaves me with doing most of it in software, which is great. So then I was thinking of having the Teensy 3.5/6 be the main workhorse for some real-time DSP, that or trying to get it all into a raspberry pi (or maybe asus tinkerboard because the rockchip silicon has a bit more lightning in it) and just mixing through Jackd.

Then there's the matter of getting that audio in and back out again with minimal latency or distortion, I was initially looking at options for the best SPI/I2C/I2S DAC's and ADC's but then I came across the so called "Codec" chips like the TLV320AIC, WM8731 and PCM3060. I can't really decide on the best one to use, so it's mostly down to availability which for me crosses out the WM8731 because I can only find them on giant Uno style shields here.

Anyway, those all provide some kind of serial bus and then I imagine for the Linux SOC based setup I'd need to build some kind of driver which ALSA can use and perhaps even build some other interface that provides the audio to the soc via USB - that all sounds like a horrible pain which leans me back towards the teensy idea.

Basically, I've gotten a bit lost in the weeds and hope someone has a good idea for architecting audio stuff  :-[

You can. simply use a AD Sigma Chip, define a processing route audio chain using Sigma Studio software, use your imagination and design any DSP" realistically you can throw at it", use a MCU, DAC and ADC. The only firmware you need to develop, is routing of audio channels (MCU I/O drivers for the ADC, DAC) with register update host code for the  sigma audio blocks you pre-configured. Using this technique you don't write a line of  DSP code, use low resource MCU like MCU (8-BIT optional), or a resource heavy system like a raspberry pi + LCD with funky graphics for aesthetics. 

Today, a project like this is obtainable. specialized mixers will use SHARC DSP or FPGA with propriety processing algorithms (which is not the objective I assume)
     
If you do everything from scratch, it will take months of dedication and many R&D cycles.

« Last Edit: June 30, 2017, 05:47:46 pm by diyaudio »
 
The following users thanked this post: colinza

Offline colinzaTopic starter

  • Contributor
  • Posts: 14
  • Country: za
Re: Digital audio mixer
« Reply #7 on: June 30, 2017, 09:19:56 am »
You can. simply use a AD Sigma Chip, define a processing route audio chain using Sigma Studio with everything your imagine (realistically can throw at it)  use a MCU, DAC and ADC the only software you will write, is routing of audio channels and the register updates for the  sigma audio blocks you pre-configured. Using this technique you don't right a line of  DSP code, so you could use a 8-BIT MCU even, or raspberry with funky graphics for aesthetics. 

Today, a project like this is obtainable. specialized mixers will use SHARC DSP or FPGA with propriety processing algorithms (which is not the objective I assume)
     
If you do everything from scratch, it will take months of dedication and many R&D cycles.

Your username is very encouraging  :-DD. This is great, thanks!

I'm not at all afraid of writing DSP code, I'm actually more afraid of trying to figure out the ALSA/Pulse/Jackd mess of Linux audio stuff, but it sounds like there's far better options anyway which is fantastic.
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: Digital audio mixer
« Reply #8 on: June 30, 2017, 09:32:07 am »
Quote
I want this mixer to have a couple of audio inputs and some outputs and be able to mix each input into each output flexibly as well as adding some stuff like compressor/limiting and an equaliser.

I am not sure what Compressor or limiting is.

I believe 'Equaliser' means changing the high/low tone. To do this in the digital domain you need to do it with Fast Fourier Transforms.
I do not thing even the most capable ARM Cortex M7 can do this in real time, certain not for more than 1 channel, let alone in stereo.
(the key part is 'real time'  ;) )
I am not familiar with the CODEC chip that you mentioned, maybe they have the necessary DSP in them?

Sounds like a cool project. Have fun  :-+
 

Offline colinzaTopic starter

  • Contributor
  • Posts: 14
  • Country: za
Re: Digital audio mixer
« Reply #9 on: June 30, 2017, 09:53:20 am »
Is FFT really the only way or are there more optimal mechanisms? I mean, Winamp had an equalizer in it way back when since I had a Pentium 133

On that though I did consider leaving the equalizer / tone control stuff as an analog bandpass filter with the opamps gain for each output/frequency set via digipots. But this would require a lot of digipots, and they aren't exactly cheap.
 

Offline dmills

  • Super Contributor
  • ***
  • Posts: 2093
  • Country: gb
Re: Digital audio mixer
« Reply #10 on: June 30, 2017, 10:00:47 am »
I believe 'Equaliser' means changing the high/low tone. To do this in the digital domain you need to do it with Fast Fourier Transforms.
I do not thing even the most capable ARM Cortex M7 can do this in real time, certain not for more than 1 channel, let alone in stereo.
Actually EQ is EASY in the digital domain, and does not require realtime FFT (Which is a pain anyway from a latency perspective), think IIR biquad or the like, easy to compute and relatively cheap in multiplies and adds.

No problem at all on a M7 with floating point, and only a small problem to code up in fixed point if you lack the FPU.

Compression and (especially) limiting are actually harder to do well as a gain cell is in some sense a multiplier, and you must ensure that both input and control signal are band limited to ensure that the product has nothing >= Fs/2, often oversampling helps here. 

Generally the I2S/TDM dedicated parts are better then the codecs (which tend to be designed for PC audio), but whatever works.

For MIC amps I like the THAT parts, the gain control is by I2C which is a little tedious (I really dislike that bus), but they work well. Do remember to consider the issues around Phantom power and its failure modes, it has some interesting ones if you have a short in a mic cable with P48 on and caps charged. 

Big mixers running many tens of channels tend to be FPGA based, because FPGAs do parallelism really really well, but lots of the smaller stuff is CPU based.

Regards, Dan (Who does this stuff for a living).
 
The following users thanked this post: colinza

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2130
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Digital audio mixer
« Reply #11 on: June 30, 2017, 11:47:21 am »
Start really simple - perhaps a 4x2 without any eq.  Then add eq. etc..

Well worth studying how the pro mixers work, plenty published on them.  The bussing structure is going to be your number-one headache, taking the "I'll just suck all the data in and deal with it in software" is going to fail pretty quickly when you get beyond a small number of inputs.

https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline colinzaTopic starter

  • Contributor
  • Posts: 14
  • Country: za
Re: Digital audio mixer
« Reply #12 on: June 30, 2017, 12:09:28 pm »
Start really simple - perhaps a 4x2 without any eq.  Then add eq. etc..

Well worth studying how the pro mixers work, plenty published on them.

Do you have any links? Not looking for anything to give the game away but struggling to find good resources.
 
The following users thanked this post: alexanderbrevig

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2130
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Digital audio mixer
« Reply #13 on: June 30, 2017, 02:06:33 pm »
Not really any links, but just found this on SSL's site.

http://sslweb.solidstatelogic.com.s3.amazonaws.com/content/system-t/The-SSL-Tempest-Engine.pdf

AMS-Neve or Calrec might have something. Sound-on-Sound likely published some articles about digital desks.
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline colinzaTopic starter

  • Contributor
  • Posts: 14
  • Country: za
Re: Digital audio mixer
« Reply #14 on: July 10, 2017, 07:55:41 am »
Today, a project like this is obtainable. specialized mixers will use SHARC DSP or FPGA with propriety processing algorithms (which is not the objective I assume)

I read up about the SHARC DSPs and requested a sample of the adau1772 from Analog. It looks like the best solution right now.

Hopefully it will arrive this week and I can start twiddling on the weekend!  :popcorn: If I get something working without releasing all the magic smoke I'll start documenting it. Wish me luck
 

Offline diyaudio

  • Frequent Contributor
  • **
  • !
  • Posts: 683
  • Country: za
Re: Digital audio mixer
« Reply #15 on: July 10, 2017, 02:41:48 pm »
Today, a project like this is obtainable. specialized mixers will use SHARC DSP or FPGA with propriety processing algorithms (which is not the objective I assume)

I read up about the SHARC DSPs and requested a sample of the adau1772 from Analog. It looks like the best solution right now.

Hopefully it will arrive this week and I can start twiddling on the weekend!  :popcorn: If I get something working without releasing all the magic smoke I'll start documenting it. Wish me luck

This is not how this chip works, sample then (plug and play), you need to buy a USBi cable, then using usbi cable, program the sigma target (with all the supporting sub circuits to boot it up) . Rather buy a development board and start from there. The amount of sub circuits will be a challenge to say the least, given the fact you never worked with this sort of stuff.
« Last Edit: July 10, 2017, 02:50:05 pm by diyaudio »
 

Offline colinzaTopic starter

  • Contributor
  • Posts: 14
  • Country: za
Re: Digital audio mixer
« Reply #16 on: July 10, 2017, 06:46:57 pm »
My bag of tricks has the necessary programmers. The dev boards are out of the question, they are just way too expensive in africa
 

Offline colinzaTopic starter

  • Contributor
  • Posts: 14
  • Country: za
Re: Digital audio mixer
« Reply #17 on: August 07, 2017, 04:05:34 pm »
Eyyyyy, I'm back. I have a DAC. I even made it quack.

Okay but seriously I did get the wrong device, doh! The 1772 is specialised towards noise cancellation so it doesn't have any of the other cool DSP functions in it.

Anyway, all is not lost I can at least learn how these work. So I put a copy of the datasheet next to the toilet and realised a good place to start is actually just controlling it via i2c directly and forget about sigmastudio. Then I can use the DAC and ADC's with I2S from some host... say.. a teensy.

Neato!



Bit of kapton tape and sheer dumb luck got it soldered onto a QFN adapter. Tested every contact, no shorts. hooray.



I read the pin list, and copied the basic startup schematic onto a breadboard... Yeah, I know, a breadboard, but hey lets abuse the natural capacitance between the rails for a neat crystal setup  :wtf: Ok so it's a spiders nest, moving on.



Great Scott, Marty! It worked and I can poke at it from my pi over i2c. Alright then, I'll revert back in a year or two when I have more time to do useful things with it.

Oh, the USBi interface mr diyaudio mentioned is a real thing, a reeeeal stupid thing but the FreeDSP project has a board that emulates it without spending $100 on a freaking USB cable. But oh wait, there's a FreeDSP project which has a bunch of opensource designs for the ADAU chips so I should just build one of those!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf