Forge Sprint 2011: Power Management and its future

Hello from Madrid. Forge Sprint is about to end, and it’s indeed time for me to blog. I have been lucky enough to get food poisoning the day my flight was scheduled – although, nothing serious: I have been able to recover quite quickly and I rescheduled my flight for day 2, and I managed to get here and do quite a lot of work.

It has been an extremely productive sprint for every Solid component, but of course I am going to put the focus back on Power Management. So here’s what we did:

Crazy bug fix

My first target for this sprint was closing as much bugs as possible. I managed to close quite a lot of them, and hopefully before the 4.7.2 tag. Some of them include DPMS, inhibition, console switching, and general reliability. You can check kde-workspace tree to have a better outlook of what happened, or simply enjoy your updated version without caring too much πŸ™‚

Power Management + KRandR = ❀

Bug fixes are not that exciting, huh? Ok, I have something better for you. Me and Alex got together and tried to improve KRandR experience even more, by hooking it up with Power Management. The result I am explaining here is demonstrated in a video Kevin will hopefully upload soon. Bottom line, now KRandR will make Power Management aware more than 1 screen is configured: hence, if you have an external screen connected and you close your laptop lid, the PC will not suspend anymore even if it’s configured, allowing you to show your movie/presentation without caring about it. Isn’t it awesome? You can try this feature with this commit you can find in kde-workspace.

Future changes in Power Management

We have been lucky enough to have Bjorn here at our sprint. We had a huge conversation on how to improve Power Management, make it easier, less intrusive and more useful. And we came up with something which might surprise you.

It’s a completely new concept I will try to explain now. To begin, we removed the possibility of creating new profiles manually, and removed the “warning state” of the battery, which was not used by default from 4.6 on anyway. This means now there are just 3 static profiles: one for AC, one for Battery, one for Low Battery. You can still configure thresholds for low and critical batteries of course. To reflect this change, we also removed the profile combo box chooser from the battery applet. This is not exactly a new approach, but we have done that to prevent handling profiles in a bad way.

The new things start here: the battery applet lost a combo box, but gained a new button: “Inhibit”. Have you ever missed the presentation profile, that thingie which was around in KDE 4.1 times? Now you have something better. When you press the “Inhibit” button, everything related to Screen power management and session power management will be, surprise, inhibited. This means your brightness won’t change, your screen will not turn off, your PC will not suspend, no matter your configuration. So, if your favorite video player or presentation did not trigger an inhibition itself, now you’re 1 click away from a 0-annoyances experience. Of course, just turn up the extender of the applet and click on “Uninhibit” to get back to your profile.

And it doesn’t stop here. In the near future, activities will also be able to affect power management. This means you can alter settings, trigger special inhibitions and more depending on which activity you are in. This opens up to endless possibilities: suppose you like to watch TV in your bed before falling asleep. What about creating a “Before sleep” activity? Here, you can add a configuration to let your PC go to sleep after 90 minutes of idling, so that when you’ll be asleep, your PC will follow you. Or you can decide how to handle your screen and everything in each activity you are in. This will allow you to be always productive, always trusting your PC to have the perfect settings for the task you are performing.

To make everything clearer, I have done a short screencast. Unfortunately, I am still not able to showcase activity configuration as it’s under development at the moment, but really wanted to show you how the UI and the battery applet have changed. Enjoy!

UPDATE: Apparently Vimeo does not like my video. I am trying to fix this problem, in the meanwhile you can still download it from VimeoΒ΄s page and watch it.

(if you can’t see the embed, video is on Vimeo, here)

~ by Dario on 2 October, 2011.

32 Responses to “Forge Sprint 2011: Power Management and its future”

  1. I’ve ALWAYS wanted something like the inhibit button, I made a custom profile to do something like that, now it’ll be much easier.
    Thanks for your effort

  2. Thanks for the improvements in Power Management. Can I request that applications can take more control of power management? For example, when my screen locks, Wifi is turned off. Wouldn’t it be better if an application like KGet can request Wifi stays on (but the screen is still locked at this point) until KGet is finished downloading files? I feel it would make more sense on portable devices.

    Is this idea already implemented or is it not possible? Where would a better place to request this be?

    • I think that’s a good idea, but I’ll try to build on that and make an even better suggestion πŸ™‚
      Instead of KGet and all other applications having to request that the connection stays up it should be in the base network management functionality. There should be a “GoingDown” network state where current connections are allowed to complete but no new connections can be opened – and when the current connections have completed (e.g. no data transmitted during some timeout period of e.g. 60 seconds) the Wifi is actually shut down.

      Similarly a nice improvement to the network stack would be its ability to reckognize that it has a Wifi connection that isn’t open (e.g. requires a logon or confirmation). Many open Wifis have either a confirmation screen where you promise to “don’t be evil” or a logon screen where you enter username and password. Such connections are useless to applications which request data – so the network state should not be “Connected” until the confirmation/logon has been executed. Don’t know how it would be done though, except with a static check for which the proper response was known.

      • This was the first thing that came to my mind after reading the post. The work in power management is great! But it would be just wonderful if complemented with network inhibitors. Imagine that you’re presenting your work slides (or just watching a dvd movie in your sofa). When you don’t have internet access in that place (or there is some problem with the internet and goes down), it’s terrible to be annoyed every now and then by a bunch of notifications telling you that it was not possible the connection with the server. A simple button to silence all this, would be perfect!

  3. +1, I also always manually add a “inhibit”-style profile, with no sleep (even on lid close), no blanking, etc.
    Thanks for your work on this!

  4. I like it πŸ™‚ keep up the good work!

  5. I think I’m a bit confused… I suppose I misunderstood when I though I read my 2 or 3 custom power profile will stop working soon ?

    • Unfortunately yes. But the good news is that probably you won’t need them anymore. What are you using them for currently?

      • Well, I just have different combinations of backlight, screen stop, laptop lid that I use in different situations (I don’t have the exact english words…)
        At the moment I have 6 of them and I don’t think I can’t go under 4 without some usability loss.

        What bothers me is the active removal of useful functionality. Do I need to change to someone else’s use instead of mine ?

  6. Awesome! These are exactly the kinds of changes I was hoping for. Simpler. Clearer. Faster. My only two suggestions:
    1. Switch the rather unusual phrase “Inhibit” (which some people won’t understand and is unclear *what* it’s inhibiting). I’d suggest “Lock settings” or even “Lock current settings” if it would fit.
    2. While, this is perfect for me, I’m prepared to bet that others will need some kind of “Advanced” button that still allows manual profiles. Just please keep it out of the way of the current, beautifully clear workflow.

    • I answered your 1. below, and 2. is already as you imagined: each activity can have a separate full-fledged power profile.

  7. Nice work πŸ™‚ I have to agree with Schnortle though, “Inhibit” is a bad button label. Not sure if the suggested “Lock settings” is technically correct. How about simply “Presentation mode” or “Disable PM temporarily” (but that’s too long etc)..

    • The “Inhibit” function will actually disable power management if I understood it correctly, so why not just use that term (Disable)? It’s already translated too.

  8. I think for a novice user the term ‘Lock current settings’ will be the most understood. You never disable powermanagement, you lock the current settings. No matter if you are giving a presentation.

    I am not sure if the new ‘only activity-bounded profiles’ is a good idea. Activities are still dark magic to a lot of users (incl myself). I understand the concept, but they do not (yet) fit my workflow. Having people to use activities just to use energy profiles does not sound right to me.

    Do I understand correctly that from then on I can push the ‘screen off’ button from my iMac and the beamer will still shine? This would be awsome, cause until now it shuts down both πŸ˜₯

  9. I agree that in general users want to interact with power management in a few simple ways and the interface could be made simpler to do those things. The thing is I’m not sure all user’s do the same things. I think it’s worth doing a survey of what users use power management for, not how they think it should be designed just how they use is.

    Personally I do two things
    (1) switch to a presentation profile, much like suspend
    (2) switch to a “headless” profile, which never suspends but turns off the display after a minute, used if I’m leaving something running
    (3) switch back to normal profile

    • We already had this very survey, and my post reflects the common thought.
      About your concerns

      1) Now you can do it through the applet
      2) You can simply inhibit through the applet, and turn off the screen through KRunner. Explicit actions are never inhibited.
      3) If you do what I said in 2) you don’t need to do that anymore πŸ™‚

  10. Thanks everyone for the feedback. About the “Inhibit” button, thanks for your suggestions and please keep them coming: we want to change that sentence with something more friendly, and you are the ones who can help with that πŸ™‚

  11. Hi,

    first of all, the linked video seems to have some problems. it tells me “Uh oh! There was a problem loading this video.”

    Then: One great thing about profiles was the possibility to add custom commands which are executed. Will this still be possible? Since I have some commands regarding thinkpad_acpi and nvidia that I would like to execute when power is plugged in / out.

    Also I liked to have the possibility to keep the brightness and power up even when the power was unplugged, when I already knew that I’ll be able to plug it back in shortly. Seems that this will be harder to achieve with the new system.

    I think that the flexibility profiles give to the power user should be kept, other systems offer this as well, just with sane default values for the regular user. I think that would be the way to go, not taking the users freedom away.

    • I know – I actually wrote it in the post. You can still download the video from the vimeo page anyway.

      The configuration as you know it is not going to go away and will remain exactly the same. If you have never switched to a manual profile you will not even be affected. For fitting your use case, you can simply “inhibit” temporarily, which makes even more sense and it’s more powerful.

      This change is towards empowering the user in a natural way, and not to take freedom away. You should really watch the video.

      • Hi, I didn’t see the update, sorry.

        After fiddling around with vimeo (I don’t like to register myself just for one single video, fortunately I found out that you don’t need to confirm your e-mail address) I had a look at the video.

        I think most use cases will work with the new way profiles are handled, however, users of laptops with a lot of different scenarios (e.g. short time no power plug, different kind of work that needs to be done without power) will miss to have at least the possibility to create custom profiles. And I don’t see a good reason for removing this possibility yet.

        So I think this solution is fine for the generic user, but the great thing about KDE was the freedom you offered to power users, so that they could adapt the system to their needs. Changes like this one take this freedom away.

        So, thanks a lot for your work, for the bugfixes and the part with krandr, but I still would prefer to have the possibility to create additional profiles and switch to them if I wanted to.

      • Thanks for your understanding. But as I told you, I am pretty confident you’ll get used to the new UI and will find it even better for your own current needs. I understand it’s a different way of working than the one your are currently using, but try giving it a shot: combining sane defaults with the inhibit button might be surprisingly effective πŸ™‚

      • +1

  12. >if you have an external screen connected and you close your laptop lid, the PC will not suspend anymore even if it’s configured, allowing you to show your movie/presentation without caring about it.
    >When you press the β€œInhibit” button, everything related to Screen power management and session power management will be, surprise, inhibited.

    It’s really nice, thanks! It will be a part KDE SC 4.8?

    >video is on Vimeo, here
    >Please join or log in to download

    Em, may you upload video to a more anon-friendly service? πŸ™‚

    • Hi,

      You don’t have to confirm your E-Mail address at vimeo, so just enter whatever imaginary address you want, then you should be able to download the video.

      Hope this helps, kind regards

    • I am recording a new screencast, if Vimeo screws up again I’ll try something else

  13. Nice work! I like the simpler profiles (never liked that the default had both “Aggressive Powersave” and “Xtreme Powersave”), and the Inhibit button sounds very useful.

    I’m not sure about activity-controlled power management, however. For me personally I usually switch power profile depending on other circumstances than my current activity, for example how much battery I have left and for how long I plan to use my laptop/netbook. If I know I won’t run out of battery I’ll always prefer “Performance”, independently of my activity. So I would still want a “Performance”/”Power Save” (or “Stamina”?) toggle in the battery monitor widget.

    Regarding the name “Inhibit”, I agree that it needs a better name. I’m more for “Disable”/”Inactivate” [Power Management] than “Lock”, since the latter seems to indicate that you lock the settings (i.e. the user can’t change anything), not that the monitor won’t go blank etc. Disable or Inactivate might not be technically correct but resembles how you disable other stuff, such as desktop effects.

    Keep up with the great work and please keep us updated! Regrading the screencast, have you considered

  14. The ‘Inhibit’ button would inhibit screen power saving I guess? Perhaps something like “Keep display active” and/or a more verbose tooltip (do you want to emphasise that it’s intended for temporary use – I’m guessing you’d prefer the app or the activity to take responsibility for the inhibition).

    Do you also want to expose a second inhibition button, that only inhibits system power saving? For example, for playing music or compiling a project or downloading stuff or any of the ad-hoc server use cases that don’t need to keep the display awake.

    I’m assuming that these inhibit buttons map to the inhibit APIs, or do they mean something different?

    Minor nit: I’d prefer if the “battery applet” looked more natural on a desktop if it’s going to be useful for more than just laptops, but that’s just cosmetics.

  15. […] 4.8, as you probably already know if you follow my blog, inhibition in power management got a significant boost all over the […]

  16. I agree with oliverhenshaw: it would be really nice if there were also a button for disabling sleep but allowing the display to turn off.

  17. I all the time emailed this website post page
    to all my friends, as if like to read it then my contacts will too.

  18. I enjoy what you guys are usually up too. Such clever work and reporting!
    Keep up the fantastic works guys I’ve included you guys to my
    personal blogroll.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: