initial power profiles do not use suspend support

Bug #1066892 reported by Harald Sitter on 2012-10-15
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KDE Base Workspace
Fix Released
High
Kubuntu PPA
Low
Harald Sitter
kde-workspace (Ubuntu)
Critical
Harald Sitter
Precise
Critical
Harald Sitter
Quantal
Critical
Harald Sitter
Raring
Critical
Harald Sitter

Bug Description

Currently when the initial power management profiles are generated the support of suspend and hibernate is not detected properly due to an init order problem. In particular powerdevil will ask libsolid for support, which in turn asks powerdevil though powerdevil at that point does not provide the daemon to deliver the information yet.
This makes fallback code active which for example on laptop lid closing will instead of going to suspend will turn off the screen. Since this is not expectable behavior and different from other OSes/DEs the user might not realize this assuming the suspend takes a bit longer and since they are in a rush put it in their backpack (while the laptop is still running!) this can cause excessive overheating and potential damage the hardware.

[Test Case]
* Create new user
* Go to systemsettings -> power management
* Check that the on battery profile will suspend on lid closing (assuming suspend is supported, which can be confirmed by looking at the application menu's "Leave" tab)

[Regression Potential]
The issue was addressed by not querying libsolid but pass the internally available information directly to the profile creator. Hence there is next to no potential for regression as in case the patch is not working properly it would simply cause the same broken behavior of not taking suspend into account when creating the profiles.

In powerdevilprofilegenerator.cpp we can find the following

        QSet< Solid::PowerManagement::SleepState > methods = Solid::PowerManagement::supportedSleepStates();

       //...

        KConfigGroup handleButtonEvents(&acProfile, "HandleButtonEvents");
        handleButtonEvents.writeEntry< uint >("powerButtonAction", LogoutDialogMode);
        if (methods.contains(Solid::PowerManagement::SuspendState)) {
            handleButtonEvents.writeEntry< uint >("lidAction", ToRamMode);
        } else {
            handleButtonEvents.writeEntry< uint >("lidAction", TurnOffScreenMode);
        }

Now on Kubuntu 12.10 the contains() query is always false thus the lidaction is turn off screen. However it should not be false because...

me@novalis:~$ qdbus org.freedesktop.PowerManagement /org/freedesktop/PowerManagement org.freedesktop.PowerManagement.CanSuspend
true

solid::powermanagement uses the same dbus interface to get its information, so one gets to wonder why it works for me and not for solid.... turns out that this interface is provided by the very same daemon that creates the config (why that does not sound dangerous at all :S). My assumption at present is that either the initialization order is wrong (i.e. the config is created before the interface) or the upower code is bogus (race condition in init or something).

Reproducible: Always

Changed in kdebase-workspace:
importance: Unknown → High
status: Unknown → Confirmed
Changed in kde-workspace (Ubuntu Precise):
status: New → Triaged
importance: Undecided → Critical
assignee: nobody → Harald Sitter (apachelogger)

valorie@valorie-HP-Pavilion-dv7-Notebook-PC:~$ qdbus org.freedesktop.PowerManagement /org/freedesktop/PowerManagement org.freedesktop.PowerManagement.CanSuspend
true

Same situation here: screen turns off, but true suspend doesn't happen, and I cannot wake the session successfully. This was true in Precise, and is still true in Quantal beta.

Changed in kubuntu-ppa:
status: New → Triaged
importance: Undecided → Low
assignee: nobody → Harald Sitter (apachelogger)
Harald Sitter (apachelogger) wrote :
Changed in kde-workspace (Ubuntu Raring):
status: Triaged → Fix Committed
Changed in kubuntu-ppa:
status: Triaged → Fix Released
Changed in kde-workspace (Ubuntu Quantal):
status: Triaged → In Progress

Hello Harald, or anyone else affected,

Accepted into quantal-proposed. The package will build now and be available in a few hours in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in kde-workspace (Ubuntu Quantal):
status: In Progress → Fix Committed
tags: added: verification-needed
Scott Kitterman (kitterman) wrote :

Works for me in quantal.

tags: added: verification-done-quantal
removed: verification-needed

When upgrading to ubuntu 12.10 can reenable PPA disabled by the update. You put the root password but the check is not activated.

Harald Sitter (apachelogger) wrote :

What do you mean?

Harald Sitter (apachelogger) wrote :
Changed in kde-workspace (Ubuntu Precise):
status: Triaged → In Progress
Scott Kitterman (kitterman) wrote :

Hello Harald, or anyone else affected,

Accepted into quantal-proposed. The package will build now and be available in a few hours in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Brian Murray (brian-murray) wrote :

The fix also made it to precise-proposed and could use verification there:

kde-workspace (4:4.8.5-0ubuntu0.2) precise-proposed; urgency=low

  * Add fix-powerdevil-profile-generation.patch to ensure powerdevil
    profiles are created using appropriate information on support of suspend
    and hibernate (LP: #1066892)
 -- Harald Sitter <email address hidden> Tue, 16 Oct 2012 11:38:40 +0200

Changed in kde-workspace (Ubuntu Precise):
status: In Progress → Fix Committed

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package kde-workspace - 4:4.9.2-0ubuntu2.1

---------------
kde-workspace (4:4.9.2-0ubuntu2.1) quantal-proposed; urgency=low

  * Add fix-powerdevil-profile-generation.patch to ensure powerdevil
    profiles are created using appropriate information on support of suspend
    and hibernate (LP: #1066892)
 -- Harald Sitter <email address hidden> Mon, 15 Oct 2012 15:49:07 +0200

Changed in kde-workspace (Ubuntu Raring):
status: Fix Committed → Fix Released
Changed in kde-workspace (Ubuntu Quantal):
status: Fix Committed → Fix Released
Scott Kitterman (kitterman) wrote :

Tested on precise too and it works.

tags: added: verification-done-precise
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package kde-workspace - 4:4.8.5-0ubuntu0.2

---------------
kde-workspace (4:4.8.5-0ubuntu0.2) precise-proposed; urgency=low

  * Add fix-powerdevil-profile-generation.patch to ensure powerdevil
    profiles are created using appropriate information on support of suspend
    and hibernate (LP: #1066892)
 -- Harald Sitter <email address hidden> Tue, 16 Oct 2012 11:38:40 +0200

Changed in kde-workspace (Ubuntu Precise):
status: Fix Committed → Fix Released

I fixed this, in 4.10 for sure and also in 4.9, perhaps in 4.9.4

Thanks for reporting !

Changed in kdebase-workspace:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.