[mythtvnz] Wellington Channel Retuning 19 June 2012

tortise tortise at paradise.net.nz
Sat Jun 16 23:13:51 BST 2012


On 16/06/2012 10:07 p.m., Stephen Worthington wrote:
> On Sat, 16 Jun 2012 19:07:28 +1200, you wrote:
>
>> On Sat, Jun 16, 2012 at 6:47 PM, tortise<tortise at paradise.net.nz>  wrote:
>>> Wellington users may not be aware of
>>> http://www.rsm.govt.nz/cms/policy-and-planning/projects/digital-terrestrial-television-frequency-restacking/timing-and-channel-information
>>>
>>> For kaukau
>>>
>>> 50>  32
>>> 48>  32
>>
>> no 48 goes to 34 I think.
>>
>>> 59>  36
>>>
>>
>> Yes I see we are next! (after you I mean).
>>
>> Are you suggesting just changing the freqid? I am not sure that will
>> work if the serviceids change too.
>>
>>> I suppose it can also be done through SQL, but for the time it would take to
>>> do I am presuming one can do this thru
>>>
>>> /mythweb/settings/tv/channels
>>>
>>> sql seems more risky and would take longer.
>>>
>>
>> No it would be three lines, if simply changing the freqid works (see above)
>
> The Kaukau changes are identical to what the Wharite changes in May
> were, so here is the script I used then:
>
> #!/bin/bash
> # Update the channel frequencies for FreeviewHD from Kaukau for the
> # 19-Jun-2012 changes.
> source /etc/mythtv/mysql.txt
> mysql -u $DBUserName -p$DBPassword -h $DBHostName $DBName<<  EOF
> drop function if exists calcfreq;
> delimiter $$
> create function calcfreq(freqid int) returns int
> begin
>      return (506000000+(8000000*(freqid - 25)));
> end$$
> delimiter ;
>
> set @freqid1 =    50;
> set @newfreqid1 = 32;
> set @freqid2 =    48;
> set @newfreqid2 = 34;
> set @freqid3 =    59;
> set @newfreqid3 = 36;
>
> update channel set freqid = @newfreqid1 where freqid = @freqid1;
> update channel set freqid = @newfreqid2 where freqid = @freqid2;
> update channel set freqid = @newfreqid3 where freqid = @freqid3;
> update dtv_multiplex set frequency = calcfreq(@newfreqid1) where
> frequency = calcfreq(@freqid1);
> update dtv_multiplex set frequency = calcfreq(@newfreqid2) where
> frequency = calcfreq(@freqid2);
> update dtv_multiplex set frequency = calcfreq(@newfreqid3) where
> frequency = calcfreq(@freqid3);
>
> drop function calcfreq;
> EOF
>
> exit 0
>
>
> This will change the "freqid" values, and the "frequency" values.  I
> think the "frequency" value in the dtv_multiplex table is all that
> matters, but if the "freqid" values are also there in the channel
> table it would be best to have them matching.  The tuning code for
> DVB-T looks up the mplexid in the channel table, and uses that to
> index the dtv_multiplex table for the tuning data.  It uses the
> "frequency" value from dtv_multiplex to tune to the multiplex, then
> uses the "serviceid" from the channel table to select the channel on
> that multiplex.  The "freqid" value in the channel table is used to
> tune analogue channels, but as far as I can tell it is ignored when
> tuning digital channels.
>
> If you are using one of the other Wellington transmitters affected by
> this change (Haywards, Fitzherbert or Baxter's Knob) and want to use
> this script, you will need to fill in the correct values from the URL
> above in the script's "set" statement pairs.
>
> All that is changing are the frequencies the multiplexes are broadcast
> on - there are no changes to other things like "serviceid" values.

Thanks Stephen, that's really cool and I am sure will be used by more 
than me!

I note the dev's were talking about removing mysql.txt, I think in favor 
of xml. I suppose mysql.xml could be used instead but I couldn't code 
using that in any great hurry. Perhaps its still easy to use?



More information about the mythtvnz mailing list