[mythtv] more on dvb record failure (race condition in signalmonitor.cpp?)

Mark Weaver mark-clist at npsl.co.uk
Tue Aug 23 22:45:49 UTC 2005

Daniel Kristjansson wrote:
> On Mon, 2005-08-22 at 17:18 +0100, Mark Weaver wrote:
>>Mark Weaver wrote:
>>>I am also having trouble with DVB (livetv|recording) -- sometimes 
>>>getting the PMT timeout.  I have tried latest SVN but the backend seems 
>>>very unstable for me.  I've done a little debugging, so far I think I 
>>>have found a race condition in signalmonitor.cpp:
It appears that the SignalMonitor class is reused (sometimes without an 
intervening call to Stop).  On the next run, exit=true therefore the 
thread just quits immediately, and Start() hangs waiting for running to 
become true (which it misses).  I tested this by running mythtv-setup 
and got a hang scanning channels.

void SignalMonitor::Stop()
     VERBOSE(VB_CHANNEL, QString("SignalMonitor::Stop(%1) -- 
ed int)this));
         QMutexLocker locker(&startStopLock);
         if (running)
             exit = true;
             pthread_join(monitor_thread, NULL);
+           exit = false;

Setting exit=false again after pthread_join and inside the mutex looks 
correct to me if the class is to be reused (and solves that problem; 
scanning now completes), although I am unable to get a lock on any channels.

I am currently getting:

DVB#0 ERROR - Getting Frontend tuning parameters failed. (22) Invalid 

So I'll look into that one next.

More information about the mythtv-dev mailing list