Flexible HiFiBerry replaces old audio amplifier

Musical Pi

© Lead Image © Author, 123RF.com

© Lead Image © Author, 123RF.com

Article from Issue 257/2022
Author(s):

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.

Figure 1: The Amp2 contains a small DAC+ sound module on-board, so all signal processing takes place on the board, without the need for any other hardware.
Figure 3: The two jacks on the Amp2 to the left of the connections for the speakers are an alternative power connection; the screw design for power and speakers is similar, so caution is advised.

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).

Figure 2: The AAmp60 requires a compatible HiFiBerry sound card. Here, a DAC+ ADC is plugged directly onto the GPIO ports at the bottom, with the AAmp60 sitting on top.

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.

Figure 4: Plug the cables from the left speaker into the two left-hand terminal connections on the AAmp60; the cables from the right speaker are plugged into the next connections to the right.

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

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • FOSSPicks

    This month Graham checks out OpenRGB, QMPlay2, OctaSine, HiFiBerryOS, Speed Dreams, and much more!

  • Rasp Pi Symfonisk

    Build open software, open hardware smart WiFi speakers for the home with the Sonos and Ikea Symfonisk.

  • Raspberry Pi Model B+

    The brand new Raspberry Pi Model  B+ is solid and tidy, with many clever improvements in detail that make this the best version so far. The desired improvement in performance will have to wait for now.

  • BerryLan

    BerryLan installs a system on a Raspberry Pi that can be integrated into the wireless network with a smartphone app over Bluetooth.

  • BlackBerry on the Block

    Makers of the iconic smartphone look for a new start.

comments powered by Disqus
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.

Learn More

News