vdr-1.5.1 & problems with the new shutdown code

Message ID 45EAAEA1.9030809@gmx.de
State New
Headers

Commit Message

Udo Richter March 4, 2007, 11:33 a.m. UTC
  Rolf Ahrenberg wrote:
> No "assuming manual start of VDR" entry found on my logs, so this really 
> was on automatic wakeup for the timer.

If VDR did detect it as manual start, then something else must have 
caused VDR to believe that there's an interactive user. Something 
triggers the activity, maybe a plugin?

> Mar  4 02:05:57 xxx vdr: [6748] next timer event at Sun Mar  4 10:58:00 
> 2007
> 
> Mar  4 10:58:00 xxx vdr: [6688] timer 18 (5 1058-1130 'xxx') start
> ... and vdr just stays on ...

... and I assume that VDR started not more than 10 minutes before, eg. 
after 10:48?

Please add the attached patch, it logs some more infos that might shed 
light on this.

This gives log lines like this:

Mar  4 12:11:18 xx vdr: [3788] Manual Start check: Delta = 240

- means on VDR startup, the expected vs. now time was 240 seconds, VDR 
started 4 minutes before planned.

The following log lines get dumped once a minute:

Mar  4 12:12:20 xx vdr: [3788] LastActivity: Never
Mar  4 12:12:20 xx vdr: [3788] ActiveTimeout:     62
Mar  4 12:12:20 xx vdr: [3788] Retry:  Never

- No keyboard activity ever, no interactive user, ready to shut down 
again since 62 seconds. Never tried to restart. Thats how it should look 
like.

Mar  4 12:14:20 xx vdr: [3788] LastActivity:    36
Mar  4 12:14:20 xx vdr: [3788] ActiveTimeout:  -1164
Mar  4 12:14:20 xx vdr: [3788] Retry:  Never

- This is after activity: Last key stroke 36 seconds ago, no automatic 
shutdown for next 1164 seconds.

Cheers,

Udo
  

Comments

Rolf Ahrenberg March 4, 2007, 4:57 p.m. UTC | #1
On Sun, 4 Mar 2007, Udo Richter wrote:

> Please add the attached patch, it logs some more infos that might shed light 
> on this.

Ok. Here's my log debug entries:

Mar  4 17:56:06 xxx vdr: [6740] VDR version 1.5.1 started
Mar  4 17:56:10 xxx vdr: [6740] Manual Start check: Delta = 230

Mar  4 17:57:14 xxx vdr: [6740] LastActivity: Never
Mar  4 17:57:14 xxx vdr: [6740] ActiveTimeout:     64
Mar  4 17:57:14 xxx vdr: [6740] Retry:  Never

...

Mar  4 17:59:14 xxx vdr: [6740] LastActivity: Never
Mar  4 17:59:14 xxx vdr: [6740] ActiveTimeout:    184
Mar  4 17:59:14 xxx vdr: [6740] Retry:  Never

Mar  4 18:00:00 xxx vdr: [6740] timer 14 (3 1800-1805 'zzz') start

Mar  4 18:00:14 xxx vdr: [6740] LastActivity: Never
Mar  4 18:00:14 xxx vdr: [6740] ActiveTimeout:    244
Mar  4 18:00:14 xxx vdr: [6740] Retry:  Never

...

Mar  4 18:04:14 xxx vdr: [6740] LastActivity: Never
Mar  4 18:04:14 xxx vdr: [6740] ActiveTimeout:    484
Mar  4 18:04:14 xxx vdr: [6740] Retry:  Never

Mar  4 18:05:01 xxx vdr: [6740] timer 14 (3 1800-1805 'zzz') stop

Mar  4 18:05:14 xxx vdr: [6740] LastActivity: Never
Mar  4 18:05:14 xxx vdr: [6740] ActiveTimeout:    544
Mar  4 18:05:14 xxx vdr: [6740] Retry:  Never

Mar  4 18:06:13 xxx vdr: [6740] deleting timer 14 (3 1800-1805 'zzz')

Mar  4 18:06:14 xxx vdr: [6740] LastActivity: Never
Mar  4 18:06:14 xxx vdr: [6740] ActiveTimeout:    604
Mar  4 18:06:14 xxx vdr: [6740] Retry:  Never

...

Mar  4 18:31:14 xxx vdr: [6740] LastActivity: Never
Mar  4 18:31:14 xxx vdr: [6740] ActiveTimeout:   2104
Mar  4 18:31:14 xxx vdr: [6740] Retry:  Never

... goes on and on and no shutdown attempts...

My current activity/timeout settings are:
MinUserInactivity = 600
MinEventTimeout = 10

BR,
--
rofa
  

Patch

Index: vdr.c
===================================================================
--- vdr.c	(Revision 874)
+++ vdr.c	(Arbeitskopie)
@@ -1193,6 +1193,37 @@ 
 
         // Main thread hooks of plugins:
         PluginManager.MainThreadHook();
+
+
+#define DebugTimeouts
+#ifdef DebugTimeouts
+        
+        static time_t DebugTime = time(NULL);
+        time_t Now = time(NULL);
+        if (Now - DebugTime >= 60) {
+           time_t LastActivity = cRemote::LastActivity();
+           if (!LastActivity)
+              dsyslog("LastActivity: Never ");
+           else
+              dsyslog("LastActivity: %5i ",(int)(Now - LastActivity));
+
+           time_t ActiveTimeout = ShutdownHandler.GetUserInactiveTime();
+           if (!ActiveTimeout)
+              dsyslog("ActiveTimeout:  Never ");
+           else
+              dsyslog("ActiveTimeout: %6i ",(int)(Now - ActiveTimeout));
+           
+           time_t Retry = ShutdownHandler.GetRetry();
+           if (!Retry)
+              dsyslog("Retry:  Never ");
+           else
+              dsyslog("Retry: %6i ",(int)(Now - Retry));
+           
+           DebugTime = Now;
+           }
+
+#endif
+
         }
 
   if (ShutdownHandler.EmergencyExitRequested())
Index: shutdown.c
===================================================================
--- shutdown.c	(Revision 874)
+++ shutdown.c	(Arbeitskopie)
@@ -103,6 +103,8 @@ 
 void cShutdownHandler::CheckManualStart(int ManualStart)
 {
   time_t Delta = Setup.NextWakeupTime ? Setup.NextWakeupTime - time(NULL) : 0;
+    
+  dsyslog("Manual Start check: Delta = %i", (int)Delta);
 
   if (!Setup.NextWakeupTime || abs(Delta) > ManualStart) {
      // Apparently the user started VDR manually