Archive for September, 2007

MythTV upgrade to 0.20.2 for SchedulesDirect support

Friday, September 14th, 2007

As a result of the Zap2It Labs shutdown, I recently had to upgrade my MythTV installation from 0.20.1 to 0.20.2.

Graciously, Zap2It Labs was scheduled to shut down on September 1, but they extended guide data past that date. For a few days after the shutdown, it was possible to fetch the full 14 days of upcoming data. Once the data service was deactivated, no more data was put into the database and the amount of remaining data dwindled. As I stared at the MythTV status screen, it was obvious that my schedule data would run out during an upcoming trip:

Zap2It Labs mythfilldatabase

(Furthermore, the new TV season starts in late September, so I’d also miss all the season openers on the week of the September 24!)

I’d been delaying the upgrade because Gentoo’s Portage system wanted to upgrade from MySQL version 4 to MySQL version 5. The database upgrade seemed like it had high potential to go wrong, and would not add obvious functionality to MythTV. I’d already experienced one crash that took out the database, and it was painful enough to recover from that.

However, my hand was forced by the Zap2It shutdown. I was out of the country attending an IEEE ad hoc meeting, and I didn’t want to do the upgrade remotely. Fortunately, Zap2It extended listing data beyond their September 1 shutdown date, so I had a few days grace period after returning home.

I wasn’t concerned about the switchover to SchedulesDirect within MythTV, which was described as drop-dead simple everywhere. It was getting there.

MySQL upgrade. Thankfully, I heeded the advice to back up the database before starting. The upgrade process doesn’t convert over the data, and it turned out to be much simpler just to delete the existing database, install MySQL 5 from scratch, and have MythTV set up the new database.

When I attempted to restore the database, I received the following error message:
ERROR 1071 (42000): Specified key was too long; max key length is 1000 bytes

That’s in part because the default character set needs to be configured on the database. What happened is that the table definition for the “people” table uses the name as a primary key, and it doesn’t allocate enough space for the table unless you restrict the character set that field is stored in.

However, when I attempted to restore the database from my backup snapshot, I received another error message:
ERROR 1062 (23000) at line 24800: Duplicate entry ‘Monika Sanchez’ for key 2

The error was caused by having two entries with the same text value:
mythtv@myth ~ $ cat mythtv_backup.sql | grep “Monika Sanchez”
INSERT INTO people (person, name) VALUES (2590,’Monika Sanchez’);
INSERT INTO people (person, name) VALUES (622,’Mónika Sánchez’);

At first, I tried removing the name “Monika Sanchez” from the database, but as it turns out, there are lots of duplicate spelling. The easiest thing to do is to not restore the people table.
mythtv@myth ~ $ cat mythtv_backup.sql | grep -v “INSERT INTO people” > mythtv_backup-nopeople.sql

After restoring the database, I figured the next step was to try repopulating the TV listings.
mythtv@myth ~ $ mythfilldatabase
2007-09-08 08:43:42.604 Using runtime prefix = /usr
QSqlDatabase: QMYSQL3 driver not loaded
QSqlDatabase: available drivers:
2007-09-08 08:43:42.619 New DB connection, total: 1
2007-09-08 08:43:42.620 Unable to connect to database!
2007-09-08 08:43:42.620 No error type from QSqlError? Strange…
QSqlQuery::exec: database not open
QSqlQuery::exec: database not open
2007-09-08 08:43:42.674 DB Error (KickDatabase):
Query was:
No error type from QSqlError? Strange…
2007-09-08 08:43:42.730 Failed to init MythContext, exiting.

According to the Gentoo wiki, that error message indicates that there is no support for MySQL in the QT library. So, I tried rebuilding QT, and and figured that I’d go all the way and upgrade MythTV, too.

At this point, I’m about six hours and fifteen minutes into the upgrade.

MythTV upgrade. This is one of the most uneventful builds I’ve ever watched. Interesting, the Gentoo system started by checking out the 0.20.2 source from the subversion repository, rather than downloading a compressed source code archive.

Myth plugins. Most of the plugins were uneventful, though the MythWeb plugin broke. To use it, I had to remove PHP4 and the older version of Apache that was installed, and then reinstall Apache and PHP5 from scratch. One small change was needed in php.ini to view pages. The “allow_url_fopen” parameter needs to be set to “on” instead of “off.”

MythTV reconfiguration. With MythTV running again, it seemed anticlimactic to switch over to Schedules Direct. Signing up for the service took a couple of minutes, and Bruce Markey’s Schedules Direct configuration procedure took another few. In about 8 minutes, it was over.

By running mythfilldatabase with the SQL debug command, I even noticed that the “people” table I’d been unable to restore was recreated without intervention.

Finally: THE END!

Finally, after about seven hours of work, only 15 minutes of which were related to signing up for and configuring SchedulesDirect, I once again had a two-week window of guide data:

SchedulesDirect mythfilldatabase

My lesson: don’t let MythTV upgrades slide so much in the future!

I heart SchedulesDirect

Friday, September 14th, 2007

Earlier this year, Zap2It Labs shut down and stopped giving free TV guide data to MythTV users. In response, the community set up SchedulesDirect, a non-profit organization to license the data for non-commercial uses.

Although I liked getting guide data for free (who doesn’t like free?), the initial SchedulesDirect plan seemed like a good price. SchedulesDirect asked $15 for three months of data. TiVo pricing is currently $16.95 for one month, or $299 for three years.

(Two notes on the TiVo plans: When I bought my current TiVo — now unplugged and retired — lifetime service for the device was $249. Today, their three-year plan advertises an “extra year for $20,” which is the yearly cost that SchedulesDirect hopes to get to if they can sign up enough subscribers.)

Yesterday, though, a good deal got even better. SchedulesDirect announced that $15 now buys six months of listing data:

We have now passed our second milestone and are lowering the membership fee to $15 for 6 months, effective immediately. For existing members, you’ll notice that the expiration date of your account has been extended an additional three months.

I had given SchedulesDirect money on September 12. Frequently, when a company drops its price, you have to contact them to get the improved price plan. More importantly for the cynics out there who grumbled that SchedulesDirect was going to benefit its founders financially, they are showing a clear committment to act like the community service organization that they claim to be.

But, that’s not all. It wasn’t enough just to give existing subscribers the same deal that new subscribers are getting. There’s a bonus for existing paid subscribers:

To thank you all for getting us to this point, we’ve also added an extra day for each day you’ve had a paid membership. It’s our way of showing our appreciation for your confidence in our organization.

Darn! I was out of the country when SchedulesDirect launched, so I couldn’t upgrade MythTV until I returned home on September 8. After a couple of days worth of testing, I only converted to a paid membership on September 12. Had I been in the country, I would have signed up on the first day!

eneloop charge lifetime anecdote #1

Thursday, September 13th, 2007

A couple of weeks ago, I recommended Sanyo’s eneloop low-discharge nickel-metal hydride rechargeables. The first set I’ve bought has finally completely discharged. I purchased a package of four AA batteries to power my Canon Speedlite. The eneloops are shipped fully charged and can be used immediately; when mine arrived on July 19, I put them into the camera and started blasting away with the flash. That set was finally exhausted on August 30. (I use the flash every week, but I am not a professional photographer who needs multiple fully charged sets of batteries per day.)

I was so impressed with the long-term charge retention that I decided to convert over to eneloops for my Logitech Harmony remote. I’ve been feeding it alkaline AAA batteries for three years, in large part because remote controls are a low-draw application that is not well suited to rechargeable batteries. My first set of AAAs for the Harmony was delivered on August 17, and I’ll post an update when those need to be recharged.