From MythTV Official Wiki
Jump to: navigation, search

Electrical engineer with a decent (abet aging) software background (not up on OO programming yet).


  • Video capture: Dual tuner HDHR
  • Hard drives:
    • RAID-1 with 2x Western Digital WD7500AAKS 750 GB SATA, each extracted from a mybook external USB exclosure (p/n WDG1U7500N)
    • Media storage on a Samsung F4EG 2TB HD204UI with "fixed" firmware
  • Processor: E2200 (2.2 GHz) Core 2 Duo (/proc/cpuinfo says 4392.21 bogomips)
  • Motherboard: an el-cheapo (actually, free from Fry's with the processor purchase) | ECS 945GCT-M V2.0 uATX, with
    • 82801G (ICH7) chipset: [8086:27cc] (rev 01)
    • 82801 PCI Bridge: [8086:244e] (rev e1)
    • 82945G/GZ Integrated Graphics and memory Controller [8086:2772] (rev 02)
    • Realtek RTL8101E PCI Express Fast Ethernet controller [10ec:8136] (rev 01)
  • EVGA Nvidia GT430 configured to use PulseAudio:default. It also appears ALSA:plughw:1,9 which I have selected as a separate digital output device under advanced audio.
    • Perhaps not completely necessary, but JYA seemed to imply this would lower log messages: echo 128 | sudo tee /proc/asound/card1/pcm9p/sub0/prealloc

This all worked with no configuration troubles.

Main system (not including video in and out) consumes around 90 Watts when idle, and ~125 Watts when fully loaded, including several sessions of Firefox open with many tabs on each session.

Retired equipment:

  • Video in/capture: Hauppauge WinTV-PVR-USB2 using composite inputs from cable box (a DCT2524/1614) controlled by RS-232
  • Video out: VGA to SVIDEO Scan converter: Scan-IT 1024 Pro Plus (which is a relabeled unit made by Averkey)

Steps used for install

In the hopes of helping other less experienced people being able to bring up their own system without spending as much time as I had to spend hunting down various items, here is a step by step list of what I used to install:

  1. Grabbed alternate install .iso CD for Ubuntu, because I wanted to do RAID
  2. Installed Ubuntu:
    • Partitioned two drives identically:
      1. XFS for /var, w/allocsize in /etc/fstab set to 512 Meg to reduce fragmentation): noatime,nodiratime,logbufs=8,allocsize=512m
      2. EXT3 for /boot
      3. EXT3 for everything else
    • Set each partition to be RAID 1 protected with its twin on the other drive
    • Set LVM on top of the RAID 1 for each partition except boot
    • Possibly a few other steps I've forgotten
  3. Let Ubuntu update itself
  4. $ apt-get install mythbuntu-desktop
    That's it! Well, not really. Now for some follow-up work. Also check out [1] for follow-up ideas.
  5. Get VNC working (seems like myth control center should do this when you enable VNC)
    • Add "DisallowTCP=false" to file "/etc/gdm/gdm.conf-custom" so remote vnc will work
    • Uncomment the unset line in ~/.vnc/xstartup
    • chmod 0750 xstartup (may already be that way)
    • add gnome-session& or xfce4-panel & xfwm4 to xstartup
      (KDE isn't installed by default)
    • I wasn't happy with the default 1024x768 resolution when I launched vncserver and connected to it with a vnc client, so I created an alias:
      alias vnc='echo "vncserver -geometry 1280x1024";vncserver -geometry 1280x1024'
      (if and when I want a smaller 1024 window, I just run vncserver rather than my alias)
  6. Enable mythfilldatabase to run regularly (yet another thing that should be prompted at install and auto configured): "mythfilldatabase Log Path" must be set to a writable filename (ex: /var/log/mythtv/mythfilldatabase.log), not a directory name.
  7. Needed channel changer controller:
    • Hunt for hours to find the name of the serial-port channel changing program for Motorola cable boxes. Finally found it on the Ubuntu website. Turns out that it is: dct-channel.tar.bz2
    • Downloaded it
    • $ apt-get install libc6 (install C compiler - includes libc6-dev)
    • $ tar xjvf dct-channel.tar.bz2
    • $ make
    • For firewire, check out
  8. $ apt-get install smartmontools ... or hddtemp (temperature reading util)
  9. $ apt-get install xfsdump (XFS filesystem Administrative utils) - maybe not needed
  10. Now for lirc. Considering how easy everything else is, I'm still trying to figure out why lirc has to be so hard.
  11. After many hours of searching on the web for the latest /etc/lirc/lircd.conf file, I stumbled upon a posting that pointed out lirc files in /usr/share/lirc/remotes/mceusb as a possible source. Amazingly, you still have to download or manually create /home/mythtv/.lircrc and /home/mythtv/.mythtv/lircrc
    • I might need a newer version of lirc because I have a SMK version of the MCE remote.
  12. Install UPS stuff per security domain writeup and [2]
    • $ apt-get install nut-cgi (UPS monitoring utils)
    • Use useradd or adduser to create user(s) nut (or nutdev and nutsrv). Put any created in a group called 'nut'.
    • Needum to edit files in /etc/nut, per Linux Lore: upsd.conf and upsd.users
    • Also, ups.conf:
    #driver = usbhid-ups # doesn't support Tripp Lite Smart 700 USB
    driver = tripplite_usb
    port = auto
    desc = "Tripp Lite Smart 700 USB hiddev96"
    • $ sudo /sbin/upsdrvctl start
    • $ sudo /sbin/upsd -u nut
    • $ upsc myups@localhost (to verify that it works)
    • Edit /etc/default/nut
    • I assume I do NOT need to do:
    • $ update-rc.d add upsd default
    • $ update-rc.d add upsmon -u nut default
    • dmesg shows: hiddev96hidraw0: USB HID v1.00 Device [TRIPP LITE TRIPP LITE SMART700USB ] on usb-0000:00:1d.0-2
  13. Keep screen saver from starting:
    Section "ServerFlags"
    Option "BlankTime" "0"
    Option "StandbyTime" "0"
    Option "SuspendTime" "0"
    Option "OffTime" "0"
    Then execute 'sudo /etc/init.d/gdm restart'
    (Hmmm.... that didn't seem to do the trick - gotta keep working on it. *sigh*)
    Found it later in a submenu while left clicking on desktop
  14. increase "php_value memory_limit" to 128M in /etc/apache2/sites-available/mythweb.conf
  15. User:Mrand/non myth stuff
  16. [Get rid |] of annoying 'Xlib: extension "Generic Event Extension" missing on display' messages when on NX.
  17. Image quality (especially color depth) is lacking. Maybe resolution/mode related?
  18. Enable S.M.A.R.T. monitoring to watch for this type of thing. RoundCube as well.
  19. I need to open up a small hole/port in my firewall so I can have remote ssh access. And need to check security via nmap, and securing the application in general, including securing phpmyadmin. Maybe Webmin will make sure I don't miss something. Here's some ssh hints.
  20. I'm interested in giving TVWish a try, although I'll probably wait until 0.21 arrives next month. I've noticed plenty of good shows and movies are on at strange times and I'd like to not have to monitor t.v. listings to find them. This may be my undoing - MythTV is more a toy than a tool to me... if I have lots of good t.v. to watch, I may actually watch it - and I don't have time for that![3]
  21. I'm also interested in Pluto and maybe home automation. Someday. The wife might be interested in MythRecipe also.

Stuff to keep an eye on

  • /var/log is where all the logs are kept
  • vaapi, to be available in libva, may lower the power consumption and increase playback speed and quality. Someday. Hopefully sooner than later.
  • After rebooting, my mythfilldatabase sometimes stops running... need to investigate. Do I need to prime it?

If When there's a problem...

  • I've removed "quiet" from the kernel line of /boot/grub/menu.lst
  • If there are major boot troubles, you can remove the word "splash" from the kernel line as well

VFS: busy inode on changed media

If you make the mistake of ejecting with the button on the front of your CD/DVD drive, the OS may be unable to unmount it and will flood /var/log/messages (the System Log) with "VFS: busy inodes on changed media." Solution is to let the apps eject the disk. But if you forget:

  1. $sudo eject
  2. Let it eject and then push the button on your drive to pull the empty CD tray back in.
  3. sudo eject -t (wasn't even necessary for me)

SQL/database corruption

Happens most often when a reboot without graceful shutdown occurs:

/etc/myth/mysql.txt contains all the important details (username and password). Interesting log files:

  • /var/log/mysql/mysql.log
  • /var/log/mysql/mysql.err

I have a script that I've created:

$ less
echo '/etc/init.d/mythtv-backend stop'
/etc/init.d/mythtv-backend stop

echo '/etc/init.d/mysql stop'
/etc/init.d/mysql stop

echo 'check/fix database corruption'
echo 'cd /var/lib/mysql/mythconverg'
cd /var/lib/mysql/mythconverg
echo 'myisamchk -f -r *.MYI'
myisamchk -f -r *.MYI

echo '/etc/init.d/mysql start'
/etc/init.d/mysql start
echo '/etc/init.d/mythtv-backend start'
/etc/init.d/mythtv-backend start

X problems

  • When you get to the point that you think X is failing, hit ctrl alt F1. Take a look at the ~/.xsession-errors file, /var/log/Xorg.0.log and dmesg.

Random stuff

submitting bug report

When submitting a bug report, include frontend and backend logs, with "-v network" and "-v record,channel,siparser" if at all possible. GDB output is highly desirable too.

boot problems

sudo apt-get install bootchart

will install a program which will create a .png image showing you the process time during boot

Future ideas

  • Tune performance
  • Web compression?
  • Measure hd performance (with hdparam?) and when I eventually roll out RAID5 or something, try: "echo "1024" >> /sys/block/md0/md/stripe_cache_size" (2048 is probably too high in most cases - and this setting goes away at each reboot). Also investigate /sys/block/md0/md/sync_speed_max and sync_speed_min.
  • Broadcom Crystal HD maybe someday?

Improve signal quality

The ivtv wiki] has some mostly common sense things to do to improve signal quality, originally suggested by Andy Walls:

  • Ensure you are using 75 ohm splitters that cover your desired frequency range (55 - 802 MHz for the current US NTSC broadcast allocation).
  • Ensure that all unused cable runs, wall jacks, or splitter outputs are properly terminated in a 75 ohm load.
  • Replace RG-58/U cables with RG-6/U cables. RG-6/U has about 3 dB less loss per 100 feet at 400 MHz than RG-58/U according to one manufacturer. (according to this source:
  • Add a broadband TV amplifier as close as you can to where the signal comes into your location, ideally before any splitters or long cable runs. If you don't also use your cables to receive FM radio signals and the amplifier has an FM trap, set the FM trap to "IN" to reduce intermodulation products induced in the tuner by the FM broadcasts in the 88-108 MHz band. Set the trap to "OUT" if amplifying a cable television feed. Cable uses frequencies in the FM broadcast range for TV channels. Please be aware that when you have a cable internet modem you will have to put this before the amplifier!!!! The amplifier will filter out the frequencies used by the cable company to transport the network data.
  • Make sure you have an in-line lightning protection/grounding unit installed in the cable close to where the signal comes into your location. Grounding the shield of the coax protects your gear from electrical transients induced by nearby lightning. "Full stop Grounding the shield of the coaxial cable using the lightning protector may also improve the signal quality in you location especially if using a consumer-quality antenna amplifier.  :)"

Build instructions

svn co mythtv.svn
cd mythtv.svn/mythtv
patch -p0 < ../../{various patches}
apt-get build-dep mythtv
cd /usr/lib || ln -s
./configure --help
./configure --enable-vdpau --enable-proc-opt
make -j 4
make install

(To build MythTV on a multi-CPU machine (or with distcc), specify "-j numjobs". Two concurrent jobs is recommended for a single CPU system. Do not set the number of jobs too high) (If distcc, and you had two other host machines (red, blue) participating, you would do something like:

$ export DISTCC_HOSTS='localhost red blue'
$ make -j 6 CXX=distcc