New MythTV setup

| No Comments | No TrackBacks
I decided it'd become time to replace my current MythTV setup. The hardware had irritated me for some time (noisy, and required irqpoll to boot), and the software was now some versions behind and seemed to have mangled its database. So it was time to purchase some new toys, and lose multiple hours to the headaches of configuring them. It wasn't as easy as expected, and there were some exciting pitfalls that hopefully this will help others avoid.

Yes Phil, that means this is going to be boring.

A big change from my old setup is splitting the backend and frontend. The main driver for this was the desire to deploy something small and silent near the TV, and gain the ability to install more drives and tuner cards than the existing shuttle provides. A big goal of this new build was to gain a DVB-S card so I can receive Freesat, and thus the free to air HD channels. I can't do this via DVB-T as there aren't any DVB-T2 cards on the market yet.

So, the hardware:

ASRock NetTop ION 300 HT: this is a tiny atom based system, with external power brick. It's dead quiet, and having an Nvidia ION it has VDPAU support. This gives it the ability to decode 1080p mpeg2 streams despite the lack of CPU power. It even has a built in IR receiver.

Hauppauge WinTV Nova-T 500: a dual DVB-T tuner card. This really turns out to be a USB hub and two of their USB tuners on the same card with a shared antenna. Capable of tuning to two different multiplexes simultaneously, when it works. This was in my old system and could be quite troublesome.

Hauppauge WinTV Nova-HD S2: The only DVB-S2 card I could find. While I don't need S2 yet for FreeSat I decided that it'd be worth future-proofing.

And finally, a random box I'd had lying about for some years. It seems to contain an Athlon T-Bird 1.2Ghz. With the addition of a cheap SATA controller it can take the couple of 500GB SATA drives I had lying about.

And on the software end of things I've chosen to use the Mythbuntu Karmic CDs for install.


So, onto the build.

The first handful of headaches were down to the age of the backend system. Flat BIOS battery had led to it enabling power off on CPU fan fail - not so useful when there's a huge Zalman passive heatsink providing the cooling. CDROM drive had filled with dust and could no longer read disks. The biggest headache by far was down to my choice of cheap SATA controller (purchasing decision based on 0 research), it turns out that the VT-6421 cannot be booted from! This presented a bit of an issue, so I've booted off an old PATA disk that just has grub and /boot on it.

Now something slightly interesting: getting the latest Mythbuntu to do software RAID. They've decided to kill off the alternative install CDs, and the "desktop"one doesn't allow you to do RAID. This isn't a huge problem, but requires a bit of mucking about:

Start with the "try mythbuntu" option. Fire up a terminal and apt-get install mdadm, this will give you the software raid utils. Now partition your disk using fdisk (you might find cfdisk easier if it's installed), creating the partitions you want to use for RAID and setting them to the RAID autodetect type. I decided I wanted a 12GB RAID1 for /, 1GB per drive of swap, a 100GB RAID1 for storage of things I care about, and the rest of the disks as RAID0 for storing recordings (anything I care about I'll move to the RAID1.) Use mdadm to create your RAID arrays. Something like "mdadm -C -n 2 -l1 /dev/sd[ab]1" to create a RAID1 of sda1 and sdb1.

You can now launch the installer. When you get to partitioning you want the "advanced" option, and create the partitions you want under your /dev/md[0-9] devices rather than under the normal disk devices (although don't forget your swap partitions.) Install as normal, however do NOT reboot - it's not going to come up if you do! The Mythbuntu install lacks things from the initrd that are required to boot when / is on RAID.

Go back to your terminal and, if it's not already, mount your / partition. Bind mount proc and dev under it (e.g. if mounted on /target "mount -o bind /proc /target/proc && mount -o bind /dev /target/dev"), and chroot into it ("chroot /target /bin/bash"). Edit /etc/initramfs-tools/modules and add "raid0" and "raid1". Now apt-get install mdadm. It ought to froth about for a bit and build a new initrd. Logout of the chroot, unmount the drive, and you're hopefully safe to reboot. You might need to muck about with grub before you reboot, but I didn't because /boot was on a different disk...

Reet, that's a backend installed. The frontend was nice and painless, although for some reason the Mythbuntu install for a dedicated backend fails to bind various services to the network interface. The myth backend service needed reconfiguring in the settings app to listen on a useful network interface rather than loopback. I also had to reconfigure the mySQL bind-address (in /etc/mysql/my.cnf) to 0.0.0.0. The install onto the Nettop frontend was painless, and it happily came up talking to the backend.. after about an hour of mucking about trying to work out why it couldn't connect due to the backend config issues.

The next thing to do was make it useful! For starters the dvb firmware package needed installing, but after that and reboot dmesg was full of angry messages about the DVB-S card firmware. Looks like the Ubuntu package contains broken firmware for this card :-(

Fortunately, after some experimentation with different versions, I found that the following works fine:
wget http://www.wintvcd.co.uk/drivers/88x_2_124_27191_1_WHQL.zip
unzip -jo 88x_2_124_27191_1_WHQL.zip Driver88/hcw88bda.sys
sudo dd if=hcw88bda.sys of=/lib/firmware/dvb-fe-cx24116.fw skip=105768 bs=1 count=32674

Now after a reboot the firmware loads correctly. I also chose to build and install the latest v4l drivers. This probably isn't actually necessary, but I was desperate due to a problem I had with the DVB-S card...

The DVB-T card was simple, and seems a lot happier in recent kernels than it used to be. If I start seeing the USB disconnect issues again I'll post about fixing it.

So it's time to add the cards in the myth backend setup. The DVB-S card needs to be told to talk to a LNB in the DiSEqC. The default (Universal) works fine for me. The other card shows up as two devices (because that's what it really is.) Video sources is where things get a bit odd. I've created two of them (one for DVB-T, one for DVB-S) and set both to use the RadioTimes grabber. Two are required otherwise it'll apparently get utterly confused and assume that all the cards can do the same channels with the same tuning which, obviously, they can't. The two DVB-S cards, being identical, can share the same input.

Under input connections I associated the DVB-T cards with the DVB-T source, and ran a scan (only one needed per source, not one per card.) This took a while but was happy. So, onto DVB-S.

Sadly I ran into a big headache at this point that wasted several hours of my life. Most of the docs seem to recommend using the linuxtv "scan" command to generate a channels.conf, then importing it into Myth to start the scan. Unfortunately this failed for me. While scan produced a sensible looking channels.conf, Myth decided to repeatedly detect the same 7 channels... several hundred times. Not happy, and it led to a big warning about conflicting channels. Initially I decided it must be a bad driver, hence the v4l upgrade, but that didn't fix it.

In the end I gave up and found the scan details for Astra 2D, which seems to have most (all?) of the Freesat channels on it.
Frequency: 10788000
Symbol rate: 2200000
Polarity: vertical
The rest can be left as default. Started a scan and after a while it started picking up sensible numbers of channels.

Woo, backend is complete... ish.

The frontend, meanwhile, needs some work. The CPU isn't powerful enough to cope with playing BBC HD, however the ION GPU has VDPAU support and is easily able to deal with it. It needs the NVidia proprietary drivers installed, and then under one of the pages (3, Playback profiles) of "settings -> TV -> playback" there's an option to set the system to use VDPAU. That needs to be set to "VDPAU Normal". The hardware doesn't seem to cope with "High Quality." I also had to disable Compositing to fix tearing (sudo nvidia-xconfig --no-composite.)

There's also the matter of the remote control, a driver (with instructions provided) has to be downloaded from the ASrock site: http://www.asrock.com/Nettop/download.asp?Model=ION%20330HT&o=Linux

And there, mostly working. I haven't got round to sorting out the channel listings yet, or configuring the RT grabber. That's all on my todo list for today.

Edit:
The odd i2c errors and USB disconnects still happen to the DVB-T card with the latest drivers. To fix I needed to set a 500ms tuning delay and only enable active  EIT scanning on one of the capture cards.

No TrackBacks

TrackBack URL: http://growler.woaf.net/cgi-bin/mt/mt-tb.cgi/4

Leave a comment

About this Entry

This page contains a single entry by Growler published on February 25, 2010 8:40 AM.

Find recent content on the main index or look in the archives to find all content.

Categories

Pages

Powered by Movable Type 4.33-en