Gentoo Linux VDR Guide
1.
General information to DVB
What is DVB?
DVB stands for Digital Video Broadcasting. DVB describes methods
to transfer digital data of TV, radio, interactive services like MHP, EPG and
teletext. Through data compression with MPEG-2, or H.264 for HDTV, it's
possible to transfer several channels on the same frequency. The more data
compression, the more channels can be transferred, but you pay it with quality
loss.
DVB can be transferred in several ways. The trailing letter identifies the
method of transfer, e.g. DVB-T for terrestrial transmission. There are
several more types:
- DVB-S for transmission over satellites
- DVB-C for transmission over cable
- DVB-H for transmission to mobile devices (terrestrial)
- DVB-IPI for transmission over IP based networks, e.g. internet
-
DVB-RC(S/C/T) return channel for the transmission of data services, e.g.
broadband internet
Types and requirement of DVB cards
Besides the different methods available to receive a DVB stream, the cards are
classified by their type of produced output. There are cards with a decoder
implemented which offer direct access to the stream by the device
/dev/video. These cards are full featured cards. Other
cards have no own decoder implemented and require a software decoder on the
computer and are budget cards. This implies higher system requirements.
Your computer's CPU should run at at least 600 MHz, and have at least 256MB of
RAM. This
list is useful for identifying your card.
2.
Preparing the system
Configuring the kernel
First, we must ensure that your kernel supports DVB and your DVB device. Since
kernel version 2.6 the necessary drivers are included. Check your kernel
configuration and make sure the following options are selected as a static
driver or as modules.
Code Listing 2.1: Required kernel options |
Input Device Support --->
* Event Interface
Device Drivers --->
Multimedia Devices --->
Digital Video Broadcasting Devices --->
[*] DVB For Linux
* DVB Core Support
M [Your driver]
|
Additionally we have to select the proper driver for your hardware. To find out
the right module for your card, we mark every driver as module. If you have a
PCI card, install pciutils if you haven't already. If you want built-in
drivers or you don't own a PCI card, skip this step and continue with Checking the kernel output.
Code Listing 2.2: Installing pciutils |
# emerge pciutils
|
After booting the new kernel, we run pcimodules to list the required
modules.
Code Listing 2.3: Listing the required modules |
# pcimodules
ohci-hcd
ehci-hcd
sis900
snd-emu10k1
b2c2-flexcop-pci
nvidia
nvidiafb
|
In this case we have to load the module b2c2-flexcop-pci. We add the
name to /etc/modules.autoload.d/kernel-2.6.
Code Listing 2.4: Adding the module name |
# echo b2c2-flexcop-pci >> /etc/modules.autoload.d/kernel-2.6
|
Checking the kernel output
It's recommended to mark every driver as module, so that you can add the
required module dynamically, especially if you don't know the module name. If
you already know the module name, select the driver as a built-in driver.
Compile the kernel, install the modules and boot it. You can check if your
kernel has successfully detected your card by using dmesg.
Code Listing 2.5: Checking kernel output |
# dmesg | grep DVB
DVB: registering new adaptor (TerraTec/qanu USB2.0 Highspeed DVB-T Receiver).
input: TerraTec/qanu USB2.0 Highspeed DVB-T Receiver remote control as /class/input/input2
|
3.
Installing VDR
To install VDR, we just emerge it.
Code Listing 3.1: Installing VDR |
# emerge vdr
|
Now continue with Installing the Remote Control.
4.
Installing the Remote Control
There are at least two ways to control VDR via an infrared remote control. If
your TV card has an onboard IR receiver you can use vdr-remote.
Otherwise, you most likely need to use LIRC.
Installing vdr-remote
We first install the plugin via emerge:
Code Listing 4.1: Installing vdr-remote |
# emerge vdr-remote
# eselect vdr-plugin enable remote
|
When using the remote plugin for the IR port on your DVB card everything should
be fine with the default config. It automatically uses the input device which
has "dvb" in its name. For more advanced uses take a look at
/etc/conf.d/vdr.remote.
Now, continue with Video Output Methods.
Alternative: installing LIRC
If your card can be remotely controlled (but you cannot or do not want to use
vdr-remote), you may wish to configure LIRC. LIRC interprets the pressed
keys and returns a name for each one. A program that supports LIRC waits for key
events and runs the action configured in the config file, mostly stored in the
config directory of the executing program (e.g. mplayer loads the file
~/.mplayer/lircrc). Before we install LIRC, you have to add
lirc to your USE flags and add an additional entry to
/etc/make.conf: LIRC_DEVICES. Use this list to find the proper
arguments for the option.
Code Listing 4.2: Installing LIRC |
# nano -w /etc/make.conf
LIRC_DEVICES="devinput"
USE="lirc"
# emerge lirc
|
At first we have to define each key code with a name. Most supported remote
controls are configured already, take a look at the remote list. Download the
required file and save it as /etc/lircd.conf. Now we have to find
out where to access your remote control. Run the following command to get a
list of the current input devices (make sure your device is running).
Code Listing 4.3: List of current input devices |
# cat /proc/bus/input/devices
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="TerraTec/qanu USB2.0 Highspeed DVB-T Receiver remote control"
P: Phys=usb-0000:00:1d.7-1/input0
S: Sysfs=/class/input/input2
H: Handlers=kbd event1
B: EV=100003
B: KEY=108fc210 2043 0 0 0 0 8000 2080 1 9e1680 0 0 ffc
|
In this case we have the Terratec Cinergy T2 device plugged in, so we can
access the device over /dev/input/event1. Replace event1
with the matching device in your output.
lircd needs to know the device to use. Add the following line to
/etc/conf.d/lirc.conf. Remember to replace devinput with
the name of your driver and event1 with the actual device.
Code Listing 4.4: Adding options to lircd |
LIRCD_OPTS="-H devinput -d /dev/input/event1"
|
It's time to start lircd:
Code Listing 4.5: Starting lircd |
# /etc/init.d/lircd start
|
Now it should be possible to watch lircd capturing and decoding key
presses. Just run the command irw. Stop it by pressing Ctrl+C when you
have enough.
Code Listing 4.6: Testing LIRC |
# irw
0000000000001aa2 00 Exit Technisat_TTS35AI.conf
0000000000001a8d 00 Mute Technisat_TTS35AI.conf
0000000000000a97 00 OK Technisat_TTS35AI.conf
0000000000000a97 01 OK Technisat_TTS35AI.conf
0000000000000a92 00 Menu Technisat_TTS35AI.conf
|
Next, add it to the default runlevel so that it starts automatically at boot.
Code Listing 4.7: Adding lircd to the default runlevel |
# rc-update add lircd default
|
To be able to use your remote control, you must enable LIRC support in VDR. Add
the following line to /etc/conf.d/vdr:
Code Listing 4.8: Enabling support for LIRC |
# nano -w /etc/conf.d/vdr
IR_CTRL="lirc"
|
5.
Video Output Methods
You now need to decide on one (and only one!) of the following video output
devices which show the picture and the overlayed On Screen Display (OSD).
Hardware decoding: full-featured DVB cards
Users of these expensive cards need not install anything else, so you may
continue with configuring your channel list.
Hardware decoding: DXR3/Hollywood+ cards
To use a DXR3 card for VDR output we need the vdr-dxr3 plugin.
Code Listing 5.1: Installing the plugin |
# emerge vdr-dxr3
# echo em8300 >> /etc/modules.autoload.d/kernel-2.6
|
The em8300 module need some configuration that depends on the exact revision of
that card.
Continue with configuring your channel list.
Hardware decoding: PVR350 cards
As PVR350 cards have an onboard MPEG-Decoder chip we want to make use of that.
We need to install the vdr-pvr350 plugin. If ivtv-driver is not
yet installed emerge will automatically install it for you. To have the ivtv
module loaded at boot we add it to
/etc/modules.autoload.d/kernel-2.6:
Code Listing 5.2: Installing PVR350-Plugin |
# emerge vdr-pvr350
# echo ivtv >> /etc/modules.autoload.d/kernel-2.6
|
Continue with configuring your channel list.
Software decoding: vdr-softdevice
To install it, we have to emerge vdr-softdevice. Don't forget
to enable the plugin.
Code Listing 5.3: Installing the softdevice plugin |
# emerge vdr-softdevice
# eselect vdr-plugin enable softdevice
|
To select the proper video and audio output, edit
/etc/conf.d/vdr.softdevice.
For now, we will only describe the shm ("shared memory") method. This is already
enabled in the installed config file (Setting SOFTDEVICE_VIDEO_OUT). Later you
need to start ShmClient to get a window showing the picture.
Note:
If you do not want to think about a separate keyboard layout for controlling
VDR, there are remote configuration files available at Matthias Schwarzott's
devspace. There
are files for softdevice/shm and xineliboutput (more coming). You will need the
relevant file to /etc/vdr/remote.conf and run chown vdr:vdr
on the file to get it working.
|
Continue with configuring your channel list.
Software decoding: vdr-xineliboutput
Some people prefer to use vdr-xineliboutput, because it can also work
remotely. We'll now teach you how to configure vdr-xineliboutput on your
host and client. First, the host setup:
Code Listing 5.4: Installing vdr-xineliboutput |
# emerge vdr-xineliboutput
# eselect vdr-plugin enable xineliboutput
|
Adding command line options at this point is crucial for xineliboutput to work.
For more options, see vdr --help.
Code Listing 5.5: Adding command line options to /etc/conf.d/vdr.xineliboutput |
_EXTRAOPTS="--local=none --remote=37890"
|
The next step is to edit /etc/vdr/svdrphosts.conf. This file
describes a number of host addresses that are allowed to connect to the SVDRP
port of the video disk recorder running on the host system.
Code Listing 5.6: Editing /etc/vdr/svdrphosts.conf |
127.0.0.1
192.168.1.0/24
#204.152.189.113
#0.0.0.0/0
|
If you only want to use vdr-xineliboutput to view the picture on the same
computer as the one running VDR you can continue with configuring your channel list.
Otherwise, you now simply emerge media-plugins/vdr-xineliboutput on your
client:
Code Listing 5.7: Client setup |
# emerge vdr-xineliboutput
|
Later (after having started VDR) you will use the command vdr-sxfe
xvdr://hostname to connect to VDR and view its picture and OSD.
Continue with configuring your channel list.
Note:
There is also a plugin which just simulates the existance of a real
output device (vdr-dummydevice) for some fancy uses like record-only
servers, but that is more advanced than a normal VDR setup.
|
6.
Creating a Channel List
To make VDR really useful you need to create an appropriate channel list. There
is more than one way to get a working list of channels (besides downloading
one). The channel list installed by default is for DVB-S reception on Astra on
19.2°E.
Using dvbscan from linuxtv-dvb-apps
Code Listing 6.1: Installing linuxtv-dvb-apps |
# emerge linuxtv-dvb-apps
|
Find the correct frequency list for your region and type of reception. These
files are stored under /usr/share/dvb/scan. For reception with
DVB-T in Germany, Region Nuernberg you need to use
/usr/share/dvb/scan/dvb-t/de-Nuernberg.
Code Listing 6.2: Scanning with dvbscan |
$ dvbscan -o vdr /usr/share/dvb/scan/dvb-t/de-Nuernberg > /etc/vdr/channels.conf
|
Using vdr-reelchannelscan
First, delete the contents of the existing channel list.
Code Listing 6.3: Cleaning old channel-list |
# rm /etc/vdr/channels.conf
|
Code Listing 6.4: Installing and activating vdr-reelchannelscan |
# emerge vdr-reelchannelscan
# eselect vdr-plugin enable reelchannelscan
|
Channels for systems using vdr-analogtv
You'll probably want to configure your channels at this point. The VDR project
provides you with some examples which can be found at
/usr/share/doc/vdr-analogtv-$version/examples/, as long as you've
installed >=media-plugins/vdr-analogtv-1.0.00-r1.
7.
Starting VDR
After having all basic software parts ready on the system you need to
configure VDR with its OSD.
If you use a hardware decoder for picture output you should switch on the
connected TV now. If you use software output the client for this must be started
after VDR.
First, you should learn your key definitions; that is, connecting keys on your
remote control to VDR's internal commands.
Note:
Just in case you need to edit the keyboard configuration, or (more likely) want
to delete it to go back to learning the keys: VDR stores its key-definitions in
/etc/vdr/remote.conf.
|
We begin with starting VDR:
Code Listing 7.1: Starting VDR |
# /etc/init.d/vdr start
* Preparing start of vdr:
* config files ... [ ok ]
* Waiting for prerequisites (devices nodes etc.) ... [ ok ]
* Starting vdr ... [ ok ]
* First start of vdr: No check for running vdr possible
* until control device (remote/keyboard) keys are learnt!
|
Note:
Users of software decoders should now start the client program that opens the
window to show the TV picture and the OSD.
|
Code Listing 7.2: Activating the software decoder for the client |
# ShmClient
# vdr-sxfe xvdr://hostname
|
The most useful keys for VDR are:
- Cursor keys (Left/Right/Up/Down)
- Menu/Exit/Ok
- Colors (Red/Green/Yellow/Blue)
- Number keys (0-9)
Important:
If you don't have many keys, make sure to assign these. (Some remotes have
Play/Pause/etc. on the same keys as the colors, so use them for the colors).
|
Now that the basic installation is over, you need to configure VDR. Switch to
your output screen and follow the on-screen instructions. VDR asks you to press
various keys on your remote control to learn the correct key codes. If you don't
own a remote control, you can use your keyboard.
Now you can add the VDR initscript to the default runlevel to get it started
every time your computer boots up.
Code Listing 7.3: Adding vdr to the default runlevel |
# rc-update add vdr default
|
8.
Troubleshooting
Note:
If you need any help, you can always ask someone in #gentoo-vdr, or look around on
our forums.
|
The contents of this document are licensed under the Creative Commons -
Attribution / Share Alike license.
|