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.


Thursday, July 25, 2013

Closure on Nexus 4 Bugs

Finally, seven months after having been reported to Google, these two Nexus 4 bugs are fixed in Android 4.3:

- Nexus 4 stops responding to ARP requests when screen is off with wifi on
- Nexus 4 loses wifi connection when bluetooth is in use

That's the good news.  The bad news is that during those seven months Google refused to acknowledge that there were software issues with their phone that prevented wifi and bluetooth from properly working. We're not going to rehash all of that again, but those not familiar with the long saga can read about it here:

The Fine Art of Corporate Fibbing

We can at last move on: the phone is working as it should have been.


Monday, July 22, 2013

Delicious Raspberry Pi

I'm sure most folks have heard about the Raspberry Pi by now, and maybe some of you are curious if this $35 ARM-based computer is worth anything more than just a digital toy to play around with.  I know I was, so this last weekend I finally took a day to build one and see what it could do.

It was quite easy to assemble and get up and running. I won't produce another HowTo doc here because there are plenty of good ones already. The ones that I used that are referred to throughout this article. What actually took the longest was putting together the slick little case sold by Built To Spec.  There are lots of folks selling enclosures for the Pi, but I liked the looks of this one. It does require a bit of ambidexterity to assemble, kind of like putting a Chinese puzzle back together, but it is a nice, well-designed case.

In addition to the $35 Model B Pi purchased from Allied Electronics, I bought a $10 8GB SDHC card and a 7-port USB 2.0 powered hub for $25, because my plans for the Pi were to see how well it could perform as a NAS device and media server, and for that I was going to need more than just the two USB ports on the Pi.

I used the Raspbian “Wheezy" distribution downloaded from here and copied it to the SDHC card. I pretty much just followed the instructions in this document to boot and configure the device, and then I installed the Tightvncserver package and did the rest of the installation and configuration with the unit running headless.  The image at the top of this article is the Pi's vnc desktop running on my Linux Mint 15 work machine, click it for a larger image. Btw, here is a nice document that describes how to have the vnc server started at boot time.

Underneath my desk, nearly covered in cat hair are four USB 2.0 drives that I've accumulated over the past few years which have a total combined capacity of about 6 TB.  That's where all my movies, music, and other digital content is stored.  It is these drives that I wanted to disconnect from my main work server and let the Pi handle. I do, btw, have redundant backup elsewhere on higher-capacity USB 3.0 drives.

Installing the NFS server was straight forward, basically as described here.  Getting the NFS server running consists pretty much of just  sudo apt-get update; sudo apt-get install nfs-kernel- server nfs-common rpcbind , and then setting up the configuration files (/etc/fstab, /etc/exports).

At this point I was ready to test the Pi as a NAS.  I was pleasantly surprised that it could effortlessly serve up big, fairly high bandwidth Matroska 1080p movies across my home network to the Linux-based home entertainment system without a hitch.  So far, so good.

The final bit that I was interested in was installing some kind of media server package so that all my movies and music could be accessible from some of the Android devices laying about the house. The package I chose for this was MiniDLNA, and there is a decent document on installing it on the Pi here. MiniDLNA will scan all folders you specify in its config file for video, audio, and picture files. It will then make these available to any UPnP devices such as televisions, games consoles, and Android devices running a UPnP client like the MediaHouse UPnP / DLNA Browser.

When you first start minidlna on the Pi it searches through all the directories that you specified in the config file and indexes all the audio, video, and digital image files that it finds and builds that information into a MYSQL database.  In my case there were about 8,500 movie and audio files that have collected over the years, and it took about 1 1/2 hours for minidlna to index all of that. However, once it was done I could access the media from the Android devices running the MediaHouse UPnP browser.

Bottom line, I am very impressed with the Pi. It is amazing how much work you can do with the Broadcom 700MHz ARM1176JZFS processor with FPU and Videocore 4 GPU, and just 512 MB of ram.


Update 7/23/2013: The cat discovered the 6 TB foot warmer.