For a few years now I have been streaming my media to my television one way or the other. My first serious setup1 involved a jailbroken Apple TV 2 running the unofficial Plex client which received its content from my 27″ iMac running the Plex Media Server and SickBeard. With every update of iOS for aTV it became harder for the developer of the client to support the new firmware, so I decided on a stabler scenario by using the device without jailbreaking and with iTunes as a media server. This was a rather convoluted setup where every downloaded video had to be reencoded or remuxed by software called iFlicks in order for iTunes to be able to stream it to the aTV. iFlicks is very nice, as it automatically fetches metadata and artwork for you and allows for easy automation of the whole workflow.
Eventually, the iMac had to go because of lack of space and I settled on a custom built PC running XBMC (now Kodi) and Steam Big Picture on Windows 8 for my media and gaming needs. In addition to XBMC, I also ran SABnzbd, Transmission and NZBDrone (now Sonarr). This setup performed very well, but despite having chosen relatively silent components, a low drone is always noticeable when the machine is powered on. So I had a look at options without as much moving parts as a full-blown desktop PC. Enter the Raspberry Pi.
Raspberry Pi 2 Model B
The Raspberry Pi Model B spawned an impressive array of Linux distributions running XBMC (now Kodi) as a frontend for media consumption. The specifications of the latest model, the Raspberry Pi 2, are quite impressive; a quadcore ARM processor and 1 GB RAM all fitted on the same board with the dimensions of a creditcard. I ordered mine at The Pi Hut as part of their Media Centre Kit. The kit contains the following:
– Raspberry Pi 2 Model B
– 8GB MicroSD
– 5V 2A Power Supply
– Black Case
– HDMI cable
– Ethernet Cable
The Pi Hut processed my order on Monday and I received my package after only four days. Quite fast considering packages generally take some time getting from the United Kingdom to the Netherlands. I was quite shocked by the size of the package, even though I knew of the small form factor of the Pi itself. Assembling the device was relatively easy, though the black case could do with some instructions on how to fit the board of the Pi and when to insert the SD card (before assembling the case). If you’re careful however, everything is quite straightforward, as is the installation of an operating system.
The provided MicroSD card comes with the NOOBS package containing installation options for a broad range of operating systems. You can choose a regular desktop operating system – Debian (Raspbian) of Fedora (Pidora) – or a media centre OS like OpenElec or Raspbmc (now OSBMC). I choose Xbian however, because I read about the fast boot times, low footprint and rolling release structure. The fact that it runs on Raspbian allows you to install other software as well, something which isn’t possible using OpenElec, I believe. Xbian is not listed in the NOOBS installer, but offers its own automated installer. All you need is a computer with an MicroSD cardreader.
Xbian’s installer can be downloaded from the website, but currently has a permissions issue on Mac OS X Yosemite which can be fixed by running the following command in a terminal. Make sure you’re in the same directory as the installer application.
chmod +x /XBian-installer.app/Content/MacOS/*
The installer takes care of erasing the SD card, downloading Xbian and installing it on the card. In my case the installation process reached 100% but never prompted that it was actually completed. I had to cancel the process after a while, but after inserting my Raspberry Pi booted Xbian without a hitch, so the installation actually did complete, so it seems.
Remote administration of a device comes in very handy and you generally don’t have to leave the couch. You may want to give the Pi a static IP address in you router configuration, as it simplifies interfacing with your device. To login to Xbian via SSH you have to use:
There’s also a root user present, but it’s generally not advisable to use this account. The SSH passwords of both root and xbian can be changed in xbian-config which starts as soon as your login to the device is successful. Changing it to something more random is probably quite a good idea. You can manage packages using
apt-getas well as perform other system administration tasks the Xbian GUI doesn’t provide.
I made the mistake of messing up my network configuration by trying to add a USB WiFi dongle to my setup. After rebooting I couldn’t make a connection to my Raspberry Pi via SSH at all… Luckily the device supports both wired and a range of wireless keyboards. Using my wireless Logitech MK520 keyboard I was able to restore the ethernet connection. The dongle has since been permanently retired.
I’ve used Kodi on my HTPC to great satisfaction. Using it on a Raspberry Pi is no different. Xbian boots very fast and it also immediately mounted my NTFS-formatted external harddrive containing all my media. Xbian has included read and write support for NTFS volumes by default.
There are a few add-ons for Kodi which I consider to be essential:
A skin by Hitcher which manages to be very stylish and simplistic at the same time. Please note that using another skin than Confluence (the default) might render the Xbian settings menu inaccessible. This menu can be reached from the command line as well or by switching back to Confluence.
This add-on updates your library automatically when media is added or removed.
Kodi File Cleaner
Periodically deletes older movies and TV series based on certain criteria. I set it to delete all my watched episodes after two weeks in order to keep my hard drive clean. Sadly the add-on doesn’t officially support Kodi as of yet, but an update is in the works. In the meantime you can bypass the add-on version checks by doing the following, the script still works regardless of an incompatible version of Kodi:
sudo stop xbmc
unzip v4.0.1.zip -d /home/xbian/.kodi/
sudo start xbmc
NZBGet & Transmission
The Pi 2 is an impressive piece of hardware, but despite its 1GB of RAM, performance can still be an issue. NZBGet is often characterised as more lightweight than SABnzbd, so this makes it an ideal choice on low-end hardware like the Pi. Transmission is my torrent client on the Mac and luckily its cross-platform. Xbian offers packages for both programs, which makes installing them very easy. When they’re setup they can be reached through a webbrowser:
Default username and password are again
There’s one caveat though. By default all the download paths for both Transmission and NZBGet will point to your MicroSD. As it’s only 8GB, this is not ideal, it will clog up really fast. NZBGet allows for easy relocation of its download paths and Transmission as well, to an extent. Transmission uses two additional paths which cannot be altered in its web interface. Using SSH:
sudo /etc/init.d/transmission stop
sudo nano /etc/transmission/settings.json
Look for the entries
watch-dir and change them to the desired path (an external drive mounted at
/media, for example). It might be a good idea to change the username and password for logging into Transmission as well, change the values of
rpc-password. When Transmission is started again the password value will be hashed automatically.
sudo /etc/init.d/transmission start
Kodi and Raspberry Pi support CEC, which is an industry standard allowing users to control devices via HDMI. At first I thought this didn’t work on my television, a Philips 32PFL8404H/12, despite having enabled EasyLink (Philips’ name for CEC) in Setup > Installation > Preferences. Turns out CEC only works reliably using high quality HDMI cables, because after switching the cable from The Pi Hut with a better one I had lying around everything started working. I can now control Kodi with the remote control of my television.
Alternatively you can use the web interface of Kodi, accessible through any browser:
Kodi Web Interface:
You need to enable control via HTTP (in Settings > Services > Webserver) in order for this to work and probably set a username and password.
SickBeard was the first PVR of its kind I used. Xbian offers two prebuilt packages of SickBeard: the plain version and SickBeard TPB – which is now called SickRage, I think. The latter version of SickBeard offers torrent downloads and more features than vanilla SickBeard. I’ve come to rely on Sonarr though, which has a nicer interface and a great feature set, including torrent downloads (using Transmission, for example). Sonarr is written in C#, as opposed to Python for SickBeard/SickRage, so you have to jump through some hoops to get the client installed on Linux. Nothing major though, I followed this excellent guide and was up and running in no time.
The Raspberry Pi sends a sound signal over HDMI and to an analogue outlet and it can do so simultaneously. My intention was to connect the device to an amplifier and use it to play my music collection as well. This is where I hit my only major roadblock; the analogue sound signal is sadly too weak. My music played, but on such a low volume I had to crank up the volume of my amplifier to uncomfortable heights. The forums of various Raspberry Pi OS distributions are replete with issues regarding low analogue volume, but in the end it all seems to boil down to the fact that the Pi originally wasn’t intended to be a set-top box media player. I tried some workarounds, which didn’t work and decided to go another route, by buying a Sonos PLAY:1 instead. A drastic measure it may be, but it renders several other bulky devices (amplifier, speakers) obsolete. Sonos also plays nice with networked drives, so it’s a nice audio counterpart to the Raspberry Pi.
Adding media is as easy as adding the volume mounted by the Pi in Sonos’ settings:
In theory you could use Kodi’s UPnP capabilities allowing Sonos to see the drive as a media server, but this works just as well.
Overall I’m very happy with my new setup. It’s fast, has a low power footprint and is accessible and easy to maintain. Above all it’s nearly silent, you can sometimes hear the external drive spin up and down, but that’s nothing compared to the fans of an idle HTPC.
- I also owned an ACRyan Playon HD for a while, a terrible, terrible device. ↩