Dec 21, 2025
Install Shairport Sync with AirPlay 2 on Raspberry Pi Zero 2 W and Waveshare PCM5122 DAC

The Raspberry Pi Zero 2 W may be tiny, but paired with a proper DAC it becomes a surprisingly capable network audio streamer. In this guide, we'll build a high-fidelity AirPlay 2 receiver using Shairport Sync, enabling multi-room playback, tight clock synchronization, and excellent resampling quality.
This setup is ideal if you want an affordable, always-on AirPlay endpoint that integrates seamlessly with Apple devices—without compromising audio quality.
🛠 Hardware Requirements
You'll need the following components:
- Raspberry Pi Zero 2 W
- Waveshare PCM5122 HiFi I2S DAC
(exposed to ALSA asIQaudIODAC) - MicroSD Card (8 GB or larger)
- Power supply and speakers / amplifier
Step 1: Flash and Boot Raspberry Pi OS
- Flash the OS
Use the official Raspberry Pi Imager and select Raspberry Pi OS Lite (64-bit). - Pre-configure the Image
Before flashing, click the ⚙️ Edit Settings icon and configure:- Hostname (for example:
hifi-pi) - Enable SSH
- Wi-Fi credentials
- Hostname (for example:
- Boot the Pi
Attach the Waveshare PCM5122 DAC to the GPIO header, insert the SD card, and power on the Pi. - Connect via SSH
ssh pi@hifi-pi.localNote: recent versions of Raspberry Pi Imager require you to define a username in the OS customization settings — the implicit
piuser no longer exists. Set your username there (for examplepi).
Hardware Verification
The Waveshare PCM5122 Audio Board carries a HAT EEPROM, so the firmware loads its overlay automatically at boot. Verify that ALSA detects it correctly:
aplay -l
You should see output similar to:
card 1: IQaudIODAC [IQaudIODAC], device 0: IQaudIO DAC HiFi pcm512x-hifi-0
If the device appears as shown above, the hardware is ready.
Troubleshooting: if the card is not listed, add
dtoverlay=iqaudio-dacplusto the[all]section of/boot/firmware/config.txtand reboot — older revisions of the board ship without an EEPROM.
Step 2: Install Build Dependencies
Shairport Sync with AirPlay 2 support requires several libraries for audio processing, encryption, and networking. Update your system and install the required packages:
sudo apt update && sudo apt upgrade -y
sudo apt install --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 \
libavutil-dev libavcodec-dev libavformat-dev \
uuid-dev libgcrypt-dev xxd
Step 3: Install NQPTP (Required for AirPlay 2)
AirPlay 2 relies on NQPTP (Not Quite Precision Time Protocol) for accurate clock synchronization across devices. Without it, multi-room playback will not work correctly.
cd ~
git clone https://github.com/mikebrady/nqptp.git
cd nqptp
autoreconf -fi
./configure --with-systemd-startup
make
sudo make install
sudo systemctl enable nqptp
sudo systemctl start nqptp
Step 4: Build Shairport Sync with AirPlay 2 Support
Now we compile Shairport Sync from source to enable AirPlay 2, metadata, and Systemd integration.
- Clone the Repository
cd ~
git clone https://github.com/mikebrady/shairport-sync.git
cd shairport-sync
- Configure and Build
autoreconf -fi
./configure \
--sysconfdir=/etc \
--with-alsa \
--with-soxr \
--with-avahi \
--with-ssl=openssl \
--with-systemd \
--with-airplay-2 \
--with-metadata \
--with-systemdsystemunitdir=/lib/systemd/system
make
sudo make install
⚠️ The
autoreconfstep can take a while on the Pi Zero 2 W. This is normal—grab a coffee and let it finish.
Step 5: Configure Shairport Sync
Next, we'll configure Shairport Sync for stable, high-quality output on the PCM5122 DAC. The settings below come from a long-running, dropout-free setup on a Pi Zero 2 W.
- Open the configuration file:
sudo nano /etc/shairport-sync.conf
- Replace the contents with the following configuration:
general =
{
name = "Living Room Pi";
interpolation = "basic";
volume_control_profile = "dasl_tapered";
audio_backend_buffer_desired_length_in_seconds = 1.0; // Increase this value as needed (e.g., 2.0, 5.0)
};
audio_backend =
{
type = "alsa";
};
alsa =
{
output_device = "plughw:CARD=IQaudIODAC,DEV=0";
period_size = 8820; // Larger values reduce underruns
buffer_size = 44100; // Or higher
};
airplay =
{
enable_airplay_2 = "yes";
};
metadata =
{
enabled = "yes";
include_cover_art = "no";
};
diagnostics =
{
statistics = "yes";
log_verbosity = 0;
};
Notes:
interpolation = "basic"is the stable choice on the Pi Zero 2 W — it uses far less CPU thansoxr, which matters when the same board is handling AirPlay 2 decoding. If you want maximum resampling quality and have headroom, change it tosoxr(the build includes it).- Larger
period_size/buffer_sizevalues trade a little latency for fewer underruns. Tune them if you hear audio dropouts.
- Save and exit (
Ctrl+O,Enter,Ctrl+X).
Step 6: Enable and Start the Service
Enable Shairport Sync so it starts automatically on boot:
sudo systemctl enable shairport-sync
sudo systemctl start shairport-sync
You can verify its status with:
systemctl status shairport-sync
Step 7: Disable Wi-Fi Power Saving (Recommended)
By default, Raspberry Pi OS enables Wi-Fi power saving to reduce energy consumption. While useful for battery-powered devices, it can cause audio dropouts, increased latency, or AirPlay discovery issues on always-on streamers.
For a stable AirPlay 2 experience, it's best to disable Wi-Fi power management.
To disable Wi-Fi power saving permanently, create a systemd service.
- Create the service file:
sudo nano /etc/systemd/system/wifi-powersave-off.service
- Paste the following content:
[Unit]
Description=Disable WiFi Power Save
After=network.target
[Service]
Type=oneshot
ExecStart=/sbin/iw dev wlan0 set power_save off
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
- Enable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable wifi-powersave-off
sudo systemctl start wifi-powersave-off
Verify Status
You can confirm Wi-Fi power saving is disabled with:
iw dev wlan0 get power_save
Expected output:
Power save: off
Step 8: Disable Bluetooth (Recommended)
On the Pi Zero 2 W, Wi-Fi and Bluetooth share the same wireless chip and antenna. Keeping Bluetooth enabled adds interference and extra load on the shared radio, which can cause Wi-Fi instability — and for a Wi-Fi-only audio streamer, a stable wireless link is everything. Since this build has no use for Bluetooth, disable it entirely:
- Edit the boot config:
sudo nano /boot/firmware/config.txt
- Add the following line in the
[all]section:
dtoverlay=disable-bt
- Disable the Bluetooth UART service and reboot:
sudo systemctl disable hciuart
sudo reboot
After the reboot, verify that Bluetooth is gone:
systemctl is-active bluetooth
# inactive
rfkill list
# no Bluetooth entries (only the Wi-Fi one, if any)
Bonus: with Bluetooth disabled, the UART pins are free — you can add
enable_uart=1to the same[all]section if you ever want a serial console for debugging.
🎉 Enjoy High-Fidelity AirPlay 2 Streaming
Your Raspberry Pi Zero 2 W is now a fully-featured AirPlay 2 receiver.
- Multi-Room Audio
Group it with HomePods, Apple TVs, or other AirPlay 2 speakers. - Stable Sound Quality
Buffered ALSA output tuned for the Pi Zero 2 W's CPU, with SoXR available if you want to trade CPU for resampling quality. - Seamless Apple Integration
"Living Room Pi" will appear instantly in the AirPlay speaker list on iOS and macOS.
For a device that costs only a fraction of commercial streamers, the result is remarkably close to a professional-grade solution.
Happy listening 🎧