The vision for this project was to be able to source audio from analog inputs (e.g. record player, TV), and use a software crossover to enable fully customisable (and tweakable) audio processing. In addition, I wanted all of the amplification inside the same box, and I wanted it to look semi-professional. I am pretty happy with the way it has turned out.

It's based around the ezsound-6x8 multichannel soundcard for the Pi5 which I designed from scratch. You can find the writeup of that project here. I am hoping to launch this soundcard on Crowdsupply in the near future - if you are interested, please leave a comment!

Here's the layout of the eventual system. As you can see, the inputs are fed into the ezsound-6x8, which converts them to digital. This is fed to the RPi's I2S input and processed by the incredible CamillaDSP engine. This acts as a crossover, and outputs 8 channels. There's a stereo pair for tweeter, mid and woofer, and finally an unmodified monitor output which feeds a front panel VU meter. Pretty simple, right?

I'll talk through the different pieces one by one.

Power

I used Meanwell power supplies to generate 24V DC (required by the amps) and to step that down to 12V (for the soundcard and panel meter). I used a cheap XL4015 buck converter from Aliexpress to power the Pi. One thing worth mentioning is the method for connecting the Pi. I took a USB-C to USB-A cable, cut off the USB-A end. I attached the black and red cables from inside the USB cable to the buck converter output. I prefer this approach because the USB-C plug is rated to several amps, and jumper wires are not.

Regarding the LRS-200-24 AC/DC SMPS - if you look at the build photos, you'll see I have been very careful to fully shield all mains components - the stuff that looks like cardboard is actually an insulating material that covers the SMPS terminals completely (holes allow the insulated wires to exit). The mains leads (blue and brown) from the master switch run all the way along between the SMPS and case to get to the input terminals, which are located on the same end as the ouput terminals. Originally, I was using the 350W version which has a fan, but the fan was way too noisy and I didn't need the extra power.

Going with a high-quality prebuilt 24V-12V DC/DC converter to supply the analog audio side of the soundcard was a no brainer for me, because this is the part which is the most sensitive to noise. On the other hand, the Pi is not fussy and I just bought a buck converter from Aliexpress that can provide enough current. 

Amplifiers

I ordered four amplifier boards from Aliexpress, and made some customisations as described in this DIYAudio post.  These Class D (aka chip-amp) boards have one TPA3116D2 chip in BTL configuration for each channel, and use high quality parts. They cost me less than $10 USD each in 2020! Unfortunately they were configured with maximum-gain setting, resulting in hiss when nothing is playing, but the modifications fixed that (bringing gain down to 20dB). They are no longer available, but there's plenty of choice for stereo amplifiers boards out there. Unfortunately, a lot of them are crap. BTW, you don't need much power if you have an amplifier for each driver and no losses in a crossover! In hindsight, I could have used something much smaller, but I had no way to know that.

As you can see in the photos, I made them into a quadruple-decker "amp sandwich" and mounted them vertically.

Pi5 + ezsound-6x8

You can read about the design and build of the soundcard on its project page. The actual crossover is implemented in CamillaDSP and the processing pipeline is shown below.

Each input has a volume control. Input selection is currently done by simply muting the inputs I don't want. These are split into four pairs, which have lowpass and/or highpass filters and a gain control (the monitor channels have no filters). Not very complicated. Filter corner frequencies were taken from the speaker design (see below).

Speakers

The speakers are a slightly modified version of Troels Gravesen's Bookshelf-3WC design. The volume of mine is a bit smaller, but that's OK because there are no crossover components inside. My woodworking skills leave a bit to be desired but I am fairly happy with the way they turned out. They match our custom-made TV cabinet really well.

Since I need 6 conductors to each speaker, I decided to do it properly and use Neutrik 8-way connectors. These are professional-quality twist-and-lock connectors. They're just a pleasure to use, and I actually enjoyed the experience of making the cables (normally making cables is the most annoying part of electronics). Sometimes you just have to acknowledge that something is really well engineered. Here's a couple of photos:

Panel meters

Aside from the soundcard, this was the most time-consuming part of the project. All of the VU meter designs I found used an ESP32 or similar to do spectrum analysis, but this seemed like a lazy approach. Why not use analog electronics? I found a bargraph circuit in the Silicon Chip magazine, but I wanted a different layout and at the same time I figured I'd make it a lot smaller. So I duplicated the circuit in KiCAD and created my own PCBs. As you can see, there is a single board with the LEDs for both channels, another board with all of the comparator op-amps for both channels, and then two identical boards which do the signal processing of the audio signal to feed into the comparators. These were designed to stack in order to minimise the real estate consumed.

The LED board is just a bunch of SMD LEDs and mounting holes for the light pipes. The light pipes ensure a flush fit in the CNC-machined front panel.

On this board you can see the 5 quad op-amp chips used as comparators. There are also some potentiometers used for calibration.

Here are the two signal processing boards - nothing too fancy.

Input selection

In the photos, you'll see another board with 6 yellow relays. This is a 6-way stereo input selector. I ordered the PCB from Silicon chip and built it. I also designed a front-panel PCB which has illuminated buttons. This is powered from the 12V supply and works well. However, adding it into the system introduces a lot of noise - I'm not sure whether this is power supply noise from the 12V supply, or because there is a ground loop (the power ground goes from the input selector to the 12V supply to the ezsound board, and the audio ground goes directly from the input selector to the ezsound). I suspect it's the latter. Anyway, if I connect my audio sources directly to the ezsound, there is no noise. 

At a later date, I plan to interface the button PCB to the Pi and do the input switching in CamillaDSP. I'll also need to move the ezsound input board to the rear panel - which means drilling a new rear panel.

Here's the button PCB. I wasn't sure exactly what spacing I wanted so I gave myself a couple of different options.

Back panel

Here's a view of the back panel. An illuminated mains switch shows whether mains power is present. The HDMI panel socket is used to display the Pi HDMI output on my TV. 

Completed build

Here are some internal shots of the final product:

Here are some build time-lapses. I'd definitely recommend watching them at half-speed (click the gear icon to change playback speed).

Note that these were made when I was building the first version of this project. Rather than the ezsound card, the Pi sent audio over HDMI to a HDMI extractor board. However, a nasty bug caused the channels to sometimes swap order. We were never able to figure out the culprit, so in the end I decided to design a multichannel soundcard. The layout of the final amplifier is almost identical, just with the ezsound's power/input/output boards in place of the HDMI extractor.

Another change I made later was the addition of a layer of MDF backing behind the button PCB. This was necessary to prevent the PCB from flexing when I was trying to press a button. I didn't want to screw the PCB to the front panel, because the screws would have detracted from the look. So, this is the solution I came up with. A layer of MDF sits behind the front panel PCB with a small gap, and some MDF shims apply constant pressure to the front panel PCB. The shims were positioned so that they don't rest on any solder joints - the components are through-hole and the solder joints aren't flush with the PCB.

Closing thoughts

I hope you enjoyed this write-up. It has been quite a journey!

I really do think that a setup like this has some big advantages, especially if you plan on building your own speakers. Class D amplifiers are ridiculously cheap and efficient, and if they're done right, the bang for buck is extremely good. You save a lot of money by not needing a transformer or any heatsinks, and this can be invested into better drivers, or even a measurement microphone so that you can measure your system's response and use EQ to flatten out some of the lumps.

The biggest obstacle here was a lack of choices for multichannel audio on the Raspberry Pi. There are plenty of USB soundcards, but they're expensive and it's hard to see how you'd put one inside the case without losing access to all of the Pi's USB ports.

If you are interested in building something like this, please show your support with a comment (either on Hackaday or anywhere where I've shared this project). I'm thinking about making the ezsound card available for purchase and the more positive feedback I get, the more likely it is that I will go ahead.