If you have an iPhone/iPad, you must be familiar with the AirPlay icon that is shown as a little triangle. It can be used to play music on a remote AirPlay receiver for better sound quality.
We will show you how to turn a pcDuino into an AirPlay receiver for streaming music in this post.
Follow the USB sound card post to install the USB sound card.
Then follow the steps in lifehacker to install Shairport.
Install the Shairport AirPlay Emulator:
Shairport is the software that actually makes AirPlay work.
We need to install the required packages before installing Shairport:
>sudo apt-get install git libao-dev libssl-dev libcrypt-openssl-rsa-perl libio-socket-inet6-perl libwww-perl avahi-utils libmodule-build-perl
After it completes, install an update so that Shairport will work with iOS 6 (you can skip this step if you’re not on or plan to upgrade iOS 6):
>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 ..
Once the iOS 6 module is installed, give it a little while, it it finally time to get Shairport installed. From your home directory type:
>git clone https://github.com/hendrikw82/shairport.git >cd shairport >make
Now, let’s run Shairport:
>./shairport.pl -a pcDuinoAirPlay
This command starts Shairport with pcDuino named “pcDuinoAirPlay”. You can change it to whatever you want. Grab your iOS device, pick the music app of your choice, and tap the AirPlay button. You should see “pcDuinoAirPlay” listed as an output device. Tap that, and the music should start streaming out of your USB sound card within a couple seconds.
The following is the output on pcDuino side,
If you want AirPlay to start automatically every time pcDuino starts then do the following:
>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
Then add Shairport as a launch item. Type:
>sudo nano shairport
This loads the Shairport file we need to edit. Look through the file for the “DAEMON_ARGS” line, and change it so it looks like this:
DAEMON_ARGS="-w $PIDFILE -a pcDuinoAirPlay"
Save the file (Ctrl+X), and you’re all set. Shairport should launch on startup every time.
Leave a Reply
You must be logged in to post a comment.