We're mostly an Apple shop here at Liquidstate HQ and heavy Spotify users. We're already using Sonos in a few rooms but wanted something in our livingroom. There's already an overly expensive AV receiver and speakers there, so shelling out on an Airport Express seemed excessive. So, instead I decided to install Shairport on our Raspberry Pi, which we already have hooked up and acting as a PBX to reduce on nuisance calls.
So, here's how we did that:
First install some pre-reqs.
apt-get install git libao-dev libssl-dev libcrypt-openssl-rsa-perl libio-socket-inet6-perl libwww-perl avahi-utils libmodule-build-perl
Now install the Perl module to handle the Apple SDP protocol:
cd perl-net-sdp perl Build.PL ./Build ./Build test ./Build install cd ..
Install and configure Shairport:
git clone https://github.com/albertz/shairport cd shairport make make install cp shairport.init.sample /etc/init.d/shairport chmod +x /etc/init.d/shairport update-rc.d shairport defaults
Configure sound on the HDMI port:
echo 'snd-bcm2835' >> /etc/modules echo 'hdmi_drive=2' >> /boot/config.txt apt-get install alsa-utils sed -i 's/^pcm.front cards.pcm.front/pcm.front cards.pcm.default/' /usr/share/alsa/alsa.conf amixer cset numid=3 2
Now reboot and see if it all works! The default name for the AirPort receiver is "ShairPort" - you can change this in the init.d script if you like.