Sadly, I have no idea how to do any of those things. But I bought a couple of Raspberry Pis, and it would have felt wasteful not to at least do something useful with them.

The obvious choice was home media streaming. The first floor of my place has all the consumer electronics and home networking a tech journalist could ask for, but my second floor was pretty bare. Enter the Raspberry Pi (and a 7-year-old TV that had been gathering dust in a corner as a result of being replaced a year ago).

Long story short, I am now streaming music from my iPad to that TV using Apple's AirPlay protocol and Raspberry Pi media software called Raspbmc. I can stream HD video in the same way, but I set it up primarily for music.

The best part is I didn't have to do anything other than follow instructions. All the heavy lifting was taken care of by the creator of Raspbmc (a 19-year-old student, believe it or not), and the developers of XBMC, the popular home media software on which it's based. XBMC developers reverse-engineered the AirPlay protocol to let it work on non-Apple devices.

Raspbmc isn't perfect—there are short delays between issuing a command from my iPad (pressing play, pause, skip, etc.) and hearing the results on the Pi-enabled TV. Considering the low cost and coolness factor, though, it was a fun project worth doing.

If you want to take on this rather easy project, the first step is heading to the Raspbmc downloads page and grabbing the network image. You'll load this onto an SD card on a Windows, Mac, or Linux computer.

Windows installation is performed by a setup program, while Mac and Linux users should open the terminal and enter a couple of simple commands:

Before installing the Raspbmc network image to the SD card, make sure you're not installing to the wrong disk, since you could lose data. There will be an option to configure wireless networking, but it's not necessary if you have an Ethernet cable.

After installing the network image, stick the SD card into the Pi and hook it up to a TV or whatever device you're using. The Pi has no on/off switch, so you turn it on simply by plugging in a micro-USB power supply.

As long as you're connected to the Internet, the Pi will now install the latest version of Raspbmc. If you didn't configure Wi-Fi in advance, this will only be possible with a wired connection. If you lack an Internet connection for the initial setup, you can get the standalone Raspbmc image instead of the network image from the downloads page.

During installation, you'll see messages like "Connection to Raspbmc update server successful," "Formatting partitions," "Downloading kernel modules," and "Downloading root file system—grab a coffee!" The installer will inform you to wait 15 to 25 minutes for it to do its thing and then reboot into Raspbmc. Mine took 22 minutes.

Keyboard input didn't work for me immediately after the installation. Unplugging the Pi and then plugging it back in did the trick, except for a nasty message telling me "Raspbmc did not shut down properly."

Once Raspbmc is installed, Wi-Fi can more easily be configured. After completing the installation on my living room TV, where I had an Ethernet connection, I brought the Pi upstairs to my bedroom, where Wi-Fi is my only option. With a cheap USB wireless adapter plugged in, I navigated to Programs/Raspbmc settings/Network Configuration, selected "wireless" and typed in my network name and password to connect.

Getting AirPlay working was as simple as heading toward System/Settings/Services/AirPlay and checking "Allow XBMC to receive AirPlay content." Once that was done, my iPad began showing "XBMC (raspbmc)" as an AirPlay target from the music and video apps. This will work from any iOS device or from iTunes on a computer:

Almost perfect

I initially attempted to install Raspbmc on a Raspberry Pi with 512MB of RAM, but the Pi simply shut off during the installation process each time. As if by magic, it worked perfectly on the 256MB model.

As it turns out, the power supply was likely the culprit, even though I used the same supply on both devices. Raspbmc creator Sam Nazarko explained to me via e-mail that "if you are using the same power supply on both Pis but only getting issues on the second, then it is likely the 512 Pi has higher resistance on the F3 polyfuse, and thus exposes the inadequacy of the power supply to a greater extent."

I didn't expect the power supply to be a problem since I had been able to run Raspbian, the recommended operating system for the Pi, on both the 256MB and 512MB devices. In any case, Raspbmc is working smoothly on the Pi with 256MB of RAM.

The only noticeable problem is one I mentioned earlier, a delay of about two seconds between issuing commands like play or pause and seeing or hearing the results. The delay occurs on both Wi-Fi and Ethernet. Others have also noticed the slow buffering, making fast-forwarding and rewinding a bit tricky. For me, the delay mostly occurs when playing music. Playing and pausing videos has been near-instantaneous.

In addition to AirPlay, Raspbmc plays music and video from local USB drives or from computers in your house if you add network locations via the settings menu.

Raspbmc is impressive software, period, and even more so when you consider that its creator is a teenager. Raspberry Pi Foundation community manager Liz Upton described Nazarko as a "terrifyingly young developer" when the final version of Raspbmc was released in February.

Nazarko spent more than a year developing Raspbmc and described the process on his blog. He received important help from the Pi Foundation, which gave him a Pi prior to the device's launch, and from numerous other people, including the developers of XBMC.

Why AirPlay can run on non-Apple devices

Those XBMC developers are the ones we can thank for getting AirPlay to run, even on non-Apple hardware. One thing you may wonder given Apple's tendency to lock down its products is why it's possible to use AirPlay with non-Apple hardware at all.

I contacted the XBMC team and received a detailed answer from an XBMC developer who goes by the name "Memphiz." Memphiz explains that Apple's streaming protocols are "closed," but they were reverse-engineered by developers to allow them to work on non-Apple hardware. Just as Apple can eliminate jailbreaks on new versions of iOS, the company could change AirPlay in such a way that the XBMC and Raspbmc implementations would stop working.

Memphiz's explanation via e-mail is worth quoting in full:

1. AirPlay (meaning video and pictures) is not encrypted. It just transfers a playback URL (HTTP) to the receiver and also some control messages. In case of e.x. YouTube app it transfers the video URL directly from YouTube to the receiver. When AirPlaying from the video app or from the camera roll it spawns an HTTP server and passes its own URL to the receiver. For images it just sends the JPEG data via HTTP. There are also a lot of control messages for controlling playback (client to receiver) or announcing playback states (receiver client). The protocol is reverse engineered and can be found on github.

2. AirTunes (meaning music streaming) is a whole different thing. It needs encryption. There are at least three different encryption types possible. The weakest was broken by some guy a couple of years ago. He extracted a private RSA key from an Apple AirPort Express or something like that. We use a third-party library here for allowing XBMC to receive music streams. It's based on a standalone app called "shairport"—we made a library out of it and added some fixups/patches. The AirTunes protocol is also reverse engineered and can be found via Google.

3. Basically it is possible as you can see in XBMC. But as it's still a closed protocol, our implementation might break here and there once Apple changes something on OS updates. Though we are happy to have the support in, it's a bit like playing blackjack (not knowing which Apple card comes next).

Cheap, but not insanely so

As you probably know, a Raspberry Pi sells for the remarkably low price of $35. For my setup, this turned into about $100, including $6 for an HDMI cable, $11 for a Wi-Fi adapter, $30 for a Bluetooth keyboard, and $18 for an SD card. If you have an old keyboard lying around (or use an XBMC smartphone-based remote control) and buy cheaper accessories than I did, you might cut the cost in half.

Ultimately, you're not saving a ton of money compared to buying a $100 Apple TV, which will do AirPlay plus iTunes home sharing, Netflix streaming, and other goodies—it even runs XBMC if it's jailbroken. Nazarko told me that "Netflix is a no-go on Raspbmc and iTunes home sharing is not possible."

As they say, though, eff that. AirPlay is way cooler on a Raspberry Pi.

UPDATE: A week after posting this article, I realized how to make iTunes home sharing work with the Pi for both music and video. By home sharing, I mean using an iOS device to access media files stored on your home computer, and then streaming that content to the Pi. Using Apple's iOS Remote app, you can access the videos on your computer, just as you'd expect. I didn't initially realize that you can also select AirPlay from within the remote app, and stream the video to Raspbmc. As a result, you can AirPlay movies and TV shows from a computer running iTunes to the Pi without actually having the media files on your iOS device.

This didn't work with music for me, for some reason. But I can stream my computer's music library to my Pi with a slightly different method. This involves going into the iOS music app, selecting a shared library (i.e. my home computer), playing a song, and then selecting AirPlay. Another option is to use iTunes Match, making your whole music library available from the cloud to your tablet (which is what I was already doing). That makes your entire music collection available to the iOS music app without needing a connection to your home computer, and you can AirPlay to the Pi as described in this article.

Yeah, the benefits of having a Pi over other devices (I use Roku, but Apple TV too I guess) seems suspect to me. After getting wifi and the SD how much savings are really to be had? And the UI is more responsive on the other devices too, not to mention them having Netflix which is a huge bonus. I would like to see some other projects that use the Pi in cool ways, particularly with home automation. I think that would be its true strength.

PS: You don't need a keyboard for the XBMC as there is a smartphone app that works surprisingly well.

54 Reader Comments

I don't use iOS devices, but I do have 2 pis on my 2 TVs, running Raspbmc connected to my 20TB media server. It works really well, and even works with my stock TV remotes which send commands over HDMI to the Pi. Although a better experience is using Yatse on android as a full xbmc remote app. Works really, really well. I would even consider upgrading to more powerful pis if they ever do release them. As it stands now, the menus are a little slow, and any plugin that does streaming from the web (like youtube) works, but is pretty slow to navigate.

Thanks for the write up. Ive played around with this myself, but I am way more interested in RasPlex, which is PLEX on a raspi and runs on openelec. While it does require a server for your content it was no issue for me since i already have plex running. Plex started as a fork of XBMC and has some clear advantages, especially for people with multiple devices.Check it out at rasplex.com

Why is the fact that the developer is 19 years old remarkable? Come on Ars, you are better than the mainstream tech press. You don't have to play the "boy genius" angle, and although this guy made something useful he's neither a boy nor a genius (for his work on this anyway).

I'm most interested in AirPlay to play certain iOS games on the big screen. While you say there is a noticeable delay, this could be reduced by plugging the Pi directly into your LAN router and removing 50% of the wireless latency.

Racing and rhythm games (RealRacing3, Jetpack Joyride, Temple Run), in particular, are well suited to the big screen as they don't require you to use onscreen buttons. The left/right side of the touchscreen and gyroscope don't require visual aids so you can keep your eyes on the TV.

I would add that I found openelec (at the time I used it) to be way faster to cold boot.There's quite some competition in terms of functionality/speed/usability in the xbmc world, even on your Pi, which is "best" for you may have changed since I did it. Also openelec without a linux box to set it up is a bit of a PITA.

The thing that blew my mind to be honest was when I (unconsciously) clicked left on the rocker on my tv remote and the onscreen gui responded. I know this is all just a standard but it was pretty awesome to see such things just working.

Why is the fact that the developer is 19 years old remarkable? Come on Ars, you are better than the mainstream tech press. You don't have to play the "boy genius" angle, and although this guy made something useful he's neither a boy nor a genius (for his work on this anyway).

I didn't call him a "boy." I definitely think the project is impressive, and when I was that age I didn't do anything that could potentially benefit thousands of people (and I probably still haven't!). As someone in my mid-30s, I actually am impressed by how many people in their late teens and early 20s have either built companies or created products that are used and enjoyed by many. I think this generation has done way more cool stuff than mine did.

I actually am impressed by how many people in their late teens and early 20s have either built companies or created products that are used and enjoyed by many. I think this generation has done way more cool stuff than mine did.

Plenty of people in our generation were doing cool stuff; you just may not be aware of it. However, I also find the emphasis on the Raspbmc developer odd; it's just a custom Linux distro focusing on a single app. The amount of effort is impressive and commendable, but it's not a complex or novel concept. The deep grunt work is in XBMC and beyond that the plethora of media decoding libraries and Airplay libraries it leverages.

I actually am impressed by how many people in their late teens and early 20s have either built companies or created products that are used and enjoyed by many. I think this generation has done way more cool stuff than mine did.

Plenty of people in our generation were doing cool stuff; you just may not be aware of it. However, I also find the emphasis on the Raspbmc developer odd; it's just a custom Linux distro focusing on a single app. The amount of effort is impressive and commendable, but it's not a complex or novel concept. The deep grunt work is in XBMC and beyond that the plethora of media decoding libraries and Airplay libraries it leverages.

There are two references to his age, one is a quote from the Raspberry Pi Foundation and the other is a link to the developer's Twitter page, where he describes himself as a "19-year-old student." It's clearly not the reason I wrote the article, it's just one side note that I noticed while researching and I mentioned it without any huge emphasis. There's also plenty in the article on the XBMC team.

Like some others here, I used OpenELEC instead of raspbmc. At the time I did my installation it was the consensus that openELEC performed better than raspbmc. I've kept my openELEC installation updated and never tried raspbmc.

I did find a couple of things however in tweaking the whole thing. I found considerable delays in the menus and pause/play functions OOB. I found some people improved this a lot by pointing their storage to a USB-flash stick and just using the SD card to boot. I setup my Pi to boot from NFS off my NAS and I found that the menus are a lot more responsive than before.

These little R-Pi's are pretty impressive. I have two of them running down in my computer room, one is a rsynced server, the other actually is mounted to a full blown webserver and acts as a file server (and actually does quite well!

I tried using XBMC on it, (B-model) and while it would put out a nice picture streaming from my 10TB FreeNAS setup, the interface was brutally laggy when trying to navigate around (even when everything I could turn off/disable was off...)

There's an open version of Silverlight called Moonlight. No, it isn't the focus of the XBMC folk. No, it isn't as full-featured and doesn't currently do the job But this is the second Ars article where Netflix-on-Pi is stated as a flat impossibility.

I love reading about all the cool stuff people are doing with these little machines.

I've been using mine to play music via mpd, controlled via MPDroid on my phone. As my Nexus 4 doesn't have expandable storage (and honestly, I have more music than would fit on an SD card), I'm working on turning it into a portable music player so I don't have to always rely on streaming to play some tunes.

Control via WiFi works great, but the dongle I had laying around has been a little flaky, so I setup PAN over bluetooth, and that's worked surprisingly well, once I found good documentation for doing it (PAN on bluez 4.x doesn't seem to be documented well).

I do agree with the author's note that the cost of the Raspberry Pi itself is a fractional part of getting a working system - for my project, the storage alone costs as much or more than the rpi itself. Still, being able to put something together yourself (if you have the time and tenacity), is a great feeling!

I don't see how Apple could change the protocol to defeat the hackers. There are lots of third-party devices out there with AirPlay chips that cannot be changed with a software update (my Pioneer receiver has an AirPlay chip). I'd say that Apple is pretty well stuck with their AirPlay implementation the way it is.

The article stumbles at the end with its price metrics versus the Apple TV. Yes, an Apple TV does now cost only $100. The models presently available at retailers are the 3rd generation variety-- which can't be jailbroken (yet?).

So, you are left with finding an Apple TV 2nd generation. If you can find one new/use from an unsuspecting someone for a $100-- buy it.

Otherwise, you'll find that jailbroken ATV2s with XBMC installed can go for as high as $250.00 on eBay. Now a Raspberry is much cheaper than an Apple.

So, buy that Raspberry Pi with confidence! I have half a mind to sell my ATV2 w/XBMC on eBay so i can buy a few RBPs with accessories...

Yeah, the benefits of having a Pi over other devices (I use Roku, but Apple TV too I guess) seems suspect to me. After getting wifi and the SD how much savings are really to be had? And the UI is more responsive on the other devices too, not to mention them having Netflix which is a huge bonus. I would like to see some other projects that use the Pi in cool ways, particularly with home automation. I think that would be its true strength.

PS: You don't need a keyboard for the XBMC as there is a smartphone app that works surprisingly well.

There's an open version of Silverlight called Moonlight. No, it isn't the focus of the XBMC folk. No, it isn't as full-featured and doesn't currently do the job But this is the second Ars article where Netflix-on-Pi is stated as a flat impossibility.

The problem with Netflix compatibility is that you need to use the encrypted video stuff in Silverlight, which means you need Microsoft's keys to make it work, and guess what the Moonlight project has zero chance of ever seeing? Netflix can't even offer a Linux solution to this problem, the studios that they license their streaming content would never let someone stream to an open source device. If they did that, people could pirate films on the Internet! Could you image a world where that is possible?!? That's why it is necessary to make life for paying customers as shitty as possible.

Yeah, the benefits of having a Pi over other devices (I use Roku, but Apple TV too I guess) seems suspect to me. After getting wifi and the SD how much savings are really to be had? And the UI is more responsive on the other devices too, not to mention them having Netflix which is a huge bonus. I would like to see some other projects that use the Pi in cool ways, particularly with home automation. I think that would be its true strength.

PS: You don't need a keyboard for the XBMC as there is a smartphone app that works surprisingly well.

I don't use a keyboard either. I use an app on my phone, but my primary input method is an IR Remote I used from an old Windows Media Center build, which works like a charm.

To be upfront, I don't run Raspbmc, but I do run the latest stable XBMC release on my HTPCs. In my experience, XBMC's AirPlay implementation does not support what Apple calls AirPlay Mirroring, which is what's used for sending a game from your iOS device to a TV, etc.

I don't see how Apple could change the protocol to defeat the hackers. There are lots of third-party devices out there with AirPlay chips that cannot be changed with a software update (my Pioneer receiver has an AirPlay chip). I'd say that Apple is pretty well stuck with their AirPlay implementation the way it is.

yeah sure util they come out with airplay2 and remove support for airplay one, two ios releases later... thus making everyone's accessories obsolete *again*.

Seriously, I'm tempted to buy but am under the impression that actual playback is far from perfect. This article gives the impression that it plays everything just fine. But unless explicitly stated that certain functionality and performance is there, we should assume that it isn't.

For instance, can it output 7GB 1080p mkv files at 24 frames per second with dts or dd 5.1 sound? How is native framerate handled? Max file size before it chokes? Howabout high bit rate airplayed video? Etc.

Does anyone know how quick the ModelB is shipping? I've been procrastinating getting one because it's constantly out of stock.

I don't want to go the ebay route because I'm trying a strict budget approach - Beg/Borrow/Freecycle all the necessary ingredients to play with.

I bought a Model B on amazon with amazon prime and had it in 2 days. Looking at amazon right now there are dozens of sellers with them in stock.

$45 for the pi, $9 for the SD card. I already had a micro usb cable, usb keyboard (not really needed after initial setup), and hdmi cable. I didn't need to buy the wifi adapter since i'm using wired ethernet. I didn't need to buy a new power supply, I'm using the USB power adapter from my iPhone.

I found that using MySQL on my Linux server for the XBMC database gave a big performance boost.

If they ever come out with a faster clock/more RAM Pi I would probably get it because the current setup even with MySQL is just a teensy bit laggy for my tastes. It's completely usable but compare it running on my Mac and you can see the difference. Not a dealbreaker by any means!

XBMC Remote on the iPhone/iPad makes a terrific UI for selecting/queueing items. My TV's remote works great for pause/play/ff/rew thanks to HDMI-CEC.

Seriously, I'm tempted to buy but am under the impression that actual playback is far from perfect. This article gives the impression that it plays everything just fine. But unless explicitly stated that certain functionality and performance is there, we should assume that it isn't.

For instance, can it output 7GB 1080p mkv files at 24 frames per second with dts or dd 5.1 sound? How is native framerate handled? Max file size before it chokes? Howabout high bit rate airplayed video? Etc.

Playback performance and capabilities is what I'm interested in.

In my setup, it plays 1080p H.264 video flawlessly over wired ethernet (I haven't tried wireless). Digital audio formats are passed through untouched to your a/v receiver, as you would expect. I haven't tried native framerate, not even sure my TV supports it to be honest. I haven't found any codecs or containers that it can't play, yet.

Filesize should not be an issue, even SMB is capable of 64-bit filesizes these days.

You should hit up YouTube, there are plenty of videos showing it in operation. That's what swayed me.

I haven't tried Airplaying video other than YouTube, which apparently doesn't even stream the bits from your phone to the device, it just sends the URL to the device and the device fetches the bits. (That's what this article implies anyway.)

For instance, can it output 7GB 1080p mkv files at 24 frames per second with dts or dd 5.1 sound? How is native framerate handled? Max file size before it chokes? Howabout high bit rate airplayed video? Etc.

I'm not sure about DTS because I haven't tried it, but as far as the 1080p/24 goes: flawlessly. I have my Raspberry Pi setup with OpenELEC, connected to an old router with dd-wrt configured as a wireless bridge, over which streams media from a server in a room on another floor.

It should be noted that as far as I can tell Display Mirroring is not possible with the Pi/XBMC. That is another kind of Airplay, and won't work. Also games from your iPhone will not stream.As far as I know this is because Airplay simply sends some links to the player and the player retrieves the content. With Games and Desktop mirroring it's more of a streaming solution and much more complicated.

Yeah, the benefits of having a Pi over other devices (I use Roku, but Apple TV too I guess) seems suspect to me.

The biggest thing is that they're extremely flexible. They can be similar to those other devices, but they're not limited in the same way. AFAIK, an AppleTV is just an AppleTV forever, but a Pi is a full-fledged Linux machine, over which you have a great deal of control. (it's not total, sadly, as the graphic driver is a binary blob.) So, if you want an AppleTV-alike now, but then later change your mind, it can morph into something entirely different.

Can you clone a R-pi from a vm setup? Our house had a clean up and I lost the fight for peripherals that weren't currently being used. As there was no desktop machine a few miscellaneous parts were begrudgingly given up. If it can be done I can just use the vm to setup and clone to my sd cards.

A quick note about the 2 second delay you mentioned. This is not a weakness in the Pi or the Raspbmc implementation of the AirPlay protocol - it's actually built into the protocol itself. You'll find this delay of exactly 2 seconds even when streaming between official Apple products such as iTunes to an Airport express.

It's basically a hard-coded network buffer. The interesting thing is that changes to the volume are heard in real time, as these are implemented by control messages. However, fast forwarding, skipping etc are delayed, as these require the receiver to buffer the new data from the client.

As an example, if I watch a video on my Mac and send the sound over Airplay to my hifi (using Airfoil), I need to delay the video in VLC by exactly 2000ms to sync the sound with the picture.

An easier option is just buy the Pivos XIOS DS and use it's XBMC firmware, Scott Davilla the guy who ported XBMC to iOS and Android works for Pivos and is the developer for this box. You will need a micro SD card to flash the firmware.

Just turn on Airplay and off you go. You should use a nightly build though the latest official release is a little long in the tooth.

It should be noted that as far as I can tell Display Mirroring is not possible with the Pi/XBMC. That is another kind of Airplay, and won't work. Also games from your iPhone will not stream.As far as I know this is because Airplay simply sends some links to the player and the player retrieves the content. With Games and Desktop mirroring it's more of a streaming solution and much more complicated.

Please correct me if I am mistaken.

It's not so much that as the fact that Airplay Mirroring checks to see if the device is actually an Apple TV by confirming it has the correct client certificate.

Which for some reason "normal" Airplay doesn't.

I expect Apple to change that at some point (or at least let devs enable it) which will break a lot of this stuff.

I've been running XBMC ever since I managed to snare a chipped original Xbox, back in the day. More recently, I've been using the WDTV live, but have become increasingly frustrated with the buggy SMB implementation - WD had to withdraw one recent firmware as it completely broke SMB access (whereas my decade-old Xbox is still happily able to connect and play media from the very same SMB shares).

So of late, I've been experimenting a bit with raspbmc on a model B (512mb) Pi.

The first trial wasn't entirely successful - I was trying to run the Pi off the USB hub built into my TV and it seems the power wasn't clean enough; while this worked initially, the SD card became corrupted. Instead, I switched to using a USB port on my Xbox 360 (these are always on, even when the Xbox 360 is switched off), which fixed this problem.

As regards the functionality of raspbmc: it works pretty well, though the GUI was definitely a bit sluggish. Being able to use my Android phone as a remote-control is definitely good - Yatze's "swiping" interface works nicely and having a keyboard makes using stuff such as Youtube much easier.

However, there were a couple of things which led to me replacing it with a antiquated IBM SFF PC (dual-core P4; 1gb ram):

1) Codec support doesn't seem to be quite as good as per the x86 version of XBMC - IIRC, I had issues with both avi and MKV files2) Skipping/rewinding isn't particularly robust3) It doesn't have the Milkdrop visualisations; if I'm going to have the TV turned on while it plays music, I want swirly graphical goodness

These days, the Pi is hooked up to the TV in my bedroom; I'll revisit it at some point to see if the more recent patches have helped to address the performance and robustness issues. Sadly, the lack of (good) visualisations looks to be a limitation of the ARM port; hopefully it'll get addressed at some point...