[mythtv-users] New frequency for NY NBC OTA channel 4
Tom Dexter
digitalaudiorock at gmail.com
Wed Apr 4 16:08:06 UTC 2018
On Wed, Apr 4, 2018 at 5:51 AM, stinga <stinga+mythtv at wolf-rock.com> wrote:
> On 03/04/18 01:26, Tom Dexter wrote:
>>
>> I just found out the hard way that apparently NY NBC channel 4
>> apparently changed frequency on April 1.
>>
>> I'd love to be able to just find out what the new frequency is and to
>> possible change it in the database. I HATE scanning for channels
>> frankly. For one thing I have a bunch of disabled Philadelphia
>> channels that I need to keep, but which can't be picked up without
>> turning my antenna, and among other things I do NOT want it to delete
>> any of those.
>
> I don't do a scan, I just find out when things don't record and fix the DB,
> here are my rough rules, if you don't know what you are doing then don't use
> :-)
> (I am in the UK)
>
>
> #Useful urls
> https://en.kingofsat.net/freqs.php?&pos=28.2E&standard=All&ordre=freq&filtre=no&aff=list
> https://www.lyngsat.com/Astra-2E-2F-2G.html
>
> #List chan details
> select c.xmltvid, c.callsign, c.chanid, c.channum, c.sourceid 'c.sourceid',
> dm.sourceid 'dm.sourceid', c.mplexid 'c.mplexid', dm.mplexid 'dm.mplexid',
> c.serviceid, dm.transportid, dm.frequency, dm.inversion, dm.symbolrate,
> dm.fec, dm.polarity, dm.modulation, dm.networkid from channel c,
> dtv_multiplex dm where c.mplexid = dm.mplexid and name like '%???%';
>
> #if nothing returned then the multiplex is probably missing - this is
> probably better
> select c.xmltvid, c.callsign, c.chanid, c.channum, c.sourceid 'c.sourceid',
> dm.sourceid 'dm.sourceid', c.mplexid 'c.mplexid', dm.mplexid 'dm.mplexid',
> c.serviceid, dm.transportid, dm.frequency, dm.inversion, dm.symbolrate,
> dm.fec, dm.polarity, dm.modulation, dm.networkid from channel c left join
> dtv_multiplex dm on c.mplexid = dm.mplexid where name like '%???%';
>
> #May need to add a new row into dtv_multiplex - see useful urls
> select
> mplexid,sourceid,transportid,networkid,frequency,inversion,symbolrate,fec,polarity,modulation,sistandard
> from dtv_multiplex where frequency=???;
> select
> mplexid,sourceid,transportid,networkid,frequency,inversion,symbolrate,fec,polarity,modulation,sistandard
> from dtv_multiplex order by frequency;
>
> #To insert a new frequency - needs to be done twice, for 3 and 5 sourceid's
> - I have HD and SD source ids
> insert into dtv_multiplex
> (sourceid,transportid,networkid,frequency,symbolrate,polarity)values(5,???,2,???,???,'?');
>
>
> #Then usually you need to alter the channel tables
> select xmltvid, name, c.callsign, c.chanid, c.channum, c.sourceid,
> c.mplexid, c.serviceid from channel c where name like '%??%';
> update channel set mplexid=??? where chanid=???;
> update channel set serviceid=??? where chanid in (???,???);
>
> #duplicate a channel row
> CREATE table x SELECT * FROM channel where chanid=???'
> #Find an empty chanid
> select chanid from channel order by chanid limit 5;
> update x set chanid=???, chanid=???;
> INSERT INTO channel select * from x;
> drop table x;
>
> --
> 'ooroo
>
> Stinga...(:)-)
Yea, I'm thinking very seriously about a similar approach going
forward...especially based on Gary's links there which tell me that
this will be happening to me a LOT over the next few years. A good
part of my job requires more or less living in MySQL so that part
isn't an issue.
In the case of US OTA I think creating new entries on dtv_multiplex
wouldn't be too tough. I'd actually forgotten that I had this perl
script that will list the freqid (which in this case is the UHF or VHF
channel) and the associated frequency that the table would need:
#!/usr/bin/perl
# Run this against /usr/share/dvb/atsc/us-ATSC-center-frequencies-8VSB
# to get a list of frequencies and channel numbers
$cnt = 1;
while ($line = <>) {
chomp($line);
@temp = split(/\s+/, $line);
if ($temp[0] eq 'A') {
$cnt++;
$f = substr($temp[1], 0, length($temp[1]) - 6) . '000000';
print "$f\t$cnt\n";
}
}
Which does this:
perl chanfreq.pl /usr/share/dvb/atsc/us-ATSC-center-frequencies-8VSB
57000000 2
63000000 3
69000000 4
79000000 5
85000000 6
177000000 7
183000000 8
189000000 9
195000000 10
201000000 11
207000000 12
213000000 13
473000000 14
479000000 15
485000000 16
491000000 17
497000000 18
503000000 19
509000000 20
515000000 21
521000000 22
527000000 23
533000000 24
539000000 25
545000000 26
551000000 27
557000000 28
563000000 29
569000000 30
575000000 31
581000000 32
587000000 33
593000000 34
599000000 35
605000000 36
611000000 37
617000000 38
623000000 39
629000000 40
635000000 41
641000000 42
647000000 43
653000000 44
659000000 45
665000000 46
671000000 47
677000000 48
683000000 49
689000000 50
695000000 51
701000000 52
707000000 53
713000000 54
719000000 55
725000000 56
731000000 57
737000000 58
743000000 59
749000000 60
755000000 61
761000000 62
767000000 63
773000000 64
779000000 65
785000000 66
791000000 67
797000000 68
803000000 69
The link that Gary posted to that CSV file shows the from and to
channel numbers.
Anything's better than dealing with those scans.
Tom
More information about the mythtv-users
mailing list