wiki:XMLTVIDs

XMLTV IDs

Note: Most users should no longer have to worry about XMLTV IDs, as Shepherd's new Guided Channel Selection takes care of this for you.

What the frick are XMLTV IDs?

Many people misunderstand XMLTV IDs, and they can be a major source of confusion and dismay when trying to set up TV channels. However, it's a simple concept, and taking a minute to understand it can save time when configuring.

An XMLTV ID is simply a unique label for a TV channel. It's customary for this name to resemble an URL (e.g. "abc.free.au"), but it can be anything. All that's important is that each channel's ID be unique and known to both Shepherd and MythTV.

This is because Shepherd doesn't say, "I have guide data for ABC TV," but rather, "I have guide data for abc.free.au." MythTV then checks this against the XMLTV IDs it knows about. Hopefully it finds one: that is, you configured it (in mythtv-setup) to have a channel with an XMLTV ID of "abc.free.au", plus other data: e.g. a name of "ABC TV Melbourne," channel number 2, frequency 753.5 MHz, etc. If so, MythTV fills this channel with guide data.

What can go wrong

The most common problem is ending up with MythTV having one set of XMLTV IDs for your channels, and Shepherd another. (E.g. MythTV might call ABC TV "abc.digital.melbourne" and Shepherd might call it "abc.free.au".) When MythTV reads in guide data from Shepherd, it sees a bunch of unknown XMLTV IDs and thinks they're new channels. It then automatically creates these in its database. But of course it has no idea what frequency the channels are, so now the user has a double list: channels with guide data but no audio/vision, and channels with audio/vision but no guide data.

(The solution here is to delete half and modify the remainder so they match. You could do it either way, but simplest is probably to delete the new, frequency-less channels in mythtv-setup, re-configure Shepherd to use the same XMLTV IDs as MythTV, and run it again.)

The simplest way from A to B

The easiest way to set this up is to use Guided Channel Selection:

  1. Run mythtv-setup, go into the Channel Editor, and use the Channel Scanner.
  2. Hopefully you now have a long list of channels. You may delete any channels you don't want (guide channels are pretty useless), or rename them, if you like.
  3. If you haven't already installed Shepherd, do that now.
  4. Configure Shepherd (~/.shepherd/tv_grab_au --configure). Say "yes" to Guided Channel Selection, and Shepherd will step through each of your MythTV channels, asking you to match it to a guide data channel.
  5. At the end of configuration, confirm that you want these changes to take effect. Shepherd will update your MythTV channels with XMLTV IDs.

Choosing XMLTV IDs

Both Shepherd and MythTV let you enter an XMLTV ID for each channel. That is, you can set the XMLTV IDs in MythTV to match the ones in Shepherd, or vice versa. Or you can make up your own list of XMLTV IDs and edit channels in both MythTV and Shepherd to suit. All that matters is each XMLTV ID be unique and known to both programs.

Note that even during Advanced configuration, Shepherd will try to read your MythTV database for existing channels and suggest XMLTV IDs to match. Also, unless mythfilldatabase is run with the --update option, MythTV will automatically create new channels for unknown XMLTV IDs (although without any frequency information, or audio/vision, as mentioned above).

Specifying XMLTV IDs

You can specify XMLTV IDs in Shepherd by selecting "Advanced Channel Selection" during configuration. In MythTV, you can use mythtv-setup -> Channel Editor, MythWeb?, or a tool like PHPMyAdmin to edit MythTV's database directly.

What are my XMLTV IDs?

Shepherd stores its XMLTV IDs in ~/.shepherd/channels.conf. MythTV's can be viewed from within mythtv-setup -> Channel Editor.

To see which Shepherd XMLTV IDs match which MythTV XMLTV IDs, use:

tv_grab_au --show-channels