Scott Hanselman

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

August 6, '12 Comments [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
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web
Monday, August 06, 2012 11:54:07 PM UTC
Awesome. Nice work and writeup.
Tuesday, August 07, 2012 12:13:42 AM UTC
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.
Tuesday, August 07, 2012 12:46:52 AM UTC
David - try the RC4, it's light years ahead of RC3 for video.
Scott Hanselman
Tuesday, August 07, 2012 1:16:05 AM UTC
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
Tuesday, August 07, 2012 2:58:30 AM UTC
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
Tuesday, August 07, 2012 8:00:27 AM UTC
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?
Tuesday, August 07, 2012 8:17:22 AM UTC
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.
Tuesday, August 07, 2012 8:24:07 AM UTC
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.
Tuesday, August 07, 2012 3:41:53 PM UTC
You've just inspired me to pick up a Raspberry PI.

Kind of disappointed that it's a three week wait though...
Tuesday, August 07, 2012 4:23:43 PM UTC
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!
Tuesday, August 07, 2012 4:42:09 PM UTC
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 :)
Tuesday, August 07, 2012 7:54:06 PM UTC
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.
Thursday, August 09, 2012 9:19:55 AM UTC
Have you tried using spotify streaming to your rasmbc airplay device? It's still beta.
muffstuff
Thursday, August 09, 2012 6:28:24 PM UTC
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
Erick
Thursday, August 09, 2012 9:34:20 PM UTC
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.
Michael Herrmann
Saturday, August 11, 2012 1:52:02 AM UTC
I suggest NNAF (Non-Nerd Acceptance Factor) in lieu of WAF. In some homes, it's the husband that needs the hand-holding experience!
Monday, August 13, 2012 11:39:07 PM UTC
It is probably cool to control Raspi from an iPad or Android remote app; The TV remote worked perfectly with XBMC
Kumar
Saturday, September 01, 2012 11:40:46 PM UTC
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
Tuesday, September 04, 2012 1:23:11 PM UTC
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?
Friday, September 14, 2012 3:31:03 AM UTC
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!

Daniel
Wednesday, October 03, 2012 6:18:20 PM UTC
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.
Gonijn
Sunday, October 07, 2012 12:22:43 PM UTC
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.
Mark
Monday, October 15, 2012 5:25:56 PM UTC
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.
raven
Thursday, October 18, 2012 2:01:04 AM UTC
Any word on latency between AirPlay video stream via RasPi? Voice sync issues?
Tom
Thursday, October 18, 2012 3:02:55 AM UTC
I haven't had any issues.
Thursday, October 25, 2012 6:36:44 AM UTC
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
Thursday, October 25, 2012 7:05:53 AM UTC
Tom - Yes, mine is wired. Can you SSH into your pi? or visit http://raspbmc?
Friday, October 26, 2012 11:21:09 PM UTC
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
Tuesday, October 30, 2012 11:54:43 AM UTC
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?
Dave Perry
Monday, November 05, 2012 12:27:28 PM UTC
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

Anders
Wednesday, November 07, 2012 9:24:41 AM UTC
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
Martin Mueller
Wednesday, November 07, 2012 8:52:15 PM UTC
Martin - I use an iPad2 and iPad3.
Friday, November 23, 2012 1:36:28 AM UTC
Any support for Netflix? <grin> I had to ask!
Abhijeet P
Saturday, November 24, 2012 9:55:40 PM UTC
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.

SimonJ
Monday, December 03, 2012 5:28:46 PM UTC
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
Linard
Friday, December 07, 2012 4:58:08 PM UTC
@Abhijeet Netflix, Hulu, etc... yes, airplay right from your iDevice!
Saturday, December 08, 2012 3:54:41 PM UTC
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)
Cristian
Saturday, December 15, 2012 7:41:14 PM UTC
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!
  • Dave
    Thursday, December 20, 2012 9:29:59 PM UTC
    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.
    Friday, January 18, 2013 6:50:06 PM UTC
    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
    Mark
    Friday, January 18, 2013 7:52:52 PM UTC
    Works great!
    Only Q is does anyone know why I can stream video from YouTube but not TV shows I have purchased from iTunes?
    Erik
    Wednesday, February 13, 2013 4:45:19 AM UTC
    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.
    Maksim
    Thursday, April 18, 2013 12:06:16 AM UTC
    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.

    Vinay Ramesh
    Thursday, April 18, 2013 2:01:50 AM UTC
    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.
    Vinay Ramesh
    Tuesday, July 16, 2013 2:56:11 PM UTC
    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.