Opened 14 years ago

Closed 14 years ago

#321 closed defect (fixed)

DVB timeouts for tuning are not not long enough for USB connected tuners

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

Description

Timeouts on USB ver 1 connected tuners (Nova-T USB2) are not long enough to allow PID capture. (25% hit rate on tuning, highly dependent on which MUX is chosen).

(This can be proven by using dvb_scan -5 .. .extended timeout option, which works fine).

I increased 2 hard coded timeouts as below, to fix the code. Also tried it with a PCI version of the tuner, which works fine, with no effect on the performance.

Fix could be as below, increasing the hard coded timeouts, or as suggested in the comments, to add a database derived timeout value. Patch given below for basic timeout increase.

From libs/libmythtv/dvbsignalmonitor.cpp

  • int wait = 3000; timeout when waiting on signal

+ int wait = 20000; timeout when waiting on signal

libs/libmythtv/tv_rec.cpp

-#define DVB_TABLE_WAIT 3000 /* msec */

+#define DVB_TABLE_WAIT 15000 /* msec */


Index: libs/libmythtv/dvbsignalmonitor.cpp
===================================================================
--- libs/libmythtv/dvbsignalmonitor.cpp (revision 7191)
+++ libs/libmythtv/dvbsignalmonitor.cpp (working copy)
@@ -31,7 +31,7 @@
  *  \brief Initializes signal lock and signal values.
  *
  *   Start() must be called to actually begin continuous
- *   signal monitoring. The timeout is set to 3 seconds,
+    signal monitoring. The timeout is set to 3 seconds, changed to 20secs
  *   and the signal threshold is initialized to 0%.
  *
  *  \param db_cardnum Recorder number to monitor,
@@ -55,7 +55,7 @@
 {
     channel_dev = channel->GetDevice();
     // These two values should probably come from the database...
-    int wait = 3000; // timeout when waiting on signal
+    int wait = 20000; // timeout when waiting on signal
     int threshold = -32768; // signal strength threshold in %

     signalLock.SetTimeout(wait);
Index: libs/libmythtv/tv_rec.cpp
===================================================================
--- libs/libmythtv/tv_rec.cpp   (revision 7191)
+++ libs/libmythtv/tv_rec.cpp   (working copy)
@@ -65,7 +65,7 @@
 #include "dbox2channel.h"
 #endif

-#define DVB_TABLE_WAIT 3000 /* msec */
+#define DVB_TABLE_WAIT 15000 /* msec */

 const int TVRec::kRequestBufferSize = 256*1000;


Change History (2)

comment:1 Changed 14 years ago by danielk

Owner: changed from Isaac Richards to danielk
Status: newassigned

See #319, I'll make both of these per card configurable. I'll use these values as the defaults for USB connected tuners, unless someone objects.

comment:2 Changed 14 years ago by danielk

Resolution: fixed
Status: assignedclosed

(In [7266]) Fixes #321; timeout not long enough for DVB over USB. Fixes #319; per tuner timeouts.

This changes the signal lock and channel lock timeouts from constants in the code to setable values in the backend configuration and sets reasonable defaults when you configure a new card.

Those with existing cards may wish to fiddle with these values, as the values are initialized to 1000 ms and 3000 ms respectively. These values may not be appropriate for your setup. i.e. if you use DVB-S, DVB over USB, or have a low signal station and want to wait a bit longer for a lock.

This also drops some old dvb_* tables, it is not really safe to regress from SVN to 0.16 now anyway, and 0.17+ does not use these tables.

Note: See TracTickets for help on using tickets.