[mythtvnz] Wharite channel changes 13-Mar-2012

Stephen Worthington stephen_agent at jsw.gen.nz
Mon Mar 12 06:33:31 GMT 2012


On Mon, 5 Mar 2012 22:24:26 +1300, you wrote:

>On Mon, 05 Mar 2012 15:53, Stephen Worthington wrote:
>> I am living in Palmerston North I just got a leaflet in my letterbox
>> telling me to retune all DVB-T receivers on 13-Mar-2012 as they are
>> changing the DVB-T transmission frequencies from the Wharite
>> transmitter.  This frequency restacking was originally scheduled for
>> August 2011, but was put off for some reason.  It is definitely going
>> ahead now.
>>
>> See:
>>   http://www.retune.co.nz
>>
>> This was discussed on the list last year, and I had prepared a script
>> to do the changes for me in Mythbuntu.  Here it is again if anyone
>> else would like to use it:
>>
>> adjust_freqid.sh:
>>
>> =====================================================================
>> #!/bin/bash
>> # Update the channel frequencies for FreeviewHD from Wharite for the
>> # August 2011 changes.
>> source /etc/mythtv/mysql.txt
>> mysql -u $DBUserName -p$DBPassword -h $DBHostName $DBName << EOF
>> update channel set freqid = 32 where freqid = 50;
>> update channel set freqid = 34 where freqid = 48;
>> update channel set freqid = 36 where freqid = 59;
>> EOF
>>
>> exit 0
>> =====================================================================
>>
>> The script would probably be easiest to be run from root (or with
>> sudo).  It should work with all versions of Mythbuntu that do DVB-T.
>>
>> If you want to use this script for other transmitters when their time
>> comes, you will need to change the freqid values to the correct before
>> and after channel numbers.
>>
>> See here for all the correct channel numbers:
>>
>>
>> http://www.rsm.govt.nz/cms/policy-and-planning/projects/digital-terrestrial
>>-television-frequency-restacking/timing-and-channel-information
>>
>
>
>Sorry to be a Doubting Thomas but I woud have thought that the correcct change 
>to make was to the frequency field in dtv_multiplex table.
>
>Anyway that was what I was planning to do when the Kaukau chanages roll around 
>in June.
>
>Regards
>
>Tony Sauri

After checking how mythbackend works, I agree that the frequencies it
uses for DVB-T tuning come from the dtv_multiplex table.  Such are the
joys of an unnormalised database.  So this is my updated script for
the frequency changes tonight.  Thanks for the formula for the
frequency calculation.

=====================================================================
#!/bin/bash
# Update the channel frequencies for FreeviewHD from Wharite for the
13-Mar-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
=====================================================================



More information about the mythtvnz mailing list