!It’s not perfect yet, but it works. There’s a small problem if you use the 3.5mm jack output. There is some distortion when you start a new song and it’s unstable. Update juli 2013: I dont know what has changed, but the problem with distorting sound at the start is gone. Although it still has some problems when there are multiple devices connected and playing. So i still have a cronjob to restart the service every 2 hours.
Let’s make a connection to the raspberry pi with ssh, you should know how to do this. There will be a guide to get this working, although it’s not there yet.
When you’re logged in and to make things easier just type in:
Be sudo to make it easy
Now you’re are sudo, so dont do weird things!
Depending on which output you’re using you can use one of the following commands to select the audio output:
For the 3.5mm jack output
amixer cset numid=3 1
amixer cset numid=3 2
Change output volume with:
I’ve got mine till 86 (PCM).
To be sure you’re up to date with the latest updates type or copy:
apt-get update && upgrade
To be able to use Airplay, you need to install shairport. It’s on github, so you also need git.
There also other packages, such as avahi, so install them with the following command:
apt-get install git libao-dev libssl-dev libcrypt-openssl-rsa-perl libio-socket-inet6-perl libwww-perl avahi-utils libmodule-build-perl
To get Airplay working with Mac OsX 10.8 and iOS 6 install perl-net-sdp
git clone https://github.com/njh/perl-net-sdp.git perl-net-sdp
Build and install with the following command
cd perl-net-sdp && perl Build.PL && ./Build && ./Build test && ./Build install
Let’s get back to the user folder:
Let’s install shairport:
git clone https://github.com/hendrikw82/shairport.git && cd shairport && make install
Copy the service file for start/stop
cp shairport.init.sample /etc/init.d/shairport
Change the startup script:
Learn how to use Vi! Click
Change your name in the startup file:
NAME=WHATEVER YOU WANT HERE
chmod a+x /etc/init.d/shairport
If the service doesnt show the right name try editing the following file with:
my $appname with
/ and change
"Shairport $$ on" to whatever you want.
Some people suggest making it start on boot with:
update-rc.d shairport defaults
Well, i did try that twice and it made my raspberry pi unbootable….So that’s a warning
Run Shairport with:
Since shairport is a little buggy do the following to restart the service every 2 hours
Add the following line at the bottom
0 */2 * * * /etc/init.d/shairport restart
This will restart the shairport service every 2 hours
You can check wether the cronjob is working or not with:
tail -f /var/log/syslog
Check your iDevice to see the shairport 🙂
P.s. When it takes a long time to start playing music change the following:
Change the following setting to: