Difference between pages "Strace: what a process does" and "Watch digital TV with VDR and a streaming client"

From Linuxintro
(Difference between pages)
imported>ThorstenStaerk
 
imported>Fmherschel
 
Line 1: Line 1:
So you have a process that is crashing or misbehaving and you found the tool strace to tell you what the process does. However you don't understand its output? Then this article is for you.
+
=== Introduction ===
 +
This article describes some aspects to setup an enviroment with a VDR server and a xine stream client.
  
= starting strace =
+
Here typically should be the obligatory screenshot of my desktop showing the running stream - I add that later on :)
You can start a new process with strace or you can attach strace to an already running process. To start a new process just put strace in front of its command:
 
strace <abbr title="print the first 99 characters of every output string">-s 99</abbr> <abbr title="follow child processes">-ff</abbr> <abbr title="command that you want to execute and trace">ls</abbr>
 
To attach strace to an already running process, in this example firefox, find out the process' id:
 
# ps -A | grep firefox
 
2728 pts/1    00:00:02 firefox
 
Then call strace with the id as parameter:
 
strace <abbr title="print the first 99 characters of every output string">-s 99</abbr> <abbr title="follow child processes">-ff</abbr><abbr title="process id">p</abbr> 2728
 
  
clock_gettime(CLOCK_MONOTONIC, {4433, 764347636}) = 0
+
=== The setup as basic for this article ===
poll([{fd=12, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 0) = 1 ([{fd=12, revents=POLLIN|POLLRDNORM}])
+
We need some Hardware - I my case:
<abbr title="Syscall. Find out more with the command man 2 recv.">recv</abbr>(<abbr title="As we can tell from man 2 recv, the following is a file descriptor. Find out more with the command cat /prov/''PID''/fd/12">12</abbr>, "\37\36&\364T<\264\6Og\20\2\30%-\31C\3757\350{\260\0203\351\23&O\365(y\212"..., 16384, 0) = 1448
+
* a laptop DELL D620
 +
* an external USB S2 digtital HD device TeVii S660
 +
* a TechnoTrend remote control (because unfortunately the remote control support of TeVii S660 is buggy in my setup)
  
== analysis ==
+
And of course some software repositories - in my case:
Every line follows the syntax
+
* Base OS is openSUSE 11.4
syscall(arguments) = return value
+
* Additional package repositories: TBD
  
The meaning of the syscall, its expected arguments and its return value can be determined from its man page. For example to understand the first line call [http://linux.die.net/man/2/clock_gettime man 2 clock_gettime]. It retrieves the current time.
+
We setup the following componets
 +
* VDR (http://www.vdr-portal.de/)
 +
* LIRC
 +
* XINE
  
Wow, that was easy. Now to the next line, poll. According to [http://linux.die.net/man/2/poll man 2 poll] it waits for an event on a file descriptor, like "data to be read". The file descriptor is the first argument, 12. What's this? Let's assume the process ID we are tracing is 7179. Then we can find out its file descriptors like this:
+
=== Here the article should go forward ===
/proc/7179/fd # ll
+
<TBD><placeholder>
total 0
 
lr-x------ 1 root root 64 Apr 19 08:02 0 -> /dev/null
 
lrwx------ 1 root root 64 Apr 19 08:02 1 -> socket:[156171]
 
l-wx------ 1 root root 64 Apr 19 08:02 2 -> /var/log/apache2/error_log
 
lr-x------ 1 root root 64 Apr 19 08:02 4 -> pipe:[156208]
 
l-wx------ 1 root root 64 Apr 19 08:02 5 -> pipe:[156208]
 
l-wx------ 1 root root 64 Apr 19 08:02 6 -> /var/log/apache2/access_log
 
lrwx------ 1 root root 64 Apr 19 08:02 7 -> anon_inode:[eventpoll]
 
lrwx------ 1 root root 64 Apr 19 08:02 12 -> socket:[155097]
 
  
Ok, to find out what socket:[155097] is we use the command
+
=== TechnoTrend USB Remote-Control ===
# lsof | grep 155097
+
==== Low Level Test with mode2 ====
  httpd2-pr 7158            root    3u    IPv4    155097      0t0        TCP *:http (LISTEN)
+
To test, if the IR keys are recognized on a very low level test using command mode2. This works also without lircd.
  httpd2-pr 7179          wwwrun    3u    IPv4    155097      0t0        TCP *:http (LISTEN)
+
furka:~ # mode2 -d /dev/lirc0
 +
  space 3508766
 +
pulse 806
 +
space 744
 +
  pulse 806
  
So this is a socket listening to the http port.
+
==== lircd configuration ====
 +
In openSUSE 11.4 lircd is configured via
 +
===== /etc/sysconfig/lirc =====
 +
## Description:    lirc (infrared remote control) configuration
 +
## Type:          string
 +
## Default:        "660"
 +
## ServiceRestart: lirc
 +
#
 +
# permissions for /dev/lircd
 +
#
 +
LIRCD_DEV_PERMISSIONS="660"
 +
 +
## Type:        string
 +
## Default:    "root:video"
 +
#
 +
# owner and group for /dev/lircd
 +
#
 +
LIRCD_DEV_OWNER="root:video"
 +
 +
## Type:        string
 +
## Default:    ""
 +
#
 +
# use given driver
 +
#
 +
LIRCD_DRIVER=""
 +
 +
## Type:        string
 +
## Default:    ""
 +
#
 +
# read from given device
 +
#
 +
LIRCD_DEVICE="/dev/lirc0"
 +
 +
## Type:        string(lirc_bt829,lirc_gpio,lirc_i2c,lirc_it87,lirc_parallel,lirc_sir,ir-kbd-i2c,ir-kbd-gpio)
 +
## Default:    ""
 +
#
 +
# load given lirc driver module
 +
#
 +
LIRC_MODULE="lirc_ttusbir"
 +
 +
## Type:        string
 +
## Default:    ""
 +
#
 +
# listen for network connections on specified port.
 +
# WARNING: don't use this on a machine with an internet
 +
# connection as lircd is running as root!
 +
#
 +
LIRCD_LISTENPORT=
 +
 +
## Type:        string
 +
## Default:    ""
 +
#
 +
# connect lircd to specified host
 +
#
 +
LIRCD_CONNECT=
 +
===== /etc/lirc/lircd.conf =====
 +
/etc/lirc/lircd.conf (enthaelt die definition der Fernbedienungstasten)
 +
#
 +
# this config file was automatically generated
 +
# using lirc-0.8.3(default) on Wed Jul  2 21:51:15 2008
 +
#
 +
# contributed by
 +
#
 +
# brand:                                  Technotrend
 +
# model no. of remote control:
 +
# devices being controlled by this remote: TV-Card
 +
#
 +
 
 +
begin remote
 +
 
 +
  name      Technotrend
 +
  bits                6
 +
  flags RC5|CONST_LENGTH
 +
  eps                30
 +
  aeps                100
 +
 
 +
  one                889  889
 +
  zero                889  889
 +
  plead              889
 +
  pre_data_bits        7
 +
  pre_data          0x55
 +
  gap              113792
 +
  toggle_bit            2
 +
  frequency        36000
 +
  duty_cycle          50
 +
 
 +
      begin codes
 +
          Power                    0x01
 +
          Mute                    0x18
 +
          1                        0x03
 +
          2                        0x04
 +
          3                        0x05
 +
          4                        0x06
 +
          5                        0x07
 +
          6                        0x08
 +
          7                        0x09
 +
          8                        0x0A
 +
          9                        0x0B
 +
          0                        0x0C
 +
          Audio                    0x1A
 +
          Repeat                  0x02
 +
          vol-                    0x26
 +
          vol+                    0x25
 +
          Text                    0x19
 +
          ch-                      0x24
 +
          ch+                      0x23
 +
          Exit                    0x13
 +
          OK                      0x0F
 +
          Up                      0x0D
 +
          Down                    0x11
 +
          Left                    0x0E
 +
          Right                    0x10
 +
          Red                      0x14
 +
          Green                    0x15
 +
          Yellow                  0x16
 +
          Blue                    0x17
 +
          Record                  0x3A
 +
          Play                    0x3B
 +
          Stop                    0x3C
 +
          Info                    0x12
 +
          Rew                      0x3D
 +
          Pause                    0x3E
 +
          Fwd                      0x3F
 +
          EPG                      0x22
 +
      end codes
 +
 +
end remote
  
= Search for a syscall =
+
==== lircd start and start at boot time ====
With strace, you can search for a special syscall. For example,
+
furka:~ # rclirc start
  strace -e open ''command''
+
  Starting lircd (/dev/lirc0)                                         done
will show you all files that have been touched (opened) by ''command''. This can be used e.g. to [[find out where configuration changes are stored]].
+
furka:~ # chkconfig lirc on
  
= Performance analysis =
+
==== lircd-client Connection Test ====
With strace, you can find out the biggest time-consuming syscalls during a program run:
+
To test, if a client of lircd could recognize key presses use command irw. This command is part of package lirc.
  strace -c ls -R
+
  furka:~ # irw
Entries  Repository  Root
+
  000000000000154c 00 0 Technotrend
  % time    seconds  usecs/call    calls    errors syscall
+
000000000000154c 01 0 Technotrend
------ ----------- ----------- --------- --------- ----------------
+
000000000000154c 00 0 Technotrend
  67.09    0.412153          14    29664          getdents64
+
  000000000000154c 01 0 Technotrend
  27.70    0.170168          11    14849        14 open
 
  4.24    0.026043          0    123740          write
 
  0.72    0.004443          0    14837          close
 
  0.20    0.001204          0    14836          fstat
 
  0.05    0.000285        285        1          execve
 
  0.00   0.000000          0        12          read
 
  0.00    0.000000          0        4        3 stat
 
  0.00    0.000000          0        33          mmap
 
  0.00    0.000000          0        18          mprotect
 
  0.00    0.000000          0        4          munmap
 
  0.00    0.000000          0        12          brk
 
  0.00    0.000000          0        2          rt_sigaction
 
  0.00    0.000000          0        1          rt_sigprocmask
 
  0.00    0.000000          0        2          ioctl
 
  0.00    0.000000          0        1        1 access
 
  0.00    0.000000          0        3          mremap
 
  0.00    0.000000          0        1          fcntl
 
  0.00    0.000000          0        1          getrlimit
 
  0.00    0.000000          0        1          statfs
 
  0.00    0.000000          0        1          arch_prctl
 
  0.00    0.000000          0        3        1 futex
 
  0.00    0.000000          0        1          set_tid_address
 
  0.00    0.000000          0        8          fadvise64
 
  0.00   0.000000          0         1          set_robust_list
 
  ------ ----------- ----------- --------- --------- ----------------
 
100.00    0.614296                198036        19 total
 
  
Now you go
+
==== Trouble-Shooting ====
  [http://linux.die.net/man/2/getdents64 man 2 getdents64]
+
* If you do NOT have a valid config file for your remote you might create one interactive using irrecord
to find out what that syscall is about.
+
  irrecord -d /dev/lirc0 file
 +
** file is the output file here
 +
** You should prefer to fetch a config file from http://www.lirc.org/remotes/
 +
** I try http://lirc.sourceforge.net/remotes/technotrend/TV-Card
 +
 
 +
=== lirc to talk with vdr ===
 +
File /etc/vdr/remote.conf needs to contain those additional entries for accepting lircd keys:
 +
LIRC.Up        Up
 +
LIRC.Down      Down
 +
LIRC.Menu      Repeat
 +
LIRC.Ok        OK
 +
LIRC.Back      Exit
 +
LIRC.Left      Left
 +
LIRC.Right      Right
 +
LIRC.Red        Red
 +
LIRC.Green      Green
 +
LIRC.Yellow    Yellow
 +
LIRC.Blue      Blue
 +
LIRC.0          0
 +
LIRC.1          1
 +
LIRC.2         2
 +
LIRC.3          3
 +
LIRC.4          4
 +
LIRC.5          5
 +
LIRC.6          6
 +
LIRC.7          7
 +
LIRC.8          8
 +
LIRC.9          9
 +
LIRC.Info      Info
 +
LIRC.Play      Play
 +
LIRC.Pause      Pause
 +
LIRC.Stop      Stop
 +
LIRC.Record    Record
 +
LIRC.FastFwd    Fwd
 +
LIRC.FastRew    Rew
 +
LIRC.Power      Power
 +
LIRC.Channel+  ch+
 +
LIRC.Channel-  ch-
 +
LIRC.Volume+    vol+
 +
LIRC.Volume-    vol-
 +
LIRC.Mute      Mute
 +
 
 +
 
 +
=== UNSORTED STUFF ===
 +
Auf dem Laptop Latitude D820 habe ich einen vdr installiert mit einer externen USB-Box TVii 660
 +
==== Installation of the DVB-S2 USB-Box ====
 +
<TBD>
 +
==== Installation vdr ====
 +
<TBD>
 +
==== Plugins ====
 +
We need / expore the following VDR plugins:
 +
* xine
 +
* streamdev
 +
* libxineoutput
 +
==== Video clients ====
 +
===== Remote Streaming: vdr-plugin-streamdev =====
 +
vlc - What is already running is that you can watch TV and also switch the programm. But you do not have full control over VDR using that method.
 +
vlc http://127.0.0.1:3000/PES/1
 +
URL in general:
 +
http://<hostip>:<port>/[PES|xx]/<prognummer>
 +
You need to setup the file /etc/vdr/streamdev.conf:
 +
# streamdev.conf:
 +
<TBD>
 +
 
 +
Passender /etc/sysconfig/vdr Auszug
 +
  VDR_PLUGINS="streamdev"
 +
 
 +
===== vdr-plugin-xineliboutput =====
 +
With xineliboutput
 +
vlc tcp://localhost:37890
 +
 
 +
But how to switch the program using this connection?
 +
 
 +
===== Best practice local access with <html><acronym title="On Screen Display">OSD</acronym></html>: vdr-plugin-xine =====
 +
'''This is the recommended way if you want to watch TV on the computer where VDR is running.'''
 +
 
 +
Using the xine plugin (from repository PackMan) you could use xine for a complete VDR client (with full control over all menus).
 +
 
 +
* install it:
 +
yast -i vdr-plugin-xine
 +
 
 +
* Matching line in /etc/sysconfig/vdr (the plugin "remote" is optional and can be dropped, if you use lirc)
 +
  VDR_PLUGINS="remote xine"
 +
  VDR_PLUGIN_ARGS_remote="-i /dev/input/ir"
 +
  VDR_PLUGIN_ARGS_xine=""
 +
 
 +
* Restart VDR
 +
  /etc/init.d/vdr restart
 +
 
 +
* start watching TV:
 +
xine vdr://
 +
 
 +
==== Remote Control ====
 +
===== TeVii S660 remote control is a bit painfull for me =====
 +
Translation: <TBD>
 +
* Mit dem Update von c.a. Mitte März auf den Herstellerseiten (auf Simplon Download/Tevii) geht nun die Erkennung der Fernbedienung
 +
* Kleiner Patch in ./v4l/dw2102.c die Ausgaben von "query RC..." auskommentiert (also nicht aktiv), weil sonst der syslog voll läuft
 +
* VDR meldet (ohne Config s.u.) beim Starten, dass er kein lirc findet, allerdings scheint die Fernbedienung als Tastatur zur funktionieren:
 +
** Test mit fb bringt messages im syslog (kann ggf später entfallen)
 +
** xev zeigt tastaturreaktion, wenn man fb bedient
 +
** KDE lautstärke regler funktioniert bereits :)
 +
** Cursorbewegungen (auf/ab/rechts/links) funktinieren u.a. hier im wiki :)
 +
** war jetzt nach einigen Eingaben nicht stabil - prüfen!
 +
 
 +
In den VDR bindet  man die Fernbedienung mit dem plugin remote ein.
 +
Passender Auszug aus der /etc/sysconfig/vdr
 +
  VDR_PLUGINS="remote"
 +
  VDR_PLUGIN_ARGS_remote="-i /dev/input/ir
 +
 
 +
Die Berechtigungen für das IR-device (/dev/input/ir) müssen so eingestellt werden,
 +
dass der VDR (Benutzer vdr) darauf Zugreifen darf.
 +
  chown vdr:users /dev/input/ir
 +
 
 +
Die FB muss beim ersten Benutzen im VDR trainiert werden, wenn die Datei /etc/vdr/remote.conf nicht
 +
angepasst wird (Datei stelle ich bei Bedarf zur Verfügung :).
 +
==== Paketliste ====
 +
===== Liste der Xine und VDR Pakete =====
 +
gxine-0.5.904-1.pm.2.6.x86_64
 +
gxine-browser-plugin-0.5.904-1.pm.2.6.x86_64
 +
libdvdread3-0.9.7-5.pm.5.1.x86_64
 +
libdvdread4-4.1.3-1.pm.2.1.x86_64
 +
libxine1-1.1.18.1-1.pm.36.7.x86_64
 +
libxine1-codecs-1.1.18.1-1.pm.36.7.x86_64
 +
libxine1-gnome-vfs-1.1.18.1-1.pm.36.7.x86_64
 +
libxine1-pulse-1.1.18.1-1.pm.36.7.x86_64
 +
phonon-backend-xine-4.3.1-3.3.x86_64
 +
vdr-1.6.0-49.1.x86_64
 +
vdr-plugin-cutalot-0.0.3-4.1.x86_64
 +
vdr-plugin-epgsearch-0.9.24-4.3.x86_64
 +
vdr-plugin-remote-0.4.0-4.1.x86_64
 +
vdr-plugin-streamdev-0.0_CVS20080716080048-4.3.x86_64
 +
vdr-plugin-xine-0.9.3-1.pm.2.1.x86_64
 +
vdr-plugin-xineliboutput-1.0.4-2.6.x86_64
 +
xine-browser-plugin-1.0.2-1.pm.1.1.x86_64
 +
xine-skins-1.0.3-1.pm.1.1.noarch
 +
xine-ui-0.99.5cvs20091115-0.pm.1.1.x86_64
 +
 
 +
===== Pakete und DISTURL =====
 +
* obs://10.8.0.1/main/openSUSE_11.2_Update
 +
libdvdread4 obs://10.8.0.1/main/openSUSE_11.2_Update/306059dfe7c2fe75c81463ffdc94b602-libdvdread
 +
libdvdread3 obs://10.8.0.1/main/openSUSE_11.2_Update/36bda5a7750dcdd29c15b71d09d30dc5-libdvdread3
 +
xine-skins obs://10.8.0.1/main/openSUSE_11.2_Update/a081540ec1b7e330947215723b405cb6-xine-skins
 +
xine-ui obs://10.8.0.1/main/openSUSE_11.2_Update/a666d655902a208cd16815381bb904ed-xine-ui
 +
xine-browser-plugin obs://10.8.0.1/main/openSUSE_11.2_Update/b4f55cabb13736ad3445f83e562c8eec-xine-browser-plugin
 +
gxine obs://10.8.0.1/main/openSUSE_11.2_Update/e7ca26543c8c88e2aad0fd9932000cf1-gxine
 +
gxine-browser-plugin obs://10.8.0.1/main/openSUSE_11.2_Update/e7ca26543c8c88e2aad0fd9932000cf1-gxine
 +
vdr-plugin-xine obs://10.8.0.1/main/openSUSE_11.2_Update/eca889b371e2a093c15d926ca9aee98a-vdr-plugin-xine
 +
* obs://10.8.0.1/main_pm/openSUSE_11.2
 +
libxine1 obs://10.8.0.1/main_pm/openSUSE_11.2/4788c3fd626509d2d6a0a206decf0ba7-xine-lib
 +
libxine1-codecs obs://10.8.0.1/main_pm/openSUSE_11.2/4788c3fd626509d2d6a0a206decf0ba7-xine-lib
 +
libxine1-gnome-vfs obs://10.8.0.1/main_pm/openSUSE_11.2/4788c3fd626509d2d6a0a206decf0ba7-xine-lib
 +
libxine1-pulse obs://10.8.0.1/main_pm/openSUSE_11.2/4788c3fd626509d2d6a0a206decf0ba7-xine-lib
 +
* obs://build.opensuse.org/openSUSE:11.2/standard
 +
xinetd obs://build.opensuse.org/openSUSE:11.2/standard/26ae7516fc8927f0dd79a740c4a5112d-xinetd
 +
vdr-plugin-epgsearch obs://build.opensuse.org/openSUSE:11.2/standard/2ff727d44350a87268023d017b0c07c1-vdr-plugin-epgsearch
 +
vdr-plugin-cutalot obs://build.opensuse.org/openSUSE:11.2/standard/3756441b40467ca978334fcdd3da5c92-vdr-plugin-cutalot
 +
phonon-backend-xine obs://build.opensuse.org/openSUSE:11.2/standard/6903a64ebd71ba3a9821e225ad1b7318-phonon
 +
vdr-plugin-remote obs://build.opensuse.org/openSUSE:11.2/standard/82c16937795c5fe821d9a57d5946bc4b-vdr-plugin-remote
 +
vdr-plugin-streamdev obs://build.opensuse.org/openSUSE:11.2/standard/886f590ea9d6228ed3de8eac63aae288-vdr-plugin-streamdev
 +
vdr obs://build.opensuse.org/openSUSE:11.2/standard/c70699e1e939c603de2b1b636bbf04e3-vdr
 +
* obs://build.opensuse.org/vdr/openSUSE_11.2
 +
vdr-plugin-xineliboutput obs://build.opensuse.org/vdr/openSUSE_11.2/b2b3714110677b022ab9e75e26f02b33-vdr-plugin-xineliboutput
 +
 
 +
===== Pakete und VENDOR =====
 +
rpm -qa --queryformat "%{NAME} %{VENDOR}\
 +
" | egrep '(vdr|xine)' | sort -k2
 +
* Packman
 +
gxine Packman
 +
gxine-browser-plugin Packman
 +
xine-browser-plugin Packman
 +
xine-skins Packman
 +
* http://packman.links2linux.de
 +
libdvdread3 http://packman.links2linux.de
 +
libdvdread4 http://packman.links2linux.de
 +
libxine1 http://packman.links2linux.de
 +
libxine1-codecs http://packman.links2linux.de
 +
libxine1-gnome-vfs http://packman.links2linux.de
 +
libxine1-pulse http://packman.links2linux.de
 +
vdr-plugin-xine http://packman.links2linux.de
 +
xine-ui http://packman.links2linux.de
 +
* obs://build.opensuse.org/vdr
 +
vdr-plugin-xineliboutput obs://build.opensuse.org/vdr
 +
* openSUSE
 +
phonon-backend-xine openSUSE
 +
vdr openSUSE
 +
vdr-plugin-cutalot openSUSE
 +
vdr-plugin-epgsearch openSUSE
 +
vdr-plugin-remote openSUSE
 +
vdr-plugin-streamdev openSUSE
 +
xinetd openSUSE
  
 
= See also =
 
= See also =
* [[gdb|gdb, allowing you to monitor every action of a process]]
+
* [[watch TV]]
* [http://linux.die.net/man/1/strace man strace]
+
* http://packman.links2linux.de/package/vdr-plugin-xine/229857
* http://try-linux.blogspot.de/2013/12/how-to-strace-process.html
 
* http://scn.sap.com/community/linux/blog/2014/04/11/dispwork-running-but-not-connected-to-message-server#
 
* [[TCPDump]]
 
 
 
[[Category:low-level]]
 
[[Category:command]]
 

Revision as of 13:05, 12 July 2012

Introduction

This article describes some aspects to setup an enviroment with a VDR server and a xine stream client.

Here typically should be the obligatory screenshot of my desktop showing the running stream - I add that later on :)

The setup as basic for this article

We need some Hardware - I my case:

  • a laptop DELL D620
  • an external USB S2 digtital HD device TeVii S660
  • a TechnoTrend remote control (because unfortunately the remote control support of TeVii S660 is buggy in my setup)

And of course some software repositories - in my case:

  • Base OS is openSUSE 11.4
  • Additional package repositories: TBD

We setup the following componets

Here the article should go forward

<TBD><placeholder>

TechnoTrend USB Remote-Control

Low Level Test with mode2

To test, if the IR keys are recognized on a very low level test using command mode2. This works also without lircd.

furka:~ # mode2 -d /dev/lirc0
space 3508766
pulse 806
space 744
pulse 806

lircd configuration

In openSUSE 11.4 lircd is configured via

/etc/sysconfig/lirc
## Description:    lirc (infrared remote control) configuration
## Type:           string
## Default:        "660"
## ServiceRestart: lirc
#
# permissions for /dev/lircd
#
LIRCD_DEV_PERMISSIONS="660"

## Type:        string
## Default:     "root:video"
#
# owner and group for /dev/lircd
#
LIRCD_DEV_OWNER="root:video"

## Type:        string
## Default:     ""
#
# use given driver
#
LIRCD_DRIVER=""

## Type:        string
## Default:     ""
#
# read from given device
#
LIRCD_DEVICE="/dev/lirc0"

## Type:        string(lirc_bt829,lirc_gpio,lirc_i2c,lirc_it87,lirc_parallel,lirc_sir,ir-kbd-i2c,ir-kbd-gpio)
## Default:     ""
#
# load given lirc driver module
#
LIRC_MODULE="lirc_ttusbir"

## Type:        string
## Default:     ""
#
# listen for network connections on specified port.
# WARNING: don't use this on a machine with an internet
# connection as lircd is running as root!
# 
LIRCD_LISTENPORT=

## Type:        string
## Default:     ""
#
# connect lircd to specified host
#
LIRCD_CONNECT=
/etc/lirc/lircd.conf

/etc/lirc/lircd.conf (enthaelt die definition der Fernbedienungstasten)

#
# this config file was automatically generated
# using lirc-0.8.3(default) on Wed Jul  2 21:51:15 2008
#
# contributed by 
#
# brand:                                   Technotrend
# model no. of remote control: 
# devices being controlled by this remote: TV-Card
#
 
begin remote
  
 name       Technotrend
 bits                 6
 flags RC5|CONST_LENGTH
 eps                 30
 aeps                100 
  
 one                 889   889
 zero                889   889
 plead               889
 pre_data_bits         7
 pre_data           0x55
 gap              113792
 toggle_bit            2
 frequency         36000
 duty_cycle           50
 
     begin codes
         Power                    0x01
         Mute                     0x18
         1                        0x03
         2                        0x04
         3                        0x05
         4                        0x06
         5                        0x07
         6                        0x08
         7                        0x09
         8                        0x0A
         9                        0x0B
         0                        0x0C
         Audio                    0x1A
         Repeat                   0x02
         vol-                     0x26
         vol+                     0x25
         Text                     0x19
         ch-                      0x24
         ch+                      0x23
         Exit                     0x13
         OK                       0x0F
         Up                       0x0D
         Down                     0x11
         Left                     0x0E
         Right                    0x10
         Red                      0x14
         Green                    0x15
         Yellow                   0x16
         Blue                     0x17
         Record                   0x3A
         Play                     0x3B
         Stop                     0x3C
         Info                     0x12
         Rew                      0x3D
         Pause                    0x3E
         Fwd                      0x3F
         EPG                      0x22
     end codes

end remote

lircd start and start at boot time

furka:~ # rclirc start
Starting lircd (/dev/lirc0)                                          done
furka:~ # chkconfig lirc on

lircd-client Connection Test

To test, if a client of lircd could recognize key presses use command irw. This command is part of package lirc.

furka:~ # irw
000000000000154c 00 0 Technotrend
000000000000154c 01 0 Technotrend
000000000000154c 00 0 Technotrend
000000000000154c 01 0 Technotrend

Trouble-Shooting

  • If you do NOT have a valid config file for your remote you might create one interactive using irrecord
irrecord -d /dev/lirc0 file

lirc to talk with vdr

File /etc/vdr/remote.conf needs to contain those additional entries for accepting lircd keys:

LIRC.Up         Up
LIRC.Down       Down
LIRC.Menu       Repeat
LIRC.Ok         OK
LIRC.Back       Exit
LIRC.Left       Left
LIRC.Right      Right
LIRC.Red        Red
LIRC.Green      Green
LIRC.Yellow     Yellow
LIRC.Blue       Blue
LIRC.0          0
LIRC.1          1
LIRC.2          2
LIRC.3          3
LIRC.4          4
LIRC.5          5
LIRC.6          6
LIRC.7          7
LIRC.8          8
LIRC.9          9
LIRC.Info       Info
LIRC.Play       Play
LIRC.Pause      Pause
LIRC.Stop       Stop
LIRC.Record     Record
LIRC.FastFwd    Fwd
LIRC.FastRew    Rew
LIRC.Power      Power
LIRC.Channel+   ch+
LIRC.Channel-   ch-
LIRC.Volume+    vol+
LIRC.Volume-    vol-
LIRC.Mute       Mute


UNSORTED STUFF

Auf dem Laptop Latitude D820 habe ich einen vdr installiert mit einer externen USB-Box TVii 660

Installation of the DVB-S2 USB-Box

<TBD>

Installation vdr

<TBD>

Plugins

We need / expore the following VDR plugins:

  • xine
  • streamdev
  • libxineoutput

Video clients

Remote Streaming: vdr-plugin-streamdev

vlc - What is already running is that you can watch TV and also switch the programm. But you do not have full control over VDR using that method.

vlc http://127.0.0.1:3000/PES/1

URL in general:

http://<hostip>:<port>/[PES|xx]/<prognummer>

You need to setup the file /etc/vdr/streamdev.conf:

# streamdev.conf:
<TBD>

Passender /etc/sysconfig/vdr Auszug

 VDR_PLUGINS="streamdev"
vdr-plugin-xineliboutput

With xineliboutput

vlc tcp://localhost:37890

But how to switch the program using this connection?

Best practice local access with <html><acronym title="On Screen Display">OSD</acronym></html>: vdr-plugin-xine

This is the recommended way if you want to watch TV on the computer where VDR is running.

Using the xine plugin (from repository PackMan) you could use xine for a complete VDR client (with full control over all menus).

  • install it:
yast -i vdr-plugin-xine
  • Matching line in /etc/sysconfig/vdr (the plugin "remote" is optional and can be dropped, if you use lirc)
 VDR_PLUGINS="remote xine"
 VDR_PLUGIN_ARGS_remote="-i /dev/input/ir"
 VDR_PLUGIN_ARGS_xine=""
  • Restart VDR
 /etc/init.d/vdr restart
  • start watching TV:
xine vdr://

Remote Control

TeVii S660 remote control is a bit painfull for me

Translation: <TBD>

  • Mit dem Update von c.a. Mitte März auf den Herstellerseiten (auf Simplon Download/Tevii) geht nun die Erkennung der Fernbedienung
  • Kleiner Patch in ./v4l/dw2102.c die Ausgaben von "query RC..." auskommentiert (also nicht aktiv), weil sonst der syslog voll läuft
  • VDR meldet (ohne Config s.u.) beim Starten, dass er kein lirc findet, allerdings scheint die Fernbedienung als Tastatur zur funktionieren:
    • Test mit fb bringt messages im syslog (kann ggf später entfallen)
    • xev zeigt tastaturreaktion, wenn man fb bedient
    • KDE lautstärke regler funktioniert bereits :)
    • Cursorbewegungen (auf/ab/rechts/links) funktinieren u.a. hier im wiki :)
    • war jetzt nach einigen Eingaben nicht stabil - prüfen!

In den VDR bindet man die Fernbedienung mit dem plugin remote ein. Passender Auszug aus der /etc/sysconfig/vdr

 VDR_PLUGINS="remote"
 VDR_PLUGIN_ARGS_remote="-i /dev/input/ir

Die Berechtigungen für das IR-device (/dev/input/ir) müssen so eingestellt werden, dass der VDR (Benutzer vdr) darauf Zugreifen darf.

 chown vdr:users /dev/input/ir

Die FB muss beim ersten Benutzen im VDR trainiert werden, wenn die Datei /etc/vdr/remote.conf nicht angepasst wird (Datei stelle ich bei Bedarf zur Verfügung :).

Paketliste

Liste der Xine und VDR Pakete
gxine-0.5.904-1.pm.2.6.x86_64
gxine-browser-plugin-0.5.904-1.pm.2.6.x86_64
libdvdread3-0.9.7-5.pm.5.1.x86_64
libdvdread4-4.1.3-1.pm.2.1.x86_64
libxine1-1.1.18.1-1.pm.36.7.x86_64
libxine1-codecs-1.1.18.1-1.pm.36.7.x86_64
libxine1-gnome-vfs-1.1.18.1-1.pm.36.7.x86_64
libxine1-pulse-1.1.18.1-1.pm.36.7.x86_64
phonon-backend-xine-4.3.1-3.3.x86_64
vdr-1.6.0-49.1.x86_64
vdr-plugin-cutalot-0.0.3-4.1.x86_64
vdr-plugin-epgsearch-0.9.24-4.3.x86_64
vdr-plugin-remote-0.4.0-4.1.x86_64
vdr-plugin-streamdev-0.0_CVS20080716080048-4.3.x86_64
vdr-plugin-xine-0.9.3-1.pm.2.1.x86_64
vdr-plugin-xineliboutput-1.0.4-2.6.x86_64
xine-browser-plugin-1.0.2-1.pm.1.1.x86_64
xine-skins-1.0.3-1.pm.1.1.noarch
xine-ui-0.99.5cvs20091115-0.pm.1.1.x86_64
Pakete und DISTURL
  • obs://10.8.0.1/main/openSUSE_11.2_Update
libdvdread4 obs://10.8.0.1/main/openSUSE_11.2_Update/306059dfe7c2fe75c81463ffdc94b602-libdvdread
libdvdread3 obs://10.8.0.1/main/openSUSE_11.2_Update/36bda5a7750dcdd29c15b71d09d30dc5-libdvdread3
xine-skins obs://10.8.0.1/main/openSUSE_11.2_Update/a081540ec1b7e330947215723b405cb6-xine-skins
xine-ui obs://10.8.0.1/main/openSUSE_11.2_Update/a666d655902a208cd16815381bb904ed-xine-ui
xine-browser-plugin obs://10.8.0.1/main/openSUSE_11.2_Update/b4f55cabb13736ad3445f83e562c8eec-xine-browser-plugin
gxine obs://10.8.0.1/main/openSUSE_11.2_Update/e7ca26543c8c88e2aad0fd9932000cf1-gxine
gxine-browser-plugin obs://10.8.0.1/main/openSUSE_11.2_Update/e7ca26543c8c88e2aad0fd9932000cf1-gxine
vdr-plugin-xine obs://10.8.0.1/main/openSUSE_11.2_Update/eca889b371e2a093c15d926ca9aee98a-vdr-plugin-xine
  • obs://10.8.0.1/main_pm/openSUSE_11.2
libxine1 obs://10.8.0.1/main_pm/openSUSE_11.2/4788c3fd626509d2d6a0a206decf0ba7-xine-lib
libxine1-codecs obs://10.8.0.1/main_pm/openSUSE_11.2/4788c3fd626509d2d6a0a206decf0ba7-xine-lib
libxine1-gnome-vfs obs://10.8.0.1/main_pm/openSUSE_11.2/4788c3fd626509d2d6a0a206decf0ba7-xine-lib
libxine1-pulse obs://10.8.0.1/main_pm/openSUSE_11.2/4788c3fd626509d2d6a0a206decf0ba7-xine-lib
  • obs://build.opensuse.org/openSUSE:11.2/standard
xinetd obs://build.opensuse.org/openSUSE:11.2/standard/26ae7516fc8927f0dd79a740c4a5112d-xinetd
vdr-plugin-epgsearch obs://build.opensuse.org/openSUSE:11.2/standard/2ff727d44350a87268023d017b0c07c1-vdr-plugin-epgsearch
vdr-plugin-cutalot obs://build.opensuse.org/openSUSE:11.2/standard/3756441b40467ca978334fcdd3da5c92-vdr-plugin-cutalot
phonon-backend-xine obs://build.opensuse.org/openSUSE:11.2/standard/6903a64ebd71ba3a9821e225ad1b7318-phonon
vdr-plugin-remote obs://build.opensuse.org/openSUSE:11.2/standard/82c16937795c5fe821d9a57d5946bc4b-vdr-plugin-remote
vdr-plugin-streamdev obs://build.opensuse.org/openSUSE:11.2/standard/886f590ea9d6228ed3de8eac63aae288-vdr-plugin-streamdev
vdr obs://build.opensuse.org/openSUSE:11.2/standard/c70699e1e939c603de2b1b636bbf04e3-vdr
  • obs://build.opensuse.org/vdr/openSUSE_11.2
vdr-plugin-xineliboutput obs://build.opensuse.org/vdr/openSUSE_11.2/b2b3714110677b022ab9e75e26f02b33-vdr-plugin-xineliboutput
Pakete und VENDOR

rpm -qa --queryformat "%{NAME} %{VENDOR}\ " | egrep '(vdr|xine)' | sort -k2

  • Packman
gxine Packman
gxine-browser-plugin Packman
xine-browser-plugin Packman
xine-skins Packman
libdvdread3 http://packman.links2linux.de
libdvdread4 http://packman.links2linux.de
libxine1 http://packman.links2linux.de
libxine1-codecs http://packman.links2linux.de
libxine1-gnome-vfs http://packman.links2linux.de
libxine1-pulse http://packman.links2linux.de
vdr-plugin-xine http://packman.links2linux.de
xine-ui http://packman.links2linux.de
  • obs://build.opensuse.org/vdr
vdr-plugin-xineliboutput obs://build.opensuse.org/vdr
  • openSUSE
phonon-backend-xine openSUSE
vdr openSUSE
vdr-plugin-cutalot openSUSE
vdr-plugin-epgsearch openSUSE
vdr-plugin-remote openSUSE
vdr-plugin-streamdev openSUSE
xinetd openSUSE

See also