Enhancement request

User avatar
diyhouse
Senior
Posts: 223
Joined: Mon Mar 31, 2014 9:42 am
Great Britain

Enhancement request

Post by diyhouse »

I am a relative new comer to MythTV,.. some 2yrs and counting,... I now have a fully fledged (reliable ) media PC running 0.27 release.

1st my thanks to the development team,.. pulling together such a vast project with so many contributors,. I applaud you all.

Now having got a running system,.. the biggest pain I found when setting up / configuring the system was when it came to sorting out the channel mappings, now for my system this is slightly more complicated as I have both satellite and FreeView tuners,.. hopefully getting the best from both worlds.

---------------------------------------------
Anyway,.. when scanning for channels on the second tuner card there are invariably duplicate channel numbers,.. and the option is then provided to enter a NEW channel number or SUGGEST one,.. this is fine for one or two channels but for potentially a hundred or so duplicate channels can be a little laborious,.. is it possible to incorporate some option where the action can be duplicated to all remaining issues, as the actual number does not make any big impacts to the end config as they will probably be changed anyway.
----------------------------------------------
Now once all channels have been scanned, (and before sorting and hiding).. something that got me most frustrated and confused for some months checking log files, forums etc was the fact that many of the tuned FreeView channels are useless,.. signal strength too low etc etc. eventually I just figured this out this must me the cause of many failed recordings as there was nothing else,.... Eventually I managed to filter out the bad/low signal strength channels and just hide them out of the way, and pull in the good signals to the Visible area of my channel listings.

This is where I ask for some help thought, input, on a way to improve that way a system is setup,.. and have maybe a FE option to View ALL tuned channels from a setup menu option, ( maybe password protected ) and mark channels as Visible/In-Visible,.. ie view each channel and review its signal quality and mark accordingly. One may also be able to change channel number number here so they are correctly ordered. other options could be to write a SQL/XML script that could be read for future installs, thereby saving time of reviewing each channel whenever the channels are re-scanned.
----------------------------------------------
I appreciate this would take some considerable development effort, but may payback benefits for novices starting off with MythTV,.. my apologies if this is the wrong forum page, or my idea is totally ridiculous,..

I leave it for developer discussion
BTW,.. is there an estimate of how many MythTV system are in existence in the world...
User avatar
stuarta
Developer
Posts: 220
Joined: Wed Feb 05, 2014 5:13 pm
Great Britain

Re: Enhancement request

Post by stuarta »

diyhouse wrote: Anyway,.. when scanning for channels on the second tuner card there are invariably duplicate channel numbers,.. and the option is then provided to enter a NEW channel number or SUGGEST one,.. this is fine for one or two channels but for potentially a hundred or so duplicate channels can be a little laborious,.. is it possible to incorporate some option where the action can be duplicated to all remaining issues, as the actual number does not make any big impacts to the end config as they will probably be changed anyway.
By second tuner to you mean the dvb-s card vs the dvb-t card, or a 2nd input on one of those card?
If it's the second input on one of those cards, you should use the same data source for both and then you will not have duplicate channels. Using both a dvb-t and dvb-s card i'm not getting duplicates, so the only other explanation is you are in a region where you can receive dvb-t broadcasts from multiple transmitter sites. This is something we do not handle well at all.
diyhouse wrote: This is where I ask for some help thought, input, on a way to improve that way a system is setup,.. and have maybe a FE option to View ALL tuned channels from a setup menu option, ( maybe password protected ) and mark channels as Visible/In-Visible,.. ie view each channel and review its signal quality and mark accordingly. One may also be able to change channel number number here so they are correctly ordered. other options could be to write a SQL/XML script that could be read for future installs, thereby saving time of reviewing each channel whenever the channels are re-scanned.
----------------------------------------------
I appreciate this would take some considerable development effort, but may payback benefits for novices starting off with MythTV,.. my apologies if this is the wrong forum page, or my idea is totally ridiculous,..
Thoughts noted. It is an area that still needs further work.
User avatar
diyhouse
Senior
Posts: 223
Joined: Mon Mar 31, 2014 9:42 am
Great Britain

Re: Enhancement request

Post by diyhouse »

Thanks for responding,..My Config is a Dual input S2 card with a quad FreeView T2 tuner,.. I appreciate I can apply the FreeView Source to all four FreeView Inputs,.. ( took me a while to realise this as initially I was tuning each tuner,.. but I have now seen the light :-) ).

Where I live I get good signals for different regions,.. so for a number of tuned channels I can select from two regions, ( but not all ),.... another thought here would be the ability to immediately remove all channels where the signal strength is below 50% or some set value,.. but not sure how this applies to channels that may not be transmitting and the point of tuning config... but food for thought
User avatar
stuarta
Developer
Posts: 220
Joined: Wed Feb 05, 2014 5:13 pm
Great Britain

Re: Enhancement request

Post by stuarta »

That's what i suspected. You receive multiple transmitters at your location. The thought I have at the moment is potentially to analyze the NIT which IIRC, contains the transmitter name, and only use the data from that transmitter.

The other approach, is to do a tuned scan from your best transmitter, telling it to add any multiplexes it finds, then do a scan on all known multiplexes.
User avatar
diyhouse
Senior
Posts: 223
Joined: Mon Mar 31, 2014 9:42 am
Great Britain

Re: Enhancement request

Post by diyhouse »

Stuart,.. cannot say I understand all the details you mention,.. but from my simplistic point of view,.. I look at my SONY TV and "it" can distinguish between good and bad channels,.. and pick the good one every time... I therefore extrapolate "it must be possible",.. as Sony cannot be doing anything that clever.
BTW,.. I live outside Oxford,.. towards London,.. needless to say I tune to the Oxford Transmitter,.. one of the most power transmitters in the UK, and pick up a whole host of local TV transmissions,.. some good,.. and many totally useless channels,.. which is where I kept getting 0B sized recorded files from,.. but it took me a while to work this out.
Rgds
User avatar
diyhouse
Senior
Posts: 223
Joined: Mon Mar 31, 2014 9:42 am
Great Britain

Re: Enhancement request

Post by diyhouse »

Just curious,... but a question to the Dev. folks,...

Has there been any movement/development on the duplicate channel input when asked to input channel number or suggest.

Have been through several cycles of retunes,.. and the above would still be a very useful feature. IMHO...

Many thanks to the dev. teams

Kind regards.
User avatar
paulh
Developer
Posts: 909
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: Enhancement request

Post by paulh »

Almost a year on and sadly nothing has really changed in this area :(

Blame a diminishing number of devs and those that are left are finding it hard to find the time or more truthfully the motivation to work on Myth.
User avatar
diyhouse
Senior
Posts: 223
Joined: Mon Mar 31, 2014 9:42 am
Great Britain

Re: Enhancement request

Post by diyhouse »

That's a shame,.... but Thanks for the update,...

had noticed some time schedules slipping,.. this is one of the really great projects out there!!
PhilB
Senior
Posts: 403
Joined: Sun May 11, 2014 6:23 pm
Great Britain

Re: Enhancement request

Post by PhilB »

I have been working on a Perl script to hide/show channels by name or multiplex (following your earlier correspondence!), change names and change ranges of channel numbers. It uses the new API interface and started by wanting to hide all channels with 'jewellery' or 'adult' in the name. It looks pretty stable in my setup (at least with 0.27.4) and I think the interface is pretty intuitive. I'm looking for a volunteer to see if it works in a situation a little more complex then my single SourceId, single receiver, EIT only scenario. If it passes that test then I'll put it up on the wiki.
Are you interested?

Phil
User avatar
diyhouse
Senior
Posts: 223
Joined: Mon Mar 31, 2014 9:42 am
Great Britain

Re: Enhancement request

Post by diyhouse »

PhilB,.. Had to remind myself of my original ask as it's been so long since I last retuned,.. having got to the bottom of my "drifting"channels.

But an interface that allows for pre-sets on the tuning range, if I read your note correctly sounds good.

And Yes I am up for a play,.. I can certainly do a complete rescan etc on my 'play" system,... so safe from any corruption issues,... so not a problem if it fails... look forward to not pressing arrow keys over 1000 times when re-tuning

Having said all that its probably time for a rescan/retune,..
Gribnif
Junior
Posts: 88
Joined: Wed May 14, 2014 12:46 pm
United States of America

Re: Enhancement request

Post by Gribnif »

I'm definitely interested, too. I have two data sources, one of which is Dish. I'd love to try it out. You can send me a private message, if you like.
PhilB
Senior
Posts: 403
Joined: Sun May 11, 2014 6:23 pm
Great Britain

Re: Enhancement request

Post by PhilB »

I have posted it below but sadly the spacing has vanished.
Note
1. you need the scan_database module found in https://www.mythtv.org/wiki/Perl_API_examples Instructions there.
2. It expects to find a config.xml to get backend IP address.
3. No database chnages made without THREE warnings.
4. Please ignore the stuff commented as obsolete - will remove this some time.

Good luck and thanks for volunteering!
I've sent you my email address to your private inboxes in this forum if you have comments or want me to send you a copy with spacing for readability.

Regards
Phil



#----------------------------
#!/usr/bin/perl -w
use strict;
use scan_database;

print "\n\n--------------------------------------\n";
print "This program can be used in a Mythtv environment.\n";
print "It will to make channels visible or hidden,\n";
print "change their number or change their name.\n";
print "It uses the API interface and was developed under 0.27.4\n";
print "Phil Brady, Sept 2015.\n";
print "------------------------------------------\n\n";
&more;



#get host address and database credentials
my $backend; my $mysqluser=''; my $mysqlpwd='';
&GetCredentials;

#Which video source?
my %sources; my $videosource; my %header;my $temp;
print "\nConnecting to host to get video sources\n";
ReadBackend($backend . ':6544/Channel/VideoSourceList', $temp);
FillHashofHash(%sources, $temp, 'VideoSource', 'Id', 'SourceName');
do{
my $count;
print "Video sources are\n";
foreach (keys %sources){
print "$_ $sources{$_}{'SourceName'}\n";
$count++;
$videosource=$_;
}
if ($count>1){
print "Which video source? ";
chomp ($videosource=<STDIN>);
}else{print "Assuming video source $videosource\n";
}
} while (!defined $sources{$videosource});



print "\nGetting multiplex info\n";
my %freqs;
ReadBackend($backend . ':6544/Channel/GetVideoMultiplexList?SourceID='.$videosource, $temp);
my $reply=FillHashofHash(%freqs, $temp, 'VideoMultiplex', 'MplexId','Frequency' );
print "Found $reply multiplexes\n";

print "\nGetting channel info\n";
my %mydata;
ReadBackend($backend . ':6544/Channel/GetChannelInfoList?SourceID='.$videosource, $temp);
$reply=FillHashofHash(%mydata, $temp, 'ChannelInfo', 'ChanId','CallSign','ChanNum','Visible','MplexId');
print "Found $reply channels\n";
foreach (keys %mydata){
$mydata{$_}{'NewVisible'} = $mydata{$_}{'Visible'};
$mydata{$_}{'ChangeStatus'}=0;
};


=pod
#obsolete stuff
#Show channels with these strings in their names:
my @keep =('*');

#and hide these:
my @discard=('adult','rocks','create','qvc','television x','jewellery',
'store','gems','travel','red button','bbc rb','quest','food network','ideal world',
'pop','kerrang!','kiss','pick','tru','really','4music','viva','tbn','jazeera','absolute', 'smooth', 'talksport');

#mark keeps then discards
my $tag;
foreach $tag (@keep){
&GeneralMark("$videosource:V:T:$tag")
}
foreach $tag (@discard){
&GeneralMark("$videosource:H:T:$tag")
}
=cut



&Menu; #main loop
&UpdateDB;
exit 0;

#-----------------------
sub UpdateDB{

#pre-change checks
my $hide=0; my $unhide=0;
print "Proposed changes are:\n";
my $changecount = &ScanChanges(0, 'proposed');
if ($changecount == 0){exit 0};

exit 0 if &no('Continue and change database');
exit 0 if &no('Do you have a good backup');
exit 0 if &no('Last chance - ok to change database');

#If you would prefer to use SQL change this next line to : if(1){ :

if (0){
&SQLtheDatabase; #for SQL way of doing it
}else{
# use APIs:
&ScanChanges(1, 'made');
}
}

#----------------------
sub ScanChanges{
(my $live, my $wording)=@_;
# $live==0 for reporting, ==1 for changing database
my $changecount=0;
for (sort keys (%mydata)){
if (($mydata{$_}{'NewVisible'} ne $mydata{$_}{'Visible'}) or
($mydata{$_}{ChangeStatus}>0)){
#this channel has been changed
my $new = 'Hidden ';
if ($mydata{$_}{'NewVisible'} eq 'true') {$new='Revealed '};
print "$new Chan=$mydata{$_}{'ChanNum'} ChanId=$_ $mydata{$_}{'CallSign'}\n";
$changecount++;
if ($live>0){
&ChangeChannel($_)
};
}
}
print "$changecount changes $wording\n";
$changecount;
}
#--------------------------
sub ChangeChannel{
#hide or show channel using API
(my $ChanId)=@_;
my $content; my %hash;

my $url= $backend . ':6544/Channel/GetChannelInfo?ChanID='. $ChanId;
ReadBackend($url, $content);
GetAllFields(%hash, $content, '<ChannelInfo', '</ChannelInfo>');

#mark the changes
$hash{'Visible'}= $mydata{$ChanId}{NewVisible};
$hash{'ChanNum'}= $mydata{$ChanId}{'ChanNum'};
$hash{'CallSign'}= $mydata{$ChanId}{'CallSign'};
$hash{'ChannelName'}= $mydata{$ChanId}{'CallSign'};
$hash{'Icon'}= $hash{'IconURL'}; #not aliased by ValidatePost
#Validate and issue post
$url='http://'. $backend . ':6544/Channel/UpdateDBChannel';
ValidatePost(%hash,$url,'raw',16);
}
#-------------------------
sub SQLtheDatabase{
#obsolete routine which only changes visibility.

#decide which need to change
my @hide; my @unhide;
foreach $_ (sort keys (%mydata)){
if ($mydata{$_}{'NewVisible'} ne $mydata{$_}{'Visible'}){
#this channel has been changed
if ($mydata{$_}{'NewVisible'} eq 'true'){
push @unhide, $mydata{$_}{'ChanNum'};
}else{
push @hide, $mydata{$_}{'ChanNum'};
}
}
}

my ($selection,$selection2,$i);

print "Will run mysql statements:\n";
if ($#unhide>-1){
$selection = "update channel set visible=1 where channum=$unhide[0]";
for $i (1..$#unhide){ $selection .= " or channum=$unhide[$i]"};
$selection .=';';
print "$selection\n\n";
}

if ($#hide>-1){
$selection2 = "update channel set visible=0 where channum=$hide[0]";
for $i (1..$#hide){ $selection2 .= " or channum=$hide[$i]"};
$selection2 .=';';
print "$selection2\n\n";
}

#cribbed stuff here ===============

use DBI;

my $dsn; my $sth; my $dbh;
$dsn="DBI:mysql:database=mythconverg;host=$backend";
$dbh=DBI->connect($dsn, $mysqluser, $mysqlpwd, { PrintError=>1, RaiseError=>1 } );
$dbh->{RaiseError} = 0; # only warn on DB errors from here

if ($#hide>-1) {$sth=$dbh->prepare("$selection2")};
if ($#unhide>-1) {$sth=$dbh->prepare("$selection")};
$sth->execute();
$sth->finish();
$dbh->disconnect();

print "All changes done!\n";
}

#----------------------------------
sub GetCredentials{
my $configfile;
my $fn;
my $line;
my $finished;
print "\n";
for my $file (qw (~/.mythtv/config.xml /home/mythtv/.mythtv/config.xml /etc/mythtv/config.xml)){
print "looking for config file $file\n";
($fn)=glob($file);
if ((defined $fn) && (-e $fn)){
open CONFIG, "$fn" or die "Cannot open $fn $!";
while ($_ = <CONFIG>){
if (m!<Host>(\S+)</Host>!) {$backend=$1; $finished +=1};
if (m!<Password>(\S+)</Password>!) {$mysqlpwd=$1; $finished +=10};
if (m!<UserName>(\S+)</UserName>!) {$mysqluser=$1; $finished +=100};
}
close CONFIG;
last;
}
}

if ($finished ==111){
if ($backend =~/localhost/){$backend='127.0.0.1'};
print "Extracted host $backend Database User $mysqluser Password $mysqlpwd\n"
}else{
print "Cannot find host credentials. Fatal\n";
exit 0;
}
}
#----------------
sub no{
while (1){
print "$_[0] (please answer yes or no)? ";
$_=<STDIN>;
chomp;
if (/^yes$/i){return 0};
if (/^no$/i){return 1};
}
}
#----------
sub more{
print "press return to continue:";
<STDIN>;
}
#---------------======
sub ShowMultiplexes{
print "Multiplex Frequency\n";
for (sort keys %freqs) {
print " $_ $freqs{$_}{'Frequency'}\n";
}
}
#------------------------
sub Menu{
my @list;
my $reply=0;
my $ok=0;
print "\n--------------------------------------------------------------------------------------\n";
print "NOTE:\n";
print "All changes will only be proposals until you choose menu option 12 to update the database.\n";
print "Even then, the database will not be changed without 3 further warnings.\n";
print "--------------------------------------------------------------------------------------\n\n";
&more;

while (1){
$ok=0;
print "\nPlease reply:\n\n";
print " 1 to list channels by Call sign (name)\n";
print " 2 .. by Channel number\n";
print " 3 .. by Channel Id\n";
print " 4 .. by Multiplex\n";
print " 5 .. visible first\n";
print " 6 to list multiplexes\n";
print " 7 to mark channels hidden: by name (or all)\n";
print " 8 .. whole multiplex\n";
print " 9 to mark channels visible: by name (or all)\n";
print "10 .. whole multiplex\n";
print "11 to change channel numbers of a range of channel IDs\n";
print "12 to change a call sign\n";
print "13 to import rules\n";
print "14 to continue and update database\n";
print "15 to quit\n";
chomp ($reply=<STDIN>);

if ($reply =~/^\d+$/){

if ($reply eq '15'){print "No database changes made.\n"; exit 0};
if ($reply eq '14'){return 0};
if ($reply eq '13'){&ImportRules};
if ($reply eq '12'){&ChangeName};
if ($reply eq '11'){&ChangeNumbers};
if ($reply eq '10'){&MarkMultiplexes('true', 'unhide')};
if ($reply eq '9'){&ModifyByName('true','')};
if ($reply eq '8'){&MarkMultiplexes('false', 'hide')};
if ($reply eq '7'){&ModifyByName('false','')};
if ($reply eq '6'){&ShowMultiplexes; &more};
if (($reply<6) and ($reply>0)){&ListChannels($reply)};
}else{print "Need numeric reply\n";
}
}
}
#------------------------
sub ImportRules{
my $file='./edit_chans.rules';
unless (open RULES, '<'.$file){
print "Cannot open $file\n";
print "File needs to contain lines with:\n";
print "hide:name OR\n";
print "show:name\n";
return;
}
while (<RULES>){
chomp; $_=lc($_);
if (/^show:(.*)$/){&ModifyByName('true',$1)};
if (/^hide:(.*)$/){&ModifyByName('false', $1)};
}
close RULES;
}
#------------------------
sub ListChannels{
my ($reply)=@_;
my @list;
if ($reply eq '5'){@list=sort { ($mydata{$b}{NewVisible} cmp $mydata{$a}{NewVisible}) or
(lc($mydata{$a}{'CallSign'}) cmp lc($mydata{$b}{'CallSign'}))}
keys (%mydata)};

if ($reply eq '4'){@list=sort {($mydata{$a}{'MplexId'} <=> $mydata{$b}{'MplexId'}) or
($a <=> $b)} keys (%mydata)};
if ($reply eq '3'){@list=sort {($a <=> $b)} keys (%mydata)};
if ($reply eq '2'){
@list=sort {$mydata{$a}{'ChanNum'} <=> $mydata{$b}{'ChanNum'}} keys (%mydata)};
if ($reply eq '1'){
@list=sort {lc($mydata{$a}{'CallSign'}) cmp lc($mydata{$b}{'CallSign'})}
keys (%mydata)};
my $count=0;
foreach $_ (@list){
if ($count==0){
print "\n\nCallSign ChanNo ChanId Mplx Visible Changed\n";
print "--------------------------------------------------------------------\n";
}
my $status=' h ';
if ($mydata{$_}{'NewVisible'} eq 'true') {$status='v '};
if (($mydata{$_}{'NewVisible'} ne $mydata{$_}{'Visible'}) or ($mydata{$_}{'ChangeStatus'}>0)) {
$status ="$status *"
} else {
$status = "$status";
};

printf "%-25s %5s %5s %2s %-20s\n", $mydata{$_}{'CallSign'},
$mydata{$_}{'ChanNum'}, $_,$mydata{$_}{'MplexId'}, $status ;
$count++;
if ($count==34){$count=0; &more};
}
&more;

}
#------------
sub ChangeNumbers{
my $firstId;my $LastId;my $count=0;my %NewNo;my $i;my $new;
print "Please give channel id of first to be changed: ";
chomp ($firstId = <>);
print "Please give channel id of last to be changed: ";
chomp ($LastId = <>);
print "ChanId ChanNo CallSign\n";
print "--------------------\n";
for ($i=$firstId; $i<=$LastId; $i++){
if (exists $mydata{$i}){
print "$i $mydata{$i}{ChanNum} $mydata{$i}{CallSign}\n";
$count++;
}
}
if ($count==0){print "None found\n"; return};
if (&no("$count found. Are these right")){return};
print "What is to be added to channel numbers (negative subtracts)?";
chomp (my $add=<>);
#check no clashes - make list of new
$count=0;
for ($i=$firstId; $i<=$LastId; $i++){
if (exists $mydata{$i}){
$new=$mydata{$i}{ChanNum}+$add;
if ($new<0){
print "Cannot have negative channel no $new for $mydata{$i}{CallSign}\n";
return;
}
$NewNo{$new}++;
}
}
#now check against main list

for (keys %mydata){
$i=$mydata{$_}{ChanNum};
if (exists $NewNo{$i}){
print "sorry - chan num $i clashes with $mydata{$_}{CallSign}\n";
$count++;
}
}
if ($count>0){print "Cannot continue\n"; return};
#okay - seems all to check out. Do the changes:
for ($i=$firstId; $i<=$LastId; $i++){
if (exists $mydata{$i}){
$mydata{$i}{ChanNum} +=$add;
$mydata{$i}{ChangeStatus}++;
}
}
print "Changes done\n";
}
#------------
sub ChangeName{
my $name; my $ChanId;
print "Please give channel id: ";
chomp ($ChanId = <>);

unless (defined $mydata{$ChanId}){print "Not found\n"; return};
print "ChanId=$ChanId Channel number=$mydata{$ChanId}{ChanNum} CallSign=$mydata{$ChanId}{CallSign}\n";
if (&no("Is this right")){return};
print "Give new name:"; chomp ($name = <>);
for (keys %mydata){
if ($mydata{$ChanId}{CallSign} eq $name) {
print "Non unique name\n";
return;
}
};
$mydata{$ChanId}{CallSign}=$name;
$mydata{$ChanId}{ChangeStatus}++;
print "Name changed\n";
}

#-------------------------

sub MarkMultiplexes{
(my $newstate, my $do)=@_;
&ShowMultiplexes;
print "Which multiplex to $do?";
chomp(my $mpx=<STDIN>);

return if (length($mpx)<1);
unless (exists $freqs{$mpx}){
print "Multiplex not recognised\n";
return;
}
#mark the multiplex
for (keys %mydata){
if ($mydata{$_}{'MplexId'} == $mpx){
$mydata{$_}{'NewVisible'}=$newstate;
my $PrintText=($newstate eq 'false')?'Hiding ':'Revealing ';
print "$PrintText $mydata{$_}{CallSign}\n";
}
}
}

#------------------
sub ModifyByName{
#hide or show channels by name
(my $newstate, my $param)=@_;
my $PrintText=($newstate eq 'false')?'hiding ':'revealing';

if ($param eq ''){
print "Give a string (case insensitive) to be found in names of channels for $PrintText (or * for all): ";
chomp($param=<STDIN>);
$param=lc($param);
}

foreach (keys (%mydata)){
my $name=$mydata{$_}{'CallSign'};
if ($param eq '*') {
$mydata{$_}{'NewVisible'}=$newstate;
print "$PrintText $name\n";
}elsif ( $name =~ /$param/i){
$mydata{$_}{'NewVisible'}=$newstate;
print "$PrintText $name\n";
}
}
}
Gribnif
Junior
Posts: 88
Joined: Wed May 14, 2014 12:46 pm
United States of America

Re: Enhancement request

Post by Gribnif »

Hi Phil,

I ran your script and have some suggestions:
  • In the tables, such as "list channels by Call sign", the headings don't line up with the data.
  • For OTA, the fields atsc_major_chan and atsc_minor_chan should be included, IMHO. These are very important to understanding which channel you're looking at.
  • When there are multiple pages of channels, they seem to be split up into chunks of 35 or so, which doesn't work well if you're using a 24-line terminal window. Maybe use the Perl curses library or similar to do pagination?
  • With several hundred Dish channels, it would be helpful to be able to search by number or especially name. Paging through any of the longer tables takes forever and there's no way to stop paging and return to the menu.
  • "Change channel numbers of a range of channel IDs" should show the results of the operation, for just the affected channels.
  • Some of my channel numbers look like "24_2" instead of "24.2". Adding to these doesn't have the desired effect.
  • I don't know how useful it is to ask for a range of channel IDs, since this is just a row ID in the database. In the case of ATSC channels, the sub-channels might have been added at various times, so they end up with non-contiguous IDs.
  • The prompt, "Are these right (please answer yes or no)?" is needlessly verbose. The user shouldn't have to type the whole word "yes" for this operation, just when actually writing to the database.
  • If my response to "Continue and change database (please answer yes or no)?" is "no", it quits the script. It should return me to the menu.
  • Similarly, if you select 14 with no changes, it quits.
  • After updating, you should be returned to the menu where you select your video source. Change "Quit (15)" to "Quit without saving changes", and have it return to the video source menu.
  • Add a Quit option to the video sources menu.
Sorry for the length of the list. I'm a career programmer, so I spend a lot of time thinking about UI.
PhilB
Senior
Posts: 403
Joined: Sun May 11, 2014 6:23 pm
Great Britain

Re: Enhancement request

Post by PhilB »

Thanks for the feedback. That was a stormy crossing over the Atlantic!

1. Heading mis-aligned. I think that got lost in transit. It's wiki corruption with lots of spaces cut out. Try this:
http://paste.ubuntu.com/12698709/

2. atsc_major_chan and atsc_minor_chan. I need to ask for clarification.
Here in the UK we work on Channel number which is an integer between 1 and 700 something on my system (also on my TV) and callsign/Channel name. We don't have decimals like 5.3 (or 5_3).

See the wiki example:
https://www.mythtv.org/wiki/Channel_Ser ... elInfoList
That shows 5_3. By convention do you use 5.3 rather than 5_3?
The channel number is 5_3 and that just matches atsc_major_chan and atsc_minor_chan. Is the match coincidental? Or does
Channel number always = 10*major_chan + minor_chan? Or could you get 5.15?
What is the range of the channel numbers?

3. I put in the adding to channel numbers facility because I've seen postings where folks want to shift channels in bulk. In our environment integer addition works - but I suspect that for you we'll need to do a funny addition (eg add 1000_2).

4. Curses library? ok. This was a quick solution and maybe refinement is in order.

5. "it would be helpful to be able to search by number or especially name."
Actually I did wonder whether instead of the hide by name/number/multiplex mechanism it would be better to have a set of filters which can be applied in series like: Select all; select multiplex, select by name; select by channelID
and a set of actions:
List selection by name/channel number etc
hide selection
unhide selection

6. yes/no? I really wanted to be sure that database writing would be a very deliberate action. Database writing was of course the real challenge and the scarey bit in the whole thing! I did restore the database a few times when it all went horrible, but that seems stable now.
7. Other comments. okay, I take them on board but they are cosmetic compared with the main structure.
8. Two additional questions for you. I only have a single source so my view of the world is limited.
If you scan source 1 then source 2, will all your Channel IDs be unique? Won't source 1 channel ids be contiguous then the source 2 ones?
Will multiplex numbers be unique or are they repeated across sources?
Where I'm coming from is whether it make sense to scan all sources at the start of the program and do everything in one go?

No apologies for list length needed! No point if it doesn't work.
Regards
Phil
Gribnif
Junior
Posts: 88
Joined: Wed May 14, 2014 12:46 pm
United States of America

Re: Enhancement request

Post by Gribnif »

1. Headings: That worked, thanks. I ended up having to copy/paste from that page, rather than download the plaintext version, since that asked for a login. They couldn't just make it easy.

2. IIRC, at one point Myth's channel scanner used to assign names like "5_3", but now it does "5.3". The ones with "_" in them are left around on my system, so I suspect others may have them too. Or perhaps it's up to the broadcaster. I just checked with the hdhomerun_config_gui, and all of my OTA channels now use the "." format.

Usually, channel number = major_chan + minor_chan/10, however I think it's possible for the broadcaster to change the channum whenever it feels.

Maybe I am overthinking this. Maybe just giving the channum would be enough for most people. Based on what I'm seeing of the data and how it correlates to the channel table, I doubt Myth is even using atsc_major_chan and atsc_minor_chan to tune; they are probably just cosmetic. I'll bet it only uses mplexid and serviceid.

FYI: ATSC channel numbers can go from 2 to 69. The part after the "_" or ".", the subchannel, can be one or two digits. I've definitely seen both.

5. As long as selecting by name does partial matches, that would help a lot. I'd also suggest automatically listing the matches after each change in filters, and you'd definitely need a "select none" option.

6. I agree that the whole word "yes" should be required for database operations, but not for confirming that the selected range is correct, since that is not destructive.

8. Channel IDs for me are generally (1000 * sourceID) + freqid. This is true even when freqid > 999. But this is not, strictly speaking, necessary. They simply have to be unique, since that is the primary key in the database table.

When a new channel is discovered, Myth seems to prefer the above scheme, but if there is already a channel at the given ID it seems to just go to the next available ID. Out of the 644 Dish channels I have, 173 do not use the above formula.

So my point is, you really cannot guarantee that channel ID is anything but a unique number assigned to the row in the database. They might as well be random.

To answer your other questions: multiplex is only used for OTA and cable. For Dish (and, I assume other satellite providers), this column contains garbage. The mplexid, when used, relates to the dtv_multiplex table which contains other data about the channel. So it's possible, though not likely, for the same multiplex to be used by multiple sources. For that to happen, the user would have to have two sources that use the same transmission method but contain a different set of channels (like two antennae pointed in different directions.)
Post Reply