Total Pageviews

Tuesday, 13 September 2011

OpenElec/XBMC with Airplay/Airtunes

In an effort to build the most powerful HTPC system that you can have you have to consider not just the technologies which are useful to yourself, but others in the household. More often than not my explanations on DLNA, UPNP, SMB or AFS go down like the titanic and no matter what measures I put in place it never seems simple enough in reality to demonstrate.

So what am I rambling on about?

Update 1: I wrote this article some time ago now, but much has changed since then. Firstly OpenElec was released as final and has been updated a few times since then. I'm now on 1.0.2 for instance. The guide was written for RC5, however the instructions should still be applicable.

Update 2: If you are struggling to get this working or it just won't work, then don't worry. The latest version of XBMC Eden (currently RC2) has Airplay and AirTunes support built in!

Well, in the scenario where my better half, or a friend comes round (or if i'm just lazy) and wants to share something with us, say a video, slideshow or soundtrack, yeh you could all huddle around a tiny mobile phone screen, or you could blast that content on the frigging TV! Thats right, blast it! But obviously the TV should remain intact. So maybe go easy on the blasting. On second thought, don't be blasting anything, lets instead stream it.

How do we make this happen? Well there is a number of ways. At the moment, out of the box (and after some tweaks in the Network Services screen in XBMC) you can stream music, video's or photos on to the screen via UPNP. However you need a separate app for this to make this happen from your device, at least for iOS devices, I know some Android phones come with DLNA support, but it's certainly not standard and built in across all known devices (although there is no reason why not). Having my own devices prep'd for this is easy, but again I have go through explaining another method to somebody else, wouldn't it be easier if there was just one solid protocol?

The other way, is to have your HTPC support the dark side. Not wield it with a light saber, that would be silly. But it would look cool. Maybe I'll look into this later! But instead have it support a non-open closed source proprietary network protocol, namely Airplay and Airtunes.

If you've reached this post, then most likely you already know what these are and are looking for me to explain already how this is done. Well I'll skip the explanation on what they are and point interested people to the following pages on Airplay and Airtunes if they wish to read more on what they provide.

So down to business. Some steps:

Before going ahead with these keep in mind I've only done this for my eMachine ER1401. So you may have to take extra steps or it may not work for you at all if your are using a different setup.

  • Acquire the Airplay/Airtunes (Airplayer Suite) from the OpenElec Forums (Ultraman has kindly done the hard work to make this happen). You can download it from here. Note that this is the 32bit version.
  • Extract it and copy it to the Downloads folder on your OpenElec system. OpenElec shares folders via the Windows File Sharing protocol so you should be able to locate this folder via \\openelec.local\Downloads
  • Once in there you need to copy the folder you extracted from the downloads directory to the addon directory. By default the addons directory isn't accessible via Windows File Sharing so you need to log into your OpenElec system via SSH (Putty or next best thing) to make this transfer happen
  • Once logged in via SSH goto /storage/.xbmc/addons
    • cd /storage/.xbmc/addons
  • Copy the folder you extracted earlier to the addons folder
    • cp -R ~/downloads/service.multimedia.Airplayer-Suite .
  • You then need to create two soft-links or sym-links, first change directory to the lib directory for the addon
    • cd /storage/.xbmc/addons/service.multimedia.Airplayer-Suite/lib
  • Create the links
    • ln -s /usr/lib/
    • ln -s /usr/lib/

Now you should be sorted. The plugin won't start automatically by itself on boot so you need to start the service manually. It turns out this is only the case if your are using RC5 build of OpenElec. If you are using a newer DEVEL build seemingly this works automatically.

To start the service manually execute the following command:


Once executed you should see a message on screen on XBMC saying Airplayer Service started. Sadly because I'm using RC5 I cannot have this start automatically but I do have the command above being executed by a python script I wrote when I click the number 0 on my remote control. Maybe I'll cover this in another post if needed.

If you are seeing errors or having problems, obviously it could be any number of problems. So I recommend you review two keys logs on this:


Hope this was helpful. Any questions, let me know in the comments. But also check out the OpenElec forum thread on this topic.