Over the past couple of years, I have had mixed feelings about Raspberry Pi as a HTPC, because even after using all possible optimization tricks it simply was not responsive enough for my requirements.
Now that a new model is out, is the Raspberry Pi 2 finally ready to replace your HTPC?
In this comprehensive guide, you will learn how to set up Raspberry Pi 2 as a complete Kodi (was XBMC) entertainment center solution with the right accessories.
This guide also includes detailed instructions to set up the new OSMC stable release that replaces the Raspbmc operating system I used earlier in this guide.
In case you’re wondering, yes Raspberry Pi 2 is ready for the prime time, because according to my tests it is 55% – 100% faster compared to the Raspberry Pi 1 model B+ with Kodi.
In this complete and up-to-date tutorial, you will learn
The Raspberry Pi 2 Model B is the latest tiny computer by the Raspberry Pi Foundation that plugs into your TV with an HDMI cable.
It decodes 1080p H.264 HD video smoothly, and the Kodi user interface is now very responsive on Raspberry Pi 2 thanks to its upgraded processor.
Here are the highlights you need to know about this new Raspberry Pi 2:
To complete this tutorial, you will need to buy the following components
The total price for the computer is about $88, plus $23 for the remote control (Flirc), for a total of $111. However, you may have most of the required accessories at home already.
You can also unlock MPEG-2 and VC-1 hardware decoding by purchasing a license from the foundation’s online store.
Nowadays, there are a lot of commercial cases to choose from that you can buy online.
After testing several different models, my favorite case is the Flirc Raspberry Pi case, which is hands down the best case for RPi.
The Flirc case is compatible with both the latest second generation and older B+ models. It is made out of aluminium and it looks absolutely stunning compared to other RPi cases in the market. The case has a built-in heat sink, which is useful especially if you intend to overclock the system.
I’m using the Flirc case in my media room and I can wholeheartedly recommend it.
Get this high quality Raspberry Pi case here.
Please note that many users report issues with various memory cards, so be sure to get a supported SD card. When I got my first Raspberry Pi Model B, I tested 3 cards before I found one that worked properly with the operating system.
You can get a standard micro SD card with many Raspberry Pi 2 bundles, but they may be low quality and do not necessarily last very long.
If you want to increase the longevity of the memory card, I recommend getting a separate micro SD card that comes with wear levelling. Only the more expensive micro SD cards come with wear levelling, which means that the card will try to spread wear out over the whole disk instead of writing and reading the same spot on the disk all the time.
I would also recommend getting a card with at least 8GB storage as more space increases the longevity of the card by having more space for wear levelling.
One good card that supports wear levelling and performed really well in my tests is the SanDisk Extreme Pro 8GB MicroSDHC.
Samsung’s class 6 micro SD card that is often sold together with the NOOBS operating system install manager performed as well as the class 10 SanDisk Extreme Pro in my tests.
I also noticed with a Kingston class 10 memory card that the class of the micro SD card does not necessarily mean the memory card will be faster than class 6, as the random read/write speeds are even more important.
You can also use a USB memory stick with OSMC operating system, but I did not see any speed improvements between the Kingston DT USB 3.0 stick and the SanDisk Extreme Pro.
As a conclusion, you should make sure that your micro SD card will last longer without any issues, so I would recommend using the SanDisk Extreme Pro 8GB.
The RPi does not come with a power adapter, so you will also need to get a supported power adapter. Be sure to get a good quality power adapter as those cheap ones that come together with many Raspberry Pi bundles may not work properly.
For example, I had problems with a Flirc remote companion adapter when using a cheap power adapter. I got erratic key presses with the Flirc when using a power adapter that came together with the Raspberry Pi model B+ bundle. When I plugged the RPi into my TV’s USB slot or used my iPad’s power supply, the problems were resolved.
If your television supports HDMI CEC, I recommend using it as that is the easiest way to control your Raspberry Pi. You can use your TV’s remote to control Kodi (XBMC) by sending signals over the HDMI cable. Usually, HDMI CEC works without any further configuration.
If your television does not support HDMI CEC, then the most cost-efficient and working solution is the Flirc (get it here). Flirc learns any remote control so you can use your old IR remote control and map it with the Flirc using a configuration application on Windows and Mac OS X.
You can follow this Flirc guide to map the keys with the configuration application. You can then plug the Flirc into Raspberry Pi and start controlling the Kodi.
The third option is to use your mobile phone or tablet as a remote control using an app such as Constellation.
Building your own system is very easy and by following these four simple steps, you will have the system ready to be booted up with an operating system in less than 30 minutes.
|First, open the case and apply the thermal tape to the built-in heatsink. Then, insert the board inside the case.
|Insert the case cover back into place and tighten the screws.|
|Insert the micro SD card in the slot under the case. Please follow the instructions in the next chapter to install an operating system.
|Insert the HDMI, Ethernet and micro USB cables in place. Plug in the Flirc adapter, keyboard or any other controllers.
In this chapter, you will learn which operating system you should choose and how to install it.
I tested the OpenELEC and OSMC operating systems from a performance and stability point of view. They both use Kodi (XBMC) as an entertainment center, but the Linux distribution in the background is different.
There is also a third alternative called Xbian, which is not included in the NOOBS. However, I have not been too impressed with Xbian’s performance in the real-life usage scenarios or overall user friendliness, so for the time being I would stick with either OpenELEC or OSMC.
Before going through the installation instructions, let’s have a look at how these operating systems performed in real-life usage. As a reference, I use the Raspbmc operating system (predecessor of the OSMC) performance with Raspberry Pi 1 Model B+. Please note that these results are based on my experiments and your mileage may vary.
I compared these three alternatives on four different usage scenarios using the SanDisk Extreme Pro 8 GB micro SD card with each operating system.
|OpenELEC(v.5.07)on RPi 2||OSMC(v.1.0)on RPi 2||Raspbmcon RPi 1|
|Booting up||15.2 sec||15.8 sec||38.8 sec|
|Importing movies||35 sec||22 sec||82 sec|
|Opening library||1.0 sec||0.7 sec||1.7 sec|
|YouTube search||3.6 sec||3.1 sec||22 sec|
As you can see from pure performance point of view, there is no significant differences between the OpenELEC and the OSMC. The results show that OpenELEC boots up just a bit faster than OSMC, but the overall Kodi experience is faster out of the box with the OSMC. The OSMC uses a more lightweight and optimized skin than OpenELEC by default, which probably explains the difference in the navigation speed.
All in all, both OpenELEC and OSMC are good choices for you, but I would recommend opting for OSMC as it provides better overall user experience and it is easier to configure, if you, for example, want to overclock it later on.
In this chapter, I will show you how to install OpenELEC operating system using two alternative methods: NOOBS installer and diskimage installation.
The easiest way to install an operating system such as the OpenELEC is to use NOOBS (New Out Of the Box Software), which is an easy operating system install manager for the Raspberry Pi.
Please note that the OpenELEC booting up time via NOOBS will be a bit slower compared to a diskimage installation method, because NOOBS starts its own firmware, kernel and userspace tools before it loads the OpenELEC operating system. However, the overall installation experience is a bit easier with NOOBS installer especially for beginners.
You can either purchase a pre-installed NOOBS micro SD card from an online store or download and install it yourself.
You can buy a micro SD card with NOOBS preinstalled, for example from Amazon.com.
Your RPi will automatically boot into NOOBS after booting up the system for the first time with the card inside. The NOOBS installation manager should display a list of operating systems that you can choose to install.
Alternatively, you can download and install NOOBS to the microSD card yourself.
If you already have a micro SD card (8GB recommended), then you can download NOOBS for free and install it on your card.
|Download SD Formatter 4.0 and install it. Insert your micro SD card into the computer’s SD card reader. In SD Formatter, select the drive letter for your SD card and format it.
|Next, extract the .zip file using 7zip and drag all the files from the extracted NOOBS folder to the SD card drive. After file transfer is completed, safely remove the micro SD card and insert it into your RPi.
Follow these step-by-step instructions on how to create a NOOBS card.
Now, insert the microSD card with NOOBS into RPi, connect cables, keyboard and mouse and boot up the system.
Please note that you will need to plug in your keyboard and mouse before installing NOOBS as you will need to use a mouse to install the operating system on the RPi.
|After booting up your Raspberry Pi, a window will appear with a list of operating systems that you can install. Select OpenELEC_Pi2 and click on Install.
|Confirm to overwrite all the data on the micro SD card.
|OpenELEC will run through its installation process, which will take a while.
|When the install process has completed, the system will reboot and launch the OpenELEC for the first time.
If you want to speed up boot times, then you should install the OpenELEC to the microSD using a DiskImager tool on Windows instead of using the NOOBS installer.
|Download the RPi2 ARMv7 diskimage, and extract the OpenELEC-RPi2.arm-5.0.7.img.gz using 7zip. Insert your microSD card into the computer’s SD card reader.
|Download Win32DiskImager and run it as an administrator on Windows. Select the OpenELEC-RPi2.arm-5.0.7.img image file and choose the SD card drive letter as the device. Click “Write” and wait until the file transfer is completed. Safely remove the microSD card and insert it into your RPi.
The OSMC is the successor to Raspbmc and it is created and maintained by Sam Nazarko and you can download the latest OSMC version here. I will use the Windows installer in this tutorial.
Recently, OSMC reached its final release, which means it is now fully stable and ready for the prime time.
Before proceeding with these instructions, plug in the micro SD card reader and unplug any other USB storage devices to make sure you will not format an incorrect drive by accident.
|Launch the OSMC installer application and select the language and Raspberry Pi 2 device in the welcome screen. Then, click the “next” button and select the latest
|Next, select where you would like to install OSMC. Usually, you should install it on the SD card. Then, click the “next” button and configure whether your
system connects to the web via a wired or wireless connection.
|Now, select the device path where you would like to install OSMC. Click “next” and accept the licence agreement.
|When the download process has completed, confirm installation by selecting “Yes” when prompted. After installation is completed, you are ready to insert the micro SD card onto RPi and boot it up.
After plugging in the memory card, USB stick, USB keyboard or remote control, Ethernet cable and power adapter, the system will boot up and the Kodi will launch for the first time.
To finalize the installation, select your locale and confirm the licence agreement and you are ready for show time.
In this section, I will introduce my favourite ways to add more content sources such as live TV streaming, Netflix streaming, high-fidelity music streaming and local media files.
I would also suggest checking out my complete Kodi guide (including a PDF version), if you wish to learn more ways to set up and customize Kodi.
In order to decode and play MPEG-2 and VC1 video files using hardware acceleration, you will need to purchase codec licenses from the Raspberry Pi foundation.
Install the codecs by following these steps:
The easiest way to watch live TV with Raspberry Pi is to use it with a HDHomeRun network attached TV tuner. If you do not already have it, you can use this guide to get and install HDHomeRun.
You can also record TV shows with Raspberry Pi using a TVHeadend server, but it is still much more complicated to set up and will not provide optimal user experience as a DVR. Live TV recording in the background consumes Raspberry Pi’s resources, so using OSMC/OpenELEC at the same time will not be so smooth experience.
Therefore, I would recommend building a Windows-based DVR back-end system using this guide.
However, Raspberry Pi works well for watching live TV and timeshifting, so let’s see how you can easily watch live TV with HDHomeRun and RPi.
|Go to “Settings” > “Add-ons” > “Get Add-ons” > “Kodi Add-on repository” > “Video Add-ons” > “HDHomeRun Live TV”.
|Select “Install” and Kodi will download and install this add-on. Now, you can go to “Videos” > “Video Add-ons” > “HDHomeRun Live TV” to watch TV streams.
|In order to add live TV to the home menu, go to “Settings” > “Appearance” > “Skin – Settings” > “Home – Customize Home Menu”. Scroll down to the “Live TV” and “Choose shortcut”. Select “Add-on” > “Video Add-on” > “HDHomeRun Live TV”. Select OK to save settings.
|Now, you can launch the Live TV shortcut to watch TV.|
I think this online video streaming service is too cool to miss if you want to watch Hulu, Netflix, Amazon VOD, HBO Go and other premium content channels on your Raspberry Pi.
In order to watch premium channels on the RPi, you will need to install commercially available software called PlayOn Media Server (get it here) on your Windows-based PC that allows you to stream premium content channels into Kodi (XBMC) running on any operating system.
The PlayOn Media Server costs about $60 (a one-time fee), but according to my experience it is definitely worth it.
Just buy and download the PlayOn here and install it on your Windows-based computer.
In order to register your copy, open PlayOn Settings (go to Start / All Programs / PlayOn / PlayOn Settings) and enter the license information on the Registration tab.
Now, let’s configure OSMC to be able to view Netflix and other premium services.
|Go to “Videos” > “Files”. Select “Add Videos…” > “Browse” > “UPnP Devices” > “PlayOn (your
computer name)”. From this list, you can browse the service you want to add as a source (e.g. Netflix).
|Next, you can rename the name of this media source (e.g. Netflix).
|In order to add Netflix to the home menu, go to “Settings” > “Appearance” > “Skin – Settings” > “Home – Customize
Home Menu”. Select “Add” on any existing shortcut and “Choose shortcut” > “Video Library” > “Sources” > “Netflix”. Select OK to save settings.
|Now, you can start browsing your favourite TV shows and movies via PlayOn Media Server.
Continue reading more advanced instructions here, if you want to seamlessly integrate Netflix and Hulu into Kodi.
My favourite music streaming service is called Tidal, which allows you to stream high fidelity music (even lossless format is available) and music videos.
Installing Tidal is as easy as adding any official Kodi add-on.
|Go to “Settings” > “Add-ons” > “Get Add-ons” > “Kodi Add-on repository” > “Music Add-ons” > Select “Tidal”.
|Select “Install” and Kodi will download and install this add-on. Now, you can go to “Music” > “Music Add-ons” > “Tidal”. Press “C-key” to access to the context menu and select
“Add-on settings”. Select the quality and input your Tidal username and password.
|In order to add Tidal to the home menu, go to “Settings” > “Appearance” > “Skin – Settings” > “Home – Customize Home Menu”. Select “Add” on any existing shortcut and
“Choose shortcut” > “Add-on” > “Music Add-on” > “Tidal”. Select OK to save settings.
|Now, you are ready to enjoy high fidelity music streaming with Tidal from the home screen.
The RasPi does not have hardware decoding support for any other video codec other than H.264 out of the box, so you will need to have all video files converted into H.264 format in order to play them smoothly. Alternatively, you can buy a license to unlock MPEG-2 and VC-1 decoding.
Fortunately, there is an easier way should you have another desktop PC or a media server. You can use Plex Media Server to transcode any media file you have in your library and stream it using a PleXBMC add-on for XBMC.
First, you will need to download and install the Plex Media Server application either on your Windows, Mac OS X or Linux based computer.
After installation, configure the movie library with the media manager (go to http://your-desktop-pc-ip-address:32400/manage/index.html with your Internet browser).
Next, download the PleXBMC add-on.
In order to copy the plugin file to the RPi, you can use an FTP client such as FileZilla to copy the helix.zip to /home/pi folder on your RPi. The username is pi and the password is raspberry.
Go to Settings > Add-ons > Install from zip file > Home folder > helix.zip to install the PleXBMC add-on.
Go to Settings > Add-ons > Enabled Add-ons > Video Add-ons > PleXBMC > Settings to configure the add-on.
Go to Videos > Video Add-ons > PleXBMC > Movies and launch your first movie.
Install Amber skin for the full Plex experience
While PleXBMC works with any skin, I would recommend using Amber skin, which is a PleXBMC-enabled skin that can be downloaded here. Once you have installed Amber skin, select “Go PLEX” from the Home Screen by scrolling to Settings and selecting “Go PLEX”.
If you want to get the best audio playback quality and turn your Raspberry Pi into audiophile music player, I recommend trying out the HiFiBerry DAC+ and Volumio music player. HiFiBerry DAC+ is a special sound card for the Raspberry Pi that is optimized for 192kHz/24bit high-quality sound.
Volumio is a great music system that replaces your XBMC based operating system to play all your music, whether it is a high-resolution file or Spotify, with the highest quality. You can control it with your mobile phone, tablet or PC.
To enjoy high-quality sound, you will need
|Download and extract the Volumio1.5PI.img.zip file. Download and open Win32DiskImager, right-clicking on the file, and selecting “Run as Administrator”. Insert the MicroSD Card on your computer, and browse the Volumio1.5PI.img file and click on Write.
|Insert the HiFiBerry DAC+ board to the RPi board. Insert the micro SD card and cables and boot up system.
|Type volumio.local/ on your device’s browser. Be sure that you are connected to the same network as Volumio. From here, you can configure it such as adding NAS drives or Spotify credentials.
|Done! You are now ready to play your first song.|
I have been very satisfied with Volumio, and I have a separate HiFiBerry powered RPi and active speakers in my living room to easily play music whenever I want.
The following performance improvement tricks are particularly important if you own a Raspberry Pi 1 Model B+ or earlier model, but they can slightly improve performance on the Raspberry Pi 2 as well.
For example, by following these tricks, you can speed up the Raspberry Pi 1 system by 20-40 percent compared to the original baseline.
|RPi 1 Before||RPi 1 After|
|Booting up||32.0 sec||27.8 sec|
|Importing movies||82 sec||80 sec|
|Opening library||1.7 sec||1.4 sec|
|YouTube search||22 sec||15 sec|
You can safely speed up the RPi by overclocking it. Go to “My OSMC” > “Overclock”.
Next, change the system performance profile to “Turbo” to overclock the system.
Overclocking did not have as high of an impact as I was hoping for, but booting up time improved by over 20 percent on RPi 1. However, movie library importing, navigation speed and YouTube searching remained on the same level.
Reducing the Kodi user interface resolution to in “Settings” > “System” > “Video” will save memory and make the system and menus a bit faster. Video will still play at full resolution (e.g. 1080p).
Go to “Settings” > “System” > “Video Output” > “Resolution” to change the resolution.
I noticed about a 20 percent improvement in the navigation menu speeds on RPi 1, so if you do not need 1080p resolution in the menus, this change will make your system feel snappier.
On OSMC, the default skin is lightweight enough and already optimized for performance, so you don’t need to change the skin to improve system responsiveness.
However, there are even more beautiful skins available such as Aeon Nox and Mimic that work fine on Raspberry Pi 2 according to my tests.
Go to “Settings” > “Skins” > “Skin” to download and change a new skin.
By default, XBMC will extract thumbnails from videos that have no thumbnail in the library. As this consumes quite a lot of CPU performance, you should disable this feature to speed up navigation in the library.
Go to the “Settings” menu and select “Video” > “File lists” > disable “Extract thumbnail and video information”.
You may also want to disable Actor thumbnails from the “Settings” > “Video” > “Library” > “Download actor thumbnails when adding to library”.
I would recommend adjusting the display refresh rate to match video in order to get smoother video playback.
You can enable it by going to System > Video > Playback > Adjust display refresh rate to match video.
Another way to smoothen the playback is to use audio passthrough. I have not tested this tip myself, but using audio passthrough should lower the CPU usage for DTS and AC3.
You can enable it by going to System > System > Audio output > Enable passthrough.
If you are using a Network Attached Storage (NAS) such as Synology Diskstation, it is recommended to use NFS protocol instead of SMB protocol to access media files in XBMC. SMB networking protocol uses much more of the RPi’s CPU, so NFS is a faster option.
For example, during my tests, a 1080p video was buffering frequently over a wireless network with SMB protocol, but with NFS it played smoothly without any buffering issues.
As this computer does not have a separate power button, a good trick is to connect it to your TV’s USB port, so that when you turn on your TV it will also boot up the computer.
This way you will also need one less power plug.
All in all, the Raspberry Pi 2 is now ready to replace your home theater PC and coupled with Flirc remote companion and this high quality Raspberry Pi case, it works great as an entertainment center front-end.
One question that many of my readers ask is: “How does this system compare to my other reference HTPCs in terms of performance?”
In order to answer this question, I compared the Raspberry Pi 2 system with my budget reference HTPC and as you can see, there are still some, but not anymore significant difference. So, it all comes down to your requirements and how much time and money you are willing to spend. In my case, I still use a full-blown HTPC in the living room while other rooms have RPis as secondary HTPCs.
|Raspberry Pi 2||Budget HTPC|
|Booting up||15.8 sec||9.7 sec|
|Importing movies||22 sec||15 sec|
|Opening library||0.7 sec||0.6 sec|
|YouTube search||3.1 sec||2.0 sec|
Now go and build the RPi yourself: get the list of required parts.
After finishing this extensive guide, I thought to make an eBook version that includes 8 easy steps to build your own Raspberry Pi machine.