Next Previous Contents

12. Running MythTV

Now you can bring up the whole system for the first time. Open up another command prompt window, and in this one launch mythbackend

$ mythbackend

In your first command prompt launch mythfrontend.

$ mythfrontend

See if it all works. From the main menu press Escape and select the right option to exit mythfrontend. If you have a tuner problem and the screen is black when you select watch liveTV do an ALT-TAB back to the command prompt window you launched from, and here press CTRL-C to stop mythtvfrontend.

To improve video performance set mythfrontend to run as SUID root. This has security implications, and so you should read up on 'SUID root' before doing this.

# chmod +s /usr/bin/mythfrontend 

Note: this doesn't actually seem to do the job, as mythfrontend still complains about not being SUID... more to follow on this.

12.1 Make the SVIDEO output work

To make our nVidia FX5200 output to the TV, we need to do some xorg.conf editing. The picture quality on the TV is better when there is no monitor connected to the computer. Perhaps it is something to do with refresh rates and v-sync as movement on the TV is noticeably jagged and strobe-like if you run a dual-head setup. So to avoid this I use the following xorg.conf file:

# XFree86 4 configuration created by pyxf86config
Section "ServerLayout"
   Identifier "Default Layout"
   Screen 0 "Screen0" 0 0
   InputDevice "Mouse0" "CorePointer"
   InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "Files"
   RgbPath "/usr/X11R6/lib/X11/rgb"
   FontPath "unix/:7100"
EndSection
Section "Module"
   Load "dbe"
   Load "extmod"
   Load "fbdevhw"
   Load "glx"
   Load "v4l"
   Load "record"
   Load "freetype"
   Load "type1"
EndSection
Section "InputDevice"
   Identifier "Keyboard0"
   Driver "kbd"
   Option "XkbModel" "pc105"
   Option "XkbLayout" "us"
EndSection
Section "InputDevice"
   Identifier "Mouse0"
   Driver "mouse"
   Option "Protocol" "IMPS/2"
   Option "Device" "/dev/input/mice"
   Option "ZAxisMapping" "4 5"
   Option "Emulate3Buttons" "yes"
EndSection
Section "Monitor"
   Identifier "Monitor0"
   VendorName "TV"
   ModelName "Loewe Xelos"
   HorizSync 30.0 - 50.0
   VertRefresh 50.0 - 70.0
   DisplaySize 672 378 # this is for a 16:9 tv
EndSection
Section "Device"
   Identifier "Videocard0"
   Driver "nvidia"
   VendorName "Videocard vendor"
   BoardName "NVIDIA GeForce FX (generic)"
   Option "RenderAccel" "1"
   Option "HWCursor" "1"
   Option "NoLogo" "1"
   Option "NvAGP" "1"
   Option "TVStandard" "PAL-B"
   Option "TVOutFormat" "SVIDEO"
EndSection
Section "Screen"
   Identifier "Screen0"
   Device "Videocard0"
   Monitor "Monitor0"
   DefaultDepth 24
   SubSection "Display"
      Depth 24
      Modes "800x600" "640x480"
   EndSubSection
EndSection

Copy it to /etc/X11, connect a TV to the SVIDEO output of your graphics card and restart X (by doing the init 3 init 5 trick you learned earlier). Once you're happy that the TV display works, lets fine tune the nvidia settings, by running nvidia-settings. My setup is:

We will make the nvidia-settings load automatically at every boot when we make everything start automatically.

12.2 Making everything automatically start

The mythtv-suite package contains a nice init script which takes care of loading and unloading mythbackend during system boot, so we'll latch on to that and slip start/stop commands for /build/DVICO-Init.sh into the appropriate places. Open /etc/init.d/mythbackend in your editor of choice and add the following lines into the following spots:

edits to /etc/init.d/mythbackend

## In the start() part of the script at lines 27-28

27: start() {
28:   # Start the DVICO FusionHDTV DVB-T drivers
29:   /build/DVICO-Init.sh start
30:   echo -n $"Starting $prog: "
31:   touch /var/run/mythbackend.pid; chown mythtv:mythtv /var/run/mythbackend.pid

## and in the stop() part of the script at lines 46-47

44:   echo
45:   [ $RETVAL = 0 ] && rm -f /var/lock/subsys/$prog /var/run/$prog.pid
46:   # and finally remove the DVICO drivers
47:   /build/DVICO-Init.sh stop
48: }

Ok, now test this by running /etc/init.d/mythbackend stop (to unload the DVICO drivers) and then /etc/init.d/mythbackend start. Check that no error messages pop up in dmesg, or in your logs, and if everything seems good lets make mythbackend start every boot:

# /sbin/chkconfig mythbackend on 

When viewing TV or playing media files the current nVidia driver displays a thin blue line on the left and top edges of the picture. The fix is presented here, and to use it we need to install xvattr like this. We will apply the rest of the fix in a moment.

# rpm -i http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/3/xvattr/xvattr-1.3-4.1.fc3.fr.i386.rpm

Now we need to make mythfrontend start automatically and fix up the nvidia blue line problem, and re-load nvidia-settings on startup. As user 'mythtv' paste the following file to ~/.kde/Autostart/myth-load.sh

#!/bin/bash
# Load nVidia driver custom settings
nvidia-settings --load-config-only &
# Stop the Nvidia blue line problem
xvattr -a XV_COLORKEY -v 66048
# Launch myth frontend
mythfrontend &
exit

Now make it executable by doing the following:

$ chmod +x ~/.kde/Autostart/myth-load.sh

And we need to make mythtv automatically login so that when you turn your computer on it automatically starts up everything. So, do the following:

# gdmsetup

And, as Jarod explains:

In GDM Setup, on the first tab ('General'), you should see a section "Automatic login". Check the box for "Login a user automatically on first bootup" and select your mythtv user from the popup menu. Alternatively, if you are not very comfortable with Linux just yet, and you suspect there may be occasions where you've mucked something up to the point that an auto-login will lock up the computer, you might not want to use Automatic Login. Instead, you might opt to use the "Timed Login" option, to log the mythtv user in a few seconds after the login screen first appears. This way, you can circumvent the mythtv user logging in, and log in as root to hopefully correct whatever you've broken. NOTE: if you installed the packages from kde-redhat, they probably supplanted gdm as your display manager and put kdm in its place. I like the look of Red Hat's gdm much better than kdm, so I changed it back by editing /etc/sysconfig/desktop and setting "DISPLAYMANAGER=GNOME". Not that you should be seeing the login screen often, my box is always sitting there logged in with the Myth UI up. Maybe I'll add some kdm info in a bit... Anyhow, I recommend setting the Kicker (the panel at the bottom of the screen) to auto-hide, so it doesn't end up on-screen during video playback, disabling the screen saver, and disabling any monitor-related dynamic power management, or you may not be able to wake your system up if you don't have a mouse and keyboard connected. You can use the KDE Control Center to disable your screen saver

12.3 configure TV Playback

These settings are what I am using at the moment, but depending on your hardware the optimum settings may be different.

Don't forget to enable automatic running of mythfilldatabase.


Next Previous Contents