Various Methods of Setting Up HTPC Using Raspberry Pi (With Tradeoffs)

With the latest addition of a 50' Sharp HDTV on my living room, I decided to purchase a Raspberry Pi and setup a HTPC. Just for prelude, I had been an avid fan of XBMC ever since version 8.0 and still is even now. Before the HDTV, I mostly watch my movies (approaching 1,000 movies now) on XBMC running on my Core i7 Desktop in my comfy room at 60 FPS using SmoothVideo Project. Having this said, performance is never an issue, i.e. no video stuttering, buffering, etc. I managed to enjoy every last bit of the videos without any quality degradation.

Raspberry Pi, or generally known as the popular embedded computer for setting up HTPC, dare I say, is only having a fraction of computing power when compared to my i7 Desktop. It is comparable to a Pentium II PC in the 90's. Henceforth, I realized that I can no longer put the performance issue in the closet any longer and have to resort to alternatives.

I must say that setting up my ideal HTPC had been a rollercoaster ride for me, and I finally seek one perfect solution that match with my demands. Following just shows some of the possible setups that you might be having now, or attempted.

Setup 1 - No Nonsense. Everything is Local.

Setup Scenario: Raspberry Pi + USB Hard Drive

This is probably the most basic and barebone setup you're going to try in the first time, just to make sure everything works. This eliminates the concern of any bottleneck such as the networking issue that might cause the dreaded video buffering. However, even with a dedicated H.264 video decoder onboard, you can't really enjoy a full length BluRay Remux video without noticing video stuttering every 10's of seconds. You're choking up the feeble 8xx or 9xx Mhz (overclocked) processor if you are doing it.

Setup 2 - Hey look, No Wires!

Setup Scenario: Raspberry Pi + Home Router + Desktop running XBMC

After realizing that setup 1 works, you soon realize that it is not really the ideal setup in the long run. For one, you will need to keep on plugging and unplugging your USB hard drive trying to watch the movies. Second, you have got to hide those connected USB hard drive. Chances are you will have a Desktop somewhere inside your room away from your living room that houses multiple Terabytes of HDD with movies scattering across every one of those. This is also the desktop that you used to run XBMC. Then you start to think of a way to have your Pi accessing your XBMC library instead by having it joining the home network. With concern of network bottleneck and save yourselves from trouble of finding a compatible USB wireless adapter for your Pi (yes, Pi is picky when it comes to wireless adapter), you decided to hook up a LAN cable to your Pi and a wireless adapter on your PC. While this setup works, streaming a video of more than 10 Gigabytes often result in buffering issues every now and then. Even connecting a LAN cable to your Desktop doesn't help out a lot. If you stick to this setup, you are most probably avoid playing any video file greater than 10 Gigs.

The Goods:
  • Just like XBMC on your PC, you can browse your library by titles, actors, genres, etc. Navigation is also very similar with multiple views such as posters, walls, multiplex, etc.
  • Having Pi to locate your XBMC library is relatively easy. Just turn on uPnP support on the XBMC running on your desktop and select uPnP when adding videos on your Pi's XBMC.

The Bads:
  • Streaming videos of more than 10 Gigabytes isn't going to be smooth without noticing video buffering issues.

Setup 3 - A Swiss Army Knife With Some Tradeoffs

Setup Scenario: Raspberry Pi + Home Router + Desktop running XBMC, AirVideo + iOS devices running AirVideo

This is by far the most ideal solution to stream any video of quality or file size that you have, ranging from DVD Rips to full BluRay Remux with even 40 Gbs of file size. So here is how it works. You use AirVideo on your iOS device to browse through the movies that you want (by folders). The video is then converted (or transcoded) on your PC that runs AirVideo Server on the fly. If you're thinking that it would result in a lower video quality, then you are correct. Video quality will suffer since the video are transcoded. However, the degradation is not really noticeable when you're buffering at the highest video bitrate allowable on AirVideo at 5000 kbps and having a standard viewing distance.

Maximum streaming video bitrate of 5,120 kbps
The Goods:
  • Simply the easiest out of the box setup.
  • Play any kinds of videos regardless of the file size.
  • No video buffering issues.
  • Browse and control video using AirVideo on your iOS device. No need to invest in external wireless bluetooth remote or USB keyboard.
The Bads:
  • Not all subtitles are supported such as those embedded ones within the MKV container.
  • Maximum 720p video resolution. I found the video is still enjoyable on my 50' Sharp monitor with a viewing distance of 1.5 meters.
Maximum video resolution of only 720p. But that would suffice.
  • MP3 audio codec only. Unless you're an audiophile and your golden ear can only tolerate DTS-HD or any lossless compressed audio, you're most likely going to ignore this workflow. 
  • No browsing your movie library using multiple views just like you did on XBMC. You use AirVideo to browse through your 'folders' of movies. This is not an issue for me as I properly renamed my folders in the following formats: [Title] [Year] [Resolution] [Extras (Extended, Director's Cut, etc.] 
Browsing video is restricted by folders only. Finally your folder management effort is paid off.
Since my focus is on Setup 3, I'm going to illustrate how to do it step-by-step below from scratch.

Setup Guide

My Setup
  • Raspberry Pi Model Type-B (512 MB RAM) connected to my home router (802.11 a/b/g) using LAN cable
  • iPhone/iPad running iOS 7.0.4
  • Desktop running Air Movie Server and connected to my home router using a USB wireless adapter (a/b/g)

Step 1: Install a Raspberry Pi compatible XBMC distribution (OpenElec, Raspbmc, XBian) to SD Card

1. Choose your preferable Raspberry Pi compatible XBMC distribution (OpenElec, Raspbmc or XBian). A good article of their comparison can be found on LifeHacker article here.

When I first started, I chose XBian since it offers the bleeding edge of XBMC features compared to other distros. Soon after I realised this is also its achilles heel as latest component or plugin tends to be bugged. For instance, the YouTube plugin doesn't really work. At one time, the video simply freezes after roughly 30 minutes of playtime and it stuck on the boot loop upon restart. I then switched to OpenElec which I stick to until now. No video freezes and definitely snappier menu navigation compared to XBian. I haven't try Raspbmc but it is supposedly what XBian is developed based on. You get what I'm on don't ya? Raspbmc is essential the XBMC on Desktop running on Pi. You can tell by its larger image file size. You can even install any third party linux program on it aside from just XBMC. This is what OpenElec lack of since it is optimized to run purely XBMC, hence resulting in snappier overall performance. But then again, I intend to only run XBMC on my Pi, nothing else.

2. Download the raw image file (.img) [ OpenElec 3.2.4 (88M) | Raspbmc (273M) | Xbian 1.0 Beta 2 (320M) ]

*Raspbmc has a Windows installer guide here.

3. Download win32 Disk Imager here.

4. Open win32 Disk Imager and burn the image to your SD Card. Note everything on the card will be wiped clean.

Step 2: Setting up AirVideo Server on your Desktop

1. Download AirVideo Server here (Free).

2. Install and add a new folder path containing your videos to AirVideo Server.

Step 3: Setting up AirVideo on your iOS Device

1. Download AirVideo from AppStore here ($2.99).

2. You should see your PC name that is running AirVideo Server in the sidebar. Note: The iOS Device must be joining the same network as your PC.

Step 4: Turn on AirPlay on OpenElec

1. Now insert the memory card to your Raspberry Pi and power it up. It might take a while before showing the familiar Confluence home screen.

2. Navigate to System > Network > AirPlay and enable 'Allow XBMC to Receive Airplay Content'. This option is turned off by default.

Step 5: Output video using AirPlay on your iOS Device

1. Open up AirVideo and select a video to play.

2. You should see a video with triangle icon on the playback menu bar. Select it and choose 'XBMC (OpenElec)'.

Note: If it shows a speaker icon instead of a TV icon, you will have to restart your iOS device (i.e. power off your iOS device and then power it back on). It should display a video icon this time. It is weird alright, but heck, that is just the way it is! Now play the video again and boom, the video is now displayed on your HDTV!

Some Words on AirVideo HD

InMethod, the same company that developed AirVideo, also has AirVideo HD under their belt. With AirVideo HD, you are now able to stream videos directly without resorting to any video conversion. Moreover, it also supports full lossless audio support and any type of subtitles. However, the technology uses the latest HTML5 streaming protocol which XBMC doesn't support. Until then, we are stick to using AirVideo.

Post a Comment

If you found this article or post helpful to you, feel free to enter your comments below ;)