themacks
Posts: 4
Joined: Thu May 31, 2012 2:25 pm

AirPlay

Mon Jun 04, 2012 8:17 pm

Just got AirPlay working on the Raspberry PI running Arch using shairport. It is able to receive an audio stream from iTunes. Haven't tested iOS devices but they should work.

shairport - https://github.com/albertz/shairport

You need the following packages:
libao
openssl
avahi (howl is a meta package for it)
perl5
perl-crypt-openssl-rsa
perl-io-socket-inet6
perl-http-message

jasjeet
Posts: 90
Joined: Thu May 31, 2012 6:00 pm

Re: AirPlay

Mon Jun 04, 2012 9:02 pm

How do i do it with OpenELEC???

themacks
Posts: 4
Joined: Thu May 31, 2012 2:25 pm

Re: AirPlay

Tue Jun 05, 2012 3:52 pm

I don't know anything about OpenELEC but if you try building and run into errors post them here and I can try to help.

atrevers
Posts: 1
Joined: Wed Jun 06, 2012 12:27 pm

Re: AirPlay

Wed Jun 06, 2012 12:29 pm

I'm considering this setup as a replacement for my AirPort Express, plugged into the back of my Cambridge Audio A5 amp. What is the sound output quality like from the Pi 3.5mm jack?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5378
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: AirPlay

Wed Jun 06, 2012 1:20 pm

atrevers wrote:I'm considering this setup as a replacement for my AirPort Express, plugged into the back of my Cambridge Audio A5 amp. What is the sound output quality like from the Pi 3.5mm jack?
Not great. If you can use the HDMI output that would be better.

Corgan
Posts: 3
Joined: Tue May 22, 2012 11:18 pm

Re: AirPlay

Tue Jun 19, 2012 2:44 am

I can't seem to get this working. I got all the packages installed, modprobed the sound card, I can connect with my iPhone and Airfoil, but not iTunes. I can't get any audio to come out of the headphone jack. It opens up the audio card, because I can hear some faint white noise. Not getting any error messages either, just get a warning about it trying to open pcm.front, and then it tries the default audio card. Anything you could post to help me get it working would be greatly appreciated.

XavM
Posts: 35
Joined: Thu May 31, 2012 11:29 pm

Re: AirPlay

Tue Jun 19, 2012 8:02 pm

@jasjeet : AirPlay is already included in XBMC/OpenElec
It seams XBMX uses adapted versions of Shairport for Audio (AirTunes) and AirPlayer for Video
---> You don't have to install any thing (Just make sure there is no Settings you should activate thru the GUI : I can't remember if it is activated by default)

#Corgan : I can use ShairPort from iPhone, iPad or iTunes on Debian Squeeze or Wheezy without any problem (except for the alpha quality of the ALSA driver that stops sound from time to time with any application).

Can you play any sound on your Raspberry PI :

sudo apt-get install alsa-utils
sudo modprobe snd_bcm2835
sudo aplay /usr/share/sounds/alsa/Front_Center.wav

Could you Copy/Past the Shairport output you get when you start streaming music ?

jasjeet
Posts: 90
Joined: Thu May 31, 2012 6:00 pm

Re: AirPlay

Wed Jun 20, 2012 11:36 am

XavM wrote:@jasjeet : AirPlay is already included in XBMC/OpenElec
It seams XBMX uses adapted versions of Shairport for Audio (AirTunes) and AirPlayer for Video
---> You don't have to install any thing (Just make sure there is no Settings you should activate thru the GUI : I can't remember if it is activated by default)

#Corgan : I can use ShairPort from iPhone, iPad or iTunes on Debian Squeeze or Wheezy without any problem (except for the alpha quality of the ALSA driver that stops sound from time to time with any application).

Can you play any sound on your Raspberry PI :

sudo apt-get install alsa-utils
sudo modprobe snd_bcm2835
sudo aplay /usr/share/sounds/alsa/Front_Center.wav

Could you Copy/Past the Shairport output you get when you start streaming music ?
Yes i can airplay videos from youtube app (audio and video works) on my iphone, but nothing happens if i play music from the music app (no audio or animation at all on XBMC).

None of those commands work with OpenELEC, apt get doesnt work as OpenELEC has its own repostiry which you access through the GUI. Im not even sure if its using ALSA.

sfinx
Posts: 4
Joined: Mon Jun 25, 2012 6:07 pm

Re: AirPlay

Mon Jun 25, 2012 6:11 pm

Just compiled shairport under the latest Wheezy beta (2012-06-18) with the packages installed as suggested by the INSTALL.md from the shairport repo. Streaming audio from an iPad works fine! I'm using the analogue audio output for now, but I'm curious if audio over HDMI also works.

sfinx
Posts: 4
Joined: Mon Jun 25, 2012 6:07 pm

Re: AirPlay

Tue Jun 26, 2012 7:48 am

sfinx wrote:Just compiled shairport under the latest Wheezy beta (2012-06-18) with the packages installed as suggested by the INSTALL.md from the shairport repo. Streaming audio from an iPad works fine! I'm using the analogue audio output for now, but I'm curious if audio over HDMI also works.
Audio over HDMI works fine also.

sporez
Posts: 15
Joined: Tue Mar 06, 2012 11:59 pm

Re: AirPlay

Tue Jun 26, 2012 3:30 pm

sfinx wrote:Just compiled shairport under the latest Wheezy beta (2012-06-18) with the packages installed as suggested by the INSTALL.md from the shairport repo. Streaming audio from an iPad works fine! I'm using the analogue audio output for now, but I'm curious if audio over HDMI also works.
I'm trying to get shairport working under wheezy as well. I compiled it and when i try to stream to it from an iPod touch I get:

Code: Select all

ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front

missing frame.

missing frame.
No audio is put out either. Any ideas?

sporez
Posts: 15
Joined: Tue Mar 06, 2012 11:59 pm

Re: AirPlay

Tue Jun 26, 2012 4:16 pm

I figured out what the problem was, after running this 'amixer cset numid=3 1' the sound is now sent through the analogue out.

RussF
Posts: 2
Joined: Fri Jan 20, 2012 5:48 pm

Re: AirPlay

Tue Jun 26, 2012 9:33 pm

I did this a few weeks ago, but found that the sound cut out after a few minutes and I had to reconnect. Not good as I was hoping to just leave it running in the background. Is that an issue with the driver then? How do we fix it?

User avatar
truehl
Posts: 642
Joined: Sun Mar 04, 2012 6:47 pm
Contact: Website

Re: AirPlay

Wed Jun 27, 2012 8:28 am

RussF wrote:I did this a few weeks ago, but found that the sound cut out after a few minutes and I had to reconnect. Not good as I was hoping to just leave it running in the background. Is that an issue with the driver then? How do we fix it?
Hi RussF!
I got the same problem, AirPlay over Shairport works fine for a while and then breaks. After a reconnection it works again! So is there anyone who could give a hint on howto get Shaitport working stable on RPi?

Thanks a lot,
Thomas
truehl
http://www.squeezeplug.de

XavM
Posts: 35
Joined: Thu May 31, 2012 11:29 pm

Re: AirPlay

Wed Jun 27, 2012 9:42 am

I Think the problem does not come from shairport but rather from the ASLA driver that is still in an Alpha stage.

(correct me if i am wrong)

User avatar
truehl
Posts: 642
Joined: Sun Mar 04, 2012 6:47 pm
Contact: Website

Re: AirPlay

Wed Jun 27, 2012 10:42 am

XavM wrote:I Think the problem does not come from shairport but rather from the ASLA driver that is still in an Alpha stage.

(correct me if i am wrong)
Hi XavM,
did you or someone else try Shairport with the new Wheezy Image? Maybe that will work more reliable?!

Greetings,
Thomas
truehl
http://www.squeezeplug.de

XavM
Posts: 35
Joined: Thu May 31, 2012 11:29 pm

Re: AirPlay

Wed Jun 27, 2012 10:55 am

Yes i tried, but "no" <- Still the same pb with the ASLA driver

yeahbox
Posts: 36
Joined: Sun May 27, 2012 10:35 pm
Location: Manchester, UK

Re: AirPlay

Thu Jun 28, 2012 12:08 am

I also installed Shairport the other day and I also got it playing. I did only test it briefly since the audio quality is poor on the built in analoge output and I just wanted to check if it worked.

This is my educated guess/theory:
The real airport express have an ASRC (Asyncronous Sample Rate Converter) to handle the fact that the clocks are not the same (syncronised) and over time they will drift apart. This becomes pretty obvious if you choose more than one output from fx. iTunes. Any song will start at the same time but after less than a minute the drift is too big to accept. Try it yourself. So I suspect that the problem people have that the song stops after some time is because it is playing faster (or maybe even slower) than the output from for example your normal soundcard in the computer running iTunes. So my guess is that this more of a problem with shairport than it is with ALSA.

dontod
Posts: 5
Joined: Wed Apr 25, 2012 11:51 am

Re: AirPlay

Sat Jun 30, 2012 8:36 pm

Playing with this on the latest Wheezy image, but the same problems persist in that it disconnects after a few minutes.

The 'click' or 'pop' that the analog port emits at the start of the steam isn't too bad and overall the quality of ALSA output is not too bad.

Don.

aduncan88
Posts: 1
Joined: Sun Jul 08, 2012 4:36 pm

Re: AirPlay

Sun Jul 08, 2012 4:37 pm

having similar issues with shairport. I am pretty sure it is to do with this:

https://github.com/albertz/shairport/issues/147

I see similar output in the logs. No idea how to fix it though

Norefall
Posts: 43
Joined: Sun Nov 06, 2011 12:19 pm

Re: AirPlay

Thu Jul 19, 2012 9:33 pm

How can I compile Shairplay for ARM hard-float (Raspbian)? Im getting this error when I run 'make'.

Hairtunes uses VFP register arguments, alac.o does not

Failed to marge target spesific data of file alac.o

strolchi
Posts: 1
Joined: Mon Jul 23, 2012 8:44 pm

Re: AirPlay

Mon Jul 23, 2012 8:49 pm

Hi,

I was wondering if someone was able to install Airplay on Raspbian.

I was not even able to install the packages as it seems that they are not available in the repo?!


Thanks for any hint!

best regards,
felix

fishtopher
Posts: 1
Joined: Tue Jul 24, 2012 7:11 pm

Re: AirPlay

Tue Jul 24, 2012 7:20 pm

Hello,

I've followed the instructions ontomsolari's website, and *almost* got things working, however as soon as I hit play after connecting to the shairport from my iPhone I get this output:

Code: Select all

# perl shairport.pl 
Established under name '[email protected] 1226 on raspberrypi'
Odd number of elements in hash assignment at shairport.pl line 636.
Use of uninitialized value in subroutine entry at shairport.pl line 637.
avahi daemon terminated or 'avahi-publish-service' binary not found at shairport.pl line 236.
after that the perl/avahi processes shutdown.

Any ideas what could be going on and how I can fix it? I had a quick look in the perl, but I don't really know what's going on in there :)

Code: Select all

        /^ANNOUNCE$/ && do {
            my $sdptext = $req->content;
            my @sdplines = split /[\r\n]+/, $sdptext;
            my %sdp = map { ($1, $2) if /^a=([^:]+):(.+)/ } @sdplines;  //<<<<< This is the 'bad' line (636)...
            die("no AESIV") unless my $aesiv = decode_base64($sdp{aesiv});
            die("no AESKEY") unless my $rsaaeskey = decode_base64($sdp{rsaaeskey});
            $rsa->use_pkcs1_oaep_padding;
            my $aeskey = $rsa->decrypt($rsaaeskey) || die "RSA decrypt failed";

            $conn->{aesiv} = $aesiv;
            $conn->{aeskey} = $aeskey;
            $conn->{fmtp} = $sdp{fmtp};
            last;
        };

kyuzo
Posts: 2
Joined: Fri Jul 27, 2012 7:28 pm

Re: AirPlay

Fri Jul 27, 2012 7:36 pm

@fishtopher I had the same problem. Shairport crashed when i was trying to stream from my iPhone. I was running iOS 6 beta 3 on the iPhone and i think that was the problem. Shairport worked fine when i was streaming from my mac (iTunes, OS X 10.7.4). I solved the problem by using this (https://github.com/hendrikw82/shairport) branch of shairport, which have address the iOS 6 problem.

You'll need the following perl utilities, https://github.com/njh/perl-net-sdp to compile this shairport version.

Hope you´ll get it working!

cfdisk
Posts: 4
Joined: Fri Jul 20, 2012 9:26 am

Re: AirPlay

Sat Jul 28, 2012 7:04 pm

@kyuzo

thanks, this solved the problem for me. i got the same error when i tried to use shairport for system audio with osx 10.8

Return to “Media centres”