Since a couple of weeks I've converted my Windows based HTPC completely to a Linux based HTPC. During this process, I've tried several DVB applications but because of HDTV and cardsharing, I found out that the Video Disk Recorder project is the one of the best application for DVB-viewing. But VDR is primary used for full DVB cards, while I got a budget card.
During this trial-and-error, it took me around 4 weeks (I could only work on it on several nights or in weekends) to get it completely working. But during a HDD crash I found out I had to do it again. Now I can get VDR up-and-running in a couple of hours.
For those who don't want to use Google, I made a tutorial how I setup VDR in combination with my DVB budget card. I use the following hardware configuration:
- Enclosure : Antec NSK2480 (PSU included)
- Motherboard: Abit A-N78HD with the Geforce 8200 IGP
- CPU : AMD Athlon(tm) 64 X2 Dual Core Processor 4200+
- Memory : Kingston ValueRAM 2 GB DDR2-800 Kit (CL5)
- DVD-drive : LG GGC-H20LRB (DVD-RW, Blu-Ray and HDDVD)
- Harddisk : Samsung SpinPoint T 500GB
- Budgetcard : Hauppauge WinTV NOVA-HD-S2
All this, is connected to a Samsung HD-Ready LCD-TV using the onboard HDMI connector with the nvidia closed sources drivers.
DISCLAIMER: First I want to make one thing very clear. While this HOWTO allows you to get VDR running, I won't go into detail how you can install the compilation suite or other programs or Linux itself. I personally think that Linux knowledge is important before you continue to use Linux as your OS or as your primary DVB frontend.
I use Xubuntu 8.04 X86 myself and network, sound and video was working before starting the use of VDR. For dependencies, I use Ubuntu based apt-get install commands to get it compiled. Be sure to check your own distribution for the correct locations and additional depencies. Furthermore, I use the location /usr/local/src as the default directory. You can offcourse use an other location.
Before starting with this tutorial, make sure your DVB-S or DVB-S2 card is up and running (read: detected by Linux). For the people who use a Hauppauge NOVA-S2-HD or HVR-4000, you can use my other tutorial for that. Also, Igor's repo seems to support S2-3200 based cards as well.
WARNING! When using VDR 1.7.0, you require the multiproto drivers and they must be downloaded installed! I use Igor's repo myself and this works with VDR 1.7.0. This tutorial works for DVB-S and DVB-S2 based budget cards and also DVB-S budget cards require multiproto, even if they don't use it!
All commands which are used here, can be run from a Terminal Session within XFCE, KDE or Gnome or through a SSH connection. With all commands posted here, make sure you are using sudo -s so that your are the user root.
My Xubuntu 8.04 Desktop installation is the X86 edition. While my CPU can run the AMD64 edition, I decided not to do this. Mainly since certain optimalisation isn't entirely complete. So I would reccommend to install the X86 edition for the time being.
1. Xine and FFMpeg
Currently there does not exist a Full DVB-S2 card. Because of this we need to use a software based output plugin with VDR. Since we're going to use xineliboutput, we need additional software up-and-running before we're going to compile VDR and the additional plugins. We're going to use FFMpeg and Xine for this.
apt-get install build-essential
apt-get install mercurial cvs subversion libncurses-dev
apt-get install autoconf libtool automake pkg-config gettext
apt-get install liba52-0.7.4-dev liblame-dev libvorbis-dev zlib1g-dev libpng12-dev libx11-dev libxv-dev libasound2-dev
apt-get build-dep ffmpeg
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk
./configure --prefix=/usr --enable-shared --enable-gpl --enable-postproc --enable-liba52 --enable-libmp3lame --enable-libvorbis --enable-pthreads --enable-swscale
Xine-Lib 1.2 CVS:
apt-get install libcdio-dev libvcdinfo-dev
hg clone http://hg.debian.org/hg/xine-lib/xine-lib-1.2
wget http://www8.mplayerhq.hu/MPlayer/releas ... 07.tar.bz2
tar xivf essential-20071007.tar.bz2
mv essential-20071007 /usr/local/lib/win32
ln -s /usr/local/lib/win32 /usr/local/lib/codecs
patch -p1 < ../xine-lib-1_2-ffmpeg.patch
./autogen.sh --prefix=/usr --with-external-ffmpeg --disable-dxr3 --enable-w32dll --with-w32-path=/usr/local/lib/win32
apt-get install libxt-dev
# WARNING! We're going to install LIRCD and with this you can configure your remote if you want it used through LIRCD
apt-get install lirc lirc-modules-source lirc-x liblircclient-dev
wget http://home.vrweb.de/~rnissl/xine-ui-cv ... 00.tar.bz2
tar xivf xine-ui-cvs-20080310200000.tar.bz2
./autogen.sh --prefix=/usr --enable-vdr-keys
To test Xine and the other items. You can run the command xine from a Terminal Session (or use ALT-F2 and type xine as the command). If all goes well, the Xine-UI session should now come up. Because you started it for the first time, you can setup some items. For the time being, just press OK. Next you might want to play some media-files to check if the playback function works allright.
2. VDR and plugins
Now that Xine and FFmpeg have been installed. We can start with VDR 1.7.0 and the plugins.
apt-get install libfreetype6-dev libfontconfig1-dev libjpeg62-dev libcap-dev libncurses5-dev libncursesw5-dev
tar xivf vdr-1.7.0.tar.bz2
wget http://www.linuxtv.org/pipermail/vdr/at ... t-0001.bin
mv attachment-0001.bin vdr-1.7.0-h264-syncearly-framespersec-audioindexer-fielddetection-speedup.diff.bz2
bzip2 -d vdr-1.7.0-h264-syncearly-framespersec-audioindexer-fielddetection-speedup.diff.bz2
patch -p1 < ../vdr-1.7.0-h264-syncearly-framespersec-audioindexer-fielddetection-speedup.diff
# WARNING! Edit Make.config and make sure the DVBDIR setting is correct for your configuration!
mkdir -p /usr/lib/vdr/plugins
mkdir -p /usr/lib/vdr/scripts
mkdir -p /etc/vdr/plugins
cp -a svdrpsend.pl /usr/bin
cp *.conf /etc/vdr/
Xineliboutput 1.02 CVS - software output plugin
apt-get install libextractor-dev
cvs -d:pserver:firstname.lastname@example.org:/cvsroot/xineliboutput login
cvs -z3 -d:pserver:email@example.com:/cvsroot/xineliboutput co -P vdr-xineliboutput
mv vdr-xineliboutput xineliboutput
mkdir -p /etc/vdr/plugins/xineliboutput
cp *.mpg /etc/vdr/plugins/xineliboutput/
sc TRUNK - softcam plugin
apt-get install libssl-dev
hg clone -r trunk http://188.8.131.52:6100/sc
mkdir -p /etc/vdr/plugins/sc
tar xivf CCcam.tar.bz2
OSD Teletext - Teletext plugin
wget http://www.wiesweg-online.de/linux/vdr/ ... -0.5.1.tgz
wget http://www.vdr-portal.de/board/attachme ... ntid=13339
mv attachment.php\?attachmentid\=13339 osdteletext-0.5.1-vdr-1.5.0.diff
tar xivf vdr-osdteletext-0.5.1.tgz
mv osdteletext-0.5.1 osdteletext
patch -p1 < ../osdteletext-0.5.1-vdr-1.5.0.diff
mkdir -p /vtx
Femon - Signal Information plugin
wget http://www.saunalahti.fi/~rahrenbe/vdr/ ... -1.6.1.tgz
tar xzvf vdr-femon-1.6.1.tgz
mv femon-1.6.1 femon
Bitstreamout - AC/3 output plugin
apt-get install libmad0-dev
wget http://heanet.dl.sourceforge.net/source ... 9c.tar.bz2
tar xivf vdr-bitstreamout-0.89c.tar.bz2
Remote - Remote plugin
wget http://www.escape-edv.de/endriss/vdr/vd ... -0.4.0.tgz
tar xzvf vdr-remote-0.4.0.tgz
mv remote-0.4.0 remote
sed -i Makefile -e 's/VDRVERSION/APIVERSION/g'
EnigmaNG - VDR Skin
wget http://andreas.vdr-developer.org/enigma ... -0.0.6.tgz
tar xivf vdr-skinenigmang-0.0.6.tgz
mv skinenigmang-0.0.6 skinenigmang
mkdir -p /etc/vdr/plugins/skinenigmang
wget http://andreas.vdr-developer.org/enigma ... 070702.tgz
wget http://andreas.vdr-developer.org/enigma ... 070702.tgz
wget http://andreas.vdr-developer.org/enigma ... 080225.tgz
tar xzvf skinenigmang-channellogos-xpm-hi-20070702.tgz
tar xzvf skinenigmang-channellogos-xpm-hi-20070702.tgz
tar xzvf skinenigmang-fonts-20080225.tgz
Skin Reel - VDR Skin
wget http://rsync16.de.gentoo.org/files/vdr- ... -0.0.1.tgz
tar xzvf vdr-skinreel-0.0.1.tgz
mv skinreel-0.0.1 skinreel
sed -i Makefile -e 's/VDRVERSION/APIVERSION/g'
cp -r skinreel /etc/vdr/plugins/
Since we now have VDR and the plugins installed. We can continue with the configuration of VDR and other items.
3.1. VDR and Plugins
With the command /usr/bin/vdr --help you get an overview of the options of VDR and it's plugins. This information is very important for configuring VDR or the plugins.
To make life easier, we installed the script /var/bin/runvdr which can be edited with for instance mcedit (apt-get install mc), nano or vi. I use the following configuration myself:
VDRCMD="/usr/bin/vdr -c /etc/vdr -E /var/vdr -l 3 \
-s /var/bin/vdrpoweroff.sh \
-P sc \
-P femon \
-P skinreel \
-P'xineliboutput -l none -r 37890 -p' \
-u root \
KILL="/usr/bin/killall -q -TERM"
# Detect whether the DVB driver is already loaded
# and return 0 if it *is* loaded, 1 if not:
# Load all DVB driver modules needed for your hardware:
# Unload all DVB driver modules loaded in LoadDriver():
# Load driver if it hasn't been loaded already:
if ! DriverLoaded; then
while (true) do
if test $? -eq 0 -o $? -eq 2; then exit; fi
echo "`date` reloading DVB driver"
echo "`date` restarting VDR"
Pay close attention to the -P items. Those are the plugins which we're going to use and with -P we enable them. Also look closely to for instance xineliboutput how we can add plugin specific options to the startup of VDR. Use the --help switch with the vdr binary, to get the overview off the options from VDR as well as the plugins.
One of the items which could be usefull, is the options with the remote plugin. Since I use the included Hauppauge remote, I use the input portion of the DVB driver. With the remote plugin I can call the input portion of the DVB driver. Since many DVB cards have are included with a remote, you can use the remote plugin to use that remote. To find out what the correct syntax is for the input location, you can do the following:
root@htpc:~# cd /dev/input/by-path/
root@htpc:/dev/input/by-path# ls -il
11787 lrwxrwxrwx 1 root root 9 2008-09-06 16:56 pci-0000:00:04.0-usb-0:2:1.3-event- -> ../event2
12213 lrwxrwxrwx 1 root root 9 2008-09-06 16:56 pci-0000:01:06.0--event-ir -> ../event7
12434 lrwxrwxrwx 1 root root 9 2008-09-06 16:56 pci-1-3--event-ir -> ../event8
11766 lrwxrwxrwx 1 root root 9 2008-09-06 16:56 platform-i8042-serio-0-event-kbd -> ../event1
11834 lrwxrwxrwx 1 root root 9 2008-09-06 16:56 platform-i8042-serio-1-event-mouse -> ../event6
11844 lrwxrwxrwx 1 root root 9 2008-09-06 16:56 platform-i8042-serio-1-mouse -> ../mouse1
11855 lrwxrwxrwx 1 root root 9 2008-09-06 16:56 platform-pcspkr-event-spkr -> ../event3
As you can see, my remote is linked to pci-0000:01:06.0--event-ir (or /dev/input/event7) and that's what I use as input for the -i switch with the remote plugin. I don't use the location /dev/input/event7 since this can change when you rmmod and insmod the drivers again. And the ID of the PCI device won't change, so that's propably safer to use.
You can also use the remote plugin to use the lircd driver instead of the input driver. The lircd daemon/driver is needed when we want to use for instance a MCE remote. When we compiled the xine-ui part, we installed the lircd portion and you (hopefully) your remote. If you did not, you can do it again with the command dpkg-reconfigure lirc-modules-source. You can then use the following line in runvdr for using the remote plugin with the lircd:
-P'remote -l /dev/lircd' \
As you can see in my signature, I have a Wavefrontier T55 and it's installed with 4 LNB's aiming on 19.2e, 13.0e, 23.5e, 28.2e and 28.5e. The LNB's are then connected to a DISEqC 1.0 switch which uses the AA till BB configuration for switching. To use DISEqC we need to do two things, mainly edit /etc/vdr/diseqc.conf and enable DISEqC in the VDR setup.
As an example, I use the following configuration with my DISEqC switch and DVB card:
# port 1 option a position a
# port 2 option a position b
# port 3 option b position a
# port 4 option b position b
# DISEQC 4/1 setting on TT S2-3200
# port 1
S19.2E 11700 V 9750 t v W15 [E0 10 38 F0] W100 [E0 10 38 F0] W100 [E0 11 00] W100 A W15 t
S19.2E 99999 V 10600 t v W15 [E0 10 38 F1] W100 [E0 10 38 F1] W100 [E0 11 00] W100 A W15 T
S19.2E 11700 H 9750 t V W15 [E0 10 38 F2] W100 [E0 10 38 F2] W100 [E0 11 00] W100 A W15 t
S19.2E 99999 H 10600 t V W15 [E0 10 38 F3] W100 [E0 10 38 F3] W100 [E0 11 00] W100 A W15 T
# port 2
S13.0E 11700 V 9750 t v W15 [E0 10 38 F4] W100 [E0 10 38 F4] W100 [E0 11 00] W100 B W15 t
S13.0E 99999 V 10600 t v W15 [E0 10 38 F5] W100 [E0 10 38 F5] W100 [E0 11 00] W100 B W15 T
S13.0E 11700 H 9750 t V W15 [E0 10 38 F6] W100 [E0 10 38 F6] W100 [E0 11 00] W100 B W15 t
S13.0E 99999 H 10600 t V W15 [E0 10 38 F7] W100 [E0 10 38 F7] W100 [E0 11 00] W100 B W15 T
# port 3
S23.5E 11700 V 9750 t v W15 [E0 10 38 F8] W100 [E0 10 38 F8] W100 [E0 11 00] W100 A W15 t
S23.5E 99999 V 10600 t v W15 [E0 10 38 F9] W100 [E0 10 38 F9] W100 [E0 11 00] W100 A W15 T
S23.5E 11700 H 9750 t V W15 [E0 10 38 FA] W100 [E0 10 38 FA] W100 [E0 11 00] W100 A W15 t
S23.5E 99999 H 10600 t V W15 [E0 10 38 FB] W100 [E0 10 38 FB] W100 [E0 11 00] W100 A W15 T
# port 4
S28.2E 11700 V 9750 t v W15 [E0 10 38 FC] W100 [E0 10 38 FC] W100 [E0 11 00] W100 B W15 t
S28.2E 99999 V 10600 t v W15 [E0 10 38 FD] W100 [E0 10 38 FD] W100 [E0 11 00] W100 B W15 T
S28.2E 11700 H 9750 t V W15 [E0 10 38 FE] W100 [E0 10 38 FE] W100 [E0 11 00] W100 B W15 t
S28.2E 99999 H 10600 t V W15 [E0 10 38 FF] W100 [E0 10 38 FF] W100 [E0 11 00] W100 B W15 T
S28.5E 11700 V 9750 t v W15 [E0 10 38 FC] W100 [E0 10 38 FC] W100 [E0 11 00] W100 B W15 t
S28.5E 99999 V 10600 t v W15 [E0 10 38 FD] W100 [E0 10 38 FD] W100 [E0 11 00] W100 B W15 T
S28.5E 11700 H 9750 t V W15 [E0 10 38 FE] W100 [E0 10 38 FE] W100 [E0 11 00] W100 B W15 t
S28.5E 99999 H 10600 t V W15 [E0 10 38 FF] W100 [E0 10 38 FF] W100 [E0 11 00] W100 B W15 T
While we can't enable DISEqC yet, you do this later when you have VDR running. To enable DISEqC within VDR, Press the configured Menu button -> Goto Setup -> Goto LNB -> Set the option Use DISEqC to Yes -> Acknowledge with the configured OK button.
3.3. CCcam and the sc plugin
When you installed the sc plugin, you also installed some of my scripts and certain binaries to get CCcam running. To make one thing clearly, CCcam on Linux/X86 requires a preload so that the sc plugin can read/write the data to unlock the channel.
To make your (and mine ;) ) life easier, I created a init.d script called cccam (/etc/init.d/cccam) which has the options: start (start CCcam), stop (stop CCcam) and restart (restart CCcam) -> Example: /etc/init.d/cccam start. With this script the preload will be done automaticly and it infact starts the /var/bin/run.sh script which then compiles the preload file and starts CCcam in debug mode. WARNING! Never run the CCcam.x86 binary, use the run.sh script instead!
Also, before starting VDR, make sure you have the CCcam instance running. It can take a while before the CCcam run is completed. Configuring CCcam can be done using the file /var/etc/CCcam.cfg.
When we installed the sc plugin, you may have notices you also downloaded a file called cardclient.conf (full location: /etc/vdr/plugins/sc/cardclient.conf). This configuration file is allready configured for use with CCcam. All CAID's from VDR will be put through CCcam with the current config. You can also edit the file and add newcamd, gbox, camd3, etc connections as well. Just remember, the priority is based upon the location. The 1st line is the 1st to be checked if it can open the channel.
The default channels.conf is a bit empty, only some FTA channels from Astra 19.2e are there. If you want to add other channels and or sats, you can use the pre-scanned files from the Linowsat Settings VDR channels.conf page. With wget or a browser you can download the files. If you want to add multiple sats, be sure to download the file you want and cat it to the channels.conf (example: cat all.conf >> /var/etc/channels.conf).
The channels.conf itself, is just plain text file. So you can edit it with an editor and change it to your liking. Just make sure you have shutdown VDR before editing the file, otherwise your contributions will be overwritten. Items starting with :-> are infact bouquets names. With the config from linowsat, it's been set on the transponder and satellite. But offcourse you can add your own bouquet and change it for instance the provider.
To go through the bouquets, just watch a channel and press the button which is configured for left and right. When you are at your wanted bouquet, simply press the configured button for OK and it will change to the first channel in the bouqet.
3.5. Running VDR
If you have configured the runvdr script, we can now start VDR. Also for your convinience I made a init.d script called vdr (full location: /etc/init.d/vdr). With the options start, stop and restart you can start, stop or restart the VDR process. The output of VDR is being written to the file /var/log/user.log. So if it fails, be sure to check that file for information about the error.
Since we use the xineliboutput plugin, we use the vdr-sxfe frontend to watch the VDR output. Before starting vdr-sxfe, you might want to edit the /etc/vdr/svdrphosts.conf file to include your network configuration.
To start vdr-sxfe, simply login into your X-session and when the desktop is shown, open a Terminal Session and type the following:
vdr-sxfe --video=xv --aspect=16:9 --fullscreen --width=1280 --height=720 --nokbd --post=tvtime:method=Linear,cheap_mode=1,pulldown=0,use_progressive_frame_flag=1
With the above option the vdr-sxfe binary will start. You can change the width and height to your liking (I have my system configured for 1280x720@60Hz). Ultimately you can use a frontend like oxine or Linux MMS to start vdr-sxfe. But to be honest, this is outside of this tutorial ;)
When you start VDR for the first time, you'll need to configure your remote. Just press any key of the remote and follow the onscreen information. It's rather easy to understand and to setup your remote.
4. Some last words and knowhow
VDR is extremely flexible and can be expanded with a lot of plugins. I helped you with the plugins I think will be used the most. Just to make sure, most of the plugins have the option to be configured within VDR. To do this, press the button which is configured for Menu, goto Setup, select plugins and select the plugin you want to configure.
One important thing is, that options set within VDR must be applied by pressing the button which is configured for OK. If you don't do this, your changes will be reset to the original values.
If people encounter problems when viewing HDTV channels or if you can't lock onto a channel. The easiest way to check this, is to see if you get EPG information. If not, check the modulation and settings of the DVB-S2 transponder by going to the channellist, select your channel and press the Red button (edit). Edit the transponder information with the help of the kingofsat.net satellite information. Also, it can take a while before VDR changes the CAID's and that the sc plugin pick them up. Just be patient and eventually the channel will open (if you have correct subscription).
Concerning HDTV, with the following options you can modify the behaviour of ffmpeg when viewing h264 streams. Change these options in $HOME/.xine/config with the editor of your choice. Be sure to shutdown vdr-sxfe and VDR before changing.
# number of cores you have in your system:
Anyway, I hope you like this tutorial. And many thanks to several people, especially cr0w! If you do like this tutorial, please use the Thanks button in this thread!