Flexible HiFiBerry replaces old audio amplifier
Musical Pi
A HiFiBerry HAT, the matching system, and a Raspberry Pi combine with two old speakers to create a contemporary boombox.
When my trusty audio amplifier bit the dust with crackling, hissing, and sound dropouts, the speakers and CD player from the hi-fi system still worked perfectly. My idea was to replace the broken module with a Raspberry Pi at a reasonable price. If it could receive music on Bluetooth, then all of my family members could feed it from their smartphones without leaving the couch.
A piggyback board from the HiFiBerry series combined with the matching system on a Raspberry Pi replaced this legacy audio amplifier. The system can play music sent over Bluetooth or other ways, and you can control it conveniently in a browser. However, the build and setup come with a few pitfalls, along with a few minor quirks in operation.
A setup like this is also useful for corporate meeting rooms: The presenter streams the audio output from the Raspberry Pi to the speakers, without wiring or even leaving their seat.
Hi-Fi Berries
Of course, the Raspberry Pi only has one analog audio output, and it is not renowned for particularly good musical quality. To the rescue comes the Swiss company Modul 9, which offers various amplifiers for the small-board computer (SMB) under the HiFiBerry brand. You simply connect the small boards to the Raspberry Pi GPIO ports and plug the speaker cables into the sockets provided – that's all it takes.
The company also provides its own operating system (OS), HiFiBerryOS, which promises easy hardware startup and acts as a small audio center immediately after launching. Among other things, it accepts signals over Bluetooth and AirPlay or a from connected storage device, and you can control it in a browser. Under the hood is a customized Linux system with preconfigured services at work. Details can be found in the "Tricky Manual Steps" box.
Tricky Manual Steps
Raspberry Pi OS comes with all the drivers required for the HiFiBerry products. Instead of HiFiBerryOS, then, you could use Raspberry Pi OS and manually install all the required services. However, even setting up Bluetooth could cause you to break a sweat and lose half a weekend. If you still want to try it, you will find instructions online [1].
Although it makes sense to shut down Raspberry Pi OS gracefully, most people simply switch a boombox or hi-fi system on and off with the power switch. For this to work, you need to run the system completely in main memory. However, setting up this kind of configuration is time consuming and complex. Going for HiFiBerryOS will take you to your goal far faster and is easier on your nerves.
Hardware Zoo
Modul 9 offers several audio amplifiers for different purposes. The MiniAmp [2] for $22 (£20/EUR15) is designed for the small Pi Zero and only has two 3W outputs, which, although enough for small PC speakers, is not good enough for a sound system in your living room.
Fortunately, an all-purpose weapon named Amp2 (Figure 1) [3] comes in at $55 (£54/EUR46). The amplifier has two outputs rated at 30W, which might not sound like much at first, but the small circuit board effortlessly managed to delight even my neighbors on the next floor with hard rock.
Both the MiniAmp and the Amp2 only support two speakers at a time. If you want to connect more, you can get the Beocreate 4 Channel Amplifier for $190 (£175/EUR160) [4]. As the name suggests, it offers a total of four channels, with two connections even delivering 60W. Additionally, the Beocreate has a digital signal processor with which you can apply various effects to the audio signal in HiFiBerryOS, if required. Unfortunately, the company does not offer a solution for surround sound.
All of these boards come without an audio input, but to continue using an old CD player, you need an analog sound card with input in the HiFiBerry universe. For this project, I went for the DAC+ analog-to-digital (ADC) converter [5], combined directly with the AAmp60 amplifier [6]. However, unlike the Amp2, it does not have its own sound card, so you will have to piggyback the two HiFiBerry boards on the Raspberry Pi (Figure 2).
The DAC+ ADC in the middle then generates the audio signals, which it passes on to the speakers through the AAmp60 amplifier on top. The pair currently costs $95 (£110/EUR85). The performance of the AAmp60 is the same as that of the Amp2. Unlike the Amp2, however, the AAmp60 needs the DAC+ ADC or another compatible HiFiBerry sound card.
Other Accessories
The AAmp60, Amp2, and Beocreate each have a connector for an external power supply. Four-ohm speakers need a power supply rated at 12V-18V; for 8-ohm speakers, the developers advise you to go for 18V.
According to the data sheet, the Amp2 can handle a maximum of 24V and the AAmp60 20V. If you want to be on the safe side, purchase the respective board along with the matching power supply in the HiFiBerry store. The Amp2 and Beocreate supply the Raspberry Pi with power; the AAmp60 additionally supplies the DAC+ ADC. Consequently, the Raspberry Pi does not need its own power supply.
To play audio material over Bluetooth, you also need a USB dongle. The exceptions here are the Raspberry Pi 3B+ and 4, which come with the chips in place. The 3B model (without a plus sign) has one, but it does not give you a stable Bluetooth connection, say the HiFiBerry developers, which is why HiFiBerryOS ignores the adapter. When buying a new adapter, make sure it is compatible with the Raspberry Pi and Linux.
The weight of the boards puts some strain on the GPIO pins, so you should first mount the supplied plastic spacers after unpacking (see the "Cases" box). When connecting the cables for the speakers, pay attention to the correct sockets; their assignments differ between the various HiFiBerry models (Figures 3 and 4).
Cases
Because of the height and the position of the connectors, the amplifiers do not fit into standard Raspberry Pi cases. However, at least for the Amp2, Modul 9 offers a compact steel housing [7], as well as other models, but not all will fit every Raspberry Pi variant.
Further peripherals for operation are not needed. However, a monitor, keyboard, and mouse will facilitate the initial setup, which can also be handled in a similarly smooth way in the browser. If you connect the Raspberry Pi to the network by cable, the setup is largely automated; otherwise, you can configure over WiFi, for which you need a smartphone or other device that connects to the WiFi network and has a browser.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.
-
New Steam Client Ups the Ante for Linux
The latest release from Steam has some pretty cool tricks up its sleeve.
-
Gnome OS Transitioning Toward a General-Purpose Distro
If you're looking for the perfectly vanilla take on the Gnome desktop, Gnome OS might be for you.