I have powerdevil set up with "Screen Energy Saving" after 8 min and "Suspend Session" after 20min. After the system has been up for a while then this sometimes stops working: e.g. the screen continues to blank but the system will not autosuspend; or sometimes neither the screen nor the system power saving kick in. There's nothing inhibiting the powerdevil actions - I've turned on kded debug areas and see no messages about inhibitions in .xsession-errors. This is a system with multiple users, it usually has two long-running user sessions simultaneously logged in. I'm using gdm as the login manager but I see from the debug output that powerdevil seems to be tracking the onConsoleKitActiveSessionChanged status correctly. Packages Affected: I've had the problem for aaaaaages but the current system comprises: kde-workspace-4.8.5-2.fc16.x86_64 kdelibs-4.8.5-1.fc16.x86_64 qt-4.8.2-4.fc16.x86_64 gdm-3.2.1.1-10.fc16.x86_64 ConsoleKit-0.4.5-1.fc15.x86_64 polkit-0.102-3.fc16.x86_64 Reproducible: Sometimes
It turns out this is quite simple to reproduce. Suspend-on-idle stops working after I manually suspend from the kde menu. The problem appears to be in PowerDevil::ActionPool::loadAction - when it's called with an empty (i.e. invalid) KConfigGroup it unloads the existing action but doesn't load a new one. So PowerDevil::Core::triggerSuspendSession will unregister the idle timeout. I have a first attempt at a patch for this, which I'm compiling now.
I am experiencing the same problem; however, this happens in an environment with only one user/session. After reboot, powerdevil does suspend my laptop after the configured amount of time. After some time and several suspends, it fails to suspend on idle. I am running KDE 4.9.2 and a 64-bit system with Archlinux installed on it.
Yes, suspend on idle stops working after you manually suspend (from the kde menu or the power button or closing the lid). you might find that it starts working again if you plug/unplug the power. Try https://git.reviewboard.kde.org/r/106692/ and see if it works for you.
You are absolutely correct! Suspend on idle does stop working after manually suspending (from any of the methods you listed above). You are also right about it starting to work again after unpluging/pluging the power. This is definitely a bug and I can reproduce it and confirm it. Unfortunately, I have not yet had the chance to try your patch, but hopefully I will be able to give it a shot on the weekend. Thank you for the help!
Git commit 8be0b112e4d7322738445b0985134ea6de198505 by Oliver Henshaw. Committed on 20/09/2012 at 16:47. Pushed by oliverhenshaw into branch 'push/4.9'. Don't prematurely unload suspendsession action Sometimes ActionPool::loadAction is called with an empty (invalid) KConfigGroup in order to retrieve an Action* to trigger. These callers treat loadAction as a glorified getter, and should not disturb a loaded action. However, an "active" action was unloaded unconditionally and not subsequently reloaded, since actions can only be loaded with valid configurations. This meant that the idle timeout for the "SuspendSession" action was unregistered when session suspend was triggered by PowerDevil::Core or by a button event. - Only unload action if it's going to be loaded (i.e. group isValid) - Make m_activeActions track loaded actions, for consistency. Note: only the ActionPool::loadAction("SuspendSession") callers suffer undesirable behaviour from triggering this bug. The"DPMSControl" caller from HandleButtonEvents::processAction would disable DPMS if another bug did not mask this one. REVIEW: 106692 M +9 -8 powerdevil/daemon/powerdevilactionpool.cpp http://commits.kde.org/kde-workspace/8be0b112e4d7322738445b0985134ea6de198505
Git commit 4767b47b06b343d2225065021c030cde054b1660 by Oliver Henshaw. Committed on 20/09/2012 at 16:47. Pushed by oliverhenshaw into branch 'master'. Don't prematurely unload suspendsession action Sometimes ActionPool::loadAction is called with an empty (invalid) KConfigGroup in order to retrieve an Action* to trigger. These callers treat loadAction as a glorified getter, and should not disturb a loaded action. However, an "active" action was unloaded unconditionally and not subsequently reloaded, since actions can only be loaded with valid configurations. This meant that the idle timeout for the "SuspendSession" action was unregistered when session suspend was triggered by PowerDevil::Core or by a button event. - Only unload action if it's going to be loaded (i.e. group isValid) - Make m_activeActions track loaded actions, for consistency. Note: only the ActionPool::loadAction("SuspendSession") callers suffer undesirable behaviour from triggering this bug. The"DPMSControl" caller from HandleButtonEvents::processAction would disable DPMS if another bug did not mask this one. REVIEW: 106692 (cherry picked from commit 8be0b112e4d7322738445b0985134ea6de198505) M +9 -8 powerdevil/daemon/powerdevilactionpool.cpp http://commits.kde.org/kde-workspace/4767b47b06b343d2225065021c030cde054b1660