Summary: | powerdevil suspend on idle intermittently stops working | ||
---|---|---|---|
Product: | [Unmaintained] solid | Reporter: | Oliver Henshaw <oliver.henshaw> |
Component: | powermanagement-daemon | Assignee: | Dario Freddi <drf> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | seapossession |
Priority: | NOR | ||
Version: | 4.8.5 | ||
Target Milestone: | --- | ||
Platform: | Fedora RPMs | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kde-workspace/4767b47b06b343d2225065021c030cde054b1660 | Version Fixed In: | |
Sentry Crash Report: |
Description
Oliver Henshaw
2012-09-17 17:57:12 UTC
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 |