Home
- Startseite
Linux (english)
- AAM with hdparm
- CapiSuite
- VDR
- LTTng usage examples
Diverses
- Vallox KWL Steuerung
- Golf V Plus Autoradioausbau
Privat
- Über mich
- Links
Infos
- Impressum
Building a SUSE-based Linux VDR (analog TV)

Sorry an die deutschen Leser, aber die Linux-Seiten sind nur auf englisch vorhanden...

Analog VDR Howto for SUSE Linux

Version 0.1b for VDR 1.3.36 on SUSE Linux 10.0, latest update: Jan. 2007

TOC

Introduction

Currently, I'm building my own Video Disk Recorder based on Klaus Schmidinger's nice program and on SUSE Linux. This page contains a small HowTo and also some SUSE RPM packages of VDR, plugins and addons I built.

The HowTo describes the setup of an analog VDR on a SUSE Linux 10.0 system. In difference to other similar sites, e.g. the really nice description of Hubertus Sandmann (german), this page is targeted for experienced SUSE users. The main idea is to guide you through the necessary steps quickly without presenting too much background information. Also, not much hints about debugging are given. However, I try to do steps in a natural order and inserted many testing points to assure that everything works. This allows you to search for the needed information bit in the net as soon as a problem occurs. In addition, this HowTo tries to do things in the SUSE way - e.g. no sources will be compiled, but only prepared RPM packages are installed which gives you a clean, maintainable system.

If you're interested in more background information about VDR, there's a lot of helpful material available on the net, e.g. on the following pages. Many hints about how to solve specific problems are also available there.

For those of you who read several howtos before, here's a short feature list what works for me and what not:

PVR350 as only input and output device
(i.e. true analog VDR):
WORKING
Analog EPG:SOMEHOW WORKING ;-) (see below)
Playing DVDs:NOT WORKING, USE NATIVE TOOLS
Recording DVDs:WORKING

Downloads

SUSE only provides basic RPM packages for the VDR. As I need additional plugins and software, I created some own RPMs and recompiled others for SUSE 10.0. They are all available in my OpenSUSE build service repository. Unfortunately, those packages also require a specific VDR version - and as SUSE continuously updates their packages, my packages don't work correctly with the newest packages from them. So I also provided a copy of the old 1.3.36 version I used there.

Hardware

I use the following hardware for my VDR (bought in November 2005):

All of these components are in Germany e.g. available from Alternate or MIX Computer and did cost roughly 550 Euros altogether.

So far, I'm quite fine with my selection, the only bad thing is that the fans are quite loud in the first ten seconds after Power On. Later on, the machine is quite silent.

Software Overview

This HowTo describes setting up an analog Video Disk Recorder using the following software packages (among many others):

  • SUSE Linux 10.0
  • VDR 1.3.36
  • VDR plugins: pvr350, pvrinput, burn
  • nvram-wakeup (CVS snapshot from 2005-11-27)

Basic installation

Start with a normale installation of SUSE 10.0 with the "minimal with X" selection. I used a small partition for the OS (4 GB), 1.5 GB for Swap and the rest (238 GB) for videos, mounted to /var/spool/video. Applying the latest online updates after the installation is always a good idea.

In addition to the package selection of SUSE, I installed ivtv, km_ivtv, mc, unzip, strace and sudo.

Many nice multimedia packages for SUSE can be found on Packman. I strongly recommend that you add Packman as installation source to YaST:

  • Start YaST, go to Software/Change Installation Source, Choose "Add"
  • Use some of the packman mirrors listed in ftp://packman.links2linux.de/pub/packman/MIRRORS, e.g. http://mirror.geht-schon.de//packman.links2linux.de/suse/10.0
  • Finish the dialog

Now you should install an MPEG player, e.g. MPlayer which is needed later on for tests. Pay attention that you get the version from Packman (pm), not the SUSE version as the latter has many important features disabled due to legal reasons.

The PVR 350 TV card should be automatically found and installed during the SUSE installation. However, the firmware for the MPEG encoder and decoder of the card is missing. Background information about the Firmare can be found in the IVTV project Wiki.

There are two ways to extract the firmware: using the version from the product CD (not recommended, gave me stability problems) and downloading the packages:

To install the versions from the CD, follow these steps (NOT RECOMMENDED):

  • copy HcwFalcn.rom from the CD to /usr/lib/hotplug/firmware/ivtv-fw-enc.bin
  • download http://dl.ivtvdriver.org/ivtv/stable/ivtv-0.4.0.tar.gz
  • extract ivtvfwextract.pl from ivtv-0.4.0 package
  • change $fw_driver_name from hcwpvrp2.sys to hcwPVRP2.sys in Perl script
  • ./ivtvfwextract.pl --no-unzip /media/dvdrecorder/hcwPVRP2.sys
  • mv /lib/modules/ivtv-fw-* /usr/lib/hotplug/firmware/
  • --> We should now have ivtv-fw-dec.bin and ivtv-fw-enc.bin

To use the recommended versions from the net:

  • download ftp://ftp.shspvr.com/download/wintv-pvr_250-350/win9x-2k-xp_mpeg_wdm_drv/pvr48wdm_1.8.22037.exe
  • download ftp://ftp.shspvr.com/download/wintv-pvr_250-350/inf/pvr_1.18.21.22254_inf.zip
  • download http://dl.ivtvdriver.org/ivtv/stable/ivtv-0.4.0.tar.gz
  • extract ivtvfwextract.pl from ivtv-0.4.0 package
  • ./ivtvfwextract.pl pvr48wdm_1.8.22037.exe
  • mv /lib/modules/ivtv-fw-* /usr/lib/hotplug/firmware/
  • --> We should now have ivtv-fw-dec.bin and ivtv-fw-enc.bin

Now it's time for a first test of the card:

  • extract the ivtv-0.4.0 package downloaded above, cd utils/ivtv-tune, make
  • ivtvctl -u 0xff -p4
  • ./ivtv-tune -c2 -d/dev/video0
  • cat /dev/video0 > test.mpg
  • Check if test.mpg has a size greater 0
  • watch test.mpg with some video player with MPEG support, e.g. mplayer, you should either see some TV picture (if you connected the antenna cable to the PVR card and ivtv-tune selected a valid channel accidentaly) or at least some noise

Basic VDR installation

SUSE 10.0 already contains packages of the stable (1.2.x) and experimental (1.3.x) trees of VDR. However, as I chose to use the experimental series, I also decided to upgrade the packages to the latest state available in the supplementary tree for SUSE 10.0. Please note: If you want to use my other RPMs you have to use the old VDR 1.3.36 I used to build them. You can also find it in my download area.

I packaged all VDR plugins described here into an RPM package which can be found in my download area. Install the vdr13-plugins package now. Two plugins are especially important now: pvrinput, which allows VDR to use an analog card as input device (normally VDR supports digital DVB receivers only) and pvr350 which makes the PVR card also available as output device to your VDR.

There are also other plugins one could use, e.g. the analogtv plugin, but due to a seemingly stalled development of this plugin, I decided to use pvrinput instead. As noted above, the Wikis will give you much more background information on these things.

So let's now continue with practical work. Some basic configuration is needed before VDR can be started in /etc/sysconfig/vdr13:

  • add "pvr350 pvrinput" to VDR_PLUGINS
  • set VDR_RELOADDVB=no

Ok, now it's time for the first real test! Connect your PVR card output to the SCART input of your TV, connect your antenna cable to the PVR and do:

  • modprobe ivtv
  • modprobe ivtv_fb
  • rcvdr13 start

With some good luck, you should see the VDR menu on your screen. You can also switch to your virtual console 9 (Ctrl-Alt-F9) and try to navigate through On Screen Menus (m enters menu, x enters setup menu, cursor keys allow to navigate). If something goes wrong (chances are high... :( ), check /var/log/messages which hopefully gives you an idea of the reasons. It's ok that there's no TV picture available yet, only noise as we didn't setup the TV channels so far.

If all went well so far, we now need to setup the channels.conf file which is a quite worksome task as you have to enter all channels and frequencies manually. The examples given on the Channels.conf_analog page of the VDR-Wiki and the template /usr/share/doc/packages/vdr13/plugins/pvrinput/channels.conf.example should provide a good starting point. When you finished your channels.conf, copy it to /etc/vdr13 and restart VDR (rcvdr13 restart). Now again switch to Console 9 and try to switch between the channels.

Now switching channels with your keyboard isn't that comfortable. Let's setup the remote control which came with your PVR350:

  • connect the IR receiver to your PVR card
  • cp /usr/share/lirc/remotes/hauppauge/lircd.conf.hauppauge /etc/lircd.conf
  • edit lircd.conf, remove all remote sections beside Hauppauge_350
  • edit /etc/sysconfig/lirc, set LIRC_MODULE to "lirc_i2c"
  • rclirc start
  • start "irw" and try to press the buttons on your remote you should see an output on each keypress
  • (re)start VDR, it should display instructions how to setup your remote control
  • follow the instructions and be patient, esp. the first step takes a long time

To save your settings for the next reboot, you should now add the following lines to /etc/modprobe.conf.local

alias char-major-61 lirc_i2c
install ivtv /sbin/modprobe --ignore-install ivtv && /sbin/modprobe ivtv_fb
Now activate the services permanently:
insserv lirc
insserv vdr13

Reboot and test if all things still work.

Congratulations! The most complicated stuff is done and you can already start recording and playing back your first videos. There's still some work waiting for you, but the rest should be somehow smoother hopefully.

Polishing VDR setup

Boot times

First of all, let's improve the boot and shutdown times of your shiny, new VDR:

  • set "timeout" to "2" in /boot/grub/menu.lst
  • remove "resume=..." and "splash=..." parameters of kernel lines
  • run YaST, System -> Runlevel Editor
  • disable all services besides the following:
    boot.cleanup
    boot.clock
    boot.coldplug
    boot.ipconfig
    boot.klog
    boot.localfs
    boot.localnet
    boot.proc
    boot.rootfsck
    boot.shm
    boot.swap
    boot.udev
    cron    
    earlykbd
    earlysyslog
    kbd 
    lirc
    network
    sshd
    syslog
    vdr13
    

Note: It seems that ivtv_fb will destroy your console output *if* your console is not running on a framebuffer device already. So you should NOT remove the "vga=..." parameter of the Linux kernel. If you want to reduce the resolution so it also works with the Video output on your TV, please use 0x311 instead.

Auto power on/off

For a real VDR, it should also be possible to turn it on and off with your remote control. Also, one would expect a video recorder to be able to turn itself on without user interaction for unattended recordings.

Unfortunately, turning on your VDR with the remote control needs additional hardware - for an overview of available solutions see the VDR Wiki again. These solutions are out of the scope of this HowTo for the moment, as I found no time to implement one.

The other two features, however, just need some installation and configuration work as modern BIOSes support software-controlled Power Off and Power On. For powering on your PC at a certain time, basically two solutions are available: ACPI controlled alaram clock and NVRAM controlled alarm clock. As the ACPI implementations currently only support setting a time at which your PC will be waked up every day, I decided to go for the NVRAM-based solution.

To get this up and running, install my nvram-wakeup package from my download section (see above). To configure it:

  • start "visudo", add the following lines at the end of the sudoers file:
    vdr   ALL=NOPASSWD: /sbin/halt
    vdr   ALL=NOPASSWD: /sbin/reboot
    vdr   ALL=NOPASSWD: /sbin/modprobe nvram
    vdr   ALL=NOPASSWD: /usr/bin/nvram-wakeup
    vdr   ALL=NOPASSWD: /usr/sbin/grubonce
    
  • follow the instructions in the nvram-wakeup README; for me simply calling "nvram-wakeup -D" worked
  • follow the instructions in README.boot; for me it is necessary to reboot the machine ("first problem") :-(
  • If you need to reboot, add the following section to /boot/grub/menu.lst
    title Shutdown
        halt
    
  • set VDR_SHUTDOWN_SCRIPT in /etc/sysconfig/vdr13 to "/usr/bin/vdr13shutdown"

Now do a final test by programming some times which is more than 10 minutes in the future, turn your VDR off with your remote control and see if it turns on automatically in time.

Analog EPG

The described solution is pretty fragile and needs some manual tweaking. It's not recommended for unexperienced users!

One nice thing on digital video recorders is that they are able to receive an Electronic Program Guide and allow you to easily use it for programming your videos, see what is running on all your channels currently without switching around etc. In DVB, this is already a part of the standard and works out of the box.

For an anlog VDR, however, things are a little bit more complicated. There are quite some VDR EPG plugins available (again, please see the VDR Wiki EPG page for an overview), but all of them require either DVB or a permanent network connection for your VDR to download an EPG from the Internet. I personally like my VDR to be a standalone device and so I found NextviewEPG - a Linux (GUI :-( ) tool which receives the Nextview EPG stream sent on some TV stations along with the Videotext. For Germany, the TV station "Kabel1" transmits a quite usable Nextview EPG. So I started to integrate some patches in my VDR packages to support reception of this EPG.

The following sections present a short setup description for an automatically updating EPG.

First of all, please read my Nextview article in the VDR Wiki. (only available in German yet, sorry...) completely (without following the described steps yet). If you setup the VDR according to my description above, you don't need to recompile anything as my RPMs already contain the described pvrinput patch.

Now follow the steps given in the article in the section "manueller Weg ohne analogtv-Plugin" to prepare the NextviewEPG tool for reception of the EPG. You'll have to download the xmltv2vdr tool manually as described there as it's not contained in SUSE or my RPM packages. Store it to /var/spool/video/xmltv2vdr.pl as the patched pvrinput plugin will expect it there.

Now, proceed to the pvrinput setup menu to define your EPG-transmitting TV station(s).

Then, try to call "Load EPG now" and wait for its completion. If it doesn't return in a reasonable time frame (i.e. about half an hour per defined EPG TV station), nextviewepg probably couldn't receive because you selected the wrong TV station(s) or one of the stations has problems in EPG transmission (which unfortunately seems to occur from time to time).

If the last step worked, you can modify your /usr/bin/vdr13shutdown script to do an EPG update automatically each 3 days during VDR shutdown. You can find a ready vdr13shutdown example script here. It requires also a helper script /usr/bin/vdr13shutdown.epg which you should also download and save to your VDR machine.

Burning Video DVDs

The VDR plugin burn (see the VDR Wiki Burn-plugin page) provides a comfortable OSD-controlled way to write Video DVDs. It supports four supported disc formats: Video DVDs with menu and without menu, so called DMH-archive DVDs (Video DVD compliant recording with additional control data for VDR) and VDR archive DVDs (not Video DVD compliant). I do only write normal Video DVDs (with/without menus), so I didn't test the other two formats yet.

Activating the burn-plugin is quite straight-forward if you use my vdr-plugins package: just add "burn" to VDR_PLUGINS in /etc/sysconfig/vdr13 and restart the VDR (Menu > Settings > Restart). Now you should get a new main menu entry which allows to write Video DVDs. Check /usr/share/doc/packages/vdr13/plugins/burn/README for details.

However, please note that you should change the settings in the OSD settings menu of burn (Menu > Settings > Plugins > burn) before you can use it:

  • choose "ProjectX" as Demultiplexer
  • choose "transcode" as shrinking tool
  • choose "no" for "Offer DMH-archive"
  • choose "no" for "DMH-archive"

If you use these settings, all necessary tools for burn should've been installed by the dependencies of my vdr-plugins package.

Playing DVDs (and other media) with xine

I really invested a lot of time in trying to have video DVDs played by the VDR - however, I didn't succeed. The big problem is that the PVR350 TV card doesn't support the AC3 audio streams of commercial Video DVDs. There seems to be no ready and working solution available to have them converted to a supported format during playback. Neither mplayer support did really work for me nor the DVD plugin for VDR.

Therefore, I now gave up on this matter. I finally tried a quick'n'dirty solution by using the TV out of the onboard graphics card instead of the PVR350 video out for playing DVDs. This worked more or less out-of-the-box with xine as video player. Just for the sake of completeness, here are the steps I followed to get it working - however please note that this is not integrated in the VDR in any way but just runs in parallel on the same machine.

  • Connect the TV out of the graphics card (Intel 82865G) to the TV (I used the S-Video input)
  • Connect the audio output of the PC to some speaker or your hi-fi system
  • install xine, kdebase3-SuSE, kdebase3-kdm
  • connect a USB keyboard and a USB mouse to the machine
  • configure an X desktop with 800x600 pixels in sax2 (this gave me the smallest black frame around the picture)
  • add xine to /etc/X11/twm/system.twmrc
  • add "RandomPlacement" to /etc/X11/twm/system.twmrc
  • configure auto-login in YaST for some user (user/groups module)
  • rm /home/<user>/.xsessionrc
  • login manually with session twm, check that ~user/.dmrc contains twm
  • mv ~user/.xinitrc* ~user/.xinitrc
  • add "xine -f &" to .xinitrc (shortly before start of WINDOWMANAGER)
  • remove "devmgr" and "resmgr" lines from /etc/pam.d/* to leave video dev files with original rights
  • make the chosen user a member of group "audio" (YaST user/groups module)
  • remove "noauto" from the dvdrecorder line in /etc/fstab

Drawbacks of the described solution:

  • black frame around the picture (I didn't check X manuals yet if this can be disabled)
  • xine has to be controlled with a USB mouse (I didn't check LIRC integration into xine yet
  • no VDR integration; i.e. extra video and audio inputs required, VDR might decide to turn off machine due to inactivity, etc.

© 2002-9 Gernot Hillier
letzte Änderung: 2021-11-07 20:47:08
Valid XHTML 1.0!Valid CSS!