Saturday, August 21, 2010

Mythtv and DVB entertainment.

I just spent a number of hours on a pleasant saturday morning trying to work out exactly why MythTV doesn't get program info for Channel Nine (in Sydney, Australia). I already knew this was because Mythtv was failing to parse the EIT data, and in particular, the SDT wasn't being found.

After a fair bit of poking around, re-learning the fragments of DVB that I have long since forgotten, compiling various hacks into mythbackend, I eventually worked out that it was looking for the SDT in the wrong transport ID.

Because mythtv (being the bastion of stunning design that it is), stores a NIT/TID (network id, transport id) per channel, and _also_ stores a TID into the multiplex table. So the channel table has lots of very fine NIT/TIDs which I checked until the cows came home, before eventually discovering that the code was also reading from the dtv_multiplex table.

One "update dtv_multiplex set transportid = 1056 where mplexid=24;" and I now have program schedules for channel 9. w00t!

Ok, this is a pretty trivial thing, and I don't actually care about the data: It's just that this has been non-working for many months, and every time I noticed it it irritated me that I didn't know why it was broken.

Now I do. So now I'm happy :)

Monday, January 11, 2010

Another thing to add to the list of "Life is too short".

Attempted to add an SVN project from into Eclipse using the SVN plugin. Project is an android project.

Total failure. Eventually I got down to errors like:
java.lang.IllegalArgumentException: Path must include project and resource name: /android-l2tp-tether
        at org.eclipse.core.runtime.Assert.isLegal(
        at org.eclipse.core.internal.resources.Workspace.newResource(
        at org.eclipse.core.internal.resources.Container.getFolder(
        at Source)
        at Source)

Noting that there were a project called 'android-l2tp-tether'...
Eclipse is just too big, too clumsy, and too opaque to usefully debug. I wasted an hour wandering around with straces et al, but realized I was just wasting time. Copying the svn directory else, and then doing 'create new project from existing source' was instantly successful. ugh.

Saturday, January 9, 2010

Unit tests

Gradually coming up to speed on gtest (google c++ unit test framework). Yes, I'm know I'm painfully behind...

And retro-fitting unit tests to existing code isn't much fun. However, it is entertaining for the number of latent bugs it finds! There's always something special about output like:
[----------] 2 tests from Image
[ RUN      ] Image.Empty
Segmentation fault (core dumped)

Noting that the unit test in question creates an unparametrised object and inquires as to it's size. :)

Off to fire up a debugger and find out wtf is going on.