Wednesday, May 31, 2006

Trashing your Myth Box, day 6

I noticed that video was getting painfully choppy while recording a show this evening and did a little googling to see what could be responsible. It turns out only the boot partition and the DVD burner were set with DMA on, but not the partition where the recordings were. Continued googling explained the hdparm command, and I decided to hdparm -d1 /dev/hdc to change this. It worked, but I went overboard and did an hdparm -d1 /dev/hd? all while everything else was running. The terminal froze, Myth's frontend quit and would not restart, and when I rebooted the Dimension wouldn't recognize the OS.

For a change I actually looked things up before freaking too badly and making it worse. I did, however, boot a Knoppix CD and burn the largest downloads behind the install to a DVD in case I had to start over. This page explains a little of what I have ahead of me.

Edit: There are times when a little more thinking would have been smarter. In my zeal to make everything all better, I forgot that individual partitions don't need their own DMA settings.

Wednesday, May 24, 2006

Building my own MythTV, day 3

The symbolic link hack worked. The backend and frontend are now both 0.19, and AFAIK the entire system works: mythfilldatabase correctly loads the schedule, the program guide shows it, live TV is functional and the recordings are being recorded.

A few tweaks were necessary, however:
  • Ubuntu's default action when DVDs are inserted is bringing up Totem (and it has another default for CDs), and those defaults had to be disabled.
  • Most importantly, the default location for the recordings needs to be reset in mythtv-setup. If you don't, it defaults to /var/lib/mythtv, which is outside the giant XFS partition we set up specifically for this purpose. Everything under /home is on that partition, so I created /home/mythtv/recordings and set mythtv to store recordings there instead.

Tweaks yet to do:
  • Figure out how to stop mythbackend without killing its process.
  • Reconfigure Myth to use 0.19's own DVD player instead of mplayer (which skips menus)
  • Increase mythbrowser's default font size. Mythbrowser's cookie messages imply it's Konqueror-based.
  • Edit channels to show callsigns.
  • Install xmame and configure it to recognize the remote's keys as the default input device.
  • Map color keys to alt-F1 and alt-Tab for quickly accessing Gnome menus/switching windows, unless there's something else already doing this in Myth.


Overall, it was an interesting experience comparable to installing Debian stable (Woody) for the first time: a steep learning curve, a lot of configuration, and a reasonable amount of burr-sanding at the end. Mistakes, reinstallations, and a ton of Googling. If I had to do this again on another box, it would take less time, but I'd also insist on a T1 and >=1GHz CPU as the process involves downloading over 100Mb of source and binaries, then compiling them. If I were an installer who favored Ubuntu over KnoppMyth, I'd probably put all the files on a 1Gb memory stick along with a copy of his webpage.

A recap: Hyams' instructions are good, but he clearly got tired of writing them towards the end. His chief error in the documentation is the one where he assumes the myPHPadmin root password becomes mythconverg's password in all the config files. mySQL's permissions model changed after that documentation was written, and mythconverg has its own randomly generated password visible in Myth's own settings page. Do not change that password. Write it down and insert it into all the config files that default to 'mythtv' for a database password.

His startup script for forcing the 0.19 PATH to the beginning of $PATH does not work. It just doesn't. Accept this and do what I did to ensure 0.18 is neutered. Arguably the test of how well I understood his instructions would be rewriting them to omit the entire 0.18 installation altogether.

Perhaps 0.19 will make it to the Dapper repositories and make all that unnecessary.

Tuesday, May 23, 2006

Building my own MythTV, day 2

The software install worked, technically speaking. Unfortunately the channel listings and program guide don't work. Hyams' instructions blithely assume the phpMyAdmin setup's new root password is the same pw used by everything in MySQL, and that just ain't so. The table mythconverg that the mythtv user creates is automatically assigned a random 8-letter alpha password, and changing it in the PHP config files merely results in errors (which is what happened the first night I tried installing MythTV). The password is correct, the permissions are somehow messed up.

For the hell of it I'm going forward and upgrading to 0.19. As the instructions point out, MythTV-0.19 is a manual compile (estimated at 15 minutes, but still going after 2 hours on the 450MHz PIII). Compiling the plugins took another hour.

The biggest pain in the ass so far has been getting the box to forget there's an older version of Myth on the system and to exclusively point to the new one. I'm giving up on being nice and trying to get Hyams' PATH script to point the system to the new binaries; instead, I'm renaming the old binaries in /usr/bin, then replacing them with symbolic links to the new ones.

Sunday, May 21, 2006

Building my own MythTV, day 1

Long and short: in return for moving data off an old PC's HD to the owner's new HD, I inherited the PC. It so happens that it has 512Mb RAM, 200Gb HD, a DVD burner, an nVidia card and a mediocre 450MHz slot 1 PIII.

In other words, a reasonable candidate for a Linux PVR. Since the box was free, my objective is to get the whole thing done for less than $200.

Myth is a little different than your regular Linux distro. ext3 is apparently unsuitable for large files like the ones Myth creates and deletes, so the instructions say to set aside a separate partition in XFS. I'm following Daniel Hyams' instructions because they're made for the PVR card I bought, the $80 Hauppauge PVR-150. Nota Bene: I fucking hate Fry's. If I'd gone into CompUSA first I would have been done with my shopping and left with my dignity inside twenty minutes.

The Hauppauge series are prized in part because they have the Conexant MPEG2 encoder chip that relieves realtime load from your CPU. The PVR-150 uses the same "microphone" IR receiver the AlchemyTV DVR does, except that it also features a separate IR transmitter as well (for controlling set-tops).

Getting the video out to the ancient 19" Magnavox is another issue. This TV was bought to watch President Bush debate. That is, President Bush debating then-Governor Clinton, so it's not going to have a DV or VGA input on its back. Because we're doing this on the cheap, replacing the video card is out of the question. Fortunately, we've already got a Radio Shack RF converter connected to the television for the DVD player, so what we need is VGA to SVHS. Enter the Grandtek GEZ-1000, a $40 VGA-SVHS cable which encapsulates the converter circuitry and uses a USB cable to leech the 5v it needs from your computer instead of requiring a brick. These were clearly designed for notebook computers, but it's hard to argue with something that eats less space and costs less than the boxes that do the same thing. Had I been thinking more clearly by the time I was at CompUSA I would have purchased one there; I ended up ordering one online. It'll arrive in the mail in a few days and I can test it then.

Since the TV's on the other end of the room from the router, for now the internet connection will be managed by the AirPort Express we installed last year. I'll have to look into whether the kernel is competent at managing a generic wifi card before sinking $70 into that.

Some considerations for those who'd follow in my footsteps:
  1. Hyams' instructions were written soon after the Breezy release, so parts of his timetable are optimistic. If you're not on a T1, they're extremely optimistic; prepare to wait over an hour for apt-get update; apt-get upgrade to finish. There are a few other places where the downloads are either large or slow depending on connection.
  2. I prefer KDE to Gnome. That said, the instructions are optimized for Gnome when it comes to configuring startup and repairing broken scripts that Myth installs. Accept this, use Ubuntu not Kubuntu, and move on.
  3. This process involves creating a lot of users and passwords in various places. Keep a paper notepad nearby and take notes. Resist the impulse to use the same uname/pw everywhere; this is a box with a live internet connection.
  4. There are two PVR-150 models out there; the one with "MCE" in the title is the one you don't want. It's built for Windows XP Media Center Edition and doesn't have a remote. While it has a few more ports on the back, it doesn't have video out either. Skip it and go for the plain PVR-150; it's cheaper as well.

Thursday, May 04, 2006

Making Acrobat Reader 7 save fillable PDFs

I have a flexible spending account with an accounting firm that uses PDF forms. They aren't fillable. At work, I have a license for Acrobat Professional, so it's not rocket science to put form fields on it (and in particular, script them to tote up the receipts I'm filing). This morning, my printer ink carts went belly-up and I couldn't print the form I intended to sign, scan and fax to the accounting firm.

Bummer. See, at home, I don't have a license for Acrobat Pro, so the best I can do is fill out the form in Acrobat Reader (because in Tiger, Preview ignores the calculation scripts and worse, scales the field font size too large to fit them) -- but AR won't let you save the file, and it's just bright enough to prevent you from printing to PDF (which, IMO, is criminal misconduct).

There are two solutions to this problem depending on your platform.

OS X: AR 7 isn't bright enough to prevent you from printing to PostScript proper, which Preview is perfectly capable of reading, converting back to PDF and saving back to that format.

Windows: If you don't have PDFcreator installed as a printer driver on your box, shame on you. If you have CutePDF, double shame: you're using a crippled version meant to sell you a "complete" PDF printer driver which has nearly nothing that PDFcreator doesn't already have. AR 7 on Windows is not smart enough to recognize one printer driver from another, and will be happy to let you print your PDF to another PDF.

Linux: Most KDE distros have a PDF printer driver already configured. Follow above instructions.

Now, I have a filled PDF I can keep in my records, bring to work, print and sign.

Dear Adobe: you created fillable forms and hard-sold them on us. Quit pretending the most basic utility (saving them) is a premium feature and we won't have to own your sorry asses like this.