Zed Lopez

Adventures in Ubuntu Lucid, Mythtv, and the Hauppauge HVR-2250

saa7164-stable won’t compile with Lucid’s kernel due to some name changes in recent kernels. One needs to use saa7164-dev.

Compiling saa7164-dev errors out at first, too. But after

creates v4l/.config, you can change CONFIG_DVB_FIREDTV=m to CONFIG_DVB_FIREDTV=n

The instructions to extract and install the firmware are outdated with little attention being called to the fact. Follow the directions to get dvb-fe-tda10048-1.0.fw in the right place, but then download v4l-saa7164-1.0.2-3.fw and v4l-saa7164-1.0.3-3.fw directly and save them to /lib/firmware/`uname -r` (or /lib/firmware/2.6.32-20-generic at the moment for an up to date Ubuntu Lucid.) (I’ve also put all 3 directly in /lib/firmware, but that’s probably redundant.)

Once you’ve gone through all of this, and done a

make install

modprobe saa7164
should make your system recognize the card. But the devices are owned by group video, and ordinary users aren’t a member of it to start with. so

adduser yourusernamehere video
. (Remember that it won’t take effect in existing logins.)

Lucid’s mythtv is reasonably up-to-date and I’ve found no reason so far to seek out a more recent one.

I followed these instructions to migrate my old mythtv recordings to the new server (I followed the advice in a comment there to use —complete-insert, though it may not have been necessary.)

After installing mythtv, I found that its channel scan was having some trouble finding everything. So I did a

wajig install w-scan dvb-apps
, did a

service mythtv-backend stop
to make sure there was no competition for the card, and:

w_scan -x -f a -c us > w_scan.out
scan w_scan.out > w_scan_channels.conf
scan /usr/share/dvb/atsc/us-CA-SF-Bay-Area > scan_channels.conf
cat w_scan_channels.conf scan_channels.conf|sort|uniq > channels.conf

Then in mythv-setup I pointed it at channels.conf to do its scan.

mythtv-backend was being started before the devices for the video card had been created, which resulted in errors in the log, though I’m not sure whether the situation was causing any real harm. At any rate, inspired by this comment I put this in /etc/init/mythtv-backend.conf:

  1. MythTV Backend service

description “MythTV Backend”
author “Mario Limonciello <superm1@ubuntu.com>”

  1. modified per http://swiss.ubuntuforums.org/showthread.php?t=1345079&page=2 to wait for devices
    start on (local-filesystems and net-device-up IFACE=lo and started mysql)
    stop on starting shutdown

#expect fork

pre-start script
. /etc/mythtv/mysql.txt
\t#get the tuner card paths
\tTUNERS=`mysql —user=${DBUserName} —password=${DBPassword} —database=${DBName} —skip-column-names —execute=‘SELECT DISTINCT videodevice FROM capturecard;’`
\techo “`date`: Mythtv-backend Upstart; tuners found in database: ${TUNERS}” >> $LOG_FILE
\tfor t in $TUNERS
\t\twhile [ -c !$t ]; do
\t\t \techo “`date`: Mythtv-backend Upstart; tuner device ${t} is not ready. Waiting 1 second…” >> $LOG_FILE
\t\t\t \t sleep 1s
\t\t\t\t \t done
\t\t\t\t\t\techo “`date`: Mythtv-backend Upstart; tuner device ${t} is now ready” >> $LOG_FILE
\t\t\t\t\t\techo “`date`: Mythtv-backend Upstart: tuner devices are now registered. Starting mythbackend” >> $LOG_FILE

end script

test -f /etc/default/mythtv-backend && . /etc/default/mythtv-backend || true
/usr/bin/mythbackend $ARGS
end script

Now all I have to do is find out why there’s no sound (probably something independent of mythtv), why, even after all that scanning, it’s not finding KQED (almost certainly having to do with the antenna), and why playing videos in mythfrontend causes the system to reboot after a few seconds (!)