XBMC Media Center

The Raspberry Pi has gotten quite a lot of attention today, and it’s well deserved.  Dollar for dollar it’s the most incredible computer available today, and at $35 it’s accessible around the world as an educational tool.  There are many impressive projects out there today, everything from self-contained weather stations to supercomputer clusters.  It’s an incredible platform to learn Linux on and a great platform to start developing on.

One of the many impressive things about the RPi is that it’s got a pretty powerful GPU on it, capable of 24 GFLOPs of processing power.  This makes it a great candidate as a stand-alone media server and it’s one of the most popular RPi projects out there.  There are a handful of ports out there of popular media servers, the most popular one being XBMC.  Below I’ll outline my media server setup.

RPi1

Hardware:

ItemLinkNotes
Raspberry Pi + Casehttp://www.amazon.com/CanaKit-Raspberry-Basic-Clear-Supply/dp/B00DG9D6IK/ref=sr_1_5?ie=UTF8&qid=1377021871&sr=8-5&keywords=raspberry+pi
SD Cardhttp://www.amazon.com/Transcend-Class-Flash-Memory-TS8GSDHC10E/dp/B003VNKNEG/ref=pd_bxgy_pc_text_zthis one worked fine and was cheap, but in the end you only need a 1GB card
WiFi module http://www.amazon.com/Edimax-EW-7811Un-Wireless-Adapter-Wizard/dp/B003MTTJOY/ref=sr_1_4?ie=UTF8&qid=1377021871&sr=8-4&keywords=raspberry+pioptional
USB Hubhttp://www.amazon.com/Plugable-Port-Speed-Power-Adapter/dp/B003Z4G3I6/ref=sr_1_5?ie=UTF8&qid=1377022108&sr=8-5&keywords=pluggable+technologies+usb+hubbe very careful on this, you need on that is powered, but more importantly has enough amperage that it’s giving at least 500 mA per USB out that you intend on using (usb 2.0 spec), this one is highly regarded as one of the best for the Pi
IR Remotehttp://www.amazon.com/Mediagate-Certified-Infrared-Receiver-Ultimate/dp/B002XNQHNQ/ref=sr_1_7?ie=UTF8&qid=1377022212&sr=8-7&keywords=MCE+remoteoptional, any MCE remote *should* work out of the box, this one works great for me
External Hard Drive http://www.amazon.com/Passport-Essential-Portable-External-Drive/dp/B0041OSQ9S/ref=sr_1_11?s=electronics&ie=UTF8&qid=1377022862&sr=1-11&keywords=wd+passport(if I were buying a new one I’d buy one that was powered rather than USB powered, but this is what I had laying around
HDMI Cablehttp://www.amazon.com/AmazonBasics-High-Speed-HDMI-Cable-Meters/dp/B003L1ZYYM/ref=sr_1_1?ie=UTF8&qid=1377207051&sr=8-1&keywords=hdmi+cable
Fanhttp://www.amazon.com/gp/product/B00080G0BK/ref=oh_details_o02_s00_i00?ie=UTF8&psc=1optional, I ended up putting everything in a tuperware and am experimenting with overclocking, so the Pi runs hot for me
Plastic Storage Boxhttp://www.amazon.com/Sterilite-Deep-Clip-Box-Pack/dp/B004QJM0DG/ref=sr_1_4?ie=UTF8&qid=1377222212&sr=8-4&keywords=sterilite+storage+containersoptional, but you'll need a place to put all this stuff at some point.

Configure:

Prepping the SD Card.

Step 1:  Place an OpenElec image on the SD card using this guide: http://squirrelhosting.co.uk/hosting-blog/hosting-blog-info.php?id=9

Prepping the External Hard Drive.

Step 2:  Create an ext4 partition on the external hard drive. I used MiniTool to do this on windows: http://download.cnet.com/MiniTool-Partition-Wizard-Home-Edition/3000-2094_4-10962200.html?part=dl-6285158&subj=dl&tag=button.  The ext4 partition only needs to be very small, I used 1 GB.  I left the other partition as NTFS, maybe it would be a little bit faster if the other partition was also ext4, but this way I can plug the external drive into my windows machine and upload files directly to the drive.  Create the following directories on the root of the NTFS Partition: “Movies”,”TVShows”,”Music”,and “Misc”.  Also change the label of NTFS partition to something simple (no spaces will be best) as this will show up in the folder structure on XMBC.  The external drive will mount as “/media/<label>”

If you have movies, music, or TV shows you want to have loaded into XBMC now is a good time to add them to those folders.  For TV shows you want to organize them in the following folder structure: TVShows\Show Name\Season #\episode #-title.foo.  Movies you can just dump into the Movies directories. Music should be Artist\Album\track #-song.foo

Initial Boot OpenElec/XBMC

Step 3:  Time to plug everything up: SD Card in, HDMI to TV, ethernet to network, hard drive to USB, and a keyboard will be useful for the initial setup at least.  Powerup and the RPi will boot from the SD card.  You’ll need to configure your network settings, which are in System/OpenElec.  You’ll need to assign a static IP.  If you’re using a wifi card be sure to set the hardware source to wlan0.  If your using the onboard Ethernet it should be eth0.  I use google’s dns servers (8.8.8.8 and 8.8.8.4).  Make sure enable SSH on startup is on.  Note: don’t be tempted to configure the rest of XBMC yet, you’ll lose all these settings once you move it to the external hard drive.

screenshot001

 

screenshot003

Move XBMC to Hard Drive Partition

Step 4: SSH into the RPi, U/P: root/openelec . (if you need an SSH client for windows, Putty is the way to go: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)

login as: root
##############################################
# OpenELEC - The living room PC for everyone #
# ...... visit http://www.openelec.tv ...... #
##############################################

OpenELEC (official) Version: 3.0.6
root@10.0.1.40's password:
openelec:~ #

Use the  mount command to get a list of all external partitions.

openelec:~ # mount
rootfs on / type rootfs (rw)
devtmpfs on /dev type devtmpfs (rw,relatime,size=189064k,nr_inodes=47266,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
/dev/mmcblk0p1 on /flash type vfat (ro,noatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)
/dev/sda5 on /storage type ext4 (rw,noatime,data=ordered)
/dev/loop0 on / type squashfs (ro,relatime)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,relatime,size=76404k)
tmpfs on /var type tmpfs (rw,relatime,size=10240k)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/mmcblk0p2 on /var/media/Storage type ext4 (rw,nosuid,nodev,relatime,data=ordered)
/dev/sda1 on /var/media/ExternalDrive fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
openelec:~ #

In my case the ext4 partition ended up being /dev/sda5 (line 7) but it could very well be different for you.  You’ll know it’s the one that doesn’t have the folders that you setup in the NTFS partition.  Go ahead and make your SD card read/write:

mount –o rw,remount /flash

Next you need to edit the cmdline.txt file on the root of the SD card.  We’ll do this using the built-in text editor, nano:

openelec:~ # cd ..
openelec:/ # cd /flash
openelec:/flash # ls
LICENCE.broadcom  bootcode.bin      fixup.dat         start.elf
README.md         cmdline.txt       kernel.img
SYSTEM            config.txt        openelec.ico
openelec:/flash # nano cmdline.txt

Edit the cmddline.txt for the disk= portion such that disk=/dev/sda5 (sda5 being the ext4 partion you found at the beginning of this step).

cmdline

Reboot. Profit.

Initial Config of XBMC

Step 5: You’ll have to setup your networks again, setting a static IP.  Now is a good time to go through the system menus and just get familiar with where various settings are.  You’ll want to make sure that you turn ON the following settings: Start SSH at boot, Start Samba on Boot, Enable UPNP, Enable Other Applications To Control XBMC, Enable Applications on Other Machines to Control XBMC, Enable XBMC Web Interface (port 80).  Turn off RSS feed.  Reboot once you have all the options turned on.

Next you’ll want to add the folders from your external hard drive to the videos and music library – instructions can be found here:http://wiki.xbmc.org/index.php?title=Video_management#Adding_media_sources but in short you want to go to “Videos”/“Add Sources”/”Browse”/(your external hard drive should mount as /Media/Volume Name/, be sure to navigate to the TVShows or Movies sub directory).  Be sure to set the content type for the folder (TVShows = TV Shows, Movies = Movies, Music = Music).  More info on that here: http://wiki.xbmc.org/index.php?title=Video_library/Setting_content_and_scanning

 

screenshot000

screenshot002

 

Other stuff

1) Make your stuff a home – plastic storage boxes are a cheap and easy way to house all these components.  I’ll pretty mine up some day, zip ties keep everything in place:

    RPi3

2) The XBMC remote for the iPhone is incredible: http://wiki.xbmc.org/index.php?title=Official_XBMC_Remote/iOS also available in android flavors.

3) The RPi can stream files to any UPNP Media Player (watch one thing on TV, stream another to another device).  This is awesome  on Tablets/iPad/iPhone around the house, I use ArkMC on my mobiles: https://itunes.apple.com/us/app/arkmc-lite-dlna-upnp-media/id640095560?mt=8

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Human Verification *

Top