Bug 179303 - powerdevil support for hybrid suspend
Summary: powerdevil support for hybrid suspend
Status: RESOLVED FIXED
Alias: None
Product: solid
Classification: Frameworks and Libraries
Component: powermanagement-daemon (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Dario Freddi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-01 19:07 UTC by Andrey Borzenkov
Modified: 2010-10-02 12:47 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Borzenkov 2009-01-01 19:07:18 UTC
Version:            (using Devel)
OS:                Linux
Installed from:    Compiled sources

Hybrid suspend provides the same short resume time as normal STR while protecting against battery drain same as STD does. Tadeoff is slightly longer suspend time which is usually acceptable (you close lid and do not care whether it takes 10 seconds or 2 minutes to complete).

Hybrid suspend is fully supported by HAL and pm-utils so integrating is is mostly the matter of extra selection in GUI.
Comment 1 Dario Freddi 2009-01-11 23:06:59 UTC
Can you please give me some more pointers to that? I'm definitely interested in implementing that
Comment 2 Andrey Borzenkov 2009-01-12 05:09:02 UTC
From lshal:

  org.freedesktop.Hal.Device.SystemPowerManagement.method_names = {'Suspend', 'SuspendHybrid', 'Hibernate', 'Shutdown', 'Reboot', 'SetPowerSave'} (string list)
  org.freedesktop.Hal.Device.SystemPowerManagement.method_signatures = {'i', 'i', '', '', '', 'b'} (string list)

What it does, is to save image to disk (like Hibernate does) and then suspend. So as long as you have enough power you just resume as usual; if battery is empty, does normal resume from disk.

Comment 3 Dario Freddi 2009-01-19 00:11:22 UTC
I'm taking care of this, though I'm changing component since the implementation belongs to solid.
Comment 4 Dario Freddi 2009-02-08 15:02:49 UTC
SVN commit 923243 by dafre:

BUG: 179303

From now on, solid will check if hybrid suspension is available.
If that is the case, it will automatically trigger hybrid instead
of standard suspension to ram. So there won't be extra options
in PowerDevil and/or Solid: Hybrid will be made default if available



 M  +1 -1      halpower.cpp  
 M  +23 -3     halsuspendjob.cpp  
 M  +4 -2      halsuspendjob.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=923243
Comment 5 Dario Freddi 2009-02-08 15:08:41 UTC
SVN commit 923247 by dafre:

BUG: 179303

Backporting to 4.2



 M  +1 -1      halpower.cpp  
 M  +23 -3     halsuspendjob.cpp  
 M  +4 -2      halsuspendjob.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=923247
Comment 6 Danilo Luvizotto 2009-02-19 22:57:23 UTC
Hi,

I do not agree to this change. My notebook is able to suspend to ram out-of-the-box, but if I try s2both, it will suspend to disk and always resume from disk. As pm-utils, s2ram, s2disk and s2both do not work the same way in all machines, I think it would be nice to at least let the user choose the suspending method.

After this change (SVN commit 923247), my powerdevil's gui has two hibernate buttons: the first labeled "suspend" and the other labeled "hibernate" =(
Comment 7 Stijn Van Nieuwenhuyse 2009-02-21 14:22:20 UTC
As Danilo Luvizotto commented, I also think the proposed fix is bad: s2both locks my laptop on resume. However, s2ram and s2disk work fine. After this change, I do not have a reliable suspend to ram method in KDE anymore. I think you should at least let the user choose the suspending method.
Comment 8 Andreas Kuhl 2009-02-21 16:35:54 UTC
Does not work for me too... Before this fix, "Suspend" button triggered suspend-to-ram correctly. Now, after the fix, it triggers suspend-to-disk which takes about the same time to hibernate but ages to wake up.

Please revert this "fix" or make the suspend-command at least configurable.
Comment 9 Danilo Luvizotto 2009-02-21 18:24:42 UTC
Should we open a bug report?
Comment 10 Dario Freddi 2009-02-25 13:24:55 UTC
I'll make Hybrid Suspend an option, this will have the counter effect that it won't be available in Powerdevil until 4.3 (new strings)
Comment 11 Dario Freddi 2009-02-25 13:35:15 UTC
Ok, after a conversation with Kevin, we decided not to revert the commit in trunk and reverting it in 4.2, since the bug is clearly in pm-utils. From our conversation:

<ervin> drf__: I'd say don't make an option for now, and report the pm-utils bug upstream
<drf__> ervin, but at least we should comment the commit... this would break many suspensions in 4.2.1
<drf__> I agree with you though
<ervin> I'd say revert in 4.2 branch
<drf__> ok
<ervin> that gives room for pm-utils people to fix until 4.3 is out
<ervin> if they don't manage to fix in the meantime we'll reevaluate for an option
<ervin> but I'd really prefer avoiding it
<drf__> ok, agreed

So please, report the bug upstream and tell us what the reaction will be. We'll act accordingly after that.
Comment 12 Dario Freddi 2009-02-25 13:39:40 UTC
SVN commit 931528 by dafre:

CCBUG: 179303

After some failed attempts, I'm reverting this feature for 4.2, since
pm-utils seem not to work on every configuration.



 M  +1 -1      halsuspendjob.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=931528
Comment 13 Andreas Jaeger 2009-02-26 11:44:59 UTC
I consider this an interesting feature but I really suggest to make it configurable.  This is not what people will expect.  Even if pm-utils work correctly, users will see the suspend to disk that they did not ask for and have no way to change it.

So, IMO the kcm module should have an option that enables/disables this.
Comment 14 David Heidelberg 2009-03-10 16:14:56 UTC
(In reply to comment #13)
> I consider this an interesting feature but I really suggest to make it
> configurable.  This is not what people will expect.  Even if pm-utils work
> correctly, users will see the suspend to disk that they did not ask for and
> have no way to change it.
> 
> So, IMO the kcm module should have an option that enables/disables this.

I agree. Maybe in default settings set to active, but leave choice to deactivate it.
Comment 15 Steffen Schloenvoigt 2009-04-08 00:31:15 UTC
What's the state of the kcm-setting ? Is it available meanwhile?