Modified from https://www.hifiberry.com/guides/configuring-linux-3-18-x/.
First, install Raspbian.
Release 2017-07-05 is the latest one compatible with this guide. https://downloads.raspberrypi.org/raspbian/images/raspbian-2017-07-05/
To do this, you must edit /boot/config.txt and add the following line
dtoverlay=hifiberry-dacCreate /etc/asound.conf with the following content:
pcm.softvol {
type softvol
slave.pcm "plughw:1"
control {
name "Spotify"
card 0
}
}Reboot your Pi and make sure device shows up.
$ aplay -lLook for card { id }: sndrpihifiberry.
The following is taken from the install instructions located at https://github.com/mikebrady/shairport-sync/tree/development.
$ git clone https://github.com/mikebrady/shairport-sync.git
$ git checkout development
$ autoreconf -i -f
$ ./configure --sysconfdir=/etc --with-alsa --with-pa --with-avahi --with-ssl=openssl --with-soxr --with-systemd
$ make
$ sudo make install
$ sudo systemctl enable shairport-syncNow, edit this file:
sudo nano /etc/shairport-sync.confChange these values:
general = {
name = "whatever you want!";
};
alsa = {
output_device = "hw:1,0"; // (or whatever number card,device "sndrpihifiberry" is above)
interpolation = "soxr";
};If audio is underflowing, set audio_backend_buffer_desired_length to 22050.
Restart Shairport-sync to apply the new settings.
$ sudo service shairport-sync restart