Building a Home Media Server with Raspbmc: Part Three

In part two of this series, we discussed hardware options for the Raspberry Pi. By now you should have a pretty good idea of what needs to be bought and what can be scavenged for your Raspbmc project. This is the part in the series where the rubber meets the road. I’m going to talk about where to get Raspbmc, how to install it, and what to do after it’s up and running. By the end of this article, you’ll be able to enjoy your media collection on your new Raspbmc device. So let’s get started.

First Steps

An SD card serves as primary storage for the Raspberry Pi. It’s where we place the operating system. And it often, but not always, serves as general purpose storage. Our first task is to get Raspbmc installed on an SD card.

Raspbmc can be downloaded for free from raspbmc.com. Click on the “Download” button at the top of the Raspbmc site. This link will take you to the download page. Here you’ll find a few options.

Simple UI Installer – This is the easiest way to take your first steps with Raspbmc. The UI installer is a small tool for initializing the SD card. It deposits a few files on it for bootstrapping the Raspbmc download and install process, which actually happens on the Pi. It’s available for Windows, OSX, and Linux and it’s extremely painless. If you think you might ever want to reclaim the SD card for another use, this tool also provides a nice “Restore device for formatting” option that puts the card back into a formattable state.

Network Image – This is a minimal disk image that’s not unlike the image used by the Simple UI Installer described above. It’s a barebones OS configured to download and install the rest of Raspbmc at first boot. Use this if you’re on an OS not supported by the UI installer. You will, however, need a disk imaging tool to write the image to an SD card.

Standalone Image – This should be used if your Raspberry Pi is Internet-challenged. It’s the full blown Raspbmc image and doesn’t require any network access for the install process. To write this image to an SD card, you’ll need a disk imaging tool. A popular one for Windows is Win32DiskImager (Disclaimer: I haven’t actually used Win32DiskImager with Raspbmc images, but it should work. If you try this, let me know if it’s successful.)

From here on out, I’m going to assume you’ll be using the Windows UI installer.

Installing Raspbmc

Before launching the UI installer, plug your SD card into your PC. When you fire up the Windows-based installer tool, you’ll see a window that looks something like so.

The Raspbmc Installer will scan your machine for removable devices on startup. If you plug in your SD card before firing up this utility, you should see it appear in the list. If it doesn’t show up, try restarting the installer. If the SD card still doesn’t appear after a restart, check to see if Windows sees the SD card. You may have bigger problems.

When selecting the device to write to, double-check and triple-check that you select the device that correctly corresponds to your SD card. Selecting the wrong device could be catastrophic to your PC, your data, and even your mental health.

The only other required checkbox here is “I accept the license agreement”. The other checkboxes do what they sound like.

If you plan to use DHCP with Raspbmc, don’t worry about the “Manually configure networking option”.

The “Install Raspbmc to a USB drive” option will allow you to install Raspbmc to another USB storage device plugged into the Pi. This could be another SD card entirely if you’re using a USB card reader/writer. But you’ll still need an SD card to bootstrap the install process, which will be the card you’ve selected in the installer.

Once you’re satisfied with your selections, hit the “Install” button. It’ll only take a few seconds to do what it needs to do. And after it’s finished, you’ll have a bootable SD card you can plug into your Raspberry Pi.

Raspbmc Setup First Boot

Once your SD card is all set, you’re ready to proceed with the rest of the Raspbmc installation. Before you go any further, make sure your Pi is powered OFF. Plug in your network cable, HDMI cable, mouse, and keyboard. If you want to use a remote control or WiFi adapter, leave them unplugged for now. Don’t worry. We can set those up later. Slide in your SD card and power up the Pi. Note: Plugging in peripherals while the Pi is on is generally a bad idea. Every time I’ve done this, my Pi has either locked up or rebooted. Consider yourself warned.

The very first time you boot from the Raspbmc SD card, you’ll see a screen that looks like so.

The installer’s version of Linux will then boot. This is where hardware and network detection occurs. If there’s a problem with either of these, you’ll see an error displayed here.

If all goes well, you’ll eventually reach a blue screen that displays a message like the following.

This is the point in the process where the meat of Raspbmc is installed. This part can take a while, typically somewhere between 20-30 minutes. It’s all automated. So feel free to go grab a coffee or a beer while all this is happening. But I suggest that you poke your head in from time to time to see what’s going on. The first time I installed Raspbmc, the device locked up during a reboot. I had to manually power cycle the device to make the install continue.

There are a number of things that happen during this process. Partitions are created and formatted, software gets downloaded, kernel modules are installed, etc. If you have the patience to watch the whole thing, you’ll notice the device even reboots a few times. The crude Linux text-based boot process will eventually transition to a much nicer boot splash screen.

After 20-30 minutes and one final reboot, Raspbmc will start.

Configuring Raspbmc

When Raspbmc boots for the first time, you’ll be asked to select your language of choice.

Using your mouse, select an appropriate language.

Raspbmc uses a time server to figure out the current time, but it can’t figure out your timezone automatically. So you’ll need to set this. The timezone setting isn’t in an obvious location. I actually spent a number of days staring at the wrong time, until I found the setting. You can find it setting under System->Appearance->International->Timezone.

If you’d like to tweak your video settings, you can make changes under System->Video Output. I’ve been using my own device at 1080p without any problems. But others have reported a significant performance boost in the UI by switching to 720p. I recommend trying to use your device at 1080p. That way if you decide to switch to 720p, you’ll at least be able to gauge the significance of the performance boost.

Audio settings can be changed under System->Audio Output. This was one of the settings that I struggled to get right. For a short while, I used the mini jack connected to a stereo input on my audio receiver. Nothing I changed resulted in good audio. After a little Googling, I discovered many, many Raspbmc users complaining of noisy audio over the mini jack. I don’t know if it’s a hardware issue or a driver issue, but something isn’t quite right. The best thing to do is to set your audio output to HDMI. You’ll probably need to experiment with the rest of the settings to find a configuration that works best for you. My TV is currently connected to my audio receiver in stereo using RCA cables. So I set my speaker configuration to 2.0 and turned on “Output stereo to all speakers”. I turned off the “boost volume level” because I didn’t want any other audio processing occurring on the Pi. This resulted in the best sounding audio for my setup. This may take some tweaking to find a configuration that works best for you.

If you have a remote control or a WiFi adapter, this is probably a good point in the process to get those working. Before plugging anything into the Pi, you should power it down. Using your mouse, click on the power button in the lower left hand corner of the screen and select “Power off System”. Once the device has shut down, you can safely unplug your keyboard and mouse and stick them back in the closet. Plug in your IR receiver and/or WiFi adapter and power the Pi back up by unplugging it and plugging it back in. If your devices are compatible with Raspbmc, they should be detected automatically.

And that’s it! Your Raspbmc device is ready for use.

Adding Media

By now you’re probably itching to get some media playing on your device so you can see Raspbmc in action. Let’s try adding one of the great classics – “Night of the Living Dead”.

Fun fact: Due to a an error by the original theatrical distributor of “Night of the Living Dead”, the movie entered the public domain almost immediately after it was released. Public domain means it’s free to copy, free to modify, and free to distribute. There are well over 40 versions of the film for purchase from Amazon. Fortunately for us, a fantastic 1080p version of the film is available for free on Archive.org. It can be downloaded HERE.

What’s needed is a location that Raspbmc can use to source video content. This can be another hard drive, a shared drive from another computer, or even a location on the SD card plugged into the Pi. I have a FreeNAS box on our home network that offers up a CIFS share (AKA a Windows share) for content. So that’s what I’ll be using here to illustrate the process. But if you want to put content right on the SD card, the easiest way to do that is to upload it using FTP (Username: pi, Password: raspberry). If you decide to go this route, I hope you heeded my advice in part 2 about getting a class 10 card.

From the main menu, select “Video”. You’ll see a menu that lists three items – Files, Playlists, and Video Add-ons. Select “Files” and then on the next menu select “Add Videos…”. This will present you with the following dialog box.

Click on the “Browse” button and you’ll presented with another dialog box that looks like so.

The list on the right represents all of the different storage/streaming types that Raspbmc supports for video content. If you used FTP to upload content to the SD card, select “Home Folder” and navigate to the location where you uploaded your content. If you’re using a CIFS network share, like me, scroll down through the list until you find SMB shares. SMB is an older name for CIFS. From here you can point Raspbmc to the computer and folder containing the content.

You’ll notice that you can also specify the type of video content this location contains. This will allow you to tap into one of the neatest features in Raspbmc. By indicating that a given folder contains TV shows, for example, Raspbmc will use the Online TV Database to fetch all sorts of information on the shows contained in that folder. This includes ratings, synopsis, actors, and, best of all, fan art and posters which will be displayed in Raspbmc. A similar thing happens with movies, the data source being The Movie Database.

After you select the folder, Raspbmc will scan its content and download fanart for media it can find online. The video content will then appear in your library. Highlight a movie in the menu and you’ll see its fanart appear on the screen, assuming Raspbmc was able to find it online.

Regarding MPEG-2 (DVD video) and VC-1 content, media of these types aren’t playable on Raspbmc without the appropriate licenses. But both licenses are dirt cheap and can be purchased from the Raspberry Pi Foundation. Adding the licenses into Raspbmc can be done in Programs->Raspbmc Settings->System Configuration->Advanced System Settings.

I’m not going to bother to explain the process for adding photos or music as it’s pretty much the same as adding video. If you’ve successfully added video to your device, you should be able to just as easily add other types of content.

Conclusion

At this point, you know enough to get started with Raspbmc. But we’re not done yet. In part four, we’ll talk about some of the issues I encountered after using Raspbmc for a few days, along with some ideas and tricks to make your Raspbmc experience much more fun. In the meantime, explore Raspbmc. Try out some of the settings and add-ons. You can’t break anything. The worst that can happen is you’ll need to reinstall Raspbmc. And now you’re a pro at that. 🙂

Good luck!

Building a Home Media Server with Raspbmc: Part Two

In part one of this series, I talked a little bit about the Raspberry Pi and Raspbmc. I described what they were and why you might want a Raspbmc device of your own. In part two, we’re going to talk hardware. We’ll get into the specifics of what I chose to use with my Pi and why. And after having read this part, hopefully you’ll walk away with a good idea of what your own shopping list might look like. You’ll also get a feeling on how this project impacts your wallet.

The following is a breakdown of all of the hardware and peripherals I purchased for my Raspbmc project.

Pi – Obviously, this is the most important item to purchase. At the time of this writing, the latest version of the Raspberry Pi is the Model B Rev 2.0. It features a 700 Mhz ARM 11 processor, 512 MB of RAM, a GPU, an Ethernet port, 2 USB ports, an SD card slot, and an HDMI port. For a media center, this device is plenty capable. It can handle 1080p video without skipping a beat. I purchased my board from element14 for $35.

SD Card – You’ll need an SD card to install the OS to. And if you’re planning on storing media on the SD card as well, you should plan on purchasing a class 10 card. Class 10 is currently the highest speed classification available for regular SD cards (Note that SDXC UHS-I is a different breed of SD card and only works with SDXC devices). Class 10 is perfectly suited for full HD recording and playback. Of course, if you’re planning on streaming your content from another device, a class 10 card probably isn’t necessary. But better safe than sorry. I picked up a 32GB card from Amazon for around $24.

Power Adapter – The Raspberry Pi doesn’t come with a power adapter, so you’ll need to either salvage an old mobile phone charger or buy one. The Pi is powered over the Micro USB port, but not any ole cell phone or tablet charger will work. You’ll need a power adapter capable of delivering at least 700mA. I didn’t have any spare chargers that could provide that. So I ended up grabbing one from Amazon for $5.

Case (Optional) – There are no real case requirements here. You can leave the Pi exposed for all the world to see. But be aware you will risk damaging your device. Play it safe and put the thing in a case. If you’re crafty, you can build your own Pi case out of everyday things. If you have a 3D printer, you can find a few case models on the Internet to print out. But if, like me, you’re neither crafty nor blessed with a 3D printer, you’ll need to buy a case. I picked up a really nice one on Amazon for $14. But you have plenty of options. Just make sure the case’s design works for your Pi. For instance, the Model A had only one USB port. So a Model A case won’t work with a Model B Pi.

HDMI Cable – For both video and audio, you’ll be doing yourself a huge disservice by using composite video. If you want HD content (and who doesn’t these days?), you can’t even do HD over composite video. Plus, there are the sound issues with the Pi. Sound over the onboard mini jack is really, really bad. Kill two birds with one stone and go straight HDMI. You can source both your video and audio over the Pi’s HDMI port. A short run (6′ or less) HDMI cable is pretty cheap. I paid $7 for a 6′ cable from Newegg.

Mouse/Keyboard (Almost optional) – A mouse and keyboard is only needed for the initial setup of Raspbmc. Once you get Raspbmc installed and configured, and assuming you have something else to control the Pi with, you can unplug the mouse and keyboard and stick them back in the closet. Something to keep in mind is that the Pi only has two USB ports. So if you’re trying to use a USB WiFi adapter at the same time as the mouse and keyboard, you’ll need to use a USB hub.

WiFi Adapter (Optional) – A WiFi adapter is optional. If you plan on streaming HD content from another computer, I actually recommend avoiding WiFi altogether and plug an Ethernet cable into your Pi. That’ll give you the best transfer speed and you’ll see less jitter or skips in your playback. But if you absolutely insist on using a WiFi adapter, consult this list of compatible adapters. Not all WiFi adapters are equal. If you already have something that’s not on the list, you’ll have to experiment with it to see if it’ll work. Mine (ENCORE ENUWI-1XN42 Wireless N150) incidentally, did NOT.

Powered USB Hub (Optional) – A powered hub is only necessary if you plan on using more than 2 USB devices or if an attached device needs to draw more than 100mA (e.g., external hard drive). They’re not terribly expensive. I picked up a D-Link for around $20. But once I installed and configured the software, I realized I had no use for it. I’ve currently got nothing plugged into the USB ports since Raspbmc is using a FreeNAS box for media storage.

IR Remote (Optional) – An IR remote is another optional component. I started off using a USB mouse to interact with Raspbmc and quickly moved to a free Android application called Yatse that runs on my Kindle Fire. I’ve been using Yatse for a while now. It’s pretty slick. But I’ve found it really inconvenient to always keep the tablet near the TV. And when I do use it for a remote, waiting the 3 or 4 seconds for it to connect to WiFi when I turn it on is kind of annoying. I ordered SANOXY remote for $14, but I haven’t received it yet. Once I get it, I’ll update this to let you know how well it works. (Update 07/30/2013 – I received my SANOXY MCE remote today. It works fantastically. The little track pad thing was an unexpected bonus. Highly recommended!) If you’re thinking about buying a remote for yourself, consult these two links [1, 2] for guidance.

And that’s about it. Here’s a total breakdown of my project’s cost. Your cost will undoubtedly vary as you determine what’s right and wrong for your own project.

Pi $35
32 GB SD Card $24
Power Adapter $5
Case $14
USB Hub $20
Remote $14
Total: $112

Up next…software!

Building a Home Media Server with Raspbmc: Part One

When the Raspberry Pi first came to market, I suffered through quite a few conversations with my geeky, gadget-loving, early-adopter friends who thought it was the greatest thing since Coke Zero. To them, it was a cheap and powerful device with potential limited only by their imaginations. To me, it was just another gadget. It looked interesting. And I was sure it was a lot of fun to hack around on. But I was also sure it was one more thing that would compete for my time and that it would ultimately lose, finding itself gathering dust on my shelf of sad, forgotten gadgets.

It was only recently that I came across the Raspbmc project and my attitude towards the Raspberry Pi changed. For years I’ve intended to build an HTPC. I’ve always wanted a device that could serve as a one-stop media center for my music, photos, television shows, movies, and video podcasts. I’d grown quite tired of the constant chore of hooking up my laptop to the television just so I could watch Hulu Plus or Netflix on a big screen. And truth be told, I really had my heart set on a MythTV box. But every time I sat down to spec out a machine, I always found a more practical project to throw money at. When I learned about Raspbmc, I realized I could still end up with a device that solved all of my media center needs, but without the cost of building a full-blown HTPC.

In this series of articles, I’m going to talk about my adventures with Raspbmc. But before I do, I’m sure there’s one or two of you out there who are completely new to the whole Raspberry Pi scene. So in this first article, I’m just going to briefly discuss what the Raspberry Pi and Raspbmc is all about. In the next few articles, we’ll get into the meat and potatoes of my Raspbmc project.

“What is a Raspberry Pi exactly?” Well, it’s a very small computer – about the size of a credit card. Model B Rev 2.0, which is the latest revision as of the time of this writing, features 512 MB of RAM, a 700Mhz ARM 11 processor, a GPU, 2 USB ports, both an HDMI port and an RCA video port, an Ethernet port, an SD card slot, and a variety of GPIO pins for the hardware experimenters out there. Considering you can get all of this for around $35 + shipping, that’s quite an offering. I’ve read that this device is comparable to an iPhone 3G, although the GPU supposedly outperforms the iPhone 4S by a factor of 2. It’s quite impressive, especially considering these things were meant as educational devices.

There are a few things lacking from the Raspberry Pi worth taking note of. First, there is no storage. No storage means no preloaded operating system. You supply the storage by way of an SD card. This means you also have to download an OS appropriate for your project’s needs and flash it to the SD card. Second, there’s no case. When you buy a Raspberry Pi, you’re purchasing a bare board. It comes in an anti-static bag inside a mostly plain white box. How you mount it, encase it, or display it is entirely up to you. Unless you need easy access to the GPIO pins, I highly recommend you invest in a cheap case. Otherwise, you risk damaging it. Third, it doesn’t come with a power adapter. Power is supplied to the Raspberry Pi through a Micro USB port. But you’ll need a Micro USB power source capable for delivering at least 700mA. When I went rifling through my collection of cell phone and tablet chargers, none of them were capable of delivering that amperage. So I had to purchase a new one from Amazon. One other thing worth noting is that the regular USB ports on the Pi are limited in how much current they can supply. If you need to use a device that requires anything more than 100mA (e.g., an unpowered external hard drive), you’ll need to use a powered USB hub. Otherwise you risk damaging your Pi.

Now, what is all this Raspbmc business? Raspbmc is a port of XBMC (formerly Xbox Media Center) for the Raspberry Pi. It’s a media center platform, similar in concept to MythTV, Windows Media Center, SageTV, etc. But out of the box is lacks PVR functionality. It’s open source and has a fairly extensive feature set, including support for playing video, music, photos, and provides facilities for extending the platform’s capabilities through plugins (accessing stream services, web browsing, screensavers, etc). Controlling the device can be accomplished using a mouse and keyboard, a web based interface, your tablet or phone, or even an IR remote control. And because Raspbmc is based off of Linux, you have the ability to easily remotely administrator the device. It’s quite flexible and whole lot of fun for those who like to tinker.

Excited? Great. Now for some discouraging words. I’m not not sure I’d recommend Raspbmc for someone who doesn’t have a whole lot of patience. Nor would I recommend it for technologically challenged folks who are just looking for a cheap alternative to the Roku or Apple TV. It’s somewhat easy to setup, but it’s not perfect. It does require some persistence to get it working optimally. It took me a month before I reached a configuration I was happy with. We’ll talk about some of the issues I faced when configuring the Pi in a later article. So just consider this a warning.

In the next article, I’ll talk briefly about hardware, including cases, power supplies, hubs, and memory. In part three, I’ll go over the software installation, mention a few of the things that caught me by surprise, and in part four I’ll mention a few tricks that made the Pi work best for me.