Posts Tagged mythtv

MythTV fun and games

Bad things don’t always come in threes. For my MythTV setup, four bad things all happened at once. First was that the governments of the Australian states that run Daylight Savings Time (DST) decided to jump on the energy-saving bandwagon and change the end-time for DST this year. Second was that the OzTivo folks changed the API for connecting to their program guide data, and closed the old API interface on the same weekend that DST was originally due to finish. Third, for some reason that I’m still investigating, my run-an-emerge-world-at-least-every-fortnight MythTV backend had an old timezone-data package, so any times it handled that should have still been DST weren’t. Fourth, Shepherd isn’t quite as smart as I thought it was, and I didn’t find out until too late…

Let me get something straight: Shepherd is the bees-knees of EPG grabbers for Australian MythTV users. If you’re a MythTV user in .au and not running Shepherd, stop reading this right now and go and update your system to use it–you’ll be glad you did. If I had just looked at some of the output it has been generating since OzTivo announced it’s changes, most of the agro I’ve suffered the last few hours would have been avoided.

In a nutshell, Shepherd is a “meta-grabber”. It includes code that can get program data from a dozen or so sources, and keeps looking up sources until it fills your listings with data goodness. It automatically updates these individual source grabbers as well, so you should never need to worry about its up-to-date-ness (more on that later though). It also fetches extra program data from IMDB and TVDB, and can even automatically grab station icons for you. Highly, highly recommended.

I could see that some of my EPG data was coming from OzTivo because I had seen the notes that they had put in the program data advising of the API change. The weird thing I saw was that for a program I was recording in the same timeslot each day, sometimes the message would be there and other times not. While I thought that this was a little strange, I figured that the OzTivo folks were just being overly cautious and trusted Shepherd to do all the updates it needed.

Then, ever since Sunday morning when the southern states *didn’t* switch back from DST, I’ve had recording times out by an hour–programs trying to record an hour early. So as I mentioned, I had ye-olde timezone data on the backend, which can’t have helped depending on the data source (although I’m trying to work out if this actually is a contributor as I would have thought it would send the recordings an hour late… plus, others who have confirmed their timezone data have had the same problems). For a couple of programs, I actually had double entries: one an hour too early, then a second one at the right time. This was weird, and I still can’t explain it!

A manual run of mythfilldatabase showed why I was getting the repeated OzTivo API messages. Shepherd had downloaded the updated grabber alright, but the new version has a Perl dependency that wasn’t satisfied and it couldn’t run. Rather than bail out, Shepherd elected just to keep running with the old grabber. Given the circumstances, I’m still deciding how I feel about that. :-

So once I was confident that the grabbers were working okay again, I decided to get the EPG straight. I remembered that mythfilldatabase will not replace any existing data it thinks is valid, which is why only data post-April-5-or-so looked nice again. So, with a mailing list post or two as encouragement, I truncated (database-admin-speak for “deleted all the data from”) the “program” and “programrating” fields in the mythconverg database and ran mythfilldatabase. After about 20 minutes, voila, fixed guide data!

So now I’m thinking of how I can alert myself to a problem with Shepherd. I used to just check the result of the last mythfilldatabase run through Information Centre or mythweb, but since Shepherd ends cleanly so does mythfilldatabase. Looks like I might have to come up with something hackish to look for Perl runtime errors in the mythfilldatabase log and do a Nagios passive service check or something… Sigh, as if I needed another little project to keep me busy… ūüôā

Tags:

MythTV ups and downs

I’m still having a good time with MythTV here…  The Knoppmyth box I’ve been running has been pretty-much rock-solid.  My plan to consolidate MythTV onto the Asterisk server just got a healthy kick-along too, with an announcement that the bogus DViCO card I bought last year finally has Linux driver support.  Bad news came a couple of days ago when the grabber I used for program guide info failed.

Firstly, a rant.  Why the #@&*%$ should it be so hard to get TV guide data in electronic form?  The holders of this info charge money for it, and have clamped-down in the past on those that distribute it freely (I daresay that the reason the grabber failed is that the mob that was making it available, who were doing so as their contribution to the Open Source community in return for basing their commercial product on FOSS, were told to stop).  As far as I am concerned, Free-To-Air Television should be exactly that, free — I should not have to pay to find out what’s on and when.  All that they are doing is forcing folks on to Bittorrent; by making it more inconvenient and less reliable for viewers to watch when they want (restricted guide data, shows that run over-time and push the schedule out), they ensure that viewers NEVER see their advertisers’ content.

Right, rant off.

So I noticed that I was getting errors from the nightly mythfilldatabase run.  mythfilldatabase was running, but not adding any guide data.  After the problems I’d had in the past with the tv_grab_au script and D1’s data (mysterious timezone shifts, missing data), I immediately thought the worst and renewed my search for an alternate grabber.

One of my work colleagues mentioned Shepherd a while ago, and Google regarded it highly, so I gave it a run.  It seems to be an agreggator of a number of different grabber scripts that each pull data from a different resource, by the looks of things, it tries different grabbers (with a kind-of internal quality rating) and keeps going until it’s filled all the gaps in your guide data.  Neat.

Of course migrating from D1’s data to the Shepherd data was painful, because they use different XMLTV IDs for the stations.  Took me a number of channel scan/configure/mythfilldatabase cycles to get things straight, but it all seems to be good now.

Update: MythTV users at work mentioned that they lost some data for a few days, but it seems to be back.  Oh well.  ūüôā

Tags:

My media and Apple TV

No I did not buy an Apple TV — but seeing them on the shelves at the local Hardly Normal has got me thinking about the dilemma-in-the-making that is my media centre dream.  It all comes down to bandwidth, or lack of it to be specific.  Of the two locations at the Crossed Wires campus that ideally need access to the MythTV backend (or would be good spots to put a backend instead of where it currently is, in our bedroom) neither have wired network access.  My days of streaming low-bitrate MPEG4 and MP3 to XBox Media Centre over 802.11g spoilt me into thinking that all video will stream over 54Mbps…  Not so television!

So, points in favour of Apple TV:
* It has convenient TV-out capability
* It should stream content from the Slug, since I installed mt-daapd/Firefly on there
* Inbuilt 802.11n, so I would just have to upgrade to N-capable Wi-Fi to solve a little of my no-wired-network woe
* It seems to be hackable, so a MythTV frontend might not be out of the question
* It’s not an XBox 360, nor is it a Playstation 3

Points against however:
* The hackability is a bit of a question mark, and not really something to rely upon (as Apple may shut the gate on any of it with a software update)
* Like I need another timewasting hardware device in the house
* Without a MythTV frontend, it doesn’t really solve any problems w.r.t the TV-watching problem (even if video can be automatically exported from MythTV in a iTunes/DAAP-friendly format, I’d need to use another interface like MythWeb or a different MythTV frontend to program the MythTV backend)
* Where’s the “TV” in “Apple TV” anyway?  ūüôā  (oh yeah, you plug it into one, of course… ūüôĀ )

In a like vein, I’m trying to get LinuxMCE running (so far in a VMware guest) to see if it solves any of my backend troubles.  It looks very promising, but the installer seems to be a bit crumbly — my first install attempt was without sufficient disk space; even after increasing the space the installer just couldn’t get going again.  Lesson learnt, I’m doing the install again with more disk behind it to see what happens.

Tags: , , ,

MythTV

Spurred on by the successes of a couple of guys at work, I’ve been going through the process of setting up a Linux-based PVR.

I’ve had a tuner card for some time, but my first attempts at getting it to work with MythTV under Gentoo a couple of years ago were less than successful.  The final prompter to do something was discovering KnoppMyth, a purpose-built Linux distro based originally on the Knoppix “live-CD” distro.  KnoppMyth has a customised installer that sets up a Linux system with MythTV and a host of other plugins and extensions that take you from zero-to-PVR with a minimum of fuss.

I downloaded the CD of the latest KnoppMyth, threw the tuner card into a PC reclaimed from a defunct project of mine, and sure enough it worked beautifully.

There were a couple of things that didn’t work out-of-the-box though.  I didn’t understand how the setup process configured the “grabber” — MythTV’s name for the process that obtains program listings.  The MythTV setup program runs in its Qt interface, but the configuration of the grabber (at least, the one for Australia) runs in the text-mode window that the Qt program is launched from.  This little misunderstanding cost me some time in getting it set up properly.  Then, for some reason the channels scanned on the tuner card did not match up with the listings obtained by the grabber, so I had to go through each channel entry and manually add the XMLTV URI for the program guide data.  But now that’s done, woo-hoo!  It works a treat.  Even the IR remote control was detected and set up by KnoppMyth.

Buoyed by my success, I went and found a second tuner card for the box (you can’t have a MythTV backend box with just one tuner, you just can’t).  Here, I committed the cardinal sin of Linux — I bought a brand-new piece of kit and expected it to work.  My sole reasonig was “well it’s the same brand as the one I’ve already got, so it must work”.  Idiot. ūüôā

So the KnoppMyth box is the backend (and a frontend), and I’ve found the XBMCMythTV scripts to use XBMC (on the XBox) as a frontend as well.  MythTV’s functionality in this regard is fantastic — although it is frustrating that every MythTV backend and frontend must be running exactly the same version in order to work together.  KnoppMyth is currently based on MythTV 0.19, and Ubuntu Edgy (which I’m running on the laptops) is at 0.20a…  Probably not too much of a drama, as the laptops are only on 802.11b wireless so running a frontend on them probably wouldn’t work well anyway.

Apart from getting a frontend on the laptops, and the tuner card that doesn’t yet work, the other remaining concern is that it’s just one more box running in the house.  This can be solved however, with a couple of tricks based on Wake-On-LAN.  The MythTV frontend can already be configured to send the “magic packet” to the backend to wake it up if powered off, and there’s a couple of ways to have a backend system wake up to make a scheduled recording (one involves poking the PC’s BIOS to set the timed power-on function, the other is an ingenious method involving a second PC — ideally a low power device like a Linksys NSLU2 or WRT54 — sending the WOL magic packet at the scheduled time).

Tags:

Experiences with MythTV – part 1

Okay, I’m an ungrateful whinger.¬†¬†MythTV so far has been an exercise in lost sleep and disappointment.¬†¬†Don’t know if it’s my TV card, the card’s drivers, DVB (particularly HDTV) support in MythTV, or just the general stability of MythTV itself, but I’m far from happy.

I’ve been holding off on buying a TV card for years, partly because of my perception of poor support in Linux, but also because of the state-of-flux that TV in Australia is in (probably in other parts of the world too) regarding Digital TV.¬†¬†But, XBMC made me take the plunge and I’m thinking it was not a good move.

I wanted to get TV going via XBMC.¬†¬†There’s built-in support for ReplayTV, but since we don’t have and can’t get that over here I went a-browsing.¬†¬†There’s a Python XBMC script that hooks XBMC into MythTV — cool, I thought.¬†¬†I bought a card (supported by drivers written by a local guy, so I figured it would work well and be proven in the local area).

Getting the drivers to build and install was a trial.¬†¬†Running a 2.6 kernel as I am, the way this guy’s package builds it basically toasts a large portion of my kernel tree and replaces it with symlinks to his code (which looks like a snapshot of the LinuxTV code).¬†¬†There’s probably a lot of folk out there that don’t know any better, but IMHO you just don’t do that!¬†¬†On account of how I don’t know a better way to do it though, I’ll shut up.

So I finally got the drivers built.¬†¬†Where are the dvb-utils?¬†¬†Ah, good question…¬†¬†You see on Gentoo, the dvb-utils package builds NOTHING.¬†¬†The maintainers of this package realise that if you are running a 2.6 kernel you’ll have fairly complete LinuxTV support in your kernel, so they tell you that they are doing nothing.¬†¬†But what about the user-space utilites?¬†¬†scan?¬†¬†tzap?¬†¬†Grrr…¬†¬†Watch out for my flaming bug report…

So in the background while a lot of this was happening I was building MythTV.¬†¬†When it finished, I was itching to watch TV!¬†¬†BANG — nothing but an error from mythsetup saying that I had to add dvb support if I want to use a DVB card…¬†¬†Seems there’s a USE flag I was missing.¬†¬†I like Gentoo, but sometimes…¬†¬†So I remerge MythTV…

So now I have a working MythTV, and a working card and drivers.¬†¬†But how do I tune it in?¬†¬†As they say, nothing worth having is easy to obtain.¬†¬†This part of MythTV is probably one of its poorest-documented — how to find out the magic stuff you need to plug in to get going with DVB.¬†¬†After two days of fiddling, I finally Googled a moderately simple method, but it still requires me to key in arcane little numbers and setting for every stream (not just each channel).

So finally I get to watch some TV!¬†¬†But don’t make it high definition, oh no…¬†¬†Seems that something in the chain (driver or MythTV) can’t do HDTV on this HDTV-capable card.¬†¬†And if one of the arcane little numbers is not quite right, the whole things locks up.¬†¬†Still, it could be worse, I’ve only had a couple of kernel freezes on what was previously a rock-solid machine — I’m just glad that I’m using a desktop machine to test with rather than going with my original plan, which was to put the TV card straight into my server.

It’s no wonder that “people” don’t like Linux.¬†¬†Almost every endeavour I have undertaken using Linux has required that I undertake an exhaustive course of self-instruction to become aware of almost every facet of the mechanics of what I’m trying to do.¬†¬†It happened with telephony, with DVD authoring, with TV.¬†¬†How many people that run DVB cards on Windows would even know what PIDs are?¬†¬†I have to know, though, because I run Linux.

Lucky I’m such a fucking geek.

Tags: ,