At the end of my /etc/rc.d/rc.local (Slackware) I have the following:
if [ -x /etc/rc.d/rc.pvr ]; then
if ! grep nopvr /proc/cmdline 1> /dev/null 2> /dev/null ; then
. /etc/rc.d/rc.pvr start
fi
fi
Then I have rc.pvr which is in charge of loading the ivtv stuff and start mythbackend if the machine has those init scripts available. Note, my backend is using ivtv 0.20rcj so the rc.ivtv would have to be updated for a newer version of ivtv. As well I've added my .xinitrc. The detail minded of you will notice that I adjust the overscan twice right in a row. I do this as I've found many times where the nvidia drivers will adjust overscan after a video mode change, but still think they are using the previous overscan setting. So I force it to change in order to change it back to what I want.
I do something similar in a resetvideo.sh script which I call after something in mythgame exits
I can disable any portion of this using "nopvr, noautologin, noivtv, nomythtv" at the lilo boot prompt.
mythtv@woop:~$ cat /etc/rc.d/rc.pvr
#!/bin/sh
# Don't load ivtv if 'noivtv' was given at boot.
if [ -x /etc/rc.d/rc.ivtv ]; then
if ! grep noivtv /proc/cmdline 1> /dev/null 2> /dev/null ; then
. /etc/rc.d/rc.ivtv start
fi
fi
# Don't load mythtv if 'nomythtv' was given at boot.
if [ -x /etc/rc.d/rc.mythtv ]; then
if ! grep nomyth /proc/cmdline 1> /dev/null 2> /dev/null ; then
. /etc/rc.d/rc.mythtv start
fi
fi
#
# Don't load the dxr3 if 'nodxr3' was given at boot.
#if [ -x /etc/rc.d/rc.dxr3 ]; then
# if ! grep nodxr3 /proc/cmdline 1> /dev/null 2> /dev/null ; then
# . /etc/rc.d/rc.dxr3 start
# fi
#fi
if ! grep nosensors /proc/cmdline 1> /dev/null 2> /dev/null ; then
echo "Loading i2c/lm sensors"
modprobe i2c-sensor
modprobe i2c-isa
modprobe w83627hf
/usr/bin/sensors -s
fi
if ! grep noautologin /proc/cmdline 1> /dev/null 2> /dev/null ; then
echo "Launching XWindows"
su - mythtv -c "bash -l startx -- -dpi 100" &
fi
mythtv@woop:~$ cat /etc/rc.d/rc.ivtv
#!/bin/sh
#
# /etc/rc.d/rc.ivtv
#
# Start/stop/restart the ivtv device driver modules.
#
ivtv_load() {
echo "Loading IVTV Driver Modules"
echo -n "tuner..."
/sbin/modprobe tuner type=2
echo -n "msp3400..."
/sbin/modprobe msp3400
echo -n "saa7115..."
/sbin/modprobe saa7115
echo -n "ivtv..."
/sbin/modprobe ivtv
echo "Done!"
echo "Setting PVR to NTSC - 720x480"
/usr/local/bin/ivtvctl -u 0x3000
/usr/local/bin/ivtvctl -p 4
/usr/local/bin/ivtvctl -f width=720,height=480
# /usr/local/bin/ivtvctl -c dnr_mode=0,dnr_temporal=4,dnr_spatial=4
/usr/local/bin/ivtvctl -d /dev/video1 -u 0x3000
/usr/local/bin/ivtvctl -d /dev/video1 -p 4
/usr/local/bin/ivtvctl -d /dev/video1 -f width=720,height=480
# /usr/local/bin/ivtvctl -d /dev/video1 -c dnr_mode=0,dnr_temporal=4,dnr_spatial=4
}
ivtv_unload() {
echo "Unloading IVTV Driver Modules"
echo -n "saa7115..."
rmmod saa7115
echo -n "ivtv..."
rmmod ivtv
echo -n "msp3400..."
rmmod msp3400
echo -n "tuner..."
rmmod tuner
echo -n "tveeprom..."
rmmod tveeprom
echo "Done!"
}
ivtv_reload() {
ivtv_unload
sleep 2
ivtv_load
}
case "$1" in
'start')
ivtv_load
;;
'stop')
ivtv_unload
;;
'restart')
ivtv_reload
;;
'reload')
ivtv_reload
;;
*)
# Default is "start", for backwards compatibility with previous
# Slackware versions. This may change to a 'usage' error someday.
ivtv_load
esac
mythtv@woop:~$ cat /etc/rc.d/rc.mythtv
#!/bin/sh
#
# /etc/rc.d/rc.mythtv
#
LOGFILE="/var/log/mythtv.log"
PIDFILE="/var/run/mythbackend.pid"
mythtv_load() {
if [ -x /usr/local/bin/mythbackend ]; then
echo "Launching MythBackend"
/usr/local/bin/mythbackend --logfile $LOGFILE --pidfile $PIDFILE -d
fi
}
mythtv_unload() {
echo "Shutting down MythBackend"
kill `cat $PIDFILE`
}
mythtv_reload() {
mythtv_unload
sleep 1
mythtv_load
}
case "$1" in
'start')
mythtv_load
;;
'stop')
mythtv_unload
;;
'restart')
mythtv_reload
;;
'reload')
mythtv_reload
;;
*)
# Default is "start", for backwards compatibility with previous
# Slackware versions. This may change to a 'usage' error someday.
mythtv_load
esac
And my ~mythtv/.xinitrc
mythtv@woop:~$ cat .xinitrc
DISPLAY=:0 /usr/bin/nvidia-settings --assign="TVOverScan=24"
DISPLAY=:0 /usr/bin/nvidia-settings --assign="TVOverScan=25"
DISPLAY=:0 /usr/bin/nvidia-settings --assign="TextureSharpen=1"
DISPLAY=:0 /usr/bin/nvidia-settings --assign="TVFlickerFilter=1"
xset s off
exec /usr/local/icewm/bin/icewm-session
xset s off
mythtv@woop:~$ cat .icewm/startup
/usr/local/bin/mythfrontend&
This once I call after any emulator in mythgame finishes to ensure my resolution and overscan get back to what I want them to be.
mythtv@woop:~$ cat /usr/local/bin/resetvideo.sh
#!/bin/sh
export DISPLAY=:0
echo "Using xrandr to reset video resolution"
/usr/X11R6/bin/xrandr -s 0/720x480
echo "Resetting Overscan"
/usr/bin/nvidia-settings --assign="TVOverScan=24"
/usr/bin/nvidia-settings --assign="TVOverScan=25"
echo "Enabling Texturesharpen"
/usr/bin/nvidia-settings --assign="TextureSharpen=1"
echo "Resetting Flicker Filter"
/usr/bin/nvidia-settings --assign="TVFlickerFilter=1"