Greg's MythTV on Linux HOWTO page
Greg's home page
HOWTO home
Greg's diary
Greg's photos
Greg's links

This is an old document of little practical value. I'm leaving it here in case I can find some use in it. At least it documents the pain.

I've spent an inordinate amount of time trying to set up MythTV, an application for watching TV on a computer running Linux or possibly FreeBSD. It seems that just about everybody who has installed MythTV has had significant problems, and my main concern is that I might install it, get it to work, and then have to go through the same pain next time I try to install it. This page is intended to remind me of the steps. It's mainly for my own reference, but it may help others.

This stuff is now significantly out of date. I've since ported MythTV to FreeBSD, and I'm writing a separate page for FreeBSD.

Installing MythTV on Linux

I've tried this with Debian, Ubuntu and Fedora. So far I seem to have had the least problems with Fedora, so that's what I describe. This description roughlys follow Jarod C. Wilson's Step-by-step guide to building a MythTV System on Fedora Core 4 w/ATrpms. It differs in two ways:
  1. It's tailored for my system. If your hardware is very different, you'll probably find Jarod's version more use.
  2. As the name suggests, this currently doesn't relate directly to Fedora Core 5, and some details have changed. By the time you read this, the situation may have changed.

Note also the MythTV HOWTO.

Installing xawtv

You don't need xawtv for MythTV (I think), but it's helpful to have a second application if the thing doesn't work. Installing requires the following steps:


  1. Install Fedora Core 5. Try to get it to install as much as possible. I still failed to install important things like the X libraries and kernel sources, both of which may be necessary.
  2. Get the system up to date:

    yum upgrade
  3. Configure third party repositories:
    # cd /etc/yum.repos.d/
    # wget
    # wget
    Jarod goes into some detail on what to do if these steps go wrong.
  4. Possibly set up audio. Jarod describes this, but it doesn't seem to be necessary on my hardware.

  5. Install an analogue tuner. Mine is an MSI “TV@nywhere Master” (who thinks out these names?), which includes a remote control. It is detected immediately by the kernel:

  6. CORE cx88[0]: subsystem: 1462:8606, board: MSI TV-@nywhere Master [card=7,autodetected]
    TV tuner 33 at 0x1fe, Radio tuner -1 at 0x1fe
    i2c_adapter i2c-0: nForce2 SMBus adapter at 0x5000
    i2c_adapter i2c-1: nForce2 SMBus adapter at 0x5040
    ohci_hcd: 2005 April 22 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)
    input: cx88 IR (MSI TV-@nywhere Master as /class/input/input2
    cx88[0]/0: found at 0000:01:08.0, rev: 5, irq: 10, latency: 32, mmio: 0xe6000000
    tuner 2-0061: chip found @ 0xc2 (cx88[0])
    tuner 2-0061: microtune: companycode=3cbf part=42 rev=22
    tuner 2-0061: microtune MT2050 found, OK
    tda9887 2-0043: chip found @ 0x86 (cx88[0])
    cx88[0]/0: registered device video0 [v4l2]
    cx88[0]/0: registered device vbi0
    cx88[0]/0: registered device radio0
    set_control id=0x980900 reg=0x310110 val=0x00 (mask 0xff)
    set_control id=0x980901 reg=0x310110 val=0x3f00 (mask 0xff00)
    set_control id=0x980903 reg=0x310118 val=0x00 (mask 0xff)
    set_control id=0x980902 reg=0x310114 val=0x5a7f (mask 0xffff)
    set_control id=0x980909 reg=0x320594 val=0x40 (mask 0x40) [shadowed]
    set_control id=0x980905 reg=0x320594 val=0x20 (mask 0x3f) [shadowed]
    set_control id=0x980906 reg=0x320598 val=0x40 (mask 0x7f) [shadowed]

    This driver also handles the remote control; other cards with a remote control interface may not be recognized. Potentially lirc can help there, but I haven't investigated that yet.

  7. Install an el-cheapo SiS video card based on the SiS 315 chip set:
  8. 02:00.0 VGA compatible controller: Silicon Integrated Systems [SiS] 315PRO PCI/AGP VGA Display Adapter (prog-if 00 [VGA])
            Subsystem: Silicon Integrated Systems [SiS] 315PRO PCI/AGP VGA Display Adapter
            Flags: bus master, 66MHz, medium devsel, latency 39, IRQ 5
            BIST result: 00
            Memory at d0000000 (32-bit, prefetchable) [size=256M]
            Memory at e5000000 (32-bit, non-prefetchable) [size=256K]
            I/O ports at c000 [size=128]
            [virtual] Expansion ROM at e4000000 [disabled] [size=64K]
            Capabilities: [40] Power Management version 2
            Capabilities: [50] AGP version 2.0
  9. Create a user mythtv. Give it the home directory /home/mythv.

  10. Pick up the latest SiS drivers from Thomas Winischhofer's web site. The instructions in Jarod's page no longer apply completely; instead,
  11. mkdir -p ~mythtv/sources/sis_drv
    cd ~mythtv/sources/sis_drv
    tar -xzvf sis_drv.o_xorg_gcc3_current.tar.gz
    mv /usr/lib/xorg/modules/drivers/ /usr/lib/xorg/modules/drivers/
    cp -p /usr/lib/xorg/modules/drivers/
    It's very likely that the name will change; the SiS chipset overview and the directory listing of may help further. In this version, I'm looking for the file
  12. Get MythTV:

    # yum install mythtv-suite
  13. Install lirc:

    # yum install lirc-kmdl-`uname -r`
    # yum install lirc
    Jarod suggests storing the result of the uname -r invocation in a variable KVER, so this could also be:
    # yum install lirc-kmdl-$KVER
    # yum install lirc
    Setting up lirc is a particularly painful process. In my case, use the following:
    # wget
    # cat TVatnywhere >> /etc/lircd.conf
  14. Follow the instructions in TVatnywhere. The IR remote control will appear as a device in /dev/input/eventX. To find out the value of X, check in /proc/bus/input/devices. You should see something like:
      I: Bus=0001 Vendor=1462 Product=8606 Version=0001
      N: Name="cx88 IR (MSI TV-@nywhere Master"
      P: Phys=pci-0000:01:08.0/ir0
      S: Sysfs=/class/input/input2
      H: Handlers=kbd event2
      B: EV=100003
      B: KEY=20c0000 800000 0 0 0 4 10000 100 0 1e0000 0 2 10100ffc

    The 2 in the line starting with H: gives the clue as to the device name; it's /dev/input/event2.

  15. Start lircd like this:

    # lircd -H dev/input -d /dev/input/event2
  16. At this point, you should be able to display the infrared codes with irw. If this doesn't work, consider writing a new file with irrecord:
    # irrecord -W dev/input -d /dev/input/event2
    Follow the instructions.
  17. Set up MySQL:
    # /sbin/chkconfig mysqld on
    # /sbin/service mysqld start

    This registers mysqld (the MySQL server) as a service that should be started on boot, and then starts it.

  18. Set the mysql root password. Replace ROOT_PWD with your password

    # mysql -u root mysql
    mysql> UPDATE user SET Password=PASSWORD('ROOT_PWD') WHERE user='root';
    mysql> quit
  19. Next, create mythconverg, the MythTV database:

    $ mysql -u root -p < /usr/share/doc/mythtv-0.19/database/mc.sql
    Enter the password you just set above when prompted.
  20. Create a directory for storing video, and give it to user mythtv:

    # mkdir /spool/video
    # chown mythtv /spool/video
    # chmod 777 /spool/video

    I have my doubts about setting the permissions to 777, but that's what the MythTV HOWTO says.

  21. Ensure that all multimedia devices belong to mythtv after boot. I don't know how to do this correctly. On Fedora Core 5, it seems that after reboot they have permissions rw------- and belong to root. I've put this in /etc/rc.local, which gets executed after all the other rc scripts:
    # Make  sure  anybody  can  access multimedia  interfaces.   The  boot
    # sequence seems to give them back to root.
    chmod 666 /dev/adsp /dev/audio /dev/dsp /dev/mixer /dev/sequencer \
              /dev/sequencer2 /dev/radio0 /dev/vbi0 /dev/video0 /dev/snd/*
  22. Run mythtvsetup. It's supposed to be self-explanatory. Here are some explanations:
    • The cursor works, but is invisible. If you're a real mouse addict, you may still be able to work out where the cursor is.
    • The area towards the bottom sometimes displays a text explaining the field with focus. The test is frequently truncated.
    • You will be positioned on the bottom line of each menu page. Right arrow moves left, left arrow moves right. The highlighted box is the slightly brighter one.
    • In the "Global Backend Setup", select “TV format” by moving the cursor until the text on the bottom line reads “The TV standard to use for viewing TV”. This means that the top line (“TV format”) has focus. Don't hit Enter! If you have PAL-BG, like most of the world, decide whether to select PAL or PAL-BG..
    • In VBI format, select “PAL Teletext” if any channel in your area offers it. Presumably you would select NTSC Closed Caption if you use NTSC.

Greg's home page Greg's diary Greg's photos
Valid XHTML 1.0! $Id: mythtv-setup.html,v 1.8 2009/07/20 23:45:42 grog Exp $