Skip to content

Instantly share code, notes, and snippets.

@m1m1s1ku
Last active April 29, 2018 01:25
Show Gist options
  • Save m1m1s1ku/dd730337e2bdb29bfa35a07b16c06638 to your computer and use it in GitHub Desktop.
Save m1m1s1ku/dd730337e2bdb29bfa35a07b16c06638 to your computer and use it in GitHub Desktop.
Shairport-sync on Raspberry Pi

Shairport-sync on RPI

Shairport-sync allow to use the Raspberry Pi (Model A, B) as an AirPlay Audio gateway.

It's a wonderful option to add AirPlay on an old amplifier for example !

  • Install Raspbian latest on a SD Card
  • Boot
  • sudo raspi-config
    • Next > Localisation + Wi-Fi + SSH (if needed)

Next get the "basics" from Mike Brady readme

  • git clone https://github.com/mikebrady/shairport-sync.git (and cd into)
  • autoreconf -i -f
  • ./configure --sysconfdir=/etc --with-alsa --with-pa --with-avahi --with-ssl=openssl --with-metadata --with-soxr --with-systemd
  • make
  • make install
  • sudo systemctl enable shairport-sync

Next, edit /boot/config.txt and append this line somewhere : audio_pwm_mode=2

Set the alsa config in shairport-sync.conf (in /etc by default)

general = {
  name = "PiPlay";
};
alsa =
{
  output_device = "hw:0"; // the name of the alsa output device. Use "alsamixer" or "aplay" to find out the names of devices, mixers, etc.
  mixer_control_name = "PCM"; // the name of the mixer to use to adjust output volume. If not specified, volume in adjusted in software.
}

To start the service : /etc/init.d/shairport-sync start

The Raspberry Pi should be displayed in System Preferences > Sound :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment