Sunday, July 28, 2013

A Second Helping of Pi

In my last article I described how to set up a Raspberry Pi as a network attached storage (NAS) device and UPnP media server. By the time I was done with that project I was so impressed with the power and flexibility of the Pi that I decided to order another unit and set it up to replace my Linux Mint-based home entertainment system computer.

A quick literature search indicated that  the Pi had plenty of power to stream even 1080p HD movies, and that XBMC would be a natural choice for a Pi-based home entertainment system.

One search result returned this page listing three pre-built XBMC Raspberry Pi images. After reading through the clear, well-written installation instructions I chose the Raspbmc image, although I suspect that OpenELEC and XBian are also good XBMC implementations.

For this system I chose a different case than the one I used for the NAS. The Adafruit Industries clear case is really slick, it only took about 5 minutes to peel all the paper off the flat pieces and snap it together with the Pi inside. Here's what the assembled case looks like in my entertainment center, sitting on top of the gig-e switch and snuggled up next to the Roku player:

After connecting the Pi's HDMI output to an unused HDMI input port on the home entertainment amplifier, the Raspbmc image booted into a full screen frame buffer display with XBMC up and running as shown here.

For performance and simplicity, Raspbmc uses the frame buffer for output, X11 is not part of the distribution.

The only additional step for this system was to install the nsf-common package (sudo apt-get install rpcbind nfs-common) and set up fstab so that I could mount all of my media sources from that shiny new Pi NAS running in my office.  Then it was simply a matter of adding those music and video directories using the XBMC UI, and the installation was done! It literally only took about an hour from start to finish. Here's what the finished system looks like:

As I was playing around with it, feeling impressed at how everything Just Worked with Raspbmc, I discovered that I wasn't actually quite done yet.  I tried to play one of my MPEG-2 encoded movies, and got sound only.  Another quick literature search returned this bit of info:
The Raspberry Pi was designed to be an educational computer. As part of that educational mission, the Raspberry Pi Foundation has gone out of their way to minimize the manufacturing and licensing costs in order to keep the final cost of the device down. Part of their cost cutting measures included not purchasing a pricey blanket license to use the MPEG-2 and VC-1 video codecs. 
This doesn’t mean the Raspberry Pi is not capable of decoding media encoded in MPEG-2 or VC-1, but that by default the codecs cannot run on the Raspberry Pi hardware for want of a proper license. Fortunately the Raspberry Pi Foundation was able to make arrangements to sell individual licenses for each codec very inexpensively.
Inexpensive is right: $3.86 for the MPEG-2 codec license from the Raspberry Pi Store. A couple of hours later the license key arrived in an email, and after appending it to /boot/config.txt and a 40 second reboot, everything now Just Worked.  The viewing and listening experience with XBMC is supurb.

So, in the past week this has quickly turned into a multi-Pi household, and since they consume only 3.5 watts each, these systems will stay up 24X7.  Tonight I'm going to order another one to have just to play around with and see what other projects make sense.



  1. Thanks for sharing with us those projects.
    Could you tell me if Xbmc is responsive enough (i use it from a low power Atom and find it a tad sluggish...).

  2. You're welcome 8:40. I was pleasantly surprised to find that Xbmc was actually quite snappy running on the Pi, not sluggish at all.