Skip to content

VDR4Arch Installation (en_US)

CReimer edited this page Aug 7, 2015 · 26 revisions

Table of Contents

General

VDR4Arch is a ready to use binary repository for Arch Linux. Our main goal is to follow as many rules of the Arch Linux DeveloperWiki as possible.

Basic installation

There are more detailed instructions how to install Arch Linux in the Arch Linux Wiki. Here are just a few steps which are next to the x86 systems especially interesting for ARM systems.

Set Hostname (e.g. "vdr01")

 # echo vdr01 > /etc/hostname

Set timezone

 # ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
 # nano /etc/locale.gen

Remove the hash in front of 'en_US.UTF-8'

Generate locales

 # locale-gen

Set generated locale as default

 # echo 'LANG=de_DE.UTF-8' > /etc/locale.conf

Set keyboard layout permanently

 # echo 'KEYMAP=de' > /etc/vconsole.conf

Set the root password (There is no default password on x86 systems. On ARM systems the default passowrd is 'root')

 # passwd

And finally reboot the system

 # reboot

Installation of VDR4Arch

In the rebooted system we install vdr4arch-keyring first

 # pacman -S wget
 # wget http://creimer.net/vdr4arch/repo/vdr4arch-keyring-20130219-1-any.pkg.tar.xz
 # pacman -U vdr4arch-keyring-20130219-1-any.pkg.tar.xz

Especially on ARM systemd there might not be a default pacman-keyring. The postinstall script of the keyring packages asks to run the following commands

  1. pacman-key --init
  2. pacman-key --populate vdr4arch

To speed this process up it's recommended to run haveged, an entropy harvesting daemon.

On ARM systems this daemon is enabled by default and should be disabled after the above mentioned process.

  1. systemctl disable haveged

To enable the vdr4arch repository add the this to the end of /etc/pacman.conf.

 [vdr4arch]
 Server = http://creimer.net/vdr4arch/repos/$repo/os/$arch

Then we update the local package database

 # pacman -Sy

This command

 # pacman -Sl vdr4arch

lists the available packages.
For more details see the Packetlist

Output with VA-API/VDPAU

Preparation

Isn't the X server already started differently we can use xlogin.

 # pacman -S xlogin

The xlogin service has to be activated with the following command:

 # systemctl enable xlogin@vdr
Intel(VA-API)

First must the driver be installed:

 pacman -S xf86-video-intel

Afterwards must the X-Server be configured for use with VDR. The following new configuration file is needed:

 Section "Monitor"
   Identifier  "HDMI1"
   Modeline    "1920x1080_24"     74.230 1920 2560 2604 2752 1080 1084 1089 1125 +hsync +vsync
   Modeline    "1920x1080_50"    148.500 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync
   Modeline    "1920x1080_60"    148.500 1920 2008 2056 2200 1080 1084 1089 1125 +hsync +vsync
 EndSection
 
 Section "Extensions"
     Option         "Composite" "Disable"
 EndSection

To make sound working, we have to set the default ALSA output device in /etc/asound.conf

For Intel this config should work.

 pcm.!default {
   type hw
   card PCH
   device 7
 }

If sound still doesn't work, it's helpful to take a look at the device list.

For this we need alsa-utils

 # pacman -S alsa-utils

The list of sound devices can be get with the following command:

 # aplay -l
 **** List of PLAYBACK Hardware Devices ****
 card 0: PCH [HDA Intel PCH], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
 card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
 card 0: '''PCH''' [HDA Intel PCH], '''device 7''': HDMI 1 [HDMI 1]
   Subdevices: 1/1
   Subdevice #0: subdevice #0

With newer driver versions Intel got these ugly weathered colors. To fix this we need to install xorg-xrandr

 pacman -S xorg-xrandr

and add or edit the file /home/vdr/.xinitrc

 #!/usr/bin/bash
 xrandr --output HDMI1 --set "Broadcast RGB" "Full"
NVidia(VDPAU)

First must the driver be installed:

 pacman -S nvidia

Afterwards must the X-Server be configured for use with VDR. The following new configuration file is needed:



In rare occasions this file has to be expanded:

    Option         "DPI" "100x100"
    Option         "UseEdidDpi" "False"

For screens with wrong DPI data

    Option         "CustomEDID" "DFP-0:/etc/X11/edid.bin"

The above line loads a custom edid

The edid file can be generated with the following commands:

 # X -verbose 6 > /tmp/xlog 2>&1

The above command has to be terminated with Ctrl-C after about 5 seconds. Finally run the following command:

 # nvidia-xconfig --extract-edids-from-file=/tmp/xlog --extract-edids-output-file=/etc/X11/edid.bin

To make sound working, we have to set the default ALSA output device in /etc/asound.conf

In case of an nVidia graphic card this configuration should work:

 pcm.!default {
   type hw
   card NVidia
   device 7
 }

If sound still doesn't work, it's helpful to take a look at the device list.

For this we need alsa-utils

 # pacman -S alsa-utils

The list of sound devices can be get with the following command:

 # aplay -l
 **** List of PLAYBACK Hardware Devices ****
 card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
 card 0: '''NVidia''' [HDA NVidia], '''device 7''': HDMI 1 [HDMI 1]
   Subdevices: 0/1
   Subdevice #0: subdevice #0

Plugins

Softhddevice
 # pacman -S vdr-softhddevice

And activate it with a corresponding symlink.

 # cd /etc/vdr/conf.d
 # ln -s ../conf.avail/50-softhddevice.conf .
Xineliboutput (stand-alone VDR)
 # pacman -S vdr-xineliboutput xineliboutput-frontends

And activate it with a corresponding symlink.

 # cd /etc/vdr/conf.d
 # ln -s ../conf.avail/50-xineliboutput.conf .

Set --local=sxfe (or --local=fbfe) and --remote=none in /etc/vdr/conf.d/50-xineliboutput.conf

Xineliboutput (Client/Server)
Server
 # pacman -S vdr-xineliboutput

And activate it with a corresponding symlink.

 # cd /etc/vdr/conf.d
 # ln -s ../conf.avail/50-xineliboutput.conf .

Set --local=none and --remote=3789 in /etc/vdr/conf.d/50-xineliboutput.conf

Client

Install Xineliboutput frontends

 # pacman -S xineliboutput-frontends

To start vdr-sxfe frontend run:

 # vdr-sxfe <IP address of the server>

To start vdr-fbfe frontend run:

 # vdr-fbfe <IP address of the server>

Playback using Full-Featured DVB devices

 # pacman -S vdr

(vdr-dvbsddevice and vdr-dvbhddevice are part of the vdr package)

Create a symlink to the configuration file to activate the plugin:

 # cd /etc/vdr/conf.d
 # ln -s ../conf.avail/50-dvbhddevice.conf .

or for SD devices

 # ln -s ../conf.avail/50-dvbsddevice.conf .

The driver for the Technotrend S2-6400 has to be installed

 # pacman -S media-build-experimental-dkms

and loaded with

 # modprobe saa716x_ff

When the system is restarted, udev will load the driver automatically.

The installation of a dkms driver takes quite some time and unfortunately there's also a daemon necessary.

  1. systemctl enable dkms
  2. systemctl start dkms

The configuration of vdr is located in /etc/vdr/conf.avail and /etc/vdr/conf.d Configuration for the VDR core can be found in /etc/vdr/conf.d/10-vdr.conf

Plugins place their configuration in /etc/vdr/conf.avail. To activate a plugin, a symlink has to be made to /etc/vdr/conf.d Plugins are loaded in alphabetical order.

To be able to control VDR with the keyboard, the following configuration file has to be created: /etc/systemd/system/vdr.service.d/fullfeatured.conf

 [Service]
 StandardInput=tty
 TTYPath=/dev/tty8
 ExecStartPre=/usr/bin/chvt 8

Enable autostart of VDR:

 # systemctl enable vdr

Start VDR:

 # systemctl start vdr

Playback on the Raspberry Pi

 # pacman -S vdr-rpihddevice

Create a symlink to the configuration file to activate the plugin:

 # cd /etc/vdr/conf.d
 # ln -s ../conf.avail/50-rpihddevice.conf .

The configuration of vdr is located in /etc/vdr/conf.avail and /etc/vdr/conf.d Configuration for the VDR core can be found in /etc/vdr/conf.d/10-vdr.conf

Plugins place their configuration in /etc/vdr/conf.avail. To activate a plugin, a symlink has to be made to /etc/vdr/conf.d Plugins are loaded in alphabetical order.

In the file /boot/config.txt it's also recommended to increase the gpu_mem setting. It defaults to 64MB which is not enough for VDR.

The official kodi wiki recommend 128MB for a RaspberryPi 1 and 256MB for the RaspberryPi 2

 gpu_mem=256

The config.txt file is also the place in which the license codes for certain Codecs need to be set

 decode_MPG2=0x12345678
 decode_WVC1=0x12345678

(This is just an example. You can buy your own license codes here.)

To be able to control VDR with the keyboard, the following configuration file has to be created: /etc/systemd/system/vdr.service.d/fullfeatured.conf

 [Service]
 StandardInput=tty
 TTYPath=/dev/tty8
 ExecStartPre=/usr/bin/chvt 8
 ExecStartPre=/usr/bin/setterm --clear all --cursor off

Enable autostart of VDR:

 # systemctl enable vdr

Start VDR:

 # systemctl start vdr

Optional Configuration

Wait for the network

In case a plugin is not able to wait for for the network to be available, the following has to be altered:

In /etc/systemd/system/multi-user.target.wants/vdr.service.d the file 01-wait-for-net.conf has to be created:

 # mkdir -p /etc/systemd/system/multi-user.target.wants/vdr.service.d
 # nano /etc/systemd/system/multi-user.target.wants/vdr.service.d/01-wait-for-net.conf
 [Unit]
 After=network-online.target
 Wants=network-online.target

Additionally we have to edit the network configuration. Not all network handling daemons are able to detect if there's actually a working network connection. And as a result of that network-online.target doesn't always work as expected.

It's known to work with systemd-networkd and NetworkManager

Therefore it's recommended to use systemd-networkd. There's a really good documentation over at the Arch Wiki

Additionally a special daemon needs to be enabled.

 systemctl enable systemd-networkd-wait-online

For NetworkManager it is

 systemctl enable NetworkManager-wait-online

Safe shutdown with the power button

Usually systemd handles the powerbutton. Systemd triggers the shutdown if someone presses the powerbutton. Normally this is no big deal, but in case of vdr it is. VDR is only able to save the wakeup timer, if it also triggered the shutdown.

In case VDR triggers the shutdown: /usr/lib/vdr/bin/shutdown.sh gets started, it sets the wakeup timer and finally triggers the system shutdown. In case systemd triggers the shutdown: VDR receives a SIGTERM and terminates. Systemd continues the shutdown process (No wakeup timer was set)

vdrpbd inhibits systemd to take care of the powerbutton. Instead vdrpbd waits for the powerbutton event and tells VDR over svdrpsen, that the powerbutton was pressed.

To install vdrpbd:

 # pacman -S vdrpbd

To enable vdrpbd:

 # systemctl enable vdrpbd
 # systemctl start vdrpbd

Kodi

Start Kodi from within VDR

Create the following file /usr/lib/vdr/start_kodi

   kodi
 
   svdrpsend remo on
   svdrpsend plug graphlcd on
   svdrpsend plug softhddevice atta
 ) > /dev/null 2>&1 &

Disabling the output of another display like imonlcd, lcdproc or targavfd works exacly the same as the example above shows for graphlcd.

Afterwards add the following to /var/lib/vdr/commands.conf:

 Kodi: /usr/lib/vdr/start_kodi

Start VDR from withing Kodi

Wakeup with Kodi and VDR on the same system

VDR4Arch-Testing

 [vdr4arch]
 SigLevel = PackageRequired
 Server = http://creimer.net/vdr4arch/repos/stable

Switch back from VDR4Arch-Testing to VDR4Arch

At first. Remove

 [vdr4arch-next]
 SigLevel = PackageRequired
 Server = http://creimer.net/vdr4arch/repos/next

from /etc/pacman.conf

To start the actual downgrading process:

 pacman -Syuu (pay attention to the second "u")

Compile VDR4Arch

You need a running Arch Linux base installation on a virtual machine.

Install the developement environment

 # pacman -S base-devel

Install repo-make

 # pacman -U http://downloads.tuxfamily.org/repomake/repo-make-1.0.0-1-any.pkg.tar.xz

Clone PKGBUILDs

 # git clone https://github.com/CReimer/vdr4arch.git
 # cd vdr4arch

Start automatic build

 # repo-make

All binary packages will land in the subdirectory "repo"

Clone this wiki locally