Opened 14 years ago

Closed 14 years ago

#109 closed patch (fixed)

DVB/ATSC patch to allow configuring channels via channels.conf

Reported by: mythtv.lutzer@… Owned by: danielk
Priority: minor Milestone: 0.19
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

As per an email thread on mythdev, John Pullan (john.pullan [at] gmail dot com) suggested that I submit a patch to get this change committed to svn.

--- BEGIN EMAIL THREAD --- On 21/06/05, Christiaan Lutzer <mythtv.lutzer@…> wrote:

<snip>

  • Hide quoted text -

Anyway, onto why this message is appropriate for this email list: I had to alter my libmythtv library sources in order to get this to work. The HD-3000 card is recognized as an ATSC card. For the life of me I could not get scanning to work, so I had to figure out something else to do. I noticed that if the card was a QAM (FE_QAM) card, that you could supply a "channels.conf" file in lieu of scanning. However, with ATSC, the GUI components are not there to allow you to enter a channels.conf file if the card is ATSC. So, I hacked the code to:

1.) Allow one to specify a channels.conf file if your card is of type ATSC, and

(scanwizardhelpers.cpp)

case CardUtil::ATSC:

addSelection(tr("Full Scan"),

QString::number(FullScan_ATSC),true);

+ addSelection(tr("Import channels.conf"), + QString::number(Import));

2.) Modified the DVBConfParser to read in the program number from channels.conf if the card type is ATSC.

(dvbconfparser.cpp) bool DVBConfParser::parseConfATSC(QStringList& tokens) {

cerr << "DVBConfParser::parseConfATSC(): parsing tokens..." << endl;

Channel c; QStringList::Iterator i = tokens.begin(); QStringList::Iterator end = tokens.end(); if (i != end) c.name = *i++; else return false; if (i != end) c.frequency = (*i++).toInt(); else return false;

if (i == end
!c.modulation.parseConf(*i++)) return false;

+ We need the program number in the transport stream, otherwise we cannot + "tune" to the program. + if (i != end) c.serviceid = (*i++).toInt(); else return false;

channels.append(c);

return true;

}

And, the channels.conf file that I used simply looked like: [root@localhost ~]# cat channels.conf PBS HDTV:585000000:QAM_256:1 CBS HDTV:603000000:QAM_256:2 ABC HDTV:597000000:QAM_256:1 NBC HDTV:597000000:QAM_256:2 FOX HDTV:603000000:QAM_256:1 TNT HDTV:681000000:QAM_256:1 GBH Kids DTV:591000000:QAM_256:2

The above looks fine, although I have no way to test this, I suggest you submit a patch :)

Now, to me, if you want to use MythTV to record and view HD and SD Digital TV, it would be very difficult programmatically to determine what frequency and program number corresponded to what XMLTV ID. So, to me anyway, channels.conf seems like the way to go.

Does this hack make sense? Is there a better way to do it? Am I nuts?

If we are going to have an import channels.conf it make sense to have it for all types.

Later. -- John --- END EMAIL THREAD ---

I created an svn diff patch file (are you supposed to paste the contents of it inline?) I have the patch available here as well:

http://mandalore.dyndns.biz/~clutzer/mythtv/channels.conf_patch_for_DVB-ATSC.patch

--- BEGIN SVN DIFF PATCH --- Index: libs/libmythtv/scanwizardhelpers.cpp =================================================================== --- libs/libmythtv/scanwizardhelpers.cpp (revision 6793) +++ libs/libmythtv/scanwizardhelpers.cpp (working copy) @@ -264,6 +264,8 @@

case CardUtil::ATSC:

addSelection(tr("Full Scan"),

QString::number(FullScan_ATSC),true);

+ addSelection(tr("Import channels.conf"), + QString::number(Import));

break;

case CardUtil::ERROR_PROBE:

addSelection(QObject::tr("Failed to probe the card"),

Index: libs/libmythtv/dvbconfparser.cpp =================================================================== --- libs/libmythtv/dvbconfparser.cpp (revision 6793) +++ libs/libmythtv/dvbconfparser.cpp (working copy) @@ -154,6 +154,9 @@

if (i != end) c.name = *i++; else return false; if (i != end) c.frequency = (*i++).toInt(); else return false;

if (i == end
!c.modulation.parseConf(*i++)) return false;

+ We need the program number in the transport stream, otherwise we cannot + "tune" to the program. + if (i != end) c.serviceid = (*i++).toInt(); else return false;

channels.append(c);

--- END SVN DIFF PATCH ---

Attachments (1)

channels.conf_patch_for_DVB-ATSC.patch (1.2 KB) - added by mythtv.lutzer@… 14 years ago.
svn diff patch file

Download all attachments as: .zip

Change History (5)

Changed 14 years ago by mythtv.lutzer@…

svn diff patch file

comment:1 Changed 14 years ago by john.pullan@…

I had a look at the dvbscan code the other day, and it looked to me as if the form of channels.conf should be

name,frequency,modulation,video pid, audio pid, service id

Can you confirm that your code is correct for this. (I can't see why you'd have a different channels.conf from the standard but you never know)

comment:2 Changed 14 years ago by danielk

Owner: changed from Isaac Richards to danielk
Status: newassigned

I believe the format should be

name,frequency,modulation,atsc channel,[video pid, audio pid 1, audio pid 2, ...]

With the things in brackets being optional and atsc channel reported as NULL if a proper VCT is missing.

I'll accept this ticket, but it might be a little time before I apply it or something like this since I'm working on scanning right now in my check signal patch.

comment:3 Changed 14 years ago by mythtv.lutzer@…

Is "atsc channel" in this context a MPEG Program Number (PN)? If so, in what cases would you want to specify the video/audio pids instead of gleaning them in the PMT?

I work for a VOD/Video Server company in the U.S. and whenever dealing with HFC environments, all we talk about is tuning by frequency and program number in QAM256 environments.

For example, I get Comcast Digital Cable in Cambridge MA, I know that PBS is broadcast in HD on frequency 585MHz, program number 1.

C.

comment:4 Changed 14 years ago by danielk

Resolution: fixed
Status: assignedclosed

(In [7079]) Closes #109 by applying patch.

It needed a little editing due to all the scanner changes, and I added some "#ifdef USING_DVB" protection, but it is functionally the same as the patch.

I decided to apply it as is. While getting the channel major and minor numbers would allow you to more easilly use this for OTA channels, I don't really see the need for that since a full scan takes so little time these days and collects much more information. But a scan does not currently work for non-ATSC DTV channels on cable, and a channel.conf works...

Note: See TracTickets for help on using tickets.