MythTV / mythtv

The official MythTV repository
https://www.mythtv.org
GNU General Public License v2.0
705 stars 345 forks source link

Change ATSC major/minor channel separator from "_" to "." #864

Closed kmdewaal closed 7 months ago

kmdewaal commented 7 months ago

Channel scanning on ATSC streams gives channel numbers with the underscore character "_" as separator between the major and minor channel number, e.g. "2_1" or "23_11". With HDHomeRun tuners it is possible to import the channels directly via an XML or an M3U file. In these files the separator between the major and minor channel number is the dot "." and this gives then channel numbers as "2.1" or "23.11". It has been mentioned in issue #860 that the dot is preferred as separator because Schedules Direct does also use the dot, so matching a Schedules Direct lineup with the channels found by MythTV channel scanning is easier.

It is fairly trivial to change the separator character in MythTV from "_" to "." and given the above it seems a good idea but I do not know if that would make the users happy or that it can break something, e.g. in existing user scripts that use channel numbers.

So the question is: Should the ATSC separator be changed from "_" to "." or should it be left as it is now?

kmdewaal commented 7 months ago

This is what the Wikipedia has to say about it:

United States and Canada Further information: Program and System Information Protocol An example of the ATSC major and minor numbers used for a station in the United States or Canada would be to typically have its main programming airing on say channel 8 (the "major channel") with analog on 8.0 and digital on 8.1 (the first two "minor channels") with other entertainment channels being below 8.99 on channels 8.2, 8.3, and up and any additional informational data channels ranging from 8.100 to 8.999. The channels can also be displayed using a hyphen (such as 8-1) or a space; however, on a common seven-segment display, a decimal point would not waste a whole character. The decimal point is more familiar to FM radio listeners who tune by frequency rather than channel, and avoids confusion with ranges of values (for example, 2-4 may be misinterpreted as the range 2 to 4 instead of the fourth sub-channel of channel 2).

Changing the underscore to a dot thus looks like a good idea, and I intend to put this change in master/v35-pre one of these days.

garybuhrmaster commented 7 months ago

So the question is: Should the ATSC separator be changed from "_" to "." or should it be left as it is now?

I think in at least some parts of MythTV, the '.' and the '_' and the '-' were used interchangeably (at least at some point in the history). This is due (at least partially) because on (real) TV remotes, the manufacturers are not consistent (some use the dot, some the underscore, and some used the dash, and I think some manufacturers have changed with different models), and the TV display (on the screens when you change the channels) may show any of those (usually, but I do not think always) consistent with the remote (on one of my generic universal remotes both the dot and the dash are on the same key on the keypad). I suspect that the reason the underscore or dash may be preferred by some is that a dot, on a TV screen 10 feet away, may be (essentially) invisible.

For some people using MythTV being consistent with their TV may be desirable. As long as input (from a remote) supports any of the separators (as displayed on their remote) the internal representation should not matter, although for those using the various setup tools they may wish to have options to show what they expect to see.

Personally, I prefer dots. But since I don't watch LiveTV, I also mostly don't care about what my remote shows as the separator, nor what MythTV displays on the screen for such channel changes.

amessina commented 7 months ago

As the reporter of and as it relates to #860, I don't have a preference of which character is used, only that whatever comes out of the HDHomeRun's linueup.m3u or lineup.xml is what is placed into the channum column of the database. That way, @garybuhrmaster's https://github.com/garybuhrmaster/MythUtil will match what is coming out of tv_grab_zz_sdjson_sqlite so I can get my SchedulesDirect lineup data matched properly after a channel scan.

Essentially...

tv_grab_zz_sdjson_sqlite --quiet --get-lineup --config-file /etc/mythtv/OTA.xmltv | MythUtil-Channel-XMLTV-getLineup --videosource-id 1 --update --refresh-icons --include-extra-icons

In the back of my mind, I'm trying to think of a way that MythTV can run periodic channel scans (import lineup.M3U/XML) and automatically match the data to SchedulesDirect, and fetch updated listings/icons for new channels all in the background.

Back in the early 2010's with the old SchedulesDirect methods, all of these things happened when a channel scan was complete (inside of MythTV/mythfilldatabase). As EPG fetching has moved ahead, it seems like the connection between HDHomeRun and matching of SD EPG data had become rather disconnected.