Skip to content

Instantly share code, notes, and snippets.

@maxehmookau
Created July 2, 2013 19:04
Show Gist options
  • Save maxehmookau/5912101 to your computer and use it in GitHub Desktop.
Save maxehmookau/5912101 to your computer and use it in GitHub Desktop.
How to turn a Raspberry Pi in to an AirPlay Server

How to turn a Raspberry Pi in to an AirPlay Server

$ ssh pi@192.168.xxx.xxx
Enter Password: raspberry

$ sudo raspi-config
Choose 'Repurpose entire SD card'

Update apt repositories

$ sudo apt-get update
$ sudo apt-get upgrade

Test speakers (you should hear white noise)

$ speaker-test

Configure speakers to work on boot

$ cd /etc/modprobe.d
$ sudo vi alsa-base.conf
/'options snd-usb-audio index=-2' ^ i # <Esc> (comment out this line)
:wq (to quit vim)

Install Shairport dependencies

$ cd ~
$ sudo apt-get install git libao-dev libssl-dev libcrypt-openssl-rsa-perl libio-socket-inet6-perl libwww-perl avahi-utils libmodule-build-perl
$ git clone https://github.com/njh/perl-net-sdp.git perl-net-sdp
$ cd perl-net-sdp
$ perl Build.PL
$ sudo ./Build
$ sudo ./Build test
$ sudo ./Build install
$ cd ..

Install Shairport

$ git clone https://github.com/hendrikw82/shairport.git
$ cd shairport
$ make

Make Shairport load on boot

$ cd shairport
$ make install
$ cp shairport.init.sample /etc/init.d/shairport
$ cd /etc/init.d
$ chmod a+x shairport
$ update-rc.d shairport defaults
$ sudo vi shairport
vim: /DAEMON_ARGS <Enter>ddoi DAEMON_ARGS="-w $PIDFILE -a AirPi" <Esc> :wq (Find and replace this line)

Unplug your Pi and plug it back in.

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