Installing TVHeadend on RPi2 with Arch Linux
I would like to receive Live-TV via DVB-T2 and stream it into my LAN. As streaming server I would like to use TVHeadend. In my setup, the DVB-T2 signal is received by an antenna, which is connected to an USB tuner, which in turn is connected to the RPi. The RPi is connected to the LAN and streams the Live-TV.
Often, Raspbian is used as OS for a RPi, but since I am a fan of Arch Linux I wanted to use this as basis for my server. For this project I use the ARM port of Arch Linux. In a nutshell, the following steps need to be executed:
- Install Arch Linux
- Configure Arch Linux (this includes setting a static ip address and enabling sudo - which is needed for the subsequent steps)
- Install Yaourt
- Install TVHeadend from AUR
- Configure TVHeadend and run it as service
I use an RPi model 2, but this instruction could also be used to install Arch Linux and TVHeadend on other computers with an ARM board. Just download the appropriate version of Arch Linux ARM and follow the corresponding installation guidelines for Arch Linux ARM.
This Gist only contains the steps to set up the TVHeadend server. Since the configuration of DVB-T2 in TVHeadend is depending on the country, it is not covered here. A good instruction for Germany is .
Since I was asked which hardware besides the RPi I am using: As USB TV tuner I use the DVBSky T330 receiver which is currently sold in a bundle with a small antenna. The USB receiver is recognized by Arch Linux ARM out-of-the-box. But it needs firmware moduls in addition. They can be downloaded from the manufacturers’ web site. After you went through the entire installation instruction below, just unzip the downloaded firmware archive and copy the
*.fw files via scp to the RPi to the directory
/lib/firmware. Reboot and you should be done.
Install Arch Linux on Raspberry Pi 2
According to the howto on , Arch Linux ARM will be installed on the RPi2. Replace sdX in the following instructions with the device name for the SD card as it appears on your computer.
Start fdisk to partition the SD card:
$ fdisk /dev/sdX
At the fdisk prompt, delete old partitions and create a new one:
o. This will clear out any partitions on the drive.
pto list partitions. There should be no partitions left.
1for the first partition on the drive, press ENTER to accept the default first sector, then type
+100Mfor the last sector.
cto set the first partition to type
W95 FAT32 (LBA).
2for the second partition on the drive, and then press ENTER twice to accept the default first and last sector.
- Write the partition table and exit by typing
Create and mount the FAT filesystem:
$ mkfs.vfat /dev/sdX1 $ mkdir boot $ sudo mount /dev/sdX1 boot
Create and mount the ext4 filesystem:
$ mkfs.ext4 /dev/sdX2 $ mkdir root $ sudo mount /dev/sdX2 root
Download and extract the root filesystem (as root, not via sudo):
$ wget http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz $ sudo bsdtar -xpf ArchLinuxARM-rpi-2-latest.tar.gz -C root $ sync
Move boot files to the first partition:
$ sudo cp -r root/boot/* boot/. $ sudo rm -rd root/boot/*
Unmount the two partitions:
$ sudo umount boot root
Configure Arch Linux on RPi2
Insert the SD card into the Raspberry Pi, connect ethernet, and apply 5V power. Use SSH to the IP address given to the board by your router. Login as the default user
alarm with password
alarm (the default root password is
$ ssh alarm@<ip-address>
Configure Pacman and upgrade system
Initialize the pacman keyring and populate the Arch Linux ARM package signing keys:
$ su $ pacman-key --init $ pacman-key --populate archlinuxarm
$ pacman -Syu
$ pacman -S sudo
$ nano /etc/sudoers
Remove the comment sign in front of the row
%wheel ALL=(ALL) ALL
Save the file (CTRL+O, ENTER) and exit (CTRL+X).
To allow user
alarm to use
sudo, add the user to group
$ gpasswd --add alarm wheel
Set static ip address
eth0 with your interface):
$ nano /etc/systemd/network/eth0.network
Add the lines (replace the ip addresses with your addresses):
Address=192.168.0.100/24 Gateway=192.168.0.1 DNS=192.168.0.1
Save the file (CTRL+O, ENTER) and exit (CTRL+X).
Set host name
$ nano /etc/hostname
Replace the default host name with your host name. Save the file (CTRL+O, ENTER) and exit (CTRL+X).
Reboot the system:
This installation instruction is taken from .
Login as default user via SSH (now, you have to use the static ip address of the RPi):
$ ssh alarm@<static-ip-address>
$ sudo pacman -S --needed base-devel git wget yajl
Download and make
$ git clone https://aur.archlinux.org/package-query.git $ cd package-query $ makepkg -si $ cd ..
Download and make Yaourt
$ git clone https://aur.archlinux.org/yaourt.git $ cd yaourt $ makepkg -si $ cd ..
Source code isn’t needed anymore:
$ sudo rm -rd yaourt package-query
Install and set up TVHeadend
Install TVHeadend (this takes a while):
$ yaourt -S tvheadend
Set up TVHeadend as service:
$ sudo systemctl enable tvheadend.service $ sudo systemctl start tvheadend.service
You should now be able to access the browser UI of TVHeadend via the URL
Have fun with TVHeadend!