How to Turn your Raspberry Pi Zero W into an Airplay 2 Streaming Adapter for the Apple iPod Hi-Fi

 

Hardware needed

- Raspberry Pi to iPod HiFi 30-pin-dock Adapter for Airplay Audio Streaming from Poolside Factory. Comes with standoffs and screws to mount to the Raspberry Pi Zero form factor.

- Raspberry Pi Zero W or Raspberry Pi Zero 2 W, either with connector header soldered on.  The 'W' version is necessary for this application.

- SD Card with capacity of 4GB or higher

 

Instructions

If you already have an SD card with a working Raspberry Pi image that you can log into over WiFi, you can use that one, otherwise you can follow these steps to create a fresh one.

Log in to your Raspberry Pi.

Change the hostname of your Raspberry Pi to what you want the name to be that shows up as the Airplay speaker name that you can stream to. For this, use raspi-config as shown in the above mentioned steps

Run these commands to bring your Raspberry Pi image up to date and install all the necessary packages (can take 20ish minutes, make sure the shell has your sudo password before you copy-paste the whole block - for instance by running 'sudo ls' first):

Option 1:  Airplay 1

sudo apt-get update -y && sudo apt-get -y dist-upgrade && sudo apt-get install -y autoconf automake avahi-daemon build-essential git libasound2-dev libavahi-client-dev libconfig-dev libdaemon-dev libpopt-dev libssl-dev libtool xmltoman vim
git clone https://github.com/mikebrady/shairport-sync.git cd shairport-sync autoreconf -i -f ./configure --with-alsa --with-avahi --with-ssl=openssl --with-systemd --with-metadata
make && sudo make install
sudo systemctl enable shairport-sync
sudo service shairport-sync start

Option 2:  Airplay 2

sudo apt-get update -y && sudo apt-get -y dist-upgrade && sudo apt-get install -y 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 vim

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
cd ~

git clone https://github.com/mikebrady/shairport-sync.git
cd shairport-sync
autoreconf -fi
./configure --sysconfdir=/etc --with-alsa \
--with-soxr --with-avahi --with-ssl=openssl --with-systemd --with-airplay-2
make
sudo make install
sudo systemctl enable shairport-sync
sudo service shairport-sync start
cd ~

Common to Option 1 and 2 from here till rest

Then configure the sound to use the DAC on the Poolside Factory adapter and reboot  (note that since Bookworm, the file location has moved from /boot/config.txt to /boot/firmware/config.txt, as already reflected below):

sudo sed -i --follow-symlinks 's/dtparam=audio=on/dtparam=audio=off/' /boot/firmware/config.txt
sudo sed -i --follow-symlinks '/dtparam=audio=off/a dtoverlay=hifiberry-dac' /boot/firmware/config.txt

sudo reboot

Once your Raspberry Pi rebooted, the name you have given as hostname should show up among your Airplay speakers available to stream to. See an example here, I called mine iPodHifi-Garage.

Ready to play your favorite tunes :)

Streaming to an Airplay Speaker

 

If you need the adapter between your Raspberry Pi and the 30-pin Dock, you can order one here

 

4 comments

  • @Dai Yes, the hardware acts as a soundcard for the Raspberry Pi and will work with any software that will play audio on the Raspberry Pi. The setup instructions for non-airplay methods of streaming audio would be different though than described in this post.

    Ganymed Stanek
  • the lines
    sudo sed -i —follow-symlinks ‘s/dtparam=audio=on/dtparam=audio=off/’ /boot/config.txt
    sudo sed -i —follow-symlinks ‘/dtparam=audio=off/a dtoverlay=hifiberry-dac’ /boot/config.txt

    no longer write to /boot/config.txt, which has moved to /boot/firmware/config.txt

    chris
  • Can this work with non-Airplay stuff like a Chromecast library or HiFiBerry OS or Volumio?

    Dai
  • Working perfect with Harman&Kardon Play&Go

    JVP

Leave a comment

Please note, comments must be approved before they are published