Difference between revisions of "XMLTV Myth Channel Setup"

From MythTV Official Wiki
Jump to: navigation, search
(Using symbolic channel names: Link conversion from svn to github)
m (The reason)
Line 6: Line 6:
 
The reason is that the <code><nowiki>channel</nowiki></code> table in the <code><nowiki>mythconverg</nowiki></code> database doesn't contain any indication of what frequency the particular channels are on.  
 
The reason is that the <code><nowiki>channel</nowiki></code> table in the <code><nowiki>mythconverg</nowiki></code> database doesn't contain any indication of what frequency the particular channels are on.  
  
In North America at least, there is a tradition for for channels to be on the same frequency everywhere. So channel 7 is on the same channel in all homes across the country.
+
In North America at least, there is a tradition for channels to be on the same frequency everywhere. So channel 7 is on the same channel in all homes across the country.
  
 
But here in Europe at least, there is no such tradition. So two people in two different towns could well have the same channel on different frequencies.
 
But here in Europe at least, there is no such tradition. So two people in two different towns could well have the same channel on different frequencies.

Revision as of 21:04, 9 July 2011

Here in Denmark (Non North American PAL country), I had been struggling with this "can't change channels" business for a while, and I finally figured it out. Simple, once you get it.

After running tv_grab_dk and then Mythfilldatabase, I ended up with program information in the Electronic Program Guide, but changing channels didn't work.

The reason

The reason is that the channel table in the mythconverg database doesn't contain any indication of what frequency the particular channels are on.

In North America at least, there is a tradition for channels to be on the same frequency everywhere. So channel 7 is on the same channel in all homes across the country.

But here in Europe at least, there is no such tradition. So two people in two different towns could well have the same channel on different frequencies.

What to do

The freqid column of the channel table in the mythconverg MySQL database now needs to be edited to include information about my channels.

Gather information first

First, figure out what channel lineup you're using. I chose Channel frequency table = "europe-west" in the MythTV setup/setup. That works for me.

First you'll need to gather information about your own channel line-up. Here in Copenhagen, I am so lucky that TDC KabelTV (my cable provider) has a page containing Cable Lineups (I choose Københavns Kommune). You will need this information one way or another. For each channel you want to use, you will need either the symbolic name of the frequency or (better) the frequency itself. Go find this information now!

Here's some channel frequency listings for Belgium:

How to find the setting for a particular channel

Let us take a use case and follow it through. After having run mythfilldatabase --manual with the output of tv_grab_dk, I ended up with stuff in my channel table.

Let us use CNN as an example. Looking at my cable lineup (for Københavns Kommune), we see, that CNN is on the channel they call K22 at 479.25 MHz (At least I think its MHz :-D).

I'm told that Myth can use full frequency numbers and so we can now use 479250 as the channel in MythTV's channel table. That is probably the easiest to do. If so you can just use 479250 for CNN and so on for the other channels and skip the next sub-section:

Using symbolic channel names

I wish I had known that back when I configured my channels because what I did was use a symbolic name for that frequency. To do that, we need to look in the MythTV source code - in frequencies.c

Remember, that I used europe-west in setup/setup, so in frequencies.c above I need to find europe_west[] And notice that it consists of a number of other elements #defines. Look at these elements only!!! Other channel lineups use the same frequencies under different names. Using these other names won't work! Use the name of the frequency, that corresponds to your configured channel lineup.

For our CNN example, there are the relevant portions of frequencies.c:

#define FREQ_UHF \
<snip>
    { "22",  479250 },  \

static struct CHANLIST europe_west[] = {
    FREQ_CCIR_I_III,
    FREQ_CCIR_SL_SH,
    FREQ_CCIR_H,
    FREQ_CCIR_H2,
    FREQ_UHF
};
<snip>
struct CHANLISTS chanlists[] = {
<snip>
    { "europe-west",      europe_west,       CHAN_COUNT(europe_west)       },

From this, we notice, that the MythTV name for the frequency 479.25 MHz is 22.

Notice how the cable provider's name for the frequency ("K22")differs from MythTV's name for the frequency ("22")! This is not unusual! Use MythTV's name for the frequency ("57")!

So, now we know that for CNN, the MythTV freqid to use is 479250 or 22. The same procedure needs to be followed for all the channels in your lineup.

Change the channel table

This can be done in three different ways:

Using MythWeb

The easiest by far. Open up mythweb in a browser, go to Settings, then Channels. Here you will see a large matrix with one row for each channel. For the CNN channel in our example, set freqid to 22.

Using MySQL

Not as easy, but allows you to do it in bulk, and allows me to demonstrate it here with a command line capture. This is done from the command line like so:

myth@peter:~> mysql -pmythtv -umythtv -Ee 'select * from channel where name="CNN"' mythconverg
*************************** 1. row ***************************
       chanid: 1013
      channum: 14
       freqid: XXX
     sourceid: 1
     callsign: CNN
         name: CNN
         icon: none
     finetune: 0
 videofilters: 
      xmltvid: CNN_International.tdckabeltv.dk
  recpriority: 0
     contrast: 32768
   brightness: 32768
       colour: 32768
          hue: 32768
     tvformat: Default
     commfree: 0
      visible: 1
outputfilters: 
useonairguide: 0
      mplexid: NULL
    serviceid: NULL
    atscsrcid: NULL
myth@peter:~> mysql -pmythtv -umythtv -Ee 'update channel set freqid="22" where name="CNN"' mythconverg
myth@peter:~> mysql -pmythtv -umythtv -Ee 'select * from channel where name="CNN"' mythconverg
*************************** 1. row ***************************
       chanid: 1013
      channum: 14
       freqid: 22
     sourceid: 1
     callsign: CNN
         name: CNN
         icon: none
     finetune: 0
 videofilters: 
      xmltvid: CNN_International.tdckabeltv.dk
  recpriority: 0
     contrast: 32768
   brightness: 32768
       colour: 32768
          hue: 32768
     tvformat: Default
     commfree: 0
      visible: 1
outputfilters: 
useonairguide: 0
      mplexid: NULL
    serviceid: NULL
    atscsrcid: NULL

Channel Editor

Mythtv .15 and later includes a channel editor built into the setup application. The freqid is on the second page of the settings for each channel.

My Channel Table

I used to have my channel table here, but alas, I haven't really kept it up to date, so I think it might be more confusing to look at it than to miss it. I'll post a fresh one when I fix it up and check all the channels! :D

If you have a working MythTV setup maybe you could put in a link to both a mysqldump of your channel.db and a link to your provider's channel lineup documentation.