Get AirPlay working on your XBMC live HTPC!
March 5, 2011 71 Comments
- Go to https://github.com/PascalW/Airplayer and download the zip
- Unzip it, rename it to PascalW-Airplayer and transfer it (SFTP client) over to your home folder in XBMC
- SSH into XBMC (ssh username@xbmcip)
- sudo apt-get update
sudo apt-get install libavahi-compat-libdnssd1 python python-pip- Dive into the folder you transfered in step 2 with ‘cd PascalW-Airplayer‘
- sudo pip install -r requirements.txt
cd airplayer- Edit and insert your XBMC username and password in the settings file:
sudo nano settings.py - Start AirPlayer:
python airplayer.py - Start a video (YouTube for example) on your iOS device and AirPlay it over to XBMC!
- Get back to the previous folder
cd .. sudo cp scripts/ubuntu/airplayer /etc/init.d/airplayer-
sudo update-rc.d airplayer defaults sudo chmod +x /etc/init.d/airplayersudo nano /etc/init.d/airplayerEdit user (username), group (id username) and path to where the airplayer.py script is located for me it is “/home/tripkip/PascalW-Airplayer/airplayer/airplayer.py”- Save, reboot and test!
Now if you like to start it up automatically every time you boot XBMC continue!
Credits to PascalW, the author of AirPlay for XBMC, Boxee and Plex.
Advertisement



awesome. this works great. thanks
Works sweet. Excellent. Thanks very much
Bah.. keep getting:
“E: Couldn’t find package python-pip”
No matter what I do.. dont’ suppose you have any suggestions?
Google, download the package anf find a way to install it manually
good luck
Verstuurd vanaf mijn iPhone
I also received this error. Running
sudo apt-get updatefirst solved solved it for me.I’ve followed all the instructions exactly but I just can’t get the script to run automatically when the xbmc box starts up
I too cannot get the script to run automatically when xbmc starts. I have to run through this setup each time, so its as if all the settings are getting erased at each reboot. I am running xbmc-live off a sd card on an asus eee box with no hd installed. Any help would be much appreciated.
sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package python-pip
I also did a apt-get update and apt-get upgrade
Running Ubnutu Hardy
Any hits much appreciated…still learning linux.
Pingback: Mari bermain dengan DLNA « Dhoto’s Homepage
what exactly do you mean by group (in the 16th step, i don’t know what to write there, and it doesn’t open automatically when i turn on my media center)
You have to fill in username and your group id. In the settings file (sudo nano airplayer).
To check your group id, fill in “id yourusername” in the console…
thanks for that, also, I don’t find “path” anywhere in that file, could it be “daemon” the one I need to modify?
I can not find anything about group id in xbmc. could you tell me exactly where I enter it or find it in xbmc.
If your’re having trouble getting airplayer to start on boot, the trick is in making the airplayer python file executable:
chmod +x airplayer.py
Pingback: How To Make Your Entire Home AirPlay-Compatible | Lifehacker Australia
Pingback: How To Make Your Entire Home AirPlay-Compatible | Gizmodo Australia
I can’t seem to be able to copy the folder to my home folder. I am using Filezilla using a sftp connection. I am allowed to copy to the xbmc folder in the home directory, but when I try to run the “sudo apt-get install libavahi-compat-libdnssd1 python python-pip” Terminal returns:
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package python-pip
… Any ideas?
Welcome,
yeah sure: http://htpcbuild.wordpress.com/2011/03/05/get-airplay-working-on-your-xbmc-live-htpc/#comment-120
GL
Pingback: Rendi la tua casa AirPlay compatibile! | iPaple.com
Pingback: home » Blog Archive » How to Make Your Entire Home AirPlay-Compatible
Pingback: Guide AirPlay : Faites communiquer tous vos périphériques ! | iOStv
Pingback: Install Shairport on XBMC Live to get AirPlay audio as well! « My custom HTPC build
I followed the ubuntu/xbmc instructions and got streaming video working. Even YouTube workshop fine! However i was really hoping that spotify would work, but it doesn’t. I don’t get the AirPlay button that should automagically appear in spotify. Real pity…..
Hi,
I can’t help you with that – no spotify in Europe
Gr
It would be awesome if someone could get this working on XBMC4XBOX orig… Then the orig. XBOX could also be a cheap AirPlay device
I am stuck with using it for music and such atm, and while I can play the music from my PC over the network, it would be so nice to be able to auto-magically play video/audio onto the XBMC on my orig. XBOX. Any suggestions?
No Module Named pybonjour?
atv@appletv-ubuntu:/root/.xbmc/userdata/PascalW-Airplayer/airplayer$ python airplayer.py
Traceback (most recent call last):
File “airplayer.py”, line 18, in
import bonjour
File “/root/.xbmc/userdata/PascalW-Airplayer/airplayer/bonjour.py”, line 2, in
import pybonjour
ImportError: No module named pybonjour
same thing here. did you ever find a solution to this?
I went and downloaded pybonjour from google.
I stuck it in the airplay folder and run “python airplayer.py”
Now i get an error saying “tornado.httpserver” is missing.
Anyone know what I’m facing here?
After inputting the “sudo pip install -r requirements.txt”
I get:
Command python setup.py egg_info failed with error code 1
the Full script after that is:
Downloading/unpacking pybonjour (from -r requirements.txt (line 1))
Downloading pybonjour-1.1.1.tar.gz
Running setup.py egg_info for package pybonjour
Traceback (most recent call last):
File “”, line 14, in
File “/root/PascalW-Airplayer/build/pybonjour/setup.py”, line 32, in
import pybonjour
File “pybonjour.py”, line 109, in
_libdnssd = ctypes.cdll.LoadLibrary(_libdnssd)
File “/usr/lib/python2.5/ctypes/__init__.py”, line 431, in LoadLibrary
return self._dlltype(name)
File “/usr/lib/python2.5/ctypes/__init__.py”, line 348, in __init__
self._handle = _dlopen(self._name, mode)
OSError: libdns_sd.so.1: cannot open shared object file: No such file or directory
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File “”, line 14, in
File “/root/PascalW-Airplayer/build/pybonjour/setup.py”, line 32, in
import pybonjour
File “pybonjour.py”, line 109, in
_libdnssd = ctypes.cdll.LoadLibrary(_libdnssd)
File “/usr/lib/python2.5/ctypes/__init__.py”, line 431, in LoadLibrary
return self._dlltype(name)
File “/usr/lib/python2.5/ctypes/__init__.py”, line 348, in __init__
self._handle = _dlopen(self._name, mode)
OSError: libdns_sd.so.1: cannot open shared object file: No such file or directory
—————————————-
Command python setup.py egg_info failed with error code 1
Storing complete log in /home/atv/.pip/pip.log
Thanks, this has worked perfectly for me!
I have this installed, and from YouTube, it works very well. That being said, I’m unable to push from my local media library. Am I missing something? iPod doesn’t seem to work from my iPhone or iPad to the XBMC box.
Ok, scratch I said anything. I just read some of the docs…
thanks dude !!!!
Terrific review! This is exactly the type of blog post that should be shared around the internet. Shame on the Google for not ranking this blog post higher!
You re totally right
thx
Pingback: Airplay for XBMC « Stm Labs Forums
i must be doing something really stupid all i get when i run it is name not definded. when i run it with the username and password as “None” it’s as if it connects but just says “couldn’t connect to 127.0.0.1″ but i can see the airplay tab on my iphone, when i try to stream anything it just repeats the can’t connect message.
anyone know how this is. i am sort of new to linux.
@stuart same problem for me. installation ran without errors and airplay button is visible on iphone but no chance to stream content
@stuart problem is solved.
you just have to configure xbmc to accept http connections within network configuration; there you can also set xbmc’s user name and pw
cheers
thomas
hi thomas i set that in there but it doesnt accept the username that i set in there , just give me the same problem. will try again tonight tho incase i did something stupid which is likely lol
Great howto. Got it to work in no time!!!
Great!
It works like a charm form pictures but i can’t get it to work for movies (the airplay button is hidden for movies)
Do i miss something ?
I can not get this working I get this errored output every time.
@XBMCLive:/PascalW-Airplayer$ sudo pip install -r requirements.txt
Downloading/unpacking tornado==1.2.1 (from -r requirements.txt (line 2))
Running setup.py egg_info for package tornado
Traceback (most recent call last):
File “”, line 3, in
ImportError: No module named setuptools.command
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File “”, line 3, in
ImportError: No module named setuptools.command
—————————————-
Command python setup.py egg_info failed with error code 1
Storing complete log in ./pip-log.txt
Figured it out step 6 is missing. you need to do
sudo apt-get install python-setuptools
after step 5 then follow the rest of the steps.
Fantastic write up! Just got into xbmc live after struggling with stuttering video on my windows machine running xbmc. Would love to get airplay to work but having troubles with the auto starting.
Here is my init.d info …
#!/bin/bash
### BEGIN INIT INFO
# Provides: airplayer
# Required-Start: $network $local_fs
# Required-Stop: $network $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
NAME=airplayer
PIDFILE=”/var/run/$NAME/$NAME.pid”
LOGFILE=”/var/log/$NAME/$NAME.log”
# make sure airplayer.py is executable (chmod +x airplayer.py)
DAEMON=”/home/xbmc/PascalW-Airplayer/airplayer/airplayer.py”
DAEMON_OPTS=”-d –pidfile $PIDFILE –logfile $LOGFILE”
USER=xbmc
GROUP=1000
mkdir -p /var/run/$NAME > /dev/null 2> /dev/null
chown $USER:$GROUP /var/run/$NAME
mkdir -p /var/log/$NAME > /dev/null 2> /dev/null
chown $USER:$GROUP /var/log/$NAME
case “$1″ in
start)
echo -n “Starting $NAME: ”
start-stop-daemon –start -c $USER:$GROUP\
–exec $DAEMON — $DAEMON_OPTS
echo $NAME
;;
stop)
if [ -e $PIDFILE ]
then
echo -n “Stopping $NAME: ”
start-stop-daemon –stop –pidfile $PIDFILE
echo “$NAME”
else
echo “$NAME is not running, pidfile $PIDFILE not found.”
fi
;;
restart)
$0 stop
$0 start
;;
*)
echo “Usage: $0 {start|stop|restart}”
exit 1
;;
esac
exit $RETVAL
I changed the Daemon to my airplayer.py location and my user is xbmc when i type id xbmc I get 1000 as the group so I entered 1000 where the group was asked, I have also tried this as xbmc just to see if it would work to no avail. I am surely missing something?? Please help!
Do I have to input user and group wherever I see it within the init.d? Any help would be more than greatly appreciated, thank you!
Have you made sure airplayer.py is executable (chmod +x airplayer.py)?
Ok I got Airplay working but after I see Airplayer starting in Putty then Putty stops taking input and when I close Putty, Airplayer stops running. Any idea what I am doing wrong?
Follow the guide further so it starts aytomatically..
Verstuurd vanaf mijn iPhone
I followed it to the end and still it wont start with boot and when I close putty window the script stops working. Any ideas would be huge help.
I have followed this guide on a Ubuntu Natty with XBMC. I am unable to get iTunes on my Mac to talk to airplayer. When I see what bonjour services is running on my network I see the airplayer reports itself with at ipv6 address. My network AFAIK is only ipv4. When I check the log airplayer starts up fine and connects to XBMC, a popup comes on screen on XBMC to verify this. No errors what so ever.
When I play a video from iTunes i get the error “An error occurred while connecting to the Airplay device “XBMC”. The requested resource was not found.”
Could this be a network issue, or must ubuntu be configured for IPv6?
Thats very weird. It should not be configured as ipv6. Try with a fresh install.
OK, so I have managed to solve the issue. I followed this section on this page on how to setup avahi: http://www.kremalicious.com/2008/06/ubuntu-as-mac-file-server-and-time-machine-volume/#avahi1
Edit this file : /etc/nsswitch.conf and add mdns to the hosts line. Thanks for the great guide
Pingback: Utilisation d’AirPlay avec XBMC (1) « Blog de Floran
Pingback: Get AirPlay working on your XBMC live HTPC! (via My custom HTPC build) « HD420p
For me, it works perfect on ASRock ion 3D 152D with XBMC live and iPad2 4.3.3 (jailbreak) for:
- Youtube
- Pictures
Does not work at all with
- Garageband (new version has airplay)
- nu.nl (dutch newspaper app)
Partially works (only if I get the airplay screen to the ASrock with youtube prior to starting…)
- IMDB
At some point also installed airvideoenabler in the iPad, but that didn’t help
hello,
thanks for the share, how do it start airplayer on xbmc startup [it sleeps]?
got it to work after a little help from xbmc forum, problem was the write access to .py file.
Hello,
Thank you for sharing this how-to, it seems that Airplay/Airtunes will be directly included in XBMC in future release… In the meanwhile thanks to you we can use it !
Greg.
Hi again,
I followed your shairport guide and now I face a problem. When I stream a song via shairport I can’t have the sound anymore if I wan’t to stream a youtube video (for example) via Airplay. I see the following error message on my TV:
failed to initialize audio device
check your audiosettings
It seems like shairport doesn’t release the audio device…
Did someone experienced the same behavior?
Thanks for any help you can bring to me
Greg.
awesome – perfect! many thanks
In step 16 how do you figure out your username and id username?
95% of the time the username and group are both xbmc. Only only changed this
cd /home/xbmc/PascalW-Airplayer/airplayer/airplayer.py
Do we have a solution for ios5 ? As soon as I upgraded my iphone4 to 5 , airplayer stopped working . Has Pascal totally quit supporting the airplayer ?
Working fine on ios5 for me, must be something else.
I cant get it to start automatically though
Great tutorial. Worked first time around on iPad on ios5.
Thanks
Pingback: Mari bermain dengan DLNA - Dhoto's Homepage
Im stuck at:
2012-01-05 19:05:27 [INFO] Starting Airplayer
Traceback (most recent call last):
File “airplayer.py”, line 221, in
main()
File “airplayer.py”, line 217, in main
raise e
NameError: global name ‘bonjour’ is not defined
Hi, I’m stuck at
2012-01-05 19:05:27 [INFO] Starting Airplayer
Traceback (most recent call last):
File “airplayer.py”, line 221, in
main()
File “airplayer.py”, line 217, in main
raise e
NameError: global name ‘bonjour’ is not defined
anyone have an idea?
it’s a bunch of crap…
Pingback: AirPlay no Xbmc « uelei
It seems install now by changing the requirements.txt file content to:
pybonjour==1.1.1
tornado==1.2.1
simplejson==2.0.9