Giving an Old Raspberry Pi a New Life with AirPlay 2

There’s something rather satisfying about taking an old piece of technology, dusting it off and finding that it’s still perfectly capable of doing something useful. It’s one of the reasons I struggle to throw away old computers, even when they’ve long since been replaced by something newer.

Back in November 2020, I wrote an article about turning a Raspberry Pi into an AirPlay receiver using a brilliant piece of software called Shairport Sync. The idea was straightforward: connect a Raspberry Pi to an existing amplifier or speaker system, install some software, and suddenly you’ve got wireless music streaming without spending a fortune on new equipment.

That original Raspberry Pi is still running today. It uses the original AirPlay protocol, commonly referred to as AirPlay 1, and has been remarkably reliable. It simply works, which is exactly what you want from a device tucked away behind a stereo. However, AirPlay has moved on quite considerably since then. AirPlay 2 introduced multiroom playback, allowing compatible speakers throughout the house to play music together in sync, along with closer integration into Apple’s Home ecosystem.

I wondered whether it would be possible to bring those newer features to an ageing Raspberry Pi without spending much money. As luck would have it, I had a Raspberry Pi 3 Model B sitting in a drawer, along with a brand-new 16GB SanDisk microSD card. That seemed like a perfectly good excuse for another weekend project.

And, spoiler alert, it worked. Not only does the Raspberry Pi now support AirPlay 2, but I’ve successfully tested multiroom playback and added it directly to Apple Home. There was one slightly frustrating problem involving the power supply, but we’ll get to that shortly.

Why Use a Raspberry Pi?

The beauty of the Raspberry Pi has always been its versatility. These tiny computers can run everything from web servers and retro gaming systems to home automation platforms and network monitoring tools. Even the older models remain surprisingly useful when given a lightweight, dedicated task.

For this project, I’m using a Raspberry Pi 3 Model B, revision 1.2, a design dating back to 2016. It features a quad-core 1.2GHz processor, 1GB of RAM, built-in Wi-Fi, Ethernet and a 3.5mm audio connection. Those specifications look rather modest in 2026, but we’re not asking the Pi to run a desktop operating system or edit 4K video. All it needs to do is receive an audio stream, decode it and send the sound to an amplifier.

I initially considered using an original Raspberry Pi Zero W, which I also had available, but AirPlay 2 is more demanding than the original protocol. The developer of Shairport Sync recommends more capable hardware, making the Pi 3 B a better candidate. Another advantage of the full-size Pi is its Ethernet connection. Although AirPlay works over Wi-Fi, a wired connection removes one possible source of interference and makes the setup particularly attractive for a permanent installation.

What You’ll Need

Before we start, gather the following:

  • Raspberry Pi 3 Model B or newer

  • MicroSD card, preferably 16GB or larger

  • A reliable 5.1V, 2.5A power supply for the Pi 3 B

  • Ethernet connection or Wi-Fi

  • Speakers or an amplifier

  • A 3.5mm audio cable or compatible USB DAC

  • A Mac or PC to prepare the microSD card

  • An iPhone, iPad or Mac to test AirPlay

You’ll also need a little patience. We’re compiling Shairport Sync from source rather than installing a ready-made package, because we want to ensure AirPlay 2 support is included. The installation is entirely command-line based, but don’t let that put you off. I’ve included the commands below, and once everything is configured, the Raspberry Pi will start the music receiver automatically whenever it’s powered on

A Very Important Note About Power

Before getting into the installation, I want to highlight something I discovered during testing, because it could save you a considerable amount of frustration.

Make sure your Raspberry Pi has a decent power supply.

My first attempts at playing music weren’t particularly encouraging. Shairport Sync installed correctly, the Raspberry Pi appeared in the AirPlay menu and music started playing, but the audio kept cutting in and out. Initially, it looked like a software problem. Perhaps the Pi wasn’t powerful enough, or there was an issue with audio decoding or network synchronisation.

It turned out to be none of those things. The Raspberry Pi was suffering from undervoltage. Once I provided it with a suitable power supply, the intermittent audio dropouts disappeared and music began playing continuously.

The Raspberry Pi 3 B needs a dependable supply capable of delivering around 5.1V at 2.5A. A poor-quality USB cable can cause voltage loss too, even when the charger itself appears to have an adequate rating.

You can check whether your Raspberry Pi has detected undervoltage or throttling with:

vcgencmd get_throttled

Ideally, the result will be:

throttled=0x0

That means no undervoltage or throttling conditions have been detected since the last boot.

  • A result of 0x1 indicates undervoltage is currently being detected,

  • While 0x50000 indicates that undervoltage and throttling have occurred previously.

The Pi remembers historical warnings until reboot, so this command can be particularly useful for diagnosing an intermittent problem. It’s worth checking this before spending hours troubleshooting audio settings. In my case, giving the Raspberry Pi enough power solved the problem completely.

Step 1: Install Raspberry Pi OS Lite

The first job is preparing the microSD card.

  • Download Raspberry Pi Imager from the official Raspberry Pi website: https://www.raspberrypi.com/software/

  • Insert the microSD card into your Mac or PC and launch Raspberry Pi Imager.

  • Select your Raspberry Pi model, then choose Raspberry Pi OS Lite (32-bit) as the operating system.

We’re using the Lite edition because there’s no need for a graphical desktop. A smaller installation means fewer background processes, less memory usage and a simpler system to maintain.

  • Next, select your microSD card as the destination.

Before writing the operating system, use Raspberry Pi Imager’s customisation options to configure a few important settings.

I used the hostname musicpi2, which makes the device easy to identify on my network. You’ll also need to create a username and password, enable SSH and configure your locale and network settings. SSH is especially useful because it allows you to access the Raspberry Pi remotely from another computer without connecting a keyboard or monitor.

Once the card has been written, eject it safely, insert it into the Raspberry Pi, connect Ethernet and power it on.

Step 2: Connect to Your Raspberry Pi

With the Raspberry Pi running, open Terminal on your Mac.

If you enabled SSH and configured the hostname in Raspberry Pi Imager, you should be able to connect using:

ssh YOUR_USERNAME@musicpi2.local

Replace YOUR_USERNAME with the account you created during setup.

The first time you connect, you may be asked to confirm the Raspberry Pi’s SSH fingerprint. Accept it if it matches the device you’re expecting, then enter your password.

Once connected, update the operating system:

sudo apt update
sudo apt full-upgrade -y
sudo reboot

The Pi will restart, disconnecting your SSH session.

Reconnect using the same SSH command.

It’s also worth checking which operating system version you’re running:

cat /etc/os-release

This guide uses a current Debian-based Raspberry Pi OS Lite installation. Some dependencies differ between operating system releases, particularly on versions based on Debian 13, also known as Trixie.

Step 3: Install the Required Dependencies

Shairport Sync needs several development libraries to handle audio decoding, encryption, network discovery and audio resampling.

Rather than relying on an older packaged version, we’re going to compile the software ourselves with AirPlay 2 support explicitly enabled.

Install the required tools:

sudo apt install -y --no-install-recommends \
build-essential git autoconf automake libtool \
libpopt-dev libconfig-dev libasound2-dev \
avahi-daemon libavahi-client-dev libssl-dev \
libsoxr-dev libplist-dev libsodium-dev \
uuid-dev libgcrypt-dev xxd libplist-utils \
libavutil-dev libavcodec-dev libavformat-dev \
alsa-utils

This command installs the compiler, build tools and libraries required for the installation.

Depending on your Raspberry Pi OS version, you may also need the systemd-dev package.

This is required on Debian 13 and certain newer distributions, but be careful if you’re using backported system packages. The Shairport Sync developer specifically recommends checking the proposed installation first.

Run:

sudo apt install --dry-run --no-install-recommends systemd-dev

If the command completes without proposing unexpected removals, downgrades or major system changes, install the package:

sudo apt install -y --no-install-recommends systemd-dev

Next, enable Avahi:

sudo systemctl enable --now avahi-daemon

Avahi handles Bonjour network discovery, allowing your Apple devices to find the Raspberry Pi automatically.

Step 4: Install NQPTP

AirPlay 2 introduced more sophisticated timing and synchronisation than its predecessor. This is particularly important when playing music across multiple speakers, because even small timing differences can become noticeable.

Shairport Sync uses a companion application called NQPTP, which stands for Not Quite Precision Time Protocol.

Download it from GitHub:

cd ~
git clone https://github.com/mikebrady/nqptp.git
cd nqptp

Prepare the source code:

autoreconf -fi

Configure it for automatic startup using systemd:

./configure --with-systemd-startup

Compile the application:

make -j2

Install it:

sudo make install

Now reload the service configuration and enable NQPTP:

sudo systemctl daemon-reload
sudo systemctl enable --now nqptp

You can confirm that it’s working by running:

systemctl status nqptp --no-pager

Look for:

Active: active (running)

NQPTP uses UDP ports 319 and 320 for timing information, so make sure those ports aren’t blocked by a firewall or occupied by another precision-timing service.

With NQPTP installed and running, we’re ready for the main event.

Step 5: Build Shairport Sync with AirPlay 2

Shairport Sync is an open-source audio receiver developed by Mike Brady. It allows Linux-based devices, including the Raspberry Pi, to receive audio from Apple devices using AirPlay. It’s the same software I used for my original Raspberry Pi music receiver, although it has evolved considerably over the years.

Download the latest source code:

cd ~
git clone https://github.com/mikebrady/shairport-sync.git
cd shairport-sync

Prepare the build:

autoreconf -fi

Now configure Shairport Sync using the following options:

./configure --sysconfdir=/etc \
  --with-alsa \
  --with-soxr \
  --with-avahi \
  --with-ssl=openssl \
  --with-systemd-startup \
  --with-airplay-2

It’s worth explaining what we’re doing here, because the configuration is rather important.

ALSA handles audio output, SoXR provides audio resampling, Avahi handles network discovery and OpenSSL supplies the encryption functionality.

The --with-systemd-startup option prepares Shairport Sync to launch automatically, while --with-airplay-2 explicitly enables the newer AirPlay protocol.

Don’t miss that final option.

Without it, you could end up compiling a perfectly functional AirPlay receiver that doesn’t support the feature we’re trying to add.

Assuming the configuration finishes without errors, compile the application:

make -j2

This will take longer than installing a typical package, particularly on an older Raspberry Pi. The command uses two parallel compilation jobs to avoid placing unnecessary pressure on the Pi’s limited memory.

Once compilation completes, install Shairport Sync:

sudo make install
sudo systemctl daemon-reload

Check That AirPlay 2 Is Actually Enabled

This is where things started getting exciting.

Run:

shairport-sync -V

On my Raspberry Pi 3 B, the output was:

5.6.2-AirPlay2-smi11-OpenSSL-Avahi-ALSA-soxr-sysconfdir:/etc

There it was: AirPlay2.

That confirmed that version 5.6.2 of Shairport Sync had successfully compiled with AirPlay 2 enabled.

It also showed that the required OpenSSL, Avahi, ALSA and SoXR components were available.

At this stage, the software was installed, but there were still a few things to configure before testing music playback.

Step 6: Configure the Speaker Name

By default, Shairport Sync uses a configuration file stored in /etc.

Open it using Nano:

sudo nano /etc/shairport-sync.conf

Find the existing general section and configure the name you want your AirPlay speaker to advertise.

For example:

general =
{
    name = "MusicPi 2";
};

If your configuration file already contains a general section, simply add or edit the name entry inside it. Don’t create a duplicate section.

Save the changes using Control + O, press Enter, then exit with Control + X.

I called mine MusicPi 2 because the original AirPlay 1 receiver is still operating elsewhere on the network.

Giving each receiver a recognisable name is particularly helpful when you have multiple AirPlay speakers around the house.

Step 7: Configure the Audio Output

The Raspberry Pi 3 B has a built-in 3.5mm audio output, which is perfectly adequate for experimenting with an existing stereo or powered speakers.

However, you can also connect a compatible USB DAC if you prefer. An external DAC can provide cleaner audio output than the Pi’s built-in analogue connection, depending on the hardware used.

To see which audio devices are available, run:

aplay -l

This lists the audio hardware detected by ALSA.

For the built-in analogue audio output, you may need to enable audio in the Raspberry Pi’s boot configuration.

On current Raspberry Pi OS installations, open:

sudo nano /boot/firmware/config.txt

Check that the following setting is present and enabled:

dtparam=audio=on

On older Raspberry Pi OS versions, the configuration file may instead be located at /boot/config.txt.

If you change the boot configuration, reboot the Raspberry Pi.

You can inspect and adjust the audio mixer settings using:

alsamixer

If your preferred output isn’t the system’s default ALSA device, you’ll need to configure the relevant output device in Shairport Sync’s alsa section. The exact device name will depend on your hardware.

For the initial installation, I’d recommend keeping things simple and getting audio playing before experimenting with different output devices.

Step 8: Start Shairport Sync Automatically

We want the Raspberry Pi to behave like a proper appliance. Once configured, it should be possible to power it on and have the AirPlay receiver appear automatically without logging in or starting anything manually. Because we’re using Raspberry Pi OS Lite with direct ALSA audio, Shairport Sync can run as a system service.

First, confirm that you’re not using a desktop audio server such as PipeWire or PulseAudio:

systemctl --user is-active pipewire pulseaudio

On a typical Lite installation, these services should be inactive or absent.

Enable Shairport Sync:

sudo systemctl enable --now shairport-sync

Check that it has started:

systemctl status shairport-sync --no-pager

You should see:

Active: active (running)

Now check the three services we’ve configured:

systemctl is-active shairport-sync nqptp avahi-daemon

All three should report:

active
active
active

If something isn’t running, you can investigate its logs. For Shairport Sync, use:

journalctl -u shairport-sync -n 50 --no-pager

The beauty of this approach is that everything now runs in the background, with no desktop environment required.

Step 9: Test AirPlay 2

With everything running, connect your Raspberry Pi to an amplifier or powered speakers. On your iPhone, iPad or Mac, open Apple Music and start playing something. Bring up the AirPlay speaker selector and look for the name you configured earlier.

In my case, MusicPi 2 appeared in the list of available speakers.

I selected it, and the music started playing through the Raspberry Pi.

At first, I experienced those intermittent audio dropouts mentioned earlier. After identifying the undervoltage problem and changing the power supply, the audio settled down and continued playing without interruption. The little Raspberry Pi 3 B was now functioning as an AirPlay 2 receiver.

But there was another feature I particularly wanted to test.

Step 10: Test Multiroom Audio

One of the main reasons for upgrading from AirPlay 1 to AirPlay 2 is the ability to play music across multiple compatible speakers simultaneously.

Rather than switching between receivers, AirPlay 2 allows you to select more than one destination and have the audio synchronised. This is particularly useful if you have HomePods or other AirPlay 2 speakers in different rooms. With music playing, open the AirPlay speaker selector on your iPhone or iPad and choose MusicPi 2 alongside another AirPlay 2 speaker.

And it worked.

The Raspberry Pi 3 B successfully joined a multiroom AirPlay 2 playback session, with music playing alongside my other Apple audio equipment.

That’s quite an achievement for a computer approaching its eleventh birthday. It’s also the most compelling reason to try this project. You can take an existing amplifier and set of speakers, add a Raspberry Pi and make them part of a modern multiroom audio setup without replacing the equipment you already own.

Step 11: Add MusicPi 2 to Apple Home

This was the final piece of the puzzle, and arguably the most interesting part of the entire experiment.

Shairport Sync’s AirPlay 2 implementation includes support for pairing with Apple’s Home app. That means the receiver can appear alongside other compatible devices in your Apple Home setup, rather than existing solely as an entry in the AirPlay speaker list.

To begin,

  • Open the Home app on your iPhone.

  • In Home Settings, locate the speaker and television access options. The Shairport Sync documentation recommends temporarily allowing access to anyone on the same network and disabling any password requirement during initial pairing.

  • Return to the Home app and choose Add Accessory.

  • Look for the option to show additional or nearby accessories, which may be labelled More Options, depending on your version of iOS.

  • Your Shairport Sync receiver should appear among the available devices.

  • Select it, follow the pairing instructions and assign it to the appropriate room.

Once pairing is complete, you can restore your preferred speaker access settings, provided the receiver continues to work correctly.

Did It Work?

Yes. MusicPi 2 was successfully added to Apple Home.

That means the Raspberry Pi is no longer just an independent music receiver. It’s now part of my Apple Home setup, without needing a Homebridge plugin or another intermediary to make the speaker appear. There is an important distinction here: Shairport Sync doesn’t turn the Raspberry Pi into a HomePod. Its implementation doesn’t necessarily provide every HomePod feature, voice assistant capability or HomeKit automation control.

Nevertheless, having an ageing Raspberry Pi recognised as an AirPlay 2 speaker in Apple Home is an excellent result.

Step 12: Make Sure Everything Survives a Reboot

Before calling the project complete, it’s worth checking that the services are configured to start automatically.

Restart the Raspberry Pi:

sudo reboot

Once it has rebooted, reconnect using SSH:

ssh YOUR_USERNAME@musicpi2.local

Check the services:

systemctl is-active shairport-sync nqptp avahi-daemon

They should all report active.

The receiver should also reappear in your AirPlay speaker list without requiring any manual intervention.

For a dedicated music device, this is particularly important. You don’t want to connect a keyboard or open Terminal every time there’s a power cut or the Pi needs restarting. If the Raspberry Pi automatically starts its services and becomes available on the network, you’ve got yourself a genuinely useful little AirPlay appliance.

Troubleshooting: Things Worth Checking

Although my final installation worked successfully, there are a few potential problems worth knowing about.

Music Keeps Cutting In and Out

This is the one I encountered myself.

Before changing audio settings, rebuilding software or blaming the network, check the Raspberry Pi’s power supply.

Run:

vcgencmd get_throttled

If undervoltage has been detected, use a suitable power adapter and a good-quality cable.

For the Raspberry Pi 3 B, a reliable 5.1V, 2.5A supply is a sensible choice.

Once I’d resolved the undervoltage issue, my audio played continuously.

MusicPi Doesn’t Appear in AirPlay

First, make sure Avahi is running:

systemctl status avahi-daemon --no-pager

Also check that your iPhone and Raspberry Pi can communicate over the local network.

Some guest networks, VLAN configurations and Wi-Fi isolation settings can prevent Bonjour discovery from working correctly.

The Receiver Appears but Doesn’t Play Audio

Check the detected ALSA audio devices:

aplay -l

Then inspect the mixer:

alsamixer

Make sure the intended output isn’t muted and that Shairport Sync is configured to use the correct audio device.

Multiroom Playback Isn’t Working

Check NQPTP:

systemctl status nqptp --no-pager

This service provides the timing information needed for AirPlay 2 synchronisation.

You should also check whether anything else is using UDP ports 319 and 320.

AirPlay 2 Isn’t Enabled

Check the Shairport Sync version:

shairport-sync -V

The output should include AirPlay2.

If it doesn’t, check the configuration options used when compiling the software.

The Raspberry Pi Disappears After Reboot

Check whether the services are enabled:

systemctl is-enabled shairport-sync nqptp avahi-daemon

If necessary, enable them:

sudo systemctl enable --now shairport-sync nqptp avahi-daemon

It’s also worth checking that the Pi is receiving sufficient power during startup.

Using Wi-Fi Instead of Ethernet

If you’re connecting the Raspberry Pi wirelessly and experiencing unexplained discovery or connectivity issues, Wi-Fi power saving may be worth investigating. Shairport Sync’s official documentation recommends disabling Wi-Fi power management where it interferes with network responsiveness.

On compatible systems, the setting can be changed temporarily with:

sudo iw dev wlan0 set power_save off

You’ll need to make the change persistent separately if it solves your problem.

Personally, I’d use Ethernet whenever possible for a dedicated receiver like this.

The Final Result

After completing the installation and fixing the initial power issue, MusicPi 2 passed all the tests I wanted to carry out. Shairport Sync 5.6.2 compiled successfully with AirPlay 2 support, the Raspberry Pi played music continuously, multiroom playback worked, and the speaker paired directly with Apple Home.

All of that on a Raspberry Pi 3 B from 2016.

The original AirPlay 1 receiver remains untouched and continues doing exactly what it has done for the past six years. Meanwhile, its newer sibling has brought an old piece of hardware into the modern Apple audio ecosystem. There was no need to buy an entirely new speaker system or throw away a perfectly good amplifier. A small computer that had been sitting unused in a drawer has become a useful addition to my home.

And perhaps that’s what I enjoy most about projects like this.

Technology doesn’t suddenly become useless just because something newer arrives. Sometimes all it needs is a fresh operating system, a clever bit of open-source software and, as I discovered rather emphatically, enough power to keep it running properly.

If you’ve got an old Raspberry Pi gathering dust, this is a project I’d thoroughly recommend trying.

Just don’t undervolt it.

Useful Links

Tested in November 2026 using a Raspberry Pi 3 Model B v1.2 running Shairport Sync 5.6.2 with AirPlay 2 support. Successful AirPlay playback, multiroom operation and Apple Home pairing were confirmed on the completed installation. Software dependencies and installation options may change with future releases.

Next
Next

The Smart Home Screen I've Been Waiting For