Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: Timer Bug in vdr?



Marcus Kuba wrote:
> 
> Am 22.09.2001 19:44:56, schrieb Klaus Schmidinger <Klaus.Schmidinger@cadsoft.de>:
> 
> >The timer considerations are all done in the main thread.
> >I don't know (yet) what causes this funny behaviour, but I have also
> >observed this once. When I wanted to recreate the conditions in order
> >to reproduce it, the error didn't occur any more...
> 
> So it seems that I'm no longer alone... I have lot's of this timers that start late and the strange
> thing is that they also stop late..as if vdr has another time than the rest of the system.
> ...

Here's a patch that adds some test outputs to the main loop.
It checks whether the time is going forward linearly, and logs
the actual time (as seem by VDR) when starting a timer recording.
Maybe this helps debugging this...

--- vdr.c
+++ vdr.c
@@ -305,6 +305,7 @@
   int LastChannel = -1;
   int PreviousChannel = cDvbApi::CurrentChannel();
   time_t LastActivity = 0;
+  time_t LinearTime = time(NULL);
   int MaxLatencyTime = 0;
   bool ForceShutdown = false;

@@ -314,6 +315,14 @@
      }

   while (!Interrupted) {
+        // Test if we are running in the Einstein continuum:
+        time_t Now = time(NULL);
+        time_t LinearDelta = Now - LinearTime;
+        if (LinearDelta) {
+           if (LinearDelta < 0 || LinearDelta > 300) // assuming nothing will block for more than 5 minutes
+              esyslog(LOG_ERR, "ERROR: time warp detected (%d seconds)", LinearDelta);
+           LinearTime = Now;
+           }
         // Handle emergency exits:
         if (cThread::EmergencyExit()) {
            esyslog(LOG_ERR, "emergency exit requested - shutting down");
@@ -341,6 +350,7 @@
            cRecordControls::Process(Now);
            cTimer *Timer = Timers.GetMatch(Now);
            if (Timer) {
+              dsyslog(LOG_INFO, "system time seen is %s", ctime(&Now));
               if (!cRecordControls::Start(Timer))
                  Timer->SetPending(true);
               }

Klaus
-- 
_______________________________________________________________

Klaus Schmidinger                       Phone: +49-8635-6989-10
CadSoft Computer GmbH                   Fax:   +49-8635-6989-40
Hofmark 2                               Email:   kls@cadsoft.de
D-84568 Pleiskirchen, Germany           URL:     www.cadsoft.de
_______________________________________________________________



Home | Main Index | Thread Index