Creating an Air Play Device using a Raspberry Pi

I have several iOS devices at home and love the ability to broadcast whatever audio is playing on my device on one or more of the Air Play speakers in the house. I did a lot of research looking for speaker systems with this built in but it seemed that if you put “apple” in it, you have to bump the price tag up by a couple of hundred dollars. I set out to do the same for ~$50 total…

Parts List

Software Installation

  1. First Load the OS onto the SD media
  2. Do the initial configuration steps for Raspbian and update.
  3. Build Shairport-sync
    sudo apt install -y autoconf libtool libdaemon-dev libasound2-dev
    sudo apt install -y libpopt-dev libconfig-dev libssl-dev
    sudo apt install -y avahi-daemon libavahi-client-dev libsoxr-dev
    sudo apt install -y git
     
    mkdir /tmp/shairport-sync
    git clone https://github.com/mikebrady/shairport-sync.git /tmp/shairport-sync
     
    cd /tmp/shairport-sync
     
    autoreconf -i -f 
    ./configure --with-alsa --with-avahi --with-ssl=openssl --with-systemd --sysconfdir=/etc --with-metadata --with-soxr
     
    make
    sudo make install
    sudo systemctl enable shairport-sync
  4. Shairport configuration: sudo nano /etc/shairport-sync.conf
  5. In the General section:
    1. Update the name to the correct name and uncomment the line.
    2. Update the volume_range_db to 60 and uncomment the line.
  6. In the alsa section:
    1. Update the output_device to hw:0 and uncomment the line.
    2. Update the mixer_control_name to PCM and uncomment the line.
  7. Finally start the service: sudo service shairport-sync start
  8. Open AlsaMixer and move the volume to the highest setting that doesn't show red.

Keep in mind that the speaker output of the Raspberry Pi is not HiFi quality… The Raspberry Pi's built-in audio DAC that is connected to the device's headphone jack provides a low-quality output that is nevertheless useful for my purposes. It can be quite noisy if you turn up the volume in AlsaMixer. If you want higher quality audio, I'd recommend adding an external DAC…