fbpx

Digital Audio Mixer Pt.2

Digital Audio Mixer Pt.2

Since writing my earlier submit in regards to the digital audio mixing I’ve made some important progress. Initially my code was working on an off-the-shelf Teensy 4.1 and utilizing solely the digital enter and output I might use straight with an exterior ADC/DAC. Shortly after writing that submit I acquired the Teensy Audio Shield which makes the check setup a bit simpler to cope with.

Teensy Audio Board Rev. D2

This is an easy board that connects an NXP SGTL5000 codec chip to the Teensy. It supplies a stereo in and output on the header on the high on this image. It additionally has a reasonably respectable built-in headphone amplifier which is uncovered with the three.5mm jack on the backside of the image.

SGTL5000 block diagram from the datasheet

With this board I changed the S/PDIF enter and output within the code with an i2s interface which accomplished this right into a self-contained 2-input and 2-output audio mixer. But develop from right here? That’s extra within the realm of customized {hardware} because the Teensy Audio Shield is virtually the one board you possibly can order for Teensy Audio.

So a customized board… There’s a number of different supported codecs by the audio library. The problem is that many of the codecs within the checklist are EOL or not really helpful for brand new designs. They are additionally principally out of inventory so I postponed this concept for a bit.

FOSDEM 2024

So roughly at this level within the course of FOSDEM occurred. Not solely is that this a really attention-grabbing open supply software program occasion however it additionally manages to run ~30 concurrent dwell streams and in-room audio mixes with an ad-hoc setup with solely a few tenth of the quantity of personnel you’d anticipate to be wanted to tug this off.

To pull this off FOSDEM makes use of customized construct "video containers" that comprise half the gear wanted to run all of the multimedia in each room. Two of those (similar) containers are put in every room for the entire setup. This setup has developed so much over time.

FOSDEM video field from 2020

This is without doubt one of the examples: the good laser-cut video containers used from ~2015 to 2023. These have the job of capturing from the HDMI video inputs and ship off the video from the linked digital camera and speaker laptop computer to be encoded for the live-stream. This is a really good and compact resolution for deploying a room for FOSDEM and in the course of the occasion these are managed remotely from the central operations heart permitting only some folks to watch and handle all of the video streams.

But what in regards to the audio? There’s a microphone for the speaker and one or two microphones for viewers questions however these do not hook as much as the customized containers. The room audio in most rooms is dealt with by a Yamaha MG10 audio desk. This is well sufficient for mixing collectively the audio from 4 sources however has one main draw back: it’s a must to be bodily current to show the knobs to regulate something.

While video is normally fairly nice whereas watching again the talks I’ve seen there’s typically a number of audio points like microphones which can be clipping. The excellent resolution for this all is a digital audio mixer that may be managed remotely in fact, however these are method bigger and costlier.

It seems FOSDEM is that excellent goal for a 4-in 4-out audio mixer that’s managed over USB as an alternative of bodily controls. I’m very glad I managed to fulfill up with the FOSDEM video workforce, which result in…

FOSDEM Audio Board

So the FOSDEM setup has a number of very attention-grabbing constraints for an audio mixer:

  • There’s two audio mixes, one for in-room audio and one for the live-stream
  • All mixes are mono, there’s not a lot sense in stereo for working a number of microphones.
  • All sources are line-level. The microphones at FOSDEM are all wi-fi and the receivers can output line-level indicators so no want for microphone pre-amps. This massively simplifies the design of the analog inputs.
  • Since no condenser microphones or phantom-powered DI containers are used no +48V phantom energy provide is required.
  • The present iteration of video containers are inside 19" 1U rack instances which constrains the dimensions of the audio mixer so much.

So I’ve virtually no expertise with designing audio gear. Luckily the extra constraints massively simplify the design which is nice for price optimization as nicely. So I did probably the most harmful factor a software program developer can do: I launched Kicad.

PCB of the FOSDEM Audio Interface rev.A

For the design I made a decision to place two of the SGTL5000 codecs on the board. It’s one of many few supported codecs which can be nonetheless out there they usually already deal properly with line-level indicators. Another nice characteristic of those chips is that they embrace analog acquire management which saves me from having to implement a digital-controlled analog acquire circuit which sounds troublesome and costly. Having a built-in headphone amp can also be nice for including a headphone connection for monitoring within the room.

This shouldn’t be solely my block diagram but in addition the schematic itself because of Kicad sub-schematics 😀

This is how the {hardware} is linked internally. There are 3 analog XLR inputs for connecting the microphone receivers and the fourth enter is a 3.5mm jack that is connected for some easy analog mono-summing of the incoming sign. This 3.5mm jack will hook up with the audio output of the HDMI seize card linked to the laptop computer of the presenter.

One of the codecs additionally supplies the two XLR outputs. One connects to the present audio audio system within the room and the opposite connects to the audio enter of the digital camera. The headphone connector is linked to the outputs of the second codec in order that audio combine could be managed individually in software program.

The solely factor that should occur along with the schematic of the unique Teensy Audio Shield is coping with balanced indicators. Sadly there is not a "getting began with designing audio interfaces" e book however I discovered the sensible web site from Elliot Sound Products that has numerous info on these circuits. The inputs and outputs have a pair of opamps to transform the indicators. This is carried out with TL072 opamps as a result of they’re low-cost, out there and have 2 opamps in a single chip. This means the entire enter circuit is a single chip and some passives.

A single balanced output channel on the audio board

The different half that wanted determining is the ability half. This surprisingly was much more work than the precise analog audio dealing with. The entire design is powered from 5V from the USB port however there’s numerous separate voltages wanted to run all of the audio {hardware}.

The codec chips want two 3.3v rails and one 1.8v rail to operate. One of the three.3v rails is for the digital half and one for the analog half. The opamp circuits are much more difficult as a result of they want a constructive and unfavorable voltage rail to operate.

The precise voltage for the opamps doesn’t matter a lot however it must be excessive sufficient that they’re at all times above the analog audio enter ranges and since these are low-cost opamps it wants a number of volts additional as a result of the TL072 can not course of indicators near the provision voltage which leads to distortion. On the opposite hand the output voltage must be under 40 volts as a result of I’m constructing an audio interface and never a smoke machine. In this design the provides are +9V and -9V which brings the entire voltage on the opamp to 18V.

To generate the constructive and unfavorable 9V rails I first generate +12V and -12V with a switching regulator after which feed these into an LDO to filter out the switching noise from the switching regulator. After coping with all this I now lastly perceive why a lot of the audio gear has old-school transformers to energy them: it makes it very simple to make a dual-rail provide.

It was not simple to determine get the twin rails from 5V in any respect. To begin I made a decision to open up one of many USB powered audio interfaces I already had and see what the designers of that gadget did to repair this. In this case it was a Tascam US-2×2.

This is an image of the ability provide part of that audio interface. It comprises numerous completely different voltage regulators to make the assorted rails. It has to cope with a number of additional voltages in comparison with my design since this additionally has +48V phantom energy. After measuring it the principle unfavorable rail of this board was generated by the 34063 chip on the high of that image. This is used as an inverting switching regulator on this case. The constructive rail for opamps on this design is generated by the tiny chip labelled U26 all the way in which on the underside of the image, I’ve not been capable of determine this chip.

This all collectively result in my preliminary design:

The high left a part of the board generates the voltages for the opamp circuits and the highest proper has the regulators for the codecs (and the PC enter jack). This model of the ability provide was not full but because it was missing a number of capacitors and I discovered that the inductor I chosen was method too small to operate accurately.

This revision of the ability provide was scrapped as a result of with the right inductor the ability provide merely grew to become too giant for the board and I did not wish to make the board any bigger because the within the FOSDEM field could be very area constrained.

The MCP34063 can also be a long time previous expertise by now. It’s a switching regulator that runs at 100Khz max. In this design the switching frequency can be ~60Khz however this leads to needing a big capacitor and inductor on the board.

In the present revision of the board this has been changed with the TPS65130 regulator. This is a far more fashionable switching regulator working at 1.3Mhz as an alternative. This chip is a little more costly however it generates each the constructive rail and unfavorable rail with a single chip and because of the order of magnitude bigger switching frequency the inductor and capacitor could be method smaller. The finish result’s a extra compact and cheaper energy provide.

This is the board that was ordered as prototype. It’s principally the identical because the board proven above however it has an additional header exposing a number of I/O pins of the teensy for prototyping and the PC enter connector has moved so the jack shall be above the board to waste much less area within the case.

The precise {hardware}

After ready some days I acquired this partially assembled board:

After soldering on the connectors I powered it on and checked the voltage rails, all of it appeared effective. Then after powering it on a second time it began making a screeching coil-whine sound and inside a second the 12V generator made the underside of the PCB too scorching to the touch. After initially working for a bit I did not get it to generate the right voltages once more, even after restarting the board. Sometimes when powering it on it heated up once more, typically it did not however for some purpose the output of the +/- 12V provide was +6V/-4.5V as an alternative.

This problem plagued me for some days till sooner or later I had plugged in my headphones within the board whereas measuring issues with the multimeter and out of the blue the bizarre noise from the inputs disappeared. This occurred after I had the probe of the multimeter on one of many pads of the diode for the unfavorable provide.

It seems that the solder connection on that diode was not dependable and after heating up that pad with a soldering iron for a second I managed to get the board working on the proper voltage once more… however solely typically. At least the board was now dependable sufficient that I might work a bit on the firmware and all of the performance that did not depend upon the opamps was working nice.

This is without doubt one of the moments the place it is a large assist when different folks double-check your schematics. It seems I copy-pasted a number of capacitors and forgot to regulate the values. Specifically I had a capacitor within the suggestions path for the switching regulator that was two orders of magnitude too giant. It seems these capacitors had been optionally available anyway in accordance with the datasheet so after eradicating these from the ability provide it already grew to become much more dependable. Still it typically failed to begin and unreliable gear in a dwell setting is a non-starter.

After verifying the whole lot it turned out that there have been extra capacitors with incorrect values and sadly these capacitors had been truly required. So I took the boards to somebody with precise electronics expertise and likewise the right gear to debug the boards. A couple of capacitors have been eliminated, a number of have been added and the result’s lovely soldering work like this:

Which is a 100nF capacitor soldered on high of an 10uF capacitor to additional scale back the ripple of the ability provide. The board has since been adjusted to really have these capacitors included. After a night of messing with the board to reduce ripple the switching regulator part has become fairly a battlefield:

A couple of stacked capacitors, a pad I’ve by chance ripped when eradicating capacitors. The power-save pins on the regulator linked to GND as an alternative of VCC and within the backside left nook an exquisite stack of three capacitors and a 1k resistor on the output of the regulator.

Luckily in any case this the regulator began working reliably. To make it a bit nicer on my desk I additionally 3d printed a easy entrance panel for the mixer. I additionally obtained a random oled panel from my elements field and linked that to the GPIO pins so I can have a show to point out real-time debugging info whereas testing the software program.

The software program aspect

For the software program I began off from the Arduino IDE challenge I had for my earlier weblog submit. The design for the audio at FOSDEM can be less complicated although, no networking is required on the mixer however as an alternative the USB connection can be used for management. Adding a community port for the audio mixer would imply it wants extra change ports within the field and because the community change ports are on the surface it could want an unsightly cable popping out to the entrance of the field to attach it up.

The management of the mixer would occur via the infrastructure FOSDEM already has the place the volunteers within the rooms can management the containers with a webpage from a cellphone and a few software program on the SBC contained in the field will talk with the mixer over a serial port.

There had been additionally a number of small software program points to cope with because of the {hardware}. There are two SGTL5000 codecs on the board. There are two variants of this chip, the 32 and the 20 pin model the place the key distinction with the 20 pin model is that it would not have any tackle pins for the I²C bus. Sadly the 32 pin variant wasn’t actually out there so the codecs are actually utilizing the identical tackle however on completely different I²C busses of the Teensy. The audio library is hard-coded to have the codec on I²C0 of the Teensy so this requires a little bit of patching.

The problem of patching the Teensy audio library is that libraries within the Arduino construct system are a large number and the audio library can also be a part of the Teensy core within the IDE as an alternative of a separate library. After messing with it to attempt to make it a bit extra sane I made a decision to transform the Arduino IDE challenge to a plain cmake challenge that pulls within the numerous elements of the Teensy core as git submodules and has the entire audio library vendored in. This additionally means it is now potential to construct the firmware for the FOSDEM audio mixer with out first downloading a pre-compiled ARM compiler so it could run shortly in Alpine in CI.

I had additionally added an OLED panel to the board for testing so I added a little bit of code that shows the audio ranges of all of the inputs and outputs of the board on that display.

This half will certainly be completely different on the FOSDEM containers since these oleds are very small and the PCB behind it are giant sufficient that it barely suits within the top of an 1U rack case. It could be very cool to have audio stage bars in realtime although and if there’s a colour show it might even be usable sufficient to see if the degrees are right.

There’s additionally an preliminary implementation of the serial management protocol. The precise protocol has not been totally thought out but however no less than it does the one factor all serial protocols ought to do: print one thing helpful when sending a newline.

When sending a newline to the interface it’ll print the state of the blending matrix as percentages.

Further work

The audio interface has been examined with one of many wi-fi units from FOSDEM, which is a Sennheiser AVX ME2 set. The audio appears to work nice with this and for working FOSDEM there can merely be 3 receivers plugged into the field.

Sennheiser AVX receiver plugged into the mixer

But can this be less complicated? The AVX system works with DECT chips so possibly it could be potential to make the worlds first digital audio mixer with built-in DECT base-station 😀

Conclusion

This is definitely numerous progress for the audio {hardware} a part of the mixer challenge. While numerous the {hardware} is specified for the precise necessities of a FOSDEM room it does present a neat base to work off for designing digital audio mixers. The elements of the {hardware} design are modular sufficient to reconfigure them for different audio wants and now the line-level inputs are working it will likely be neat to determine a digitally managed microphone preamp. Or have hi-z enter for devices. Or implement a phantom energy provide.

It’s at all times a ton of enjoyable to determine new methods and as an alternative of studying a random new programming language it is {hardware} design stuff for as soon as. I completely could not’ve executed it with out the experience of {the electrical} engineers that helped me design this, particularly Thea who truly is aware of how switching regulators work 🙂

Hopefully the revision B design with the enhancements from all of the testing that occurred with this board shall be within the FOSDEM containers in FOSDEM 2025 however I’ll save that for a 3rd half on this collection of posts.

HI-FI News

by way of Hacker News https://ift.tt/tp6OGRh

March 9, 2024 at 08:01PM

Select your currency