Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: Two tv's connected to one vdr-mashine



Hi! 
 
this is exactly what I am planning, too. I want to run two DVB-cards in the same PC and watch 
different channels on either of the cards. I have found out that some people already have realized 
this. Obviously, it is only necessary to load the DVB driver once and after that start two instances 
of vdr with VDR1 and VDR2 using different video- and config-directories. A person working at the 
heise magazine has written a runvdr-script for three vdr-instances; I have modified this a bit in 
order to work with only 2 instances, but I don't if it will work yet. Could anyone of you look over it 
and tell me if this will work that way? I also don't understand what the "Endlos-Schleife" does 
exactly, as I am not a script-guru...here is the code, thank you in advance: 
 
 
#!/bin/sh 
# 
# copyright Juergen Schmidt, c't magazin 
# 
# Licence: GPL 
# 
# call  ./runvdr [vdr-dir] [port1] [port2] 
# 
 
 
# VARIABLEN 
TVDIR=/usr/local/src 
 
VDRDIR=${1:-$TVDIR/VDR} 
PORT1=${2:-2001} 
PORT2=${3:-2002} 
 
VDRPRG="$VDRDIR/vdr" 
DVBDIR="/usr/local/src/DVB/driver" 
 
 
 
## BEFEHLE ZUM STARTEN DER JEWEILIGEN VDR-INSTANZEN 
 
# VDR-Instanz 1 
 
VDR1CMD="$VDRPRG -d -w 60 -p $PORT1 -D 0 -v /video1 -c /usr/local/vdr/etc1 -E /video1/
epg.data -t /dev/tty8" 
 
# VDR-Instanz 2 
 
VDR2CMD="$VDRPRG -d -w 60 -p $PORT2 -D 1 -v /video2 -c /usr/local/vdr/etc2 -E /video2/
epg.data -t /dev/tty9" 
 
ALIVE1="/bin/fuser -sn tcp $PORT1" 
ALIVE2="/bin/fuser -sn tcp $PORT2" 
 
# alternatives 
#ALIVE1="echo 'quit' | nc localhost $PORT1" 
#ALIVE1="/bin/fuser -sn file /dev/ost/frontend0" 
 
 
echo "==================" 
echo " external Restart " 
echo "==================" 
 
 
# Startet den LIRC-Daemon 
/usr/local/sbin/lircd & 
 
 
 
# Endlos-Schleife 
while (true) do 
      echo "--------------" 
      echo -n "Starting VDR: "; date 
      # SIND DIE DVB-TREIBER BEREITS GELADEN? 
      LSMOD="`/sbin/lsmod | grep -w '^dvb' | wc -l`" 
      if [ $LSMOD -eq 0 ] ; then 
	echo "Loading DVB drivers" 
	(cd $DVBDIR; make insmod) > /dev/null 2>&1 
      fi 
      $VDR1CMD; $VDR2CMD 
      sleep 30 
 
      RESTART=0 
 
      while [ $RESTART -eq 0 ] ; do 
 
	sleep 30 
 
	if ( ! $ALIVE1 ) ; then 
	    echo -n "VDR 1 died (restarting): "; date 
	    # try to restart process 
	    $VDR1CMD 
	    sleep 5 
	    if ( ! $ALIVE1 ) ; then 
		RESTART=1 
		echo "Restart failed - shutting down" 
	    fi 
	fi 
 
	if ( ! $ALIVE2 && [ $RESTART -eq 0 ] ) ; then 
	    echo -n "VDR 2 died (restarting): "; date 
	    $VDR2CMD 
	    sleep 5 
	    if ( ! $ALIVE2 ) ; then 
		RESTART=1 
		echo "Restart failed - shutting down" 
	    fi 
	fi 
 
	if [ $RESTART -eq 1 ] ; then 
	    echo "- - - - - - - -" 
	    echo -n "VDR died: "; date 
	    # einige Debugging-Informationen 
	    /bin/fuser -vn tcp $PORT1 $PORT2 
	    # ps auxw | grep vdr 
	    dmesg | grep dvb | tail -4 
	    killall -TERM vdr 
	    sleep 5 
	    killall -9 vdr 
	    (cd $DVBDIR; make rmmod) > /dev/null 2>&1 
	fi 
    done 
done 
 
______________________________________________________________________________
WEB.DE FreeMail wird 5 Jahre jung! Feiern Sie mit uns und
nutzen Sie die neuen Funktionen http://f.web.de/features/?mc=021130



-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index