Contact us
Leave a message

Bitte benutzen:

Mein öffentlicher Kryptographie-Schlüssel


Mitglied bei

Endlich: MythTV

MythTV wird -- nach Auflösen der zahllosen Abhängigkeiten, was aber dank marillats Multimedia-Repository kein Problem ist -- direkt aus den Quellen compiliert & installiert. Dazu folgende kleine Hilfs-Skripte, die auch das gelegentliche Update auf die neueste Version aus dem SVN-Repository erleichtern:

/usr/src/updatemyth

#!/bin/sh

# updatemyth -- gets latest mythtv version from SVN
# Usage: updatemyth path_to_mythtv_sources

CURRENT_DIR=$PWD

cd $1
cd mythtv
svn update
cd ..
cd myththemes
svn update
cd ..
cd mythplugins
svn update
cd ..

cd $CURRENT_DIR

/usr/src/remakemyth

#!/bin/sh

# remakemyth -- uninstall and recompile MythTV
# Usage: remakemyth path_to_mythtv_sources

./removemyth $1
./makemyth $1

/usr/src/removemyth

#!/bin/sh

# removemyth -- uninstall MythTV
# Usage: removemyth path_to_mythtv_sources

CURRENT_DIR=$PWD
cd $1
echo Working in `pwd`

cd mythplugins
echo --- uninstalling mythplugins --------------------------------------------------
sudo make uninstall
sudo make clean
cd ../myththemes
echo --- uninstalling myththemes ---------------------------------------------------
sudo make uninstall
sudo make clean
cd ../mythtv
echo --- uninstalling mythtv -------------------------------------------------------
sudo make uninstall
sudo make clean
cd $PWD

/usr/src/makemyth

#!/bin/sh

# remakemyth -- compile and re-install MythTV
# Usage: makemyth path_to_mythtv_sources

CURRENT_DIR=$PWD
cd $1
echo Working in `pwd`

cd mythtv
echo --- configuring mythtv --------------------------------------------------------
./configure\
  --prefix=/usr/\
  --arch=c3-2\
  --enable-proc-opt\
  --enable-audio-oss\
  --enable-audio-alsa\
  --disable-audio-arts\
  --disable-audio-jack\
  --enable-frontend\
  --enable-backend\
  --enable-lirc\
  --disable-joystick-menu\
  --disable-firewire\
  --disable-freebox\
  --disable-dbox2\
  --disable-hdhomerun\
  --disable-crciprec\
  --disable-ivtv\
  --enable-dvb\
  --dvb-path=/usr/src/linux/include/\
  --enable-x11\
  --enable-xrandr\
  --enable-xv\
  --enable-xvmc\
  --enable-xvmc-vld\
  --disable-xvmc-pro\
  --disable-xvmc-opengl\
  --xvmc-lib=viaXvMC\
  --disable-mac-accel\
  --disable-opengl-vsync\
  --disable-directfb\
  --disable-directx
echo --- compiling mythtv ----------------------------------------------------------
qmake mythtv.pro
make
echo --- installing mythtv ---------------------------------------------------------
sudo make install
cd ..

cd myththemes
echo --- processing myththemes -----------------------------------------------------
./configure --prefix=/usr
qmake myththemes.pro
make
sudo make install
cd ..

cd mythplugins
echo --- configuring mythplugins ---------------------------------------------------
./configure\
  --prefix=/usr\
  --enable-opengl\
  --enable-mytharchive\
  --enable-create-dvd\
  --disable-create-archive\
  --disable-mythbrowser\
  --enable-mythcontrols\
  --enable-mythdvd\
  --enable-transcode\
  --enable-vcd\
  --disable-mythflix\
  --enable-mythgallery\
  --enable-exif\
  --enable-new-exif\
  --enable-mythgame\
  --enable-mythmusic\
  --enable-fftw\
  --enable-sdl\
  --disable-aac\
  --enable-mythnews\
  --disable-mythphone\
  --disable-festival\
  --enable-mythvideo\
  --disable-mythweather
echo --- compiling mythplugins -----------------------------------------------------
qmake mythplugins.pro
make
echo --- installing mythplugins ----------------------------------------------------
sudo make install
cd $CURRENT_DIR

echo --- setting sticky flag -------------------------------------------------------
sudo chmod +s /usr/bin/mythfrontend

echo --- done ----------------------------------------------------------------------

Automatischer Start von MythTV

Zunächst wurde in "/etc/rc.5" ein Start-Link "S30mythtv-backend" auf das "mythtv-backend"-Skript angelegt, um das Backend im Runlevel 5 automatisch zu starten. Das Start/Stop-Skript ist eine Modifikation entweder der Version, die mit dem Myth-Quellcode mitkommt, oder sie beruht auf dem Skript des mythtv-backend-Paketes von www.debian-multimedia.org -- so genau weiß ich das leider nicht mehr... ;-)

Weiterhin wurde die "/etc/inittab" wie folgt modifiziert:

/etc/inittab

# /etc/inittab: init(8) configuration.
# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $

# The default runlevel.
#--- CHANGED ----------------------------------------------
# Default runlevel is set to 5
id:5:initdefault:
#----------------------------------------------------------

# Boot-time system configuration/initialization script.
# This is run first except when booting in emergency (-b) mode.
si::sysinit:/etc/init.d/rcS

# What to do in single-user mode.
~~:S:wait:/sbin/sulogin

# /etc/init.d executes the S and K scripts upon change
# of runlevel.
#
# Runlevel 0 is halt.
# Runlevel 1 is single-user.
# Runlevels 2-5 are multi-user.
# Runlevel 6 is reboot.

l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
# Normally not reached, but fallthrough in case of emergency.
z6:6:respawn:/sbin/sulogin

# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

# Action on special keypress (ALT-UpArrow).
#kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work."

# What to do when the power fails/returns.
pf::powerwait:/etc/init.d/powerfail start
pn::powerfailnow:/etc/init.d/powerfail now
po::powerokwait:/etc/init.d/powerfail stop

# /sbin/getty invocations for the runlevels.
#
# The "id" field MUST be the same as the last
# characters of the device (after "tty").
#
# Format:
#  :::
#
# Note that on most Debian systems tty7 is used by the X Window System,
# so if you want to add more getty's go ahead but skip tty7 if you run X.
#
1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6

# Example how to put a getty on a serial line (for a terminal)
#
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100

# Example how to put a getty on a modem line.
#
#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3

#--- CHANGED ----------------------------------------------
# Do some last preparations for MythTV
twk:2345:once:/usr/local/sbin/tweak
# Launch X as user mythtv
myfe:5:respawn:/bin/su - mythtv -c "/usr/X11R6/bin/startx -- -quiet -dpi 100 -layout TV"
#----------------------------------------------------------

Wichtigste Änderungen: Der Default-Runlevel ist jetzt 5, und am Ende der Initialisierung wird zum einen das tweak-Skript aufgerufen...

/usr/local/sbin/tweak

# tweak -- called during system init; performs everything
#          required to be done before starting mythtv

# Initialize some variables
source /usr/local/bin/initSleepVars

# Set current time via ntp
ntpdate $NTP_SERVER

# Ensure BIOS clock is set correctly
hwclock -w --noadjfile --utc

# Set maximum DVD speed to 4x
hdparm -E 4 /dev/hdc

# Launch irexec daemon
killall irexec
irexec -d /etc/lirc/lircrc

# Launch lirc X event daemon
killall irxevent
irxevent /etc/lirc/lircrc &

# Prepare network adapter for Wake-on-LAN
ethtool -s eth1 wol g

...wohin alles wandert, was vor dem Start von MythTV erledigt sein muss, und zum anderen wird der X-Server für den User mythtv gestartet. Damit startet auch das MythTV-Frontend, denn mythtv's ".xinitrc" sieht wie folgt aus:

/home/mythtv/.xinitrc

# .xinitrc for user mythtv

# Set a background which doesn't cause eye 
# cancer when displayed on a TV ;-)
xsetroot -solid mediumblue 

# Switch of screen blanking when idle
xset s off

# Launch mythfrontend in background
/usr/bin/mythfrontend --logfile /var/log/mythtv/mythfrontend.log &

# Display a nice, large analog clock which will be
# visible when frontend is not running
xclock -g 320x360+200+108 -bw 0 -update 1

Die "xclock" bewirkt, dass sich der X-Server nach Starten des Frontends im Hintergrund nicht sofort wieder beendet -- und außerdem sieht's ganz nett aus, wenn auf dem Fernseher bei abgeschaltetem Frontend wenigstens die aktuelle Uhrzeit zu sehen ist.

Run, level, run!

Im neuen Default-Runlevel 5 wird also X sowie das Frontend gestartet -- für Diagnose-Zwecke möchte man aber vielleicht nicht mal das Backend automatisch starten, damit es einem den Rechner (mangels Frontend) nicht gleich wieder schlafen legt. Daher habe ich in allen "/etc/rc.n"-Verzeichnissen für n < 5 die Startlinks für das Backend entfernt und stattdessen Stopplinks angelegt.

Schließlich sollte GRUB noch entsprechend konfiguriert sein, so dass im Normalfall MythTV startet, bei Bedarf jedoch das Diagnose-System gebootet werden kann:

/boot/grub/menu.lst (Ausschnitt)

[...]

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/hda1 ro selinux_init=no quiet vga=785 quiet

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(single-user) single
# altoptions=(single-user mode) single noresume

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## ## End Default Options ##

[...]

Nachtrag zur Couch

Auch MythTV möchte man sicher per Fernbedieung steuern können -- glücklicherweise versteht sich MythTV von Natur aus mit Lirc und kann mittels einer eigenen "lircrc" konfiguriert werden:

Tastenbelegung der Fernbedienung

Taste auf URC 7730 | Taste auf Computer-Keyboard | Funktion
0 - 9 | 0 - 9 | Zahleneingabe
Channel up, Channel down | Bild rauf, Bild runter | Blättern; Wiedergabe: Vor- bzw. Zurückspringen
Mute | "Pipeline" (senkrechter Strich) | Stummschaltung linker / rechter / beide Kanäle (s.u.)
Volume up, Volume down | F11, F10 | Lautstärkenregelung
Left, Right, Up, Down | entsprechende Cursor-Tasten | Menüauswahl
Menu | M | "Kontextmenü" aufrufen
Exit | Esc | Abbrechen/Verlassen
OK | Leertaste (Space) | Auswählen/Aktivieren/OK
16:9 | W | Seitenverhältnisse 4:3, 16:9 etc. durchgehen
Rewind | Cursor links | Wiedergabe: Schnell zurückspulen
Pause | P | Wiedergabe: Pause/Weiter
Play | Eingabetaste (Enter) | OK; Wiedergabe: Position merken/löschen
FFwd | Cursor rechts | Wiedergabe: Schnell vorspulen
Red | Z | Wiedergabe: Werbung überspringen
Green | T | TV: Teletext ein/aus
Yellow | R | TV: aktuelle Sendung aufnehmen (2 x drücken!)
Blue | I | Kontextbezogene Informationen aufrufen (z.B. OSD)

Damit lässt sich MythTV fast komplett bedienen; was man nicht direkt auf der Fernbedienung hat (z. B. "D" für Löschen), lässt sich i. d. R. per "Menu" (Kontextmenü) oder "Blue" (Kontext-Informationen) erreichen.

Noch zwei Dinge zur Tastenbelegung:

  • Wenn man irgendwo tief in den MythTV-Konfigurationsdialogen die Option "Mute left and right channel separately" aktiviert, lässt sich mittels "Mute" ("|") zuerst der linke, dann der rechte und beim 3. Tastendruck beide Kanäle stummschalten. Sehr praktisch bei der ein oder anderen Sendung auf den besseren (d. h. öffentlich-rechtlichen) Sendern, wo gelegentlich mal auf einem der Känale der Originalton oder Kommentare für Sehbehinderte untergebracht werden!
  • Aktivieren des Teletextes erforderte die Umbelegung der Taste "T" von "TOGGLETT" auf "TOGGLETM" im MythTV-Keyboard-Editor (oder per MythWeb)