Get AirPlay working on your XBMC live HTPC!

    1. Go to https://github.com/PascalW/Airplayer and download the zip
    2. Unzip it, rename it to PascalW-Airplayer and transfer it (SFTP client) over to your home folder in XBMC
    3. SSH into XBMC (ssh username@xbmcip)
    4. sudo apt-get update
    5. sudo apt-get install libavahi-compat-libdnssd1 python python-pip
    6. Dive into the folder you transfered in step 2 with ‘cd PascalW-Airplayer
    7. sudo pip install -r requirements.txt
    8. cd airplayer
    9. Edit and insert your XBMC username and password in the settings file: sudo nano settings.py
    10. Start AirPlayer: python airplayer.py
    11. Start a video (YouTube for example) on your iOS device and AirPlay it over to XBMC!
    12. Now if you like to start it up automatically every time you boot XBMC continue!

    13. Get back to the previous folder cd ..
    14. sudo cp scripts/ubuntu/airplayer /etc/init.d/airplayer
    15. sudo update-rc.d airplayer defaults
    16. sudo chmod +x /etc/init.d/airplayer
    17. sudo nano /etc/init.d/airplayer Edit 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”
    18. Save, reboot and test!

    Credits to PascalW, the author of AirPlay for XBMC, Boxee and Plex.

    Advertisement

71 Responses to Get AirPlay working on your XBMC live HTPC!

  1. WB says:

    awesome. this works great. thanks

  2. Blackforce says:

    Works sweet. Excellent. Thanks very much

  3. Len says:

    Bah.. keep getting:

    “E: Couldn’t find package python-pip”

    No matter what I do.. dont’ suppose you have any suggestions? :P

  4. Rumik says:

    I’ve followed all the instructions exactly but I just can’t get the script to run automatically when the xbmc box starts up :(

  5. justm0n3y says:

    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.

  6. Simon says:


    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. :-)

  7. Pingback: Mari bermain dengan DLNA « Dhoto’s Homepage

  8. Diego says:

    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)

    • TripKip says:

      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…

      • Diego says:

        thanks for that, also, I don’t find “path” anywhere in that file, could it be “daemon” the one I need to modify?

      • topned says:

        I can not find anything about group id in xbmc. could you tell me exactly where I enter it or find it in xbmc.

  9. Fred says:

    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

  10. Pingback: How To Make Your Entire Home AirPlay-Compatible | Lifehacker Australia

  11. Pingback: How To Make Your Entire Home AirPlay-Compatible | Gizmodo Australia

  12. Jeffrey Lowy says:

    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?

  13. Pingback: Rendi la tua casa AirPlay compatibile! | iPaple.com

  14. Pingback: home » Blog Archive » How to Make Your Entire Home AirPlay-Compatible

  15. Pingback: Guide AirPlay : Faites communiquer tous vos périphériques ! | iOStv

  16. Pingback: Install Shairport on XBMC Live to get AirPlay audio as well! « My custom HTPC build

  17. Martijn says:

    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…..

  18. OrionnoirO says:

    It would be awesome if someone could get this working on XBMC4XBOX orig… Then the orig. XBOX could also be a cheap AirPlay device :D 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?

  19. Trck says:

    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

    • Pete says:

      same thing here. did you ever find a solution to this?

      • Pete says:

        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?

  20. Trck says:

    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

  21. Chris says:

    Thanks, this has worked perfectly for me!

  22. Robert Elder says:

    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.

  23. Robert Elder says:

    Ok, scratch I said anything. I just read some of the docs…

  24. Sasha says:

    thanks dude !!!!

  25. 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!

  26. Pingback: Airplay for XBMC « Stm Labs Forums

  27. stuart says:

    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.

    • Thomas says:

      @stuart same problem for me. installation ran without errors and airplay button is visible on iphone but no chance to stream content

    • Thomas says:

      @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

      • stuart says:

        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

  28. wilko says:

    Great howto. Got it to work in no time!!!

  29. irokoy says:

    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 ?

  30. chris says:

    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

  31. chris says:

    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.

  32. Justin Farry says:

    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!

  33. topned says:

    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?

    • tripkip says:

      Follow the guide further so it starts aytomatically..

      Verstuurd vanaf mijn iPhone

      • topned says:

        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.

  34. Witwolf says:

    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?

  35. Pingback: Utilisation d’AirPlay avec XBMC (1) « Blog de Floran

  36. Pingback: Get AirPlay working on your XBMC live HTPC! (via My custom HTPC build) « HD420p

  37. Jay El says:

    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

  38. dizitalart says:

    hello,
    thanks for the share, how do it start airplayer on xbmc startup [it sleeps]?

  39. dizitalart says:

    got it to work after a little help from xbmc forum, problem was the write access to .py file.

  40. Greg says:

    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 ! :D

    Greg.

  41. Greg says:

    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.

  42. duesentrieb says:

    awesome – perfect! many thanks

  43. lemaj Stoakley says:

    In step 16 how do you figure out your username and id username?

  44. mo.ucina says:

    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 ?

  45. Working fine on ios5 for me, must be something else.
    I cant get it to start automatically though

  46. Ed says:

    Great tutorial. Worked first time around on iPad on ios5.

    Thanks

  47. Pingback: Mari bermain dengan DLNA - Dhoto's Homepage

  48. Rednig says:

    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

  49. Rednig says:

    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?

  50. anyone says:

    it’s a bunch of crap…

  51. Pingback: AirPlay no Xbmc « uelei

  52. Thom says:

    It seems install now by changing the requirements.txt file content to:

    pybonjour==1.1.1
    tornado==1.2.1
    simplejson==2.0.9

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 103 other followers