Opened 5 years ago

Closed 5 years ago

#13391 closed Patch - Bug Fix (fixed)

Incorrect "Timed out" message with DVB-T channelscan

Reported by: Klaas de Waal Owned by: Klaas de Waal
Priority: minor Milestone: 30.1
Component: MythTV - Channel Scanner Version: Master Head
Severity: medium Keywords: DVB DVB-T NIT timeout channelscan
Cc: Stuart Auchterlonie Ticket locked: no

Description

A channelscan with mythtv-setup of the local DVB-T signal gives sometimes "Timed out" messages:

2019-01-26 23:33:07.357716 I  ChannelScanSM(/dev/dvb/adapter1/frontend0): Transport ID 2244 -- Timed out, 19 possible channels

The problem is that the "Timed out" messages are also given sometimes when a transport is scanned correct.

The code for this is found in channelscan_sm.cpp, function ChannelScanSM::UpdateChannelInfo?().
The "Timed out" message depends on the following comparison:

       if ((m_timer.elapsed() > (int)m_channelTimeout))

However, the scanning code allows for larger timeout times if there are DVB (or ATSC/MPEG) tables needed, as documented in lines 68-75 of channelscan_sm.cpp:

/// SDT's should be sent every 2 seconds and NIT's every
/// 10 seconds, so lets wait at least 30 seconds, in
/// case of bad transmitter or lost packets.
const uint ChannelScanSM::kDVBTableTimeout  = 30 * 1000;
/// No logic here, lets just wait at least 10 seconds.
const uint ChannelScanSM::kATSCTableTimeout = 10 * 1000;
/// No logic here, lets just wait at least 15 seconds.
const uint ChannelScanSM::kMPEGTableTimeout = 15 * 1000;

In my DVB-T signal, Digitenne in The Netherlands, the NIT is repeated every 8 seconds. The value of m_channelTimeout is 7 seconds (see also ticket #13380) so this causes a "Timed out" message once in a while even when the scan is correct.

The larger timeout values in case of DVB tables are implemented in function HasTimedOut?() which is called from ChannelScanSM::HandleActiveScan? to decide if the scan has timed out.
The attached patch replaces the comparison with a call to this function:

@ -984,7 +984,7 @@ bool ChannelScanSM::UpdateChannelInfo(bool wait_until_complete)
         }
 
         SignalMonitor *sm = GetSignalMonitor();
-        if ((m_timer.elapsed() > (int)m_channelTimeout))
+        if (HasTimedOut())
         {
             msg_tr = (cchan_cnt) ?
                 QObject::tr("%1 possible channels").arg(cchan_cnt) :

This patch has been tested with the local DVB-T and DVB-C signals.

Attachments (1)

20190127-channelscan-timeout.patch (624 bytes) - added by Klaas de Waal 5 years ago.

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by Klaas de Waal

comment:1 Changed 5 years ago by Stuart Auchterlonie

Milestone: needs_triage30.1
Owner: set to Stuart Auchterlonie
Status: newaccepted

comment:2 Changed 5 years ago by Stuart Auchterlonie

Owner: changed from Stuart Auchterlonie to Klaas de Waal
Status: acceptedassigned

comment:3 Changed 5 years ago by Klaas de Waal <kdewaal@…>

Resolution: fixed
Status: assignedclosed

In 739a994222/mythtv:

A channelscan with mythtv-setup gives sometimes incorrect "Timed out" messages.
This happens when the scan time of a particular transport is extended
because there are SDT's and a NIT to receive but the error message is given
when the original timeout time is exceeded. This is fixed by using
the already present function HasTimedOut? to decide if the scan has timed out.

Fixes #13391

Signed-off-by: Klaas de Waal <kdewaal@…>

Note: See TracTickets for help on using tickets.