I have a Raspberry Pi with Arch Linux installed and decided to take a crack at installing Shairport which is a service to use Airplay from iTunes for streaming radio from iTunes Radio or your iTunes library. It wasn’t as hard as I thought.

TO MAKE THIS EASY YOU CAN TRY TO DOWNLOAD AND INSTALL MY COMPILED SHAIRPORT PACKAGE. IT MAY OR MAY NOT WORK FOR YOU. IF NOT USE THE DIRECTIONS JUST BELOW.

I snuck “git” in on you as it isn’t a dependency for shairport but you need it to get the makefile.

Now

cd shairport-git-sysdcompat

makepkg -s --as root

NOTE: if makepkg chokes you may need to install base-devel

pacman -S base-devel

After that completes.

pacman -U shairport-git-sysdcompat-20131111-1-armv6h.pkg.tar.xz

now enable avahi-daemon

systemctl enable avahi-daemon

then

reboot

After reboot log in and type

shairport -a ArchPi (with anything after the -a any name you want to give it.

It should respond with

“Listening for Connections”

Now go to your Mac, your iPhone, your iPad and select ArchPi as your streaming device. This will work but ONLY with the 3.5mm onboard audio jack on the Raspberry Pi. If you’re good with that, you are kinda sorta done, except for auto starting the app at boot.

If you’re not good with it and want to output sound to another device such as your USB DAC do this:

aplay -l

My DAC is Card 1 so lets do this

shairport -a Airpi -o alsa -- -d hw:1,0

Your music should output from your DAC now. View from iTunes.

View from iPad:More later on the scripts file for auto starting........I also run squeezelite player and Logitech Media Server and I’m working through how to elegantly use both with the same DAC with minimal user intervention.

Here’s what I did to get both services running at once. Not very elegant but it does work. The only user intervention required is that the user change the switch for the input on the preamplifier. User friendly for non techie-types.

aplay -l

Here is how it is done

I hooked up two DAC’s. A Nuforce UDAC2 SE, and a HiFimeDIY DAC. Both USB DAC’s. On the Raspberry Pi the upper USB port contains the powered USB Hub connection. Below it is the Nuforce Dac which is controlled by squeezelite (called from a script and initiated at boot from the crontab)./usr/bin/squeezelite -o front:CARD=DAC,DEV=0 -n RaspArchPi -s 127.0.0.1 -m 80:1f:02:94:58:b1

A crontab entry was also created for shairport

@reboot shairport -a Airpi -o alsa -- -d hw:2,0 (notice the HiFimeDIY Dac is now card 2 so I made the change accordingly in this command)

Shairport crashed on me or something happened so I made a file called /root/check_services and added this line.

shairport -a Airpi -o alsa -- -d hw:2,0

then

chmod 700 /root/check_servicesThen added this to the crontab

*/5 * * * * /bin/bash /root/check_services

That checks the service every 5 minutes and restarts it if necessary.

Now all the user need do is select between 2 and 3 on the preamplifier

And here’s the Pi hooked to the NuForce UDAC. The HiFimeDIY DAC is out of sight in the mess of wires.