VDR4Arch Installation (en_US)

Christopher Reimer edited this page Apr 25, 2018 · 21 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

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

 [vdr4arch]
 Server = https://c-reimer.de/vdr4arch/repos/$repo/os/$arch
 SigLevel = Never

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

If the X server isn't already started differently, you can use vdr-xorg.

 # pacman -S vdr-xorg

The package vdr-xorg extends the systemd-configuration for VDR, so an X server is started before starting 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

 #!/bin/bash
 (
   export DISPLAY=:0
   svdrpsend remo off
   svdrpsend plug graphlcd off
   svdrpsend plug softhddevice deta
 
   kodi
 
   svdrpsend remo on
   svdrpsend plug graphlcd on
   svdrpsend plug softhddevice atta
 ) > /dev/null 2>&1 &
and make it executable
chmod +x /usr/lib/vdr/start_kodi

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

Use Kodi as the main frontend

Using Kodi as the main frontend has many advantages over the VDR OSD and frontend. The media player capabilities of Kodi are far superior to VDR, so you may use your HTPC for much more media playing tasks than with plain VDR. The vdr4arch repository provides you with all the required stuff to have VDR as so-called PVR-Backend. Means that VDR runs completely in the background, providing Kodi with Live-TV and TV recordings.

Prerequisites to port an existing VDR system

To modify an existing VDR system to use Kodi as the main frontend, you should do some initial tasks:

  1. Uninstall all Skin plugins
  2. Uninstall the vdr-softhddevice Plugin
  3. Uninstall vdr-xorg
After doing so, reboot the machine and get sure VDR still runs in background without logging any errors to journal.

Getting Kodi connected with VDR

To get Kodi connected with VDR, you need two packages from vdr4arch:

  1. kodi-addon-pvr-vdr-vnsi
  2. vdr-vnsiserver
Enable both (PVR in Kodi and vnsiserver via symlink in /etc/vdr/conf.d) and Kodi should connect to your VDR daemon.

Autostarting Kodi on system startup

The easiest way to do so is the kodi-standalone-service package which is provided by the vdr4arch repository, but you can follow the Arch Wiki on that task: https://wiki.archlinux.org/index.php/Kodi#Autostarting_at_boot_or_ondemand If you decide to not use kodi-standalone-service, then please be sure to create the user, you run Kodi with, in the following way:

groupadd -g 420 kodi
useradd -c 'kodi user' -m -u 420 -g kodi -G audio,video,network,optical -d /var/lib/kodi -s /usr/bin/nologin kodi
It is required that you use 420 for both, UID and GID, as other packages in the vdr4arch repository depend on that.

Make Kodi set the wakeup time for recordings

To use ACPI to wake up the computer for recordings, you may use the "kodi-setwakeup" package. Just install this package and enter "kodi-setwakeup" as the "Wakeuptime command" in the Kodi configuration.

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"

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.