Wednesday, November 27, 2013

RaspBMC Media Center Installation

The Raspberry Pi can be used as a media center.  The Raspberry Pi media center can serve up media such as music, videos and pictures.  There are a number of distribution options based on XBMC the "Open Source Home Theatre Software".  The two most popular are RaspBMC and OpenELEC.  The following is a quick guide for installing RaspBMC.

Write Image

First, download latest RaspBMC image and write to SD card:
# wget
# gzip -d raspbmc-2013-10-02.img.gz
# sudo dd if=raspbmc-2013-10-02.img of=/dev/sdh bs=1M

I used Linux to write the image to the SD card.  If you are using windows, you can use the "Win32DiskImager" tool (See Connecting to the Pi).  The raspbmc-2013-10-02.img.gz was the available version at the time of this post, adjust the file name as needed.  The /dev/sdh is the device node my USB SD card reader appeared as.  I used dmesg, after connecting the USB device, to determine this.

First Boot

Connect an HDMI cable to both the Raspberry Pi and a TV.  If you are planning to serve media files up from another server (across NFS / CIFS), connect a network cable.  Although it is possible to use wireless, it is recommended to use at least a Fast Ethernet wired cable, otherwise the video performance may suffer.  Connect power, and watch the Raspberry Pi boot.

On the first boot, you will be asked to configure a few of options, such as locale and time, within a text based dialog wizard.  The configuration options are minimal compared to Raspbian's raspi-config.  The Raspberry Pi will reboot again, this time into RaspBMC windows manager (pictured above).

You are now ready to start using the RaspBMC Media Center.

Serving Media from USB

The quickest way to play media is to copy the media files to a USB drive, and connect this to the Raspberry PI.  From here, it is just a matter of browsing to the files you wish to play.

Service Network Media over NFS

If you are like me, you have a massive file server in the basement housing your collection of music, videos and photos.  To remotely gain access to these files, we can mount an NFS (or CIFS) share.

The NFS tools are already available, but to mount an NFS share we need to first enable the RPC Binding service.
sudo service rpcbind restart
sudo update-rc.d rpcbind defaults

Next we can  mount our NFS share:
sudo mkdir /pub
sudo mount myserver:/pub /pub

Adjust "myserver" and "/pub" to match your server name and NFS share.

To make this available on boot, add the following to /etc/fstab:
myserver:/pub      /pub            nfs     defaults        0 0

Now you will have full access to your media from your Raspberry Pi.

DVD Playback

The Raspberry Pi can also playback MPEG encoded videos, but first you will need to purchase a MPEG-2 license from for about $4.  After waiting about 72 hours for your license key to arrive by email you can then add your license key to /boot/config.txt.  Now you will be able to play your MPEG encoded videos through RaspBMC.

1 comment:

Bethany Burgener said...

It will be fun to use once it is fully installed with games. :)