I’m a proud owner of Raspberry Pi, and I hope to have much time to spend doing software / hardware stuff with it.
However this post is about my will to see RaspberryPi as mediacenter: mounting my network shares and streaming DVB-T channels. I live in Portugal, so DVB-T channels are encoded in H264/AAC.
I’ve bought this DVB-T USB device on ebay because it’s cheap (no intended advertisement).
Connecting it to RaspberryPi and doing lsusb:
Bus 001 Device 004: ID 048d:9135 Integrated Technology Express, Inc. Zolid Mini DVB-T Stick
This device is Version 2, so according to LinuxTV Wiki to be support you would need to use at least Kernel 3.4 (no alarm here!) .
Let’s go build OpenELEC with PVR support and kernel support for most DVB-T USB devices (mostly taken from here).
Update #1: Steps 1 to 8 performed on my laptop using Ubuntu 12.04 on Oracle VirtualBox.
Update #3: Step #3 and #4 aren’t needed anymore. I tested the latest r12431 and DVB-T device is recognised and running.
1) First you need to have some packages installed (I used Ubuntu 12.04)
$ sudo apt-get install g++ git nasm flex bison gawk gperf autoconf automake m4 cvs libtool \
byacc texinfo gettext zlib1g-dev libncurses5-dev git-core build-essential xsltproc libexpat1-dev zip \
autopoint xfonts-utils libxml-parser-perl libproc-processtable-perl default-jre
2) Cloning OpenELEC project
$ git clone git://github.com/OpenELEC/OpenELEC.tv.git
We need Stefan Saraev OpenELEC media_build support so let’s create a temporary directory: $ mkdir temp
$ cd temp
$ git clone https://github.com/stefansaraev/OpenELEC.tv.git
$ cd OpenELEC.tv 3) Pull that commit that really interest us! $ git cherry-pick 3f6b9aa
$ git pull origin media_build
$ cp -R packages/linux-drivers/media_build/ ../../OpenELEC.tv/packages/linux-drivers/
$ cp tools/mkpkg/mkpkg_media_build ../../OpenELEC.tv/tools/mkpkg/
$ cd ../..
$ rm -rf temp 4) Editing RaspberryPi project options (use your favorite text editor, i used nano)
$ cd OpenELEC.tv
$ nano projects/RPi/options Search for ADDITIONAL_DRIVERS and replace this line:
ADDITIONAL_DRIVERS=”$ADDITIONAL_DRIVERS AF9035 A867 aver_h826d RTL2832 hdhomerun-driver vtuner-driver”
ADDITIONAL_DRIVERS=”$ADDITIONAL_DRIVERS media_build” 5) Fix media_build compile error
(Use your favorite text editor, once again)
$ nano packages/linux-drivers/media_build/build Add:
make VER=$VER SRCDIR=$(kernel_path) -C linux/ download
6) Compile time! It will take a while, go grab a coffee, watch some tv or read a book!
$ PROJECT=RPi ARCH=arm PVR=yes make release
Update #2: Add -j # to the above command (# is number of cores of your CPU or VM CPU), to speed up compiling time. (Thanks to azbest_hu!)
7) Format sdcard and create system
Extract OpenELEC_PVR-RPi.arm-devel-*.tar.bz2 and execute (my sdcard is mounted on /dev/sdb . check yours!):
$ ./create_sdcard /dev/sdb
$ umount /dev/sdb1 && umount /dev/sdb2
8) Create Tvheadend add-on or install it from Addons menu
We’ve built XBMC for Raspberry Pi with PVR enabled and media support now it’s time to build TVheadend add-on which will render DVB-T channels.
$ PROJECT=RPi ARCH=arm PVR=yes ./scripts/create_addon hts-tvheadend
When it’s finished you’ll have on target directory addons/2.1/RPi/arm/service.multimedia.hts-tvheadend . Copy this directory to OpenELEC Download network share.
9) Install Tvheadend add-on
On XBMC go to Add-on -> Install from zip file -> Home folder -> Download and select service.multimedia.hts-frontend-X.X.X.zip .
When done, reboot!
10) Configure Tvheadend
After Raspberry Pi rebooted go to your PC browser and enter http://rpi-ip:9981
Go to Configuration -> TV Adapters . Select your DVB-T USB Device and go to Multiplexes.
Click on “Add mux(es) manually…” and add your DVB-T frequency (mine’s 754000KHZ). Leave all the rest on Auto. Click on Save changes.
Go to Services and introduce manually channel’s name and click on Save Changes.
You now have configured your channels!
Check at Channels tab.
11) Add Tvheadend to Videos
To add your channels to XBMC go to Videos -> Files -> Add videos -> Browse -> Zeroconf -> Tvheadend . Add them to Favorites if you want to.
12) Watch TV!
Easy huh? :]
P.S.: I wouldn’t done this without Stefan Saraev help, thank you!