UBUNTU/Installation

From VDR Wiki

Revision as of 09:09, 20 July 2006 by Rwall (Talk | contribs)
Jump to: navigation, search

Contents

Install and Configure VDR on Ubuntu

This article contains tips and advice for setting up VDR and plugins on Ubuntu. Ubuntu releases are based on snapshots of Debian Unstable; therefore the following may be of use to Debian users too. Indeed, later in this article we show how to compile bleading edge versions of the VDR packages from the Debian VDR and DVB Packaging Project.

Installing from Binary Packages

VDR has been available in the Ubuntu Universe repository since Warty.

This article assumes that you have installed Ubuntu Dapper and have installed and confirmed to be working a Linux compatible DVB device.

Before you can install VDR packages, you must first add the Universe repository to your Apt sources list. Now you can use Aptitude or Synaptic to search for available vdr packages.

Installing from Debian Package Sources

If you have a budget DVB card and need to use a software decoder plugin such as xinelibout or the DXR3 MPEG decoding device plugin, this section may be particularly useful to you.

Instead of simply installing the standard binary packages described above you can instead compile your own packages using Debian packaging tools and sources from the Debian VDR and DVB Packaging Project. This way you get a greater selection and more up to date versions of the VDR packages, plus easy package installation, setup, and if necessary removal.

First read [1] and then follow the instructions below.

  • Install svn-buildpackage and its dependencies. This lives in the Ubuntu Universe repository, so if you haven't already done so, add Universe to your sources.lst
richard@vito:~$ sudo aptitude install svn-buildpackage
Password:
Reading package lists... Done
...etc...
  • Tell svn-buildpackage where to put compiled packages and where to find source tarballs.
richard@vito:~$ echo "svn-override=buildArea=${HOME}/src/debian-vdr/build-area,origDir=${HOME}/src/debian-vdr/tarballs" > .svn-buildpackage.conf
  • Setup a folder to do the package building in.
richard@vito:~$ mkdir -p src/debian-vdr
richard@vito:~$ cd src/debian-vdr/
richard@vito:~/src/debian-vdr$
  • Check out the tarballs. There are alot of them and some are quite large, so this may take a long time.
richard@vito:~/src/debian-vdr$  svn co svn://svn.debian.org/svn/pkg-vdr-dvb/tarballs
A    tarballs/vdr-plugin-nordlichtsepg_0.8a.orig.tar.gz
A    tarballs/vdr-plugin-osdtest256_0.1.0.orig.tar.gz
A    tarballs/vdr-plugin-freecell_0.0.2.orig.tar.gz
A    tarballs/vdr-plugin-xine_0.7.9.orig.tar.gz
...etc...
  • Check out the debian build scripts.
richard@vito:~/src/debian-vdr$ svn co svn://svn.debian.org/svn/pkg-vdr-dvb/vdr/vdr/trunk vdr/vdr
A    vdr/vdr/debian
A    vdr/vdr/debian/control
A    vdr/vdr/debian/config-loader.sh
...etc...
  • Start compiling the package
richard@vito:~/src/debian-vdr$ cd vdr/vdr/
richard@vito:~/src/debian-vdr/vdr/vdr$ svn-buildpackage -rfakeroot -uc -us
Imported config directives:
        --svn-override=buildArea=/home/richard/src/debian-vdr/build-area,origDir=/home/richard/src/debian-vdr/tarballs
        trunkDir: /home/richard/src/debian-vdr/vdr/vdr
        trunkUrl: svn://svn.debian.org/svn/pkg-vdr-dvb/vdr/vdr/trunk
dpkg-checkbuilddeps
dpkg-checkbuilddeps: Unmet build dependencies: libcap-dev
Insufficient Build-Deps, stop!

You will very likely see something like this telling you that you need to install dependencies. So do that and retry.

richard@vito:~/src/debian-vdr/vdr/vdr$ sudo aptitude install libcap-dev
Password:
...etc...
  • If all went well, you should see...
...etc..
build command was successful; binaries are in /home/richard/src/debian-vdr/build-area/. The changes file is:
 /home/richard/src/debian-vdr/build-area/vdr_1.4.1-1_i386.changes
Binary packages:
 /home/richard/src/debian-vdr/build-area/vdr-dev_1.4.1-1_all.deb /home/richard/src/debian-vdr/build-area/vdr_1.4.1-1_i386.deb /home/richard/src/debian-vdr/build-area/vdr-plugin-sky_1.4.1-1_i386.deb /home/richard/src/debian-vdr/build-area/vdr-plugin-examples_1.4.1-1_i386.deb
rm -rf /home/richard/src/debian-vdr/build-area/vdr-1.4.1
richard@vito:~/src/debian-vdr/vdr/vdr$
  • Finally install the packages.
richard@vito:~/src/debian-vdr/vdr/vdr$ cd ../../build-area/
richard@vito:~/src/debian-vdr/build-area$ ls
vdr_1.4.1-1.diff.gz       vdr_1.4.1.orig.tar.gz
vdr_1.4.1-1.dsc           vdr-dev_1.4.1-1_all.deb
vdr_1.4.1-1_i386.changes  vdr-plugin-examples_1.4.1-1_i386.deb
vdr_1.4.1-1_i386.deb      vdr-plugin-sky_1.4.1-1_i386.deb
richard@vito:~/src/debian-vdr/build-area$ sudo dpkg -i vdr_1.4.1-1_i386.deb vdr-dev_1.4.1-1_all.deb
  • You will be prompted about:
    • DVB kernel modules (in my experience DVB modules are automatically loaded)
    • Default recordings directory (it recommends /var/lib/video.00 and asks to create it, I always say no and manually create a /srv/vdr folder, it's up to you)
    • Choose your card type

Configuring VDR

Before continuing, please read the following documents carefully:

richard@vito:~$ less /usr/share/doc/vdr/README
richard@vito:~$ less /usr/share/doc/vdr/README.Debian.gz
richard@vito:~$ less /usr/share/doc/vdr/INSTALL.gz

Also read, and have open the two VDR man pages:

richard@vito:~$ man vdr
richard@vito:~$ man 5 vdr

Having read all that, you are now ready to continue:

  • Try running vdr. The default Video directory is not writable by my user so while we are testing vdr we ask it to use /tmp for video files. You may see a message "please turn off UTF-8 before starting VDR". If so try defining the LANG environment variable:
richard@vito:~$ LANG=c vdr -v /tmp
vdr: error while reading '/var/lib/vdr/channels.conf'

You may see this error (at least I did) and it means that the channels.conf file is somehow corrupt. You need to update the channels.conf anyway; it must be tailored to your DVB type (ie DVB-C, DVB-S, DVB-T) and if you are using DVB-T the frequencies depend on your local transmitter. To make a channels.conf use the 'scan' commandline tool, which is part of the dvb-utils package. In my case (DVB-T in the Midlands, UK) I use:

richard@vito:~$ scan -o vdr /usr/share/doc/dvb-utils/examples/scan/dvb-t/uk-SuttonColdfield > /tmp/channels.conf
richard@vito:~$ sudo mv /tmp/channels.conf ./

...replace dvb-t/uk-SuttonColdfield with whatever is appropriate for your area.

Having done that, you should be able to run vdr from the command line.

richard@vito:~$ LANG="c" vdr -v /tmp
vdr: no primary device found - using first device!

...well it runs, but if you're using a budget card, it has no way of displaying the picture.

Before moving on, and now that we know that vdr is able to run, lets set it up to run as a daemon at startup. Open /etc/default/vdr in you editor of choice and add 'export LANG="c"' at the top and set ENABLED=1. Mine looks like this:

richard@vito:~$ sudo nano -w /etc/default/vdr
# /etc/default/vdr
#
# See also /usr/share/doc/README.Debian
#

export LANG="c"

# Change to 1 to enable vdr's init-script
ENABLED=1

# Change this to 1 if you want vdr to be able to shutdown the
# computer
ENABLE_SHUTDOWN=0

# Options that will be passed to vdr's commandline
# for example: OPTIONS="-w 15"
OPTIONS="-w 60"

VIDEO_DIR="/srv/vdr"

If you choose to use a different video directory than the one recommended at installation, you'll have to create it and change its owner to vdr:vdr.

richard@vito:~/src/debian-vdr/build-area$ sudo mkdir -p /srv/vdr
richard@vito:~/src/debian-vdr/build-area$ sudo chown -R vdr:vdr /srv/vdr

Now try starting the service

richard@vito:~$ sudo invoke-rc.d vdr start Starting Linux Video Disk Recorder: vdr
Searching for plugins (VDR 1.4.1/1.4.1):.

Use the 'ps' command to check its running and look at the syslog to see if there were any errors

richard@vito:~$ ps fax | tail | less -S
 8563 ?        Ss     0:00 /bin/bash /usr/sbin/runvdr -v /srv/vdr -c /var/lib/vd
 8574 ?        S      0:00  \_ /usr/bin/vdr-kbd -v /srv/vdr -c /var/lib/vdr -L /
 8575 ?        S      0:00      \_ /usr/bin/vdr-kbd -v /srv/vdr -c /var/lib/vdr
 8578 ?        S      0:02          \_ /usr/bin/vdr-kbd -v /srv/vdr -c /var/lib/
 8579 ?        RN     0:02          \_ /usr/bin/vdr-kbd -v /srv/vdr -c /var/lib/
richard@vito:~$ tail /var/log/syslog | less -S
Jul 19 16:10:34 vito vdr: [8739] found 1 video device
Jul 19 16:10:34 vito vdr: [8739] ERROR: invalid primary device number: 2
Jul 19 16:10:34 vito vdr: [8739] ERROR: no primary device found - using first de
Jul 19 16:10:34 vito vdr: [8739] setting primary device to 1
Jul 19 16:10:34 vito vdr: [8739] SVDRP listening on port 2001
Jul 19 16:10:34 vito vdr: [8739] setting current skin to "classic"
Jul 19 16:10:34 vito vdr: [8739] loading /var/lib/vdr/themes/classic-default.the
Jul 19 16:10:34 vito vdr: [8739] switching to channel 19
Jul 19 16:10:34 vito vdr: [8739] setting watchdog timer to 60 seconds
Jul 19 16:10:34 vito vdr: [8739] ERROR: no OSD provider available - using dummy
(END)

There are some errors reported but nothing fatal. From the 'ps' output you can see that the vdr daemon is being launched from another script called 'runvdr'. Amongst other things, this script searches for configuration data from /etc/default/vdr, searches for VDR plugins and related config data from /etc/vdr/plugins. In common with the original runvdr, it periodically checks that the vdr daemon is still running and tries to restart it if it has crashed.

If there is a problem with VDR running as a service, you will notice repeated entries in the syslog that say "restarting VDR". In this case double check that vdr will run directly from the command line and check that it will run as the "vdr" user by passing the -u vdr commandline option.

richard@vito:~$ sudo su
root@vito:/home/richard# LANG="c" vdr -v /srv/vdr -u vdr

TODO: More debugging tips.

Install and Configure VDR Plugins on Ubuntu

If you have chosen to compile packages from source (as described above) you may now want to compile some of the plugin packages in the same way. You will already have checked out all the original tarballs, so all that remains is to checkout the debian build scripts for each plugin that you are interested, compile with svn-buildpackage and install with dpkg.

You can see which plugins are available for compiling by listing the tarball folder or by browsing the websvn interface.

Having installed the plugin package you can configure it according to the generic information available in the README files in /usr/share/doc/vdr-plugin-* or elsewhere on this wiki.

I will give details of compiling the Xineliboutput plugin because it is one that I have some experience with and one that anyone using a budget DVB card should try. Other options for budget card users are:

  • vdr-plugin-dxr3: See Dxr3-plugin (If you have a DXR3 hardware MPEG decoder card)
  • vdr-plugin-softdevice: See Softdevice-plugin
  • vdr-plugin-streamdev: See Streamdev-plugin
  • vdr-plugin-xine: See Xine-plugin (note this different to the xineliboutput plugin below, although similar idea)

Compile and Install Xineliboutput Plugin

The Xineliboutput plugin allows you to render both DVB MPEG stream and the VDR OSD using libxine and processing power of your CPU. If you have a budget DVB card and your computer is powerful enough Xinelibout may be ideal for you. Additionally, it can stream the video and OSD across a LAN which allows you to setup a headless VDR server (using modest hardware) while the picture is displayed on and control is handled by one or more client machines elsewhere on the LAN.

Xineliboutput is not available in any of the Ubuntu repositories so we compile it from the latest Debian Package Sources as described above in the section Installing from Debian Package Sources. Briefly:

richard@vito:~/src/debian-vdr$ svn co svn://svn.debian.org/svn/pkg-vdr-dvb/vdr/vdr-plugin-xineliboutput/trunk vdr/vdr-plugin-xineliboutput
richard@vito:~/src/debian-vdr$ cd vdr/vdr-plugin-xineliboutput/
richard@vito:~/src/debian-vdr/vdr/vdr-plugin-xineliboutput$ svn-buildpackage -rfakeroot -uc -us
richard@vito:~/src/debian-vdr/vdr/vdr-plugin-xineliboutput$ cd ../../build-area/
richard@vito:~/src/debian-vdr/build-area$ ls *.deb
libxine-xvdr_0.99rc4-1_i386.deb
vdr_1.4.1-1_i386.deb
vdr-dev_1.4.1-1_all.deb
vdr-plugin-examples_1.4.1-1_i386.deb
vdr-plugin-sky_1.4.1-1_i386.deb
vdr-plugin-xineliboutput_0.99rc4-1_i386.deb
vdr-plugin-xineliboutput-fb_0.99rc4-1_i386.deb
vdr-plugin-xineliboutput-x_0.99rc4-1_i386.deb
xineliboutput-remote-fb_0.99rc4-1_i386.deb
xineliboutput-remote-x_0.99rc4-1_i386.deb
richard@vito:~/src/debian-vdr/build-area$ sudo dpkg -i *xine*.deb

This will install the vdr plugin plus the lightweight client apps for X11 and fb, plus a xine plugin which allows you to connect to the VDR stream from standard xine-ui.

Configure Xineliboutput Plugin and Player

If Xinelibout installed without problems, you now have to configure it.

  • First read the README files.
richard@vito:~$ less /usr/share/doc/vdr-plugin-xineliboutput/README.gz

All the information you need to configure the plugin is in that README and in the configuration file its self. Debian VDR Plugin configurations live in /etc/vdr/plugins. In this case:

richard@vito:~$ sudo nano -w /etc/vdr/plugins/plugin.xineliboutput.conf

For general information on installing and configuring this plugin see Xineliboutput-plugin.

Compile the Xine-ui Source Package to Enable VDR Keys

Using xine-ui gives you many features which are not available in the lightweight clients eg Zooming and allows you to easily switch to DVD playback with full menus.

Unfortunately the stock Ubuntu Dapper xine-ui is not compiled with the necessary --enable-vdr-keys flag which enables full control of VDR. But it is not difficult to recompile xine-ui from the source packages. First glance at this guide to recompiling Debian packages then follow these steps:

  • Install all build dependencies
richard@lazar:~/src/debian-xine/xine-ui-0.99.4$ sudo apt-get build-dep xine-ui
  • Download the xine-ui source package
richard@lazar:~/src/debian-xine/xine-ui-0.99.4$ apt-get source xine-ui
  • Update the debian/rules file
richard@lazar:~/src/debian-xine/xine-ui-0.99.4$ nano -w debian/rules
configure: configure-stamp
configure-stamp:
        dh_testdir
        ./configure --prefix=/usr --mandir=\$${prefix}/share/man \
                        --enable-vdr-keys \
...
  • Update the changelog file
richard@lazar:~/src/debian-xine/xine-ui-0.99.4$ dch --nmu
xine-ui (0.99.4-0ubuntu6.1) dapper; urgency=low

  * Non-maintainer upload.
  * Added --enable-vdr-keys
...
  • Build the package.
richard@lazar:~/src/debian-xine/xine-ui-0.99.4$ debuild -us -uc
  • And install
richard@lazar:~/src/debian-xine/xine-ui-0.99.4$ sudo dpkg -i ../xine-ui_0.99.4-0ubuntu6.1_i386.deb
Personal tools
Participate