yaVDR 0.2

Die neue Version 0.2 von yaVDR (einer speziell als Home Theater Betriebssystem zusammenkonfigurierten Ubuntu Distri) wurde gestern veröffentlicht – genau einen Tag nachdem ich die alte Version 0.1.1 auf meinem HTPC installiert habe. (Danke auch!)

yaVDR 0.1 war noch sehr gewöhnungsbedürftig und funktionierte in vielen Punkten nicht so, wie ich mir das gewünscht habe. Das Update auf 0.1.1 brachte schon große Verbesserungen mit wie ich gestern festgestellt habe, daher freue ich mich auf 0.2.

Howto: X10 OR22V and VDR

Some days ago I explained how to set up basically the X10 OR22V remote control on a ubuntu system.That post also contains the required hardware.conf and lirdc.conf files! The thing that still didn’t work on my system was the ability to control my VDR.

The missing link to get things to work is a mapping from the “lirc-codes” to functions of VDR. In /etc/vdr there is a symlink “remote.conf” to a missing(!)  file located in /var/lib/vdr/remote.conf. That file will contain the required mapping. For me it was enough (sometimes) just to create the missing file (touch /var/lib/vdr/remote.conf – take care that vdr owns the file), restart vdr( /etc/init.d/vdr restart) and start the video output (for my setup: xinit -e vdr-sxfe -f). Now some teaching dialogue will (most likely) appear that tells you to press buttons in some sequence (press 1, press 2, …) and that remembers the received “lirc-codes”. If you went through this and later edit the mapping file you’ll have something like this:

LIRC.Up Up
LIRC.Down Down
LIRC.Menu Home
LIRC.Ok OK
LIRC.Back Back
LIRC.Left Left
LIRC.Right Right
LIRC.Red Red
LIRC.Green Green
LIRC.Yellow Yellow
LIRC.Blue Blue
LIRC.0 Zero
LIRC.1 One
LIRC.2 Two
LIRC.3 Three
LIRC.4 Four
LIRC.5 Five
LIRC.6 Six
LIRC.7 Seven
LIRC.8 Eight
LIRC.9 Nine
LIRC.Info More
LIRC.Play Play
LIRC.Pause Pause
LIRC.Stop Stop
LIRC.Record Record
LIRC.FastFwd Forward
LIRC.FastRew Rewind
LIRC.Next Skip
LIRC.Prev Replay
LIRC.Power Power
LIRC.Channel+ ChanUp
LIRC.Channel- ChanDown
LIRC.Volume+ VolUp
LIRC.Volume- VolDown
LIRC.Mute Mute
LIRC.Schedule KEY_TIMESHIFTING
LIRC.Channels DVD
LIRC.Timers LiveTV
LIRC.Recordings Guide

It is also possible, just to copy and paste the listing above to the mapping file. Just restart vdr and be happy that the remote will work now for VDR.

How to: X10 OR22V and XBMC

I bought a cheap media center remote control that I want to use at my home theater pc to control xbmc and vdr. Unfortunately the remote doesn’t work out of the box. Googling for a howto took me to this thread which helped a lot but took quite a lot of time to read and find the useful hints in tons of posts. Now here’s the solution in brief:

First you need to blacklist (disable) some modules. Add the following lines to /etc/modprobe.d/blacklist.conf:

blacklist ati_remote
blacklist lirc_atiusb

Now add the following to /etc/lirc/hardware.conf:

#Chosen Remote Control
REMOTE=”mceusb”
REMOTE_MODULES=”"
REMOTE_DRIVER=”atilibusb”
REMOTE_DEVICE=”/dev/lirc0″
REMOTE_LIRCD_CONF=”/etc/lirc/lircd.conf”
REMOTE_LIRCD_ARGS=”"

#Chosen IR Transmitter
TRANSMITTER=”None”
TRANSMITTER_MODULES=”"
TRANSMITTER_DRIVER=”"
TRANSMITTER_DEVICE=”"
TRANSMITTER_LIRCD_CONF=”"
TRANSMITTER_LIRCD_ARGS=”"

#Enable lircd
START_LIRCD=”true”

#Don’t start lircmd even if there seems to be a good config file
#START_LIRCMD=”false”

#Try to load appropriate kernel modules
LOAD_MODULES=”true”

# Default configuration files for your hardware if any
LIRCMD_CONF=”"

#Forcing noninteractive reconfiguration
#If lirc is to be reconfigured by an external application
#that doesn’t have a debconf frontend available, the noninteractive
#frontend can be invoked and set to parse REMOTE and TRANSMITTER
#It will then populate all other variables without any user input
#If you would like to configure lirc via standard methods, be sure
#to leave this set to “false”
FORCE_NONINTERACTIVE_RECONFIGURATION=”false”
START_LIRCMD=”"

Now add the following to /etc/lirc/lircd.conf. This will translate the codes sent by the remote control to some (well known, standard) keyname:

# Please make this file available to others
# by sending it to <lirc@bartelmus.de>
#
# this config file was automatically generated
# using lirc-0.8.4a(atilibusb) on Tue Sep  8 23:54:34 2009
#
# contributed by funnybox2006, modified by nebu
#
# brand:  X10
# model no. of remote control: OR22V with RF USB Dongle
# devices being controlled by this remote:
# note: use atilibusb driver for this remote and set device in hardware.conf to /dev$

begin remote

name        mceusb
bits           16
eps            30
aeps          100

one             0     0
zero            0     0
pre_data_bits   8
pre_data       0×14
post_data_bits  16
post_data      0×0
gap          139982
min_repeat      2
toggle_bit_mask 0×80800000

begin codes
Power                    0xD702
Red                      0x87B2
Yellow                0×0934
Green                0x88B3
Teletext             0x6B96
Blue                    0x0A35
Back                 0xF520
More              0x84AF
Up                   0xEF1A
Left                     0x729D
OK                   0xF31E
Right                0xF41F
Down                 0x77A2
KEY_TIMESHIFTING     0x6D98
Guide                0×0631
DVD                  0xD904
LiveTV               0x719C
VolUp                0xDE09
Home                 0x709B
ChanUp               0xE00B
VolDown              0x5D88
ChanUp               0x618C
Mute                 0xD500
Replay               0x76A1
Skip                 0xF823
Rewind               0x79A4
Play                 0xFA25
Forward              0x7BA6
Record               0xFC27
Stop                 0x7DA8
Pause                0xFE29
One                  0x628D
Two                  0xE30E
Three                0x648F
Four                 0xE510
Five                 0×6691
Six                  0xE712
Seven                    0×6893
Eight                0xE914
Nine                 0x6A95
Star                 0x8CB7
Zero                 0xEC17
Hash                 0x0D38
Clear                0x85B0
Enter                0x0B36
end codes

end remote

Now restart Lirc: /etc/lirc/lircd restart and type irw. You should get some output when you press buttons on the remote and see that the mapping created above will work. The remote will now work with xbmc without changing anything at xbmc’s keymaps or other files. The lircd.conf uses standard keynames which are already mapped by the standard xbmc configuration files to xbmc actions.

Now start xbmc and have fun!

Update: Here is a explanation how to get the remote to work with vdr.

TV-Browser + VDR

Ich habe vor Wochen kurz auf TV-Browser hingewiesen. Das ist ein Programm für Mac, Windows und ich glaube Linux mit dem das TV-Programm inspiziert und gefällige Sendungen selektiert werden können. Es gibt ein cooles Plugin, welches TV-Browser mit dem VDR verbindet: Lazy Bones

Mit LazyBones lassen sich Aufnahmen programmieren und v.a. Livestreams von VDR zum lokalen VLC sehr komfortabel starten.

Die Installation geht mittlerweile über das Plugin-Interface von TV-Browser.

Homeserver: Der eeePC 4G als Video-Recorder

Vor einiger Zeit habe ich mir eine DVB-T Karte bei Saturn für gewaltige 20 Euro geholt, um Fernsehen auf meinem eeePC ansehen zu können. Idee: so hat man einen 2. Fernseher im Haus. Interessanterweise hielt sich aber die Häufigkeit des Gebrauchs dieses “Fernsehers” stark in Grenzen… ;-) Daher wollte ich den eeePC für eine neue Aufgabe rüsten: das Dasein als Video-Server.

Basis-Software

Ich habe zunächst mit ein paar Softwares herumgetestet (mytube, mythTV, …) und fand das alles aber schrecklich kompliziert (MythTV), nur wenig nützlich (mytube), völlig überladen (MythTV) oder, oder oder… Von den Kollegen habe ich schließlich den Tipp bekommen VDR anzusehen und siehe da: diese Software ist tatsächlich klasse.

Mein Video-Recorder basiert jetzt also auf der Software VDR (Video Disk Recorder) und einigen VDR-Plugins. VDR ist ein Open Source Projekt von einem Menschen namens Klaus Schmidinger und wird von einer großeren Community gepflegt bzw. mit neuen Plugins ausgerüstet.

Welche Distribution?

Ich verwende Ubuntu 9.04 Server. Ubuntu deswegen, weil es die gesamten benötigten Pakete verfügbar hat und Server, weil ich keine graphische Oberfläche haben wollte.

Installation und Konfiguration

(als Root)

apt-get install vdr vdr-plugin-streamdev-server

Nun hat man die grundlegende Software für den VDR. Man benötigt jetzt die Konfigurationsdatei für die Sender. Google hilft hier, wenn man z.B. nach channels.conf München (Ersetze München durch Stuttgart, Bitterfeld, …) sucht. Die so festgestellten Sender werden in die /etc/vdr/channels.conf eingetragen (die bereits in der Datei eingetragenen Sender kann man auch getrost rauswerfen). In /etc/default/vdr setzt man nun noch Enabled = 1 und fügt den Pfad in das gewünschte Aufnahmeverzeichnis hinzu: VIDEO_DIR=/media/disk/vdr. In meinem Fall liegt dieser Pfad auf einer externen Festplatte. Jetzt könnte man den VDR starten, bedienen kann man ihn so aber noch nicht. Schön wäre es doch z.B. eine Webseite zu haben, mit der man den VDR programmieren könnte, eh voila:

apt-get install vdr-plugin-live

Nach ein paar Sekunden wäre auch diese Installation abgeschlossen und man kann sich nun mit dem Webbrowser seiner Wahl zum VDR bzw. seiner Administrationsoberfläche verbinden: http://ip-des-vdr:8008

vdr

Wie man so ein wenig auf dem Bild erkennen kann, beinhaltet dies diverse Übersichten, z.B. was läuft jetzt, was läuft nachher bzw. was läuft den Tag über auf einem bestimmten Sender. Durch einen Klick auf den roten Knopf vor einer Sendung, wird diese programmiert und auch aufgenommen. Eine wirklich feine Sache.

Ein ziemlich tolles Plugin für VDR Live, die Weboberfläche des VDR, ist epgsearch. Mit

apt-get install vdr-plugin-epgsearch

bekommt man die Möglichkeit geliefert die über DVB ausgestrahleten elektronischen Programminfos nach Sendungsnamen, etc zu durchsuchen. So dürfte also niemand mehr seine Lieblingssendung verpassen

Über VDR Live kann man aber nicht nur Aufnahmen programmieren, sondern auch einen Video Stream des aktuellen Programms zu seinem Rechner pumpen lassen. Hierzu muss man aber erst in /etc/vdr/plugins/streamdevhosts.conf den Rechner an bzw. das Netz in das gestreamed werden darf eintragen: z.B.: 192.168.178.1/8

Aufgenommene Videos ansehen:

VDR Live sollte theoretisch auch Streams der aufgenommenen Sendungen auslösen können. Das klappt bei mir aber komischerweies überhaupt nicht. Ich war daher so frei und habe auf dem eeePC einen Apache Webserver installiert und in /var/www einen Link auf das Video-Verzeichnis der externen Festplatte gesetzt. So kann ich nun per Browser durch den Folder Tree navigieren, die URL der Videos kopieren und in VLC (Video Lan Client) öffnen. Das klappt übrigens hervorragend und sogar die 54MBit WLAN Leitung ist ausreichend schnell, um die Daten zu schaufeln.

VDR hat allerdings eine etwas seltsame Eigenheit: es splittet einen aufgenommenen Film in maximal 2GB große Blöcke. D.h. ein Film von gut zwei Std. Länge erstreckt sich immer über zwei Dateien. Ich vermutete zunächst, dass man irgendwelche komplizierte Software braucht, um die Filmfragmente zusammenzufügen und suchte mehrere Stunden nach der betreffenden Info. Irgendwann kam ich auf die Idee kam mal ein cat teil1.vdr teil2.vdr >> video.mpeg zu versuchen. Eh voila: es hat funktioniert -man muss also nur die Dateien konkatenieren (zusammenhängen). Für einen überlangen Film (mit mehr als 2 Fragmenten) kann man auch einfach

cat ???.vdr >> video.mpeg

eingeben und erhält das komplette Video. Dieses kann dann natürlich wieder wie oben beschrieben durch den Apache gestreamed werden…