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
Re: AirPlay
How do i do it with OpenELEC???
Re: AirPlay
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.
Re: AirPlay
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?
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 5710
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: AirPlay
Not great. If you can use the HDMI output that would be better.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?
Re: AirPlay
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.
Re: AirPlay
@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 ?
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 ?
Re: AirPlay
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).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 ?
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.
Re: AirPlay
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.
Re: AirPlay
Audio over HDMI works fine also.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.
Re: AirPlay
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: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.
Code: Select all
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
missing frame.
missing frame.
Re: AirPlay
I figured out what the problem was, after running this 'amixer cset numid=3 1' the sound is now sent through the analogue out.
Re: AirPlay
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?
Re: AirPlay
Hi RussF!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?
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
http://www.squeezeplug.de
Re: AirPlay
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)
(correct me if i am wrong)
Re: AirPlay
Hi XavM,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)
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
http://www.squeezeplug.de
Re: AirPlay
Yes i tried, but "no" <- Still the same pb with the ASLA driver
Re: AirPlay
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.
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.
Re: AirPlay
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.
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.
Re: AirPlay
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
https://github.com/albertz/shairport/issues/147
I see similar output in the logs. No idea how to fix it though
Re: AirPlay
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
Hairtunes uses VFP register arguments, alac.o does not
Failed to marge target spesific data of file alac.o
Re: AirPlay
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
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
-
- Posts: 1
- Joined: Tue Jul 24, 2012 7:11 pm
Re: AirPlay
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:
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
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 '5D4EEB4DB562@ShairPort 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.
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;
};
Re: AirPlay
@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!
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!
Re: AirPlay
@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
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