Difference between revisions of "XMLTV Myth Channel Setup"

From MythTV Official Wiki
Jump to: navigation, search
m (XmlTv 2f Myth Channel Setup moved to XMLTV Myth Channel Setup)
m (That's not how it works... Channel 7 is channel 7 only because of a frequency table--just like the Europe West defines a channel K22.)
 
(17 intermediate revisions by 11 users not shown)
Line 1: Line 1:
[[[[Table Of Contents]]]]
 
 
= Why this page =
 
 
 
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.
 
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 [[Myth Fill Database]], I ended up with program information in the [[Electronic Program Guide]], but changing channels didn't work.
+
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 ==
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 channel configuration did not contain information about 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.
+
== What to do ==
  
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.
+
The <code><nowiki>freqid</nowiki></code> needs to be specified for each of my channels.
  
= What to do =
+
=== Gather information first ===
 
 
The <code><nowiki>freqid</nowiki></code> column of the <code><nowiki>channel</nowiki></code> table in the <code><nowiki>mythconverg</nowiki></code> 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, 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 [http://tdckabeltv.dk/ TDC KabelTV] (my cable provider) has [http://tdckabeltv.dk/print_kanal_guide.php?KN=60 a page containing my Cable Lineup]. 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!
+
First you'll need to gather information about your own channel line-up. Here in Copenhagen, I am so lucky that [http://tdckabeltv.dk/ TDC KabelTV] (my cable provider) has [http://tdckabeltv.dk/appmanager/ktv/privat?_nfpb=true&_pageLabel=P11200666311138966474793 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!
 
 
For (UPC) Telekabel Wien (Vienna, Asutria) the channel table can be found under [http://www.upc.at/tv/tv_wien.shtml UPC Telekabel].
 
  
 
Here's some channel frequency listings for Belgium:
 
Here's some channel frequency listings for Belgium:
*Integan [http://www.integan.be/aanbod/frequenties_televisie.html Integan kabelcommunicatie]
+
*Telenet [http://www.zenders.be/ Telenet zenderaanbod]
*Telenet/MixtICS [http://www.mixtics.be/kanalen/kanaalverdeling/ MixtICS]
 
 
*UPC Brussels [http://www.upcbelgium.be/upcbe_brnl/index.php?PageID=147027]
 
*UPC Brussels [http://www.upcbelgium.be/upcbe_brnl/index.php?PageID=147027]
  
== How to find the setting for a particular channel ==
+
=== How to find the setting for a particular channel ===
Let us take a use case and follow it through. After having run <code><nowiki>mythfilldatabase --manual</nowiki></code> with the output of <code><nowiki>tv_grab_dk</nowiki></code>, I ended up with stuff in my channel table.
+
Let us take a use case and follow it through. After having run <code><nowiki>mythfilldatabase --manual</nowiki></code> with the output of <code><nowiki>tv_grab_dk</nowiki></code>, I ended up with several channels.
 
 
Let us use CNN as an example. Looking at [http://tdckabeltv.dk/print_kanal_guide.php?KN=60 my cable lineup], we see, that CNN is on the channel they call <code><nowiki>K57</nowiki></code> at <code><nowiki>759.25 MHz</nowiki></code> (At least I think its MHz :-D).
 
  
MythTV needs a symbolic name for that frequency. Now, we need to look in the MythTV source code - specifically at:
+
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 <code><nowiki>K22</nowiki></code> at <code><nowiki>479.25 MHz</nowiki></code> (At least I think its MHz :-D).
  
This is no true. Myth can use full frequency numbers so this explanation is more complex than in should be. In the above example you can enter 759250 in mythtv's chanel table. No need to translate !!!!
+
I'm told that Myth can use full frequency numbers and so we can now use 479250 as the frequency ID. 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:
  
[http://cvs.mythtv.org/cgi-bin/viewcvs.cgi/mythtv/libs/libmythtv/frequencies.c?view=auto frequencies.c]
+
==== Using symbolic channel names ====
  
(Any alternatives to doing this are very welcome!)
+
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 [https://github.com/MythTV/mythtv/raw/master/mythtv/libs/libmythtv/frequencies.c frequencies.c]
  
 
Remember, that I used <code><nowiki>europe-west</nowiki></code> in setup/setup, so in <code><nowiki>frequencies.c</nowiki></code> above I need to find <code><nowiki>europe_west[]</nowiki></code> And notice that it consists of a number of other elements <code><nowiki>#defines</nowiki></code>. 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.
 
Remember, that I used <code><nowiki>europe-west</nowiki></code> in setup/setup, so in <code><nowiki>frequencies.c</nowiki></code> above I need to find <code><nowiki>europe_west[]</nowiki></code> And notice that it consists of a number of other elements <code><nowiki>#defines</nowiki></code>. 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.
Line 49: Line 36:
 
#define FREQ_UHF \
 
#define FREQ_UHF \
 
<snip>
 
<snip>
     { "57",  759250 }, \
+
     { "22",  479250 }, \
  
 
static struct CHANLIST europe_west[] = {
 
static struct CHANLIST europe_west[] = {
Line 55: Line 42:
 
     FREQ_CCIR_SL_SH,
 
     FREQ_CCIR_SL_SH,
 
     FREQ_CCIR_H,
 
     FREQ_CCIR_H,
 +
    FREQ_CCIR_H2,
 
     FREQ_UHF
 
     FREQ_UHF
 
};
 
};
Line 63: Line 51:
 
</nowiki></pre>
 
</nowiki></pre>
  
From this, we notice, that the MythTV name for the frequency <code><nowiki>759.25 MHz</nowiki></code> is <code><nowiki>57</nowiki></code>.  
+
From this, we notice, that the MythTV name for the frequency <code><nowiki>479.25 MHz</nowiki></code> is <code><nowiki>22</nowiki></code>.  
  
''Notice how the cable provider's name for the frequency ("<code><nowiki>K57</nowiki></code>")differs from MythTV's name for the frequency ("<code><nowiki>57</nowiki></code>")! This is not unusual! Use MythTV's name for the frequency ("<code><nowiki>57</nowiki></code>")!''
+
''Notice how the cable provider's name for the frequency ("<code><nowiki>K22</nowiki></code>")differs from MythTV's name for the frequency ("<code><nowiki>22</nowiki></code>")! This is not unusual! Use MythTV's name for the frequency ("<code><nowiki>57</nowiki></code>")!''
  
So, now we know that for CNN, the MythTV <code><nowiki>freqid</nowiki></code> to use is <code><nowiki>57</nowiki></code>. The same procedure needs to be followed for all the channels in your lineup.
+
So, now we know that for CNN, the MythTV <code><nowiki>freqid</nowiki></code> to use is <code><nowiki>479250</nowiki></code> or <code><nowiki>22</nowiki></code>. The same procedure needs to be followed for all the channels in your lineup.
  
== Change the channel table ==
+
=== Change the channel configuration ===
  
Until .15 is released this can be done in two different ways:
+
This can be done in three different ways:
** Using [[MythWeb]] (the easiest by far)
 
** 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.)
 
** .15 includes a channel editor built into the setup application.  The freqid is on the second page of the settings for each channel.
 
  
=== Using [[MythWeb]] ===
+
==== Using [[MythWeb]] ====
Open up mythweb in a browser, go to <code><nowiki>Settings</nowiki></code>, then <code><nowiki>Channels</nowiki></code>. Here you will see a large matrix with one row for each channel. For the CNN channel in our example, set <code><nowiki>freqid</nowiki></code> to <code><nowiki>57</nowiki></code>.
+
The easiest by far. Open up mythweb in a browser, go to <code><nowiki>Settings</nowiki></code>, then <code><nowiki>Channels</nowiki></code>. Here you will see a large matrix with one row for each channel. For the CNN channel in our example, set <code><nowiki>freqid</nowiki></code> to <code><nowiki>22</nowiki></code>.
  
=== Using MySQL ===
+
==== mythtv-setup Channel Editor ====
This is done from the command line like so:
+
In mythtv-setup's Channel Editor, the freqid is on the second page of the settings for each channel.
<pre><nowiki>
+
 
myth@peter:~> mysql -pmythtv -umythtv -e 'select name from channel' mythconverg
+
==== mythfrontend Channel Editor ====
+---------------------+
+
While watching Live TV, press <code>EDIT</code> (by default <code>E</code>). This approach allows you to view each channel, which is especially useful if you're not sure which channel is which.
| name                |
+
 
+---------------------+
+
== My Channel Data ==
| DR 1                |
+
I used to have my channel data 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
| DR 2                |
 
| TV 2                |
 
| TV 2 Zulu          |
 
| [[Tv Danmark]]          |
 
| TV3                |
 
| 3+                  |
 
| Kanal 5            |
 
| TV4                |
 
| Sverige 1          |
 
| Sverige 2          |
 
| BBC Prime          |
 
| BBC World          |
 
| CNN                |
 
| MTV                |
 
| DK4                |
 
| Discovery Nordic    |
 
| Animal Planet      |
 
| Fox Kids / Hallmark |
 
| Kanal Kbenhavn      |
 
| Info Kanalen        |
 
+---------------------+
 
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:
 
    finetune: 0
 
videofilters:
 
      xmltvid: 16.tdckabeltv.dk
 
  recpriority: 0
 
    contrast: 32768
 
  brightness: 32768
 
      colour: 32768
 
          hue: 32768
 
    tvformat: Default
 
    commfree: 0
 
      visible: 1
 
outputfilters: NULL
 
myth@peter:~> mysql -pmythtv -umythtv -Ee 'update channel set freqid="57" where name="CNN"' mythconverg
 
myth@peter:~> mysql -pmythtv -umythtv -Ee 'select * from channel where name="CNN"' mythconverg
 
*************************** 1. row ***************************
 
      chanid: 1013
 
      channum: 14
 
      freqid: 57
 
    sourceid: 1
 
    callsign: CNN
 
        name: CNN
 
        icon:
 
    finetune: 0
 
videofilters:
 
      xmltvid: 16.tdckabeltv.dk
 
  recpriority: 0
 
    contrast: 32768
 
  brightness: 32768
 
      colour: 32768
 
          hue: 32768
 
    tvformat: Default
 
    commfree: 0
 
      visible: 1
 
outputfilters: NULL
 
</nowiki></pre>
 
  
= My Channel Table =
+
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.
For reference, here is my channel table:
+
[[Category:HOWTO]]
[http://www.morch.com/postings/mythtv/channel.db]
 
This corresponds to channel line up of <code><nowiki>europe-west</nowiki></code> and these cable provider frequencies:
 
[http://tdckabeltv.dk/print_kanal_guide.php?KN=60]
 
[[Category Tips]]
 

Latest revision as of 05:52, 9 September 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 configuration did not contain information about what frequency the particular channels are on.

What to do

The freqid needs to be specified for each of 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 several channels.

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 frequency ID. 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 configuration

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.

mythtv-setup Channel Editor

In mythtv-setup's Channel Editor, the freqid is on the second page of the settings for each channel.

mythfrontend Channel Editor

While watching Live TV, press EDIT (by default E). This approach allows you to view each channel, which is especially useful if you're not sure which channel is which.

My Channel Data

I used to have my channel data 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.