Opened 18 years ago

Closed 18 years ago

#744 closed defect (fixed)

DVB Channel scan only processes one section of NIT/SDT tables

Reported by: Dibblah Owned by: danielk
Priority: minor Milestone: 0.20
Component: dvb Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

When doing a scan, certain transports will not fully populate with a single scan - Multiple scans give differing results. This is not due to channels not broadcasting - The results are apparently random.

I'll include -v all,nodatabase logs of two runs of a "single transport scan" once the ticket is created. The problem also exists in full transport scan or tuned scan.

This always appears on transport ID 2047 (mplexid 58 for me)

Attachments (5)

scan1.txt (27.5 KB) - added by Dibblah 18 years ago.
Scan #1. This scan picks up a number of channels that haven't been seen before.
scan2.txt (61.3 KB) - added by Dibblah 18 years ago.
Scan #1. This scan doesn't see any channels
scan3.txt (27.8 KB) - added by Dibblah 18 years ago.
After the timeout change
scan4.txt (55.7 KB) - added by Dibblah 18 years ago.
After the timeout change 2
scan5.txt (35.0 KB) - added by Dibblah 18 years ago.
After the timeout change 3 - Only sees one channel.

Download all attachments as: .zip

Change History (19)

Changed 18 years ago by Dibblah

Attachment: scan1.txt added

Scan #1. This scan picks up a number of channels that haven't been seen before.

Changed 18 years ago by Dibblah

Attachment: scan2.txt added

Scan #1. This scan doesn't see any channels

comment:1 Changed 18 years ago by danielk

Milestone: unknown
Severity: mediumlow
Version: head

Have you tried increasing the signal and channel timeouts in the card setup?

comment:2 Changed 18 years ago by Dibblah

The signal and tuning timeouts are 60000 and 62500 respectively - As default for dvb-s. However, the scanner doesn't seem to be honoring these in this case.

comment:3 Changed 18 years ago by mythdev@…

I suspect the timeouts are being ignored because the sql in ScanWizardScanner::scan() is broken - which means that the signal and channel timeouts default to 1000 and 40000 irrespective of what is set up in the database. The patch here fixes this but may break scanning for anyone who relied on these default values.

Index: mythtv/libs/libmythtv/scanwizard.cpp
===================================================================
--- mythtv/libs/libmythtv/scanwizard.cpp        (revision 8095)
+++ mythtv/libs/libmythtv/scanwizard.cpp        (working copy)
@@ -333,11 +333,13 @@

     MSqlQuery query(MSqlQuery::InitCon());
     query.prepare(QString("SELECT signal_timeout, channel_timeout "
+                          "FROM capturecard "
                           "WHERE cardid=%1").arg(parent->captureCard()));
     if (query.exec() && query.isActive() && query.size() > 0)
     {
+        query.next();
         signal_timeout  = (uint) max(query.value(0).toInt(), 250);
-        channel_timeout = (uint) max(query.value(0).toInt(), 500);
+        channel_timeout = (uint) max(query.value(1).toInt(), 500);
     }

     if (nScanType == ScanTypeSetting::FullScan_Analog)

comment:4 Changed 18 years ago by mythdev@…

I don't think the scan is actually 'missing' channels - Its just picking up those that it sees in the SDT sub_table that it has seen? - in both logs the PAT/NIT lists the complete set of programs available on the transport from 6401 through 6469 However the SDT entries in each log for

SIParser: SDT: NetworkID=2 TransportID=2047 

do not overlap - the first log has 6401-6452, the second has 6453-6468 - (6469 is missing) presumably corresponding to SDT section numbers 1 & 2 for the 2047 transport. Perhaps if the scan continues long enough it'll see them all? (These are split because the maximum sdt length is 1024 bytes)

comment:5 Changed 18 years ago by danielk

(In [8101]) References #744.

Fixes timeout query for scan.

comment:6 Changed 18 years ago by danielk

Dibblah, can you test now that the larger timeouts are respected?

It may still not work because of the section tracker, but then again it may.

comment:7 Changed 18 years ago by anonymous

Doesn't seem to be. Would a -v all help so you can see the DB queries?

Changed 18 years ago by Dibblah

Attachment: scan3.txt added

After the timeout change

Changed 18 years ago by Dibblah

Attachment: scan4.txt added

After the timeout change 2

Changed 18 years ago by Dibblah

Attachment: scan5.txt added

After the timeout change 3 - Only sees one channel.

comment:8 Changed 18 years ago by Dibblah

Scan 5 only sees "BBC R Gael".

comment:9 Changed 18 years ago by danielk

Dibblah, some questions:

  • Do you only have one transport?
  • What kind of scan was this?
  • What are your current timeouts and have you tried increasing them? If so to what values?

It also seems like Scan 5 sees a bunch of channels in the SDT, do you mean only one was inserted?

comment:10 Changed 18 years ago by Dibblah

There are ~50 transports defined in the database.

The logs are of a repeated single transport scan, with one scan done per run. Mythtv-setup is exited between scans. The same issue exists with tuned scan, all transport scan and with multiple scans per run.

The signal and tuning timeouts are 60000 and 62500 respectively, however, the scanner definitely does not hit these. I haven't yet tried increasing them - I don't have access for the next week.

Only one channel was inserted, only one channel was listed in the dialog - The other channels are not shown, even though they have appeared in the SDT list.

comment:11 Changed 18 years ago by mythdev@…

The other channels are not shown, even though they have appeared in the SDT list.

sorry dibblah, fyi I suspect the scan is behaving as implemented. The other channels you see in the SDT list are either associated with other transports or are radio channels (type=2). (the pid filters set retrieve SDT packets for the transport and for other transports, which is why you are seeing them - I believe the code doesn't do anything with the other SDT's until it is scanning the appropriate transport)

As it appeared in your other logs, the 2047 transport presents its service table in 3 subtables - I believe that what your logs are showing is that, as daniel suspected, the section tracker is marking the section complete after any one of the three is found. I can't see anything in the code that uses the section_number or last_section_number fields so I think this is behaving as designed. The timeout doesn't come into play because the tracker thinks its got the section and stops looking.

I'd guess any fix needs to be at the super class level because subtables can be met in other sections - and given the likely impact on other table parsing that may take a little while or a bit of inspiration unless daniel has it up his sleeve already :) I guess the workaround is to rescan (ouch)

(Apologies for butting in again - I've just been spending a lot of time with this particular area over the last week or so)

comment:12 Changed 18 years ago by danielk

Milestone: unknown0.20

I don't have a section tacker fix in the hat, but that is in my 0.20 roadmap, so I'm changing the milestone on this to 0.20.

Until then, rescan till you get the channels :/

If there are two sections per SDT, four scans should give you a 94% chance of picking up the channels in the SDT, five scans should give a 97% chance, etc.

comment:13 Changed 18 years ago by danielk

Component: mythtvdvb
Summary: DVB-s scan misses channels on Astra 28.2DVB Channel scan only processes one section of NIT/SDT tables

comment:14 Changed 18 years ago by danielk

Resolution: fixed
Status: newclosed

(In [9305]) Fixes #744. Switch over to DVBSignalMonitor based channel scan from SIParser based.

This may cause some problems in DVB land with the channel scan.

Please attach a "mythtv-setup -v siparser" log to any ticket...

This will allow us to greatly simplify the scanner and SIParser, but I have left in the SIParser hooks for now. Simply uncomment the "#define USE_SIPARSER" in siscan.h to switch back. But that code will be removed once I'm confident that most of the bugs are gone from the newer scanning code, so please report any problems instead of just uncommenting the define.

Note: See TracTickets for help on using tickets.