Scott Hanselman

Adding AirPlay to a Receiver without an Apple TV - Raspbmc and the Raspberry Pi

August 07, 2012 Comment on this post [45] Posted in Hardware | Open Source
Sponsored By

My Onkyo Receiver now supports AirPlay with a little help from Raspberry PiI'm continually amazed at the usefulness of a small but complete $35 computer that is the size of a deck of cards. I'm coming up with all sorts of uses for the three Raspberry Pi devices in our house. I talk about our experiences in Top 10 Raspberry Pi Myths and Truths, but right now I want to share what I did with a Raspberry Pi over lunch today.

I've got a lot of video on my iPad and iPhone and I've always wanted to be able to use "AirPlay." Basically AirPlay is a simple way to "throw" video or music at a device. I'm always plugging my iPad into the TV with an HDMI cable.

At some point in the future more receivers and TVs will include AirPlay built-in. I could buy an Apple TV for $99 as it includes AirPlay. However, I don't want AirPlay $99-dollar-bad. Maybe $35-dollar-bad. Since a Raspberry Pi with Ethernet is $35, ahem. It's on.

Back during the original Xbox days when folks were rooting their Xboxen left and right, the most useful thing you could install on it was XBMC. It turned your Xbox into a complete, flexible and modular Media Center. Fast-forward almost 10 years to today and XBMC is an ecosystem on its own, long separated from the Xbox. You can get XBMC for Android, even! There's XBMCs for Mac, Linux, Windows, iOS and more. Even Apple TVs themselves can be rooted and run XBMC.

The most promising new entry into the XBMC space is Raspbmc. Yes, a complete XBMC install for a the tiny Raspberry Pi. The most amazing part is the clean Windows installer for Raspbmc in my opinion. You run it on your Windows machine with an SD card plugged in and the installer does all the work of downloading, formatting and prepping your SD Card to run on the Raspberry PI. The whole operation took a few minutes. Then I put the SD Card in the Pi and waited maybe 15 and then I was looking at the boot screen. Very painless.

Raspbmc is full featured and virtually includes all the XBMC functionality - which is an amazing feat given the limitations of the hardware. The most recent Raspbmc Release Candidate 4 added a lot of new improvements that made this the perfect time to jump in.

I just want AirPlay, so note that while there's WAY WAY more in Raspbmc and XBMC than this ONE feature (and technically I could probably make a very stripped down distro that included only this one feature if I wanted to be a purist) I'm only interested in AirPlay. I want AirPlay with a high WAF (Wife Acceptance Factor.) That means she needs to press a button on the Receiver, hit play on her iPad and it needs to Just Work©.

After installing Raspbmc I used a USB keyboard to go into the System > Network menu and checked "Allow XBMC to receive AirPlay content."

If you want to use your iOS or Android device as a remote control to control your Raspbmc you can ditch the keyboard after initial setup. There are iOS and Android versions of the Official XBMC Remote. Just make sure you've enabled your Raspbmc in System > Network to be controlled by a Remote application. If you are feeling extra snazzy you can even get a real remote control and use one of those via USB IR. Perhaps you have a remote control lying around from an older Xbox or ATI Video Card like I did.

After setup, I needed to setup video, power, and networking. Here's what I ended up with.

  • Video - Just plugged a 3 foot HDMI cable from the Raspberry Pi directly into an unused HDMI on my Onkyo Receiver. I used the "PC" input as that would make sense to my wife, then I used the Onkyo setup to make the onscreen label say "AirPlay."
  • Power - I was going to pull a long USB cable to the Pi when I realized that I have a lot of devices (PS3, Xbox, Tivo, etc) that already have USB. I used a 2 foot USB cable and just leached power off the Tivo's built in USB! If your cable box's USB can do 500 mA you can likely do the same! Amazing.
  • Ethernet - I wired the whole house many years ago and actually did a 5 Part Series on my blog about wiring your house for Ethernet. Because I put in a small wiring closet I could adjust ports as I like. I changed an RJ-45 phone port into an Ethernet port at the closet, labeled it, and plugged in. If you don't have wired ethernet near your TV, you can either put in a Hub, a Wireless Ethernet Bridge or get a USB Wireless Adapter for the Raspberry Pi.

My Raspbmc hidden behind the TVMy iOS device says it's throwing video at the Raspbmc

Here's my little Pi behind the TV, and my iPad saying it's playing video on the "XBMC raspbmc."

Using my iPad as a Raspbmc XBMC remote controlWatching "Justified" on my HDTV via AirPlay on an iPad talking to a Raspbmc

Here's me using an iPad as a remote (although since I'm just throwing video at it, I won't need the remote except for configuration, and I'll SSH into the Pi to do system updates) and finally watching 1080p video on my TV, at last.

Because any video app within the iOS ecosystem gets AirPlay support this also means I can throw YouTube videos or whatever HTML5 video I find up on the TV as well. All for $35 and a lunch hour. Such fun!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
August 07, 2012 3:54
Awesome. Nice work and writeup.
August 07, 2012 4:13
I purchased a pi as an experimental replacement for the video player on my 360 (original 360 with the loudest fan on the planet inside it). I installed raspbmc on it with the plex server plugin but did not have much joy with it to be honest (music worked, video bombed out all the time). Hopefully the latest version is an improvement but I guess it's still early days! iOS xbmc remote works ok.
August 07, 2012 4:46
David - try the RC4, it's light years ahead of RC3 for video.
August 07, 2012 5:16
Raspbmc RC 4 also now supports HDMI-CEC (thanks to contributions from . What's that? Its a standard supported by most HDMI gear (although generally labeled under a vendor-specific name, e.g. Panasonic Viera Link) that allows components to send _some_ control signals to each other (start/stop playing, change input/channel). So, in theory, Raspbmc could ask your TV/receiver to change to the Raspbmc's input when an AirPlay stream starts.

If the HDMI-CEC option doesn't work out, if your receiver has RS232 or IP control, Raspbmc could implement a 'run this script on stream start' integration point where you ask the receiver to change input yourself.
Jim
August 07, 2012 6:58
Well this is timely. I've been looking at AirPlay-enabled receivers not realising that XBMC already supports it. I already have a small ASUS ION PC running XBMC on Ubuntu. So now I just need to enable AirPlay on it. My wife is already familiar with XBMC so no WAF issues too! Thanks!

Shane
August 07, 2012 12:00
Cool. I've been looking for a neat way to play Pluralsight videos in my cinema room. This might do the job.

The only reason for the ethernet is so you can perform updates. So if it works for AirPlay then there isn't really a need for the ethernet right?
August 07, 2012 12:17
Antony - The Ethernet is required for ANY network connectivity (assuming you're not going to use an USB WiFi adapter, which isn't really recommended as it tends to be buggy and suck power) so you'll use Ethernet for everything...it's where updates come from and where the video is streamed through.
August 07, 2012 12:24
Of course, what an idiot I am! I guess xbmc publishes the fact it can accept airplay via bonjour and the iDevice just sends the video to that address.

I only have a single ethernet connection in my cinema room, so I might have to get a port splitter or a switch in there. I'd only be using the AirPlay or the HTPC, never at the same time so a splitter would be okay in this case.

Before you ask, I don't use XBMC on my HTPC.
August 07, 2012 19:41
You've just inspired me to pick up a Raspberry PI.

Kind of disappointed that it's a three week wait though...
August 07, 2012 20:23
You can also try Aerodrom (http://funkyfactory.eu). Aerodrom brings Airplay to Windows.
It lets you seamlessly stream audio, video, pictures and slideshows from your iPhone, iPad or iPod touch to your Windows PC using AirPlay technology. No configuration hazzels - it just works!
August 07, 2012 20:42
I was really excited to read this, especially the part where you said "Because any video app within the iOS ecosystem gets AirPlay support".

I was envisioning using the new Amazon instant video app with my Amazon prime account and streaming it to my HDTV via my iPad. Unfortunately, some apps are restricted from using AirPlay, including Amazon's. See this ars post: http://arstechnica.com/apple/2012/08/hands-on-amazon-instant-video-on-ipad-sorely-lacks-airplay-support/

Still, this is very cool and I think I might get on the waiting list for a taste of pi :)
August 07, 2012 23:54
Very nice post--I want one!

Quick question: is there a way to get netflix and/or hulu running, or any of the other content providers out there? I know I'd need an account, but I'd love to get rid of the mac mini hooked up to my television in favor of something like this.
August 09, 2012 13:19
Have you tried using spotify streaming to your rasmbc airplay device? It's still beta.
August 09, 2012 22:28
Nice. I've got a receiver that supports AirPlay and it works well, but only for audio. I've been considering an Apple TV but this sounds better since I think I'd enjoy tinkering with the PI for other things.

@Jim Great to know it supports HDMI-CEC
August 10, 2012 1:34
Scott - Just received my Pi on Monday. Your article was very timely. Loaded up Raspbmc last night and had loads of laugh out load fun with my son playing around with this thing. Absolutely love the Android remote control app; even my wife was impressed.
August 11, 2012 5:52
I suggest NNAF (Non-Nerd Acceptance Factor) in lieu of WAF. In some homes, it's the husband that needs the hand-holding experience!
August 14, 2012 3:39
It is probably cool to control Raspi from an iPad or Android remote app; The TV remote worked perfectly with XBMC
September 02, 2012 3:40
Awesome stuff!

two question though:
1) Is it possible to play back music/video stored on the SD card?
2) I don't have any network where I'm planning on using this setup (Raspi + stereo amp). Is it possible to use the XBMC Remote app if I just buy a usb-wifi adapter? or does it require an already established network?

/Bill
September 04, 2012 17:23
Another option, even cheaper for me, was to install AirBubble on an old Android phone and connect it to my receiver. I was going to recycle the phone anyway, so why not make use of that computing power?
September 14, 2012 7:31
30 minutes after reading this post I was watching video streams from Internet, controlling it from my cell phone!

Kudos to Raspberry Pi foundation, XBMC and Raspmc!

October 03, 2012 22:18
Streaming video is running fine. Can you confirm the music app also works? I see XMBC starting something, but after a few secs nothing will play. iPhone does seem to think it is playing.
October 07, 2012 16:22
A great article. I will be reading your Ethernet wiring series next, as I have a partial closet myself. As for RPi using Raspbmc and iOS 6...I initially had AirPlay working, along with the XMBC remote. I am using an iPhone 4 and RPi Series B.

Suddenly, my iPhone dropped the AirPlay option and I am no longer able to choose AirPlay as an option. The XBMC remote works just fine and my login/password is configured. The RPi is also configured and my iPhone 4 iOS 6 thinks AirPlay is executed...alas, there is nothing.

Anyone else run into this issue? I am on the hunt for Internet input.

Thanks for the article! My workplace has "Raspberry Pi Jams" weekly during the lunch hour where we discuss projects, successes, failures, etc...and XBMC was one of the first, along with PBX and Google Voice accounts.
October 15, 2012 21:25
Hi. Do you have any experience with PPTV app in iPad, and Airplay with Raspberry Pi? When I use PPTV to try watching videos on my TV by way of the Raspberry Pi the screen goes black after the "working" text shows up. Thank you.
October 18, 2012 6:01
Any word on latency between AirPlay video stream via RasPi? Voice sync issues?
Tom
October 18, 2012 7:02
I haven't had any issues.
October 25, 2012 10:36
Hey Scott - mine's hanging at "Sending Discover" on first bootup. Wondering if the Pi has to connect via wireless usb dongle or if a wired connection is fine?

It appears as though yours was wired?

Thanks!
Tom
October 25, 2012 11:05
Tom - Yes, mine is wired. Can you SSH into your pi? or visit http://raspbmc?
October 27, 2012 3:21
Scott,

I enjoyed your excellent article.

For a while, while reading this, I thought I could use what you describe with my (pre-2008) MacBook Pro. After poking around some more, it appears that AirPlay Mirroring, even for audio-only content (I am thinking iTunes-accessible radio stations here), works only with 2011 and newer Macs.

Is this your understanding?

Thanks,

Michael
October 30, 2012 15:54
I've been thinking about this recently, and a Pi seems like a great idea (for projector use in an education environment - so would be wanting to output on the composite connector).
For network security reasons, I'd want to have wifi running adhoc from the Pi, using a usb wireless adaptor. Has anyone tried this?
November 05, 2012 16:27
What does the interface look like when playing music from your iPhone or iPad music app?

Never seen or used airplay but always been curious about it. Potentially shopping for a new receiver and finding one with it built it can be pricey. Can't say i care ALL that much about the video (although cool) but an affordable wireless way to get my playlists to the receiver is very tempting.

I'm assuming this receiver would support this type of airplay support??

http://www.amazon.com/gp/aw/d/B008CXTX5U

November 07, 2012 13:24
Hi Scott, which version of the iPad do you use?
I´ve got the first iPad and the apple support webpage says you need an iPad 2 to use video via airplay.
Could you tell me more about your experiences and experiences other people around you ?
thanks a lot
November 08, 2012 0:52
Martin - I use an iPad2 and iPad3.
November 23, 2012 5:36
Any support for Netflix? <grin> I had to ask!
November 25, 2012 1:55
Hi Scott,
Great write up. I was at a community dev talk last week that covered the use of mono on a Pi so I've decided to get one. I was also hoping to try something similar to yourself as I too have a similar setup with CAT6 in the house running back to patch panels in a cupboard where my NAS is located.

I was actually thinking of going a step further and locating the Pi right next to the patch panel. The idea of this is in the hope that I could then use some HDMI/CAT6 balun devices or matrix to allow the RaspBMC to be used via any TV in the house.

December 03, 2012 21:28
Hi,
is it possible to use the stereo jack output of the Raspberry Pi for audio and to use hdmi only for video, because my audio system has only a jack and not a hdmi input.
thanks
Linard
December 07, 2012 20:58
@Abhijeet Netflix, Hulu, etc... yes, airplay right from your iDevice!
December 08, 2012 19:54
I love my Pi but it's not enough "wife friendly" and... not nice looking enough... and if I have to buy a nice case... add the power source... the gap between this solution and apple tv is smaller and smaller. The Pi is for me ... apple tv for my wife :p. I wish only to find a good solution use the airplay from my windows computers (airparot it's not bad but... the sound is not in sync)
December 15, 2012 23:41
I installed raspbmc. Things are CLOSE to working, but not quite.

  • The pi boots to raspbmc... is there a way to stop the launch so I can get to the command line? I need to do so to try some suggested fixes to the other problems
  • The keyboard and mouse don't work once raspbmc is launched. I can use the iPhone app or the web interface to control things until...
  • ...after a few minutes of using the iPhone-based or web-based remove, it seems like the pi loses it's network connection. It's gone from the list of devices on the router. Pings don't work. Sometimes it seems like it slows down first (ping time gets long and sporadic before going away completely
  • After just 2 seconds of streaming music over AirPlay the network connection goes
  • ssh and telnet don't seem to work (even before the network connection goes away)

    Any help would be appreciated!

    Thanks!
  • December 21, 2012 1:29
    Dave, are you running latest version of raspbmc? I don't see any problems you mention here on my setup.

    * I can ssh into pi using pi/raspberry as username/pwd.
    * My Apple USB keyboard and mouse works fine with XBMC.
    January 18, 2013 22:50
    I also had some of the problems that people have listed here when I was running an earlier version of RaspBMC. Most problems have gone away since I started over with a newer version. I would suggest starting over rather than letting RaspBMC try to update itself. That worked best for me.

    A couple answers to posted questions.

    Yes you can play songs and video off the SD card but to keep things simple I have some video and songs on a USB stick that I attach to an open USB port on the Pi.

    In the RaspBMC options you can select audio to go out over HDMI or the audio port. This will allow you to connect to a receiver that doesn't have HDMI inputs and send video out to HDMI that is connected to one of your TV's extra HDMI ports
    January 18, 2013 23:52
    Works great!
    Only Q is does anyone know why I can stream video from YouTube but not TV shows I have purchased from iTunes?
    February 13, 2013 8:45
    Thanks for the write up Scott, it's always great to see people taking these kinds of solutions into their own hands and from what I've discovered - the Pi is the right kind of device for the job!
    I wish there was a similar solution for old PowerPC Macs. I have a bunch of "Jobs era" classics around my apartment - A 600 MHz G3 iMac, G4 Cube and a latest-gen iMac G4. Also not too long ago I got a hold of some beautiful receivers and loudspeakers from the 70's - all in very good condition and sound better than anything modern I could buy for the kind of price I got those. After that the next logical conclusion was to hook up the receivers to these Macs so I can play music no matter which room I'm in. Of course this idea wasn't complete as I soon realised that I will have to figure out a way to stream audio to all machines at once. I've looked around the internet to find an AirPlay/AirTunes server app that would run on Mac OS X Tiger (10.4) - a perfect OS for all of these machines. At the time of my research (about two years ago) I found AirServer which had support for Tiger at that time. I went ahead and purchased the app excited that it would be the perfect solution for my setup, but alas the whole thing was a joke. It had terrible audio sync issues, it crashed and had a lot of other issues that were never addressed even though I patiently and naively reported all issues and glitches to the developer hoping he would one day get it right. He never did... Another solution I tried was Rouge Amoebas Airfoil + Airfoil speakers. While that worked mostly well - it still had sync issues, plus it required a host app to send audio to the receiving computers. Again, less than an ideal solution considering it costs money and doesn't really work the way I intended to use it. Important to note that it wasn't a network issue - everything is hard wired and has been quadruple-checked and reconfigured countless times to achieve maximum efficiency. Both of the developers later released updates to their apps - AirServer supposedly fixed the sync issues and Rouge Amoeba also implemented iTunes compatible AirTunes streaming to their Airfoil Speakers app (which I tested on some intel machines and it works flawlessly), but I was enraged to find that both developers dropped support for PowerPC just as they made their apps actually useful! It made me scratch my head and wonder - why would these developers make an app which sole purpose in it's philosophy is to run on hardware that's not actively used and cut support for machines that are ideal for this kind of task. What makes a device like Airport Express or Apple TV great for the job is the fact that it's a passive device that can perform on-demand tasks you would like to take away from your computer - because humans usually divide their habitats in to purpose functional areas. We don't sleep where we work out, we don't eat where we poop, etc, etc. Out comes the only possible and inevitable dimension - the use case for this kind of app is where you have a computer that is either not doing anything or already performing passive (server) functions. All this leaves me wonder as to why these developers choose to unquestionably cut support for these machines that perfectly fit in this scenario - using the potential of an existing device that is no longer the primary machine yet is fully capable of doing something that you would otherwise have to purchase a new device for. I don't know what's wrong with Rouge Amoeba or AirServer but they completely missed out on this one and earn bad karma points for not pointing out and cultivating the usefulness of retired computers. Of course not all is lost and not all is bad and there are those who still think, care and craft for like-minded ones who are occupied thinking, crafting and caring to solve other problems and would like to live a nice life while doing that and help to stop producing more useless stuff along the way.


    What's the lesson to learn from this? Geeks, programmes, coders, designers, artists - communicate. A working computer is still a working computer and don't let the big corporations tell you otherwise. Please, give birth to products not by following where the industry is headed or fancy new trends on dribbble, but which instead serve peoples needs in a logical way and ooooh boy, those needs are sooooo not even close to running the latest OSs. The trends set by the industry are blatant consumerism hidden behind words like innovation and revolutionary bearing huge responsibility. It's not as bad as it sounds, but sometimes I feel like some people get too carried away and actually convince themselves of things they don't honestly believe in. Just seen 22 years of the world, but already very very tired.
    April 18, 2013 4:06
    Thanks for the useful post. This inspired me to buy Raspberry PI and use it as an Air Play Device.

    Success so far:
    1. Installed Raspbmc via sd card and raspbmc is working fine
    2. Air Play is working fine for videos, photos, youtube from my ipad.

    Trying to make the below work:
    1. My Mac Air is detecting raspbmc device but when i select from itunes dropdown, it doesnt work. Video/Music doesnt play
    2. I saw in some videos that i need not be on Itunes to mirror my mac on tv. There was a airplay icon on the menu bar, when clicked used to mirror the mac screen. Somehow that doesnt work for me. Same with Ipad too. Only the Videos, photos, youtube works and not my entire screen.

    If anybody has any hints or solutions, please suggest.

    April 18, 2013 6:01
    Based on further (re)search, i turned off IPV6 on my mac and it worked. Am able to play songs from itunes.

    Regd mirroring, looks like raspbmc doesnt support it yet.
    July 16, 2013 18:56
    Airplay mirroring finally works on raspberry pi, software available soon:

    http://forum.xda-developers.com/showthread.php?t=2359972

    Comments are closed.

    Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.