Updated: getting Shairport-sync working on Raspberry Pi

Things have moved along quite a way since my first forays into getting AirPlay-compatible Raspberry Pi devices on my home network!

Thanks to Rui’s post here, it was pretty easy to get going on my old Raspberry Pi B+ with a USB Creative Live DAC.  All I did was follow the instructions using W32 Disk Imager to put a Raspbian Lite image on a 4GB sound card.  Then, I followed Rui’s instructions, which are truncated below:

# NOTE:run these as root (or prefixed with sudo)

# install required packages
apt-get install git automake alsa-utils autoconf libtool libdaemon-dev libasound2-dev libpopt-dev libconfig-dev avahi-daemon libavahi-client-dev libssl-dev make g++

# grab the source
git clone https://github.com/mikebrady/shairport-sync.git

# build it
cd shairport-sync
autoreconf -i -f
./configure --with-alsa --with-avahi --with-ssl=openssl --with-metadata --with-systemd
make

# create a user account for it and add it to the audio group
groupadd -r shairport-sync
useradd -r -M -g shairport-sync -s /usr/bin/nologin -G audio shairport-sync

# install and enable service
make install
systemctl enable shairport-sync

Then I edited /usr/local/etc/shairport-sync.conf and added in the name of my AirPlay device that I wanted to appear on the network, and added in these two lines (which I got from using aplay -l to figure out what my USB sound card was coming in as):

(Under the alsa = section)

output_device = "hw:1";
mixer_control_name = "USB Audio";

Done. I also tried adding in the dwc_otg.speed=1 line to /boot/cmdline.txt but found that there was no real need for it as I don’t have any crackling or popping like I used to (after making sure the mic input was muted using alsamixer). Plus, when I do have that line in, USB keyboards and the like don’t work, so be careful with that one.

QED. 🙂

Advertisements