Counted 113528 visitors
Page served in
42
s.

Setting up MythTV

My notes on setting up an Ubuntu Linux MythTV Media Center using:
  • Antec Fusion V2 HTPC case,
  • ASUS M2A-VM HDMI motherboard,
  • AMD Athlon 64 X2 4800+,
  • ASUS DVD writer,
  • WD 500G SATA harddrive,
  • PVR-250 and PVR-350 tv cards,
  • Brother HL2030 printer (USB)

Putting all the stuff into the case

Just followed the manuals, and I thought it worked out fine, until I booted the thing and got no image on the external monitor I dug up from the basement :( Needless to say, an hour into reconnecting all the cables (and the processor even) I found out the monitor's contrast was turned down to 0, and everything had been working all the time.

Getting Ubuntu 7.10 installed

Using the LiveCD installer will not work -- apparently the M2A-VM motherboard has an ATI X1200 card which needs proprietary drivers that don't come with the LiveCD. Installing those drivers while in the LiveCD is a pain as you cannot test it properly. I've made my monitor crash once and then decided I'd use the alternate CD (following a tip from my-geek-side.blogspot.com).

Oh, and I found out the hard way that if you enabled "Plug and Play OS" in the BIOS, you have to add irqpoll as a boot option because otherwise no one will handle the IRQ's ;). And remove the quiet option while you're at it.

The installation from the alternate CD was straightforward. Funnily enough, in the end, I had a GUI login, which was actually working, albeit with a "using restricted drivers" warning.

Minor wow-moment: After the first boot, I plugged in a USB mouse. It worked immediately.

Installing ATI drivers

Followed the instructions from my-geek-side.blogspot.com. For archiving purposes:

# wget --no-check-certificate https://a248.e.akamai.net/f/674/9206/0/www2.ati.com/drivers/linux/ati-driver-installer-8.40.4-x86.x86_64.run

# apt-get update && apt-get upgrade

# apt-get install module-assistant build-essential fakeroot dh-make debconf libstdc++5 gcc-3.3-base linux-headers-$(uname -r)

# chmod +x ati-driver-installer-8.40.4-x86.x86_64.run

# ln -sf bash /bin/sh && ./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg Ubuntu/feisty && ln -sf /bin/bash /bin/sh

# dpkg -i xorg-driver-fglrx_8.40.4-1_amd64.deb
# dpkg -i fglrx-kernel-source_8.40.4-1_amd64.deb
# dpkg -i fglrx-amdcccle_8.40.4-1_amd64.deb
# dpkg -i xorg-driver-fglrx-dev_8.40.4-1_amd64.deb

# cd /usr/src
# m-a update
# m-a prepare
# m-a build fglrx
# m-a install fglrx

# aticonfig --initial
I had to install ia32-libs (+ many other 32 bits dependencies) halfway into the process.

Unfortunately, after all this and a reboot, my display was completely screwed up. On the other hand, it worked fine on the TV (where it is going to be), so I decided to leave it.

L\

Now I could follow the InstallLirc/Feisty article from the Ubuntu installation. Apart from an

# apt-get install lirc lirc-modules-source module-assistant
# dpkg-reconfigure lirc-modules-source
this involves actually building the modules, i.e.
# m-a update,prepare
# rm /usr/src/lirc*deb
# m-a clean lirc
# m-a a-i -f lirc
# depmod -a

After this, the wheel was detected fine, and could be "defined" using

# irrecord -d /dev/lirc0 lircd.conf.wheel
But the infrared receiver didn't seem to do much.

Gone back to configure -- now added atiusb, mceusb(2) to the list of drivers to build. Rebuilt the modules. Adapted /etc/lirc/hardware.conf to reflect changes. Still no luck. Maybe the receiver only recognizes selected remotes?

For the LCD display: I did an apt-get install lcdproc. Changed Driver=curses to Driver=imon in /etc/LCDd.conf, and it worked. Neat stuff :)

Update: Worked fine with lirc_imon driver and a Windows MCE remote I borrowed of someone... But I consider that a very ugly remote, trying something else ;)

Got a HP remote off Ebay, that worked great! Configured it using irrecord, copied the .lircrc from my old machine, installed the lirc-x package for irxevent, and it worked great!

Doing something about the CPU fan noise

In order to reduce noise and power usage I wanted to be able to change the CPU fan speed (because that one seemed to be making most of the noise). After some googling and playing around, I seem to have done:

# apt-get install lm-sensors
Now sensors shows a list of temperatures (can't really be accurate, actually, it showed +11 C / +2 C on one of the cores, that's kinda cold... Or could that be? The fan had been blowing at full speed for quite a while).
# sensors-detect
tries some modules and sees which one fits, and offers to add these modules to /etc/modules, which I did. It my case they were it87 and k8temp. After modprobeing both of these, sensors' output was still odd, but now motherboard voltages were added. Furthermore, now pwmconfig did something useful: It tries to adjust fan speed. Kinda neat to see with an open case sitting there, the terminal saying:
Testing pwm control hwmon1/device/pwm1 ...
  hwmon1/device/fan1_input ... speed was 3040 now 1108
    It appears that fan hwmon1/device/fan1_input
    is controlled by pwm hwmon1/device/pwm1
Would you like to generate a detailed correlation (y)? y
    PWM 255 FAN 2973
    PWM 240 FAN 2947
    PWM 225 FAN 2800
    PWM 210 FAN 2678
    PWM 195 FAN 2518
....
and the fan on the CPU going slower and slower, until it stopped in the end. It helps you create a fancontrol config file. Be careful, if you mess up you may end up with a fried CPU... Refer to the fancontrol man page for details. There seems to be a small error in the pwmconfig software while testing for MINSTART and MINSTOP -- it claims to stop the fan but it doesn't... Well, I just thought of some values and it seems to work just fine :)

Trouble!

After playing around with lirc, the fans, and creating a new partition (which I added to fstab), the thing suddenly refused to boot! Cryptic messages (most notably something about hda_codec), and it would mount the root partition only read-only. The last line of dmesg was:

[   24.061384] hda_codec: Unknown model for ALC883, trying auto-probe from BIOS...
If I then ctrl-alt-del'd it would just continue booting, throwing an error when trying to start gdm. Odd.

Updated the BIOS. DON'T use a CD to do this -- a USB drive will actually work. Didn't fix my problem, though. Booted using the Ubuntu Live CD, chrooted into my own installation, rebuilt the ati drivers (just to be sure). No luck.

Next, removed most of the lirc drivers again, because those where the one-but-last lines in dmesg. Problem solved :)

Next morning: More trouble!

More trouble the next morning: The network would not come up. Doing a sudo ifconfig eth0 up worked just fine, but yesterday everything was automatic. Following a tip here I removed network-manager. No luck. Changed auth eth0 in /etc/network/interfaces to iface eth0 inet dhcp. No luck.

Ended up adding ifconfig eth0 up; dhclient to /etc/rc.local. Not very elegant, but at least it works.

Setting up an encrypted partition

I wanted to use an encrypted partition for my backups. A zillion howtos around, I decided to use EncryptedFilesystemHowto from ubuntu.com.

That worked relatively well, except that once everything was set up (including /etc/crypttab and /etc/fstab) the machine refused to boot (something about it not being able to verify the ext2 file system on the encrypted partition -- well, duh, if I hadn't provided it with a pass phrase!). Removing the lines from the two -tab files solved the problem.

I'm now mounting the encrypted partition with a small script I run by hand every time it boots, which was the way I had wanted to do it all along.

Brother HL-2030 printer

Brother has excellent linux support. I downloaded the "LPR driver" for Debian from this page and the "CUPS wrapper driver" from this page, and read the installation instructions on this page.

Basically, it all boils down to:

# dpkg -i --force-all --force-architecture brhl2030lpr-2.0.1-1.i386.deb 
# dpkg -i --force-all --force-architecture cupswrapperHL2030-2.0.1-2.i386.deb 
Then connect to the cups system on http://localhost:631/ and verify everything is OK. Except then, it didn't work :(

Running cups with debug output (set LogLevel to debug in /etc/cups/cupsd.conf) and some googling later it turned out the problem was the 64-bit version of Ubuntu I was running, (see Brother FAQ page), and all I had to do was:

# ln -s /usr/lib/libbrcomplpr2.so /usr/lib32/libbrcomplpr2.so
Restarting samba (which I installed earlier) gave me access to the printer on my laptop immediately. Nice.

Installing the TV card

Everything is a bit easier in Ubuntu, it seems -- earlier (Debian) I had to jump through all sorts of loops to get ivtv etc going. In Ubuntu, the Install IVTV Feisty article on ubuntu forums is very clear: I don't need to do anything, the TV card is supported in the basic install!

Installing MythTV

Now I could follow the instructions from an Ubuntu Documentation article.

This was a nice guide, but I got lots of ugly errors when running the required mythtv-setup, apparently the mysql database wasn't even created. (Not strange, actually, since I never entered the mysql root password ;) ). Running sudo dpkg-reconfigure mythtv-common didn't really help (didn't ask for mysql root pwd either). Maybe when setting up mysql earlier I changed something in the config so that Ubuntu got confused...

I then imported the existing database from my old system, which was what I wanted to do anyway ;). I'm afraid, however, that I then screwed up things a bit -- I was running the svn version of mythtv on the old box... Which may have actually been newer then the (Ubuntu package repository) version on the new machine. Ouch.

Emptied the mythconverg database, reran mythtv-setup (I had by then manually added a user and database for mythtv with the required credentials, so now mythtv-setup could create the relevant tables), manually refilled the database with some stuff from the old machine. And noticed that halfway through I'd forgotten about reading the article on ubuntu.com, where everything is actually explained nicely (and indeed: If you have set a mysql root password, you should do something extra). In the end it all worked out.

Things to remember

  • After every kernel update: The ati drivers and LIRC drivers have to be rebuilt.

Upgrading to Ubuntu 8.04LTS (Hardy)

Everything went quite smoothly, with the exception of:
  • lirc: Refer to the Ubuntu wiki page for LIRC on Hardy. At the end there is a useful section titled "Adding support for more remotes" which details howto rebuild the modules, but didn't solve the problem. In the end I reinstall lirc and carefully reconfigured, and then it worked -- So the problem was probably just me messing up the configuration files ;)
    Note, though, that the way of building the modules has changed. Ubuntu is using DKMS now, so if you're on Hardy you should use InstallLirc/Hardy.
  • LCDd / lcdproc: Stopped working, and started sending loads of messages to kern.log:
    /var/lib/dkms/lirc/0.8.3~pre1/build/drivers/lirc_imon/lirc_imon.c: lcd_write: invalid payload size: 32 (expecting 8)
    
    several a second, in fact. Fortunately, I'm not the only one with the problem, and the suggestion at ubuntuforums.org to add
    options lirc_imon islcd=0
    
    to /etc/modprobe.d/options solved the problem, and got me a working LCD again :) Note: See below: This breaks lirc when upgrading to 8.10!

Upgrading to Ubuntu 8.10 (Intrepid)

  • mythtv: Kept complaining about not being configured. "Fixed" this by patching the mythtv-common part of /var/lib/dpkg/status.
  • mythweb: Broke to PHP upgrade. Fixed by removing /var/www/mythweb/.htaccess, and commenting out output_handler in suitable places. See Bug 329053.
  • fancontrol: Broke, hwmon1 apparently relocated to hwmon2. Could have rerun pwmconfig, but chose instead to replace all hwmon1's by hwmon2's in /etc/fancontrol :)
  • lirc: Broke again. Endless messing around without succes.
    Finally thought I could fix it by not using lirc-0.8.4afrom intrepid-backports, but instead lirc-0.8.3 from intrepid itself. This can be done by downloading the .deb and then installing it using sudo dpkg -i lirc-modules-source_0.8.3-0ubuntu2_all.deb. Don't forget to do the same for lirc itself, and for lirc-x. Doesn't work, though.

    Next try:
    • apt-get install lirc lirc-x
    • Get the diff from the launchpad page
    • Apply the diff, following this tutorial
    • And install the patched lirc-modules-source package.
    That at least completed successfully, but did not quite work yet:
  • # modprobe lirc_imon
    FATAL: Error inserting lirc_imon (/lib/modules/2.6.27-11-generic/updates/dkms/lirc_imon.ko): Unknown symbol in module, or unknown parameter (see dmesg)
    # dmesg | grep lirc_imon | tail -n1
    [  420.742877] lirc_imon: Unknown parameter `islcd'
    So removed options lirc_imon islcd=0 from /etc/modprobe.d/options again... And it worked!!

Upgrading to Ubuntu 9.10 (Karmic)

  • graphics drivers fglrx: Apparently unsupported now. cf. this page; I switched to the open source driver.
  • I had to go 8.10 -> 9.04 -> 9.10; after the upgrade to 9.04 ("jaunty") I lost the image on the TV screen... Maybe it'll come back automatically?
  • Funny, how the upgrade to 9.10 appears to decide to install fglrx anyway...
     *  fglrx (8.660)...
    fglrx (8.660): Installing module.
    ...........
    ......
       ...done.
    
  • Strangely enough, mythtv was completely gone. However, an apt-get install mythtv restored it successfully.
  • Unfortunately, after everything still no image on the TV screen (via S-video; no DVI/HDMI attached). Created an /etc/X11/xorg.conf from scratch using this ubuntu page, but no luck. Did get a TEXT prompt, though...
    Also tried this wiki page from x.org, but no luck either. Ubuntuforums does not give much hope, BUT the vesa-driver trick a bit further down the page seemed to actually work! Did significantly increase cpu usage, though.
    Next up: "How I Got TV Out to Work with ATI X1200 without FGLRX". Did have to do sudo apt-get install xserver-xorg-video-ati. Did NOT get TV out.
    Settled for the vesa option, but had stupid aspect ratio. And the CPU usage. Grumble.
  • fancontrol stopped working again; this bug. Added acpi_enforce_resources=lax to the kernel options, changed hwmon2 to hwmon3 (...) and there was silence.