Fixing Live TV Tuning Problems

Live TV can become locked up if you select a bad channel or one that offends MythTV in some way. Typically, this kind of problem manifests itself in a channel selection that seems to be OK (i.e. it gets a LAM Lock) but doesn't display properly (either no picture or a broken picture). Sometimes the display just locks or freezes. Sometimes you get a message that you should have gotten a LAM lock but the display stays blank. A further symptom may be that the frontend will bail out of the Live TV display after 30 seconds or so, with some incoherent message about no buffer or not being able to record the program (e.g. "Video frame buffering failed too many times"). This problem can also occur on a valid channel that has the "Copy Never" flag set (either for a particular piece of content or always) when a cable card is being used.

In their infinite wisdom, the MythTV guys decided that, in this situation, none of the other keys (that you might use to get out of this mess) should work. This means that the menu key won't work to allow you to pop up the source switching dialog. Nor do any of the arrow keys work so you can't change the channel to something that works. You're just stuck.

If you get lucky and the frontend does give up after 30 seconds, you can continue with the steps below, to fix the problem. Otherwise, if you can telnet or SSH to the system, you can kill the frontend like this:

     su
     ps x -A | grep myth
     (make a note of the PID for mythfrontend or mythfrontend.real)
     kill -9 [mythfrontend.real-PID]    (for later versions of Myth)
     kill -9 [mythfrontend-PID]    (for earlier versions of Myth)

Once the frontend gets back to the main menu, you will still be stuck. Because, in another stroke of genius, the MythTV guys decided to remember which channel Live TV was watching when you exited. In this case, it remembers the broken channel. Nice going! When you start up Live TV again, it goes right back to the broken channel and hangs again. Brilliant!

The solution is to change the default channel ID in the database. In order to do this, you must first exit the frontend completely on the machine which cannot watch Live TV (the current Live TV channel ID is stored on a machine by machine basis). The frontend saves the current value when you exit it so, if you change it while the frontend is still running, the value will simply be reset when you exit the frontend. And, you must exit the frontend to cause it to reread the changed value.

After you exit the frontend, select the default channel ID from the settings table for the machine in question. For example:

     select * from settings where hostname='yourhost' and value='DefaultChanid';

If you see the default channel ID that you wish to change, you can go ahead and change it like this:

     update settings set data='3071'
       where hostname='yourhost' and value='DefaultChanid';

Note that the value used for the channel ID must be a channel ID number, not the channel's virtual channel number or call sign or anything else. The channel ID number can be found under the "chanid" column in the channel table. If you don't know what to use, you can search by call sign like this:

     select callsign, chanid, channum from channel where callsign='WGBH';

This will give you a channel ID to update in the settings table (above). Once you've made the replacement in the "settings" table, you can restart the frontend and you should be able to go back to Live TV without any problems.