Updates from KDE Power Management land: for Users and Developers!

Hi everyone,

a lot of code has been flowing into the new KDE Power Management system, and there are some good news both for users and developers. Let’s start from our beloved KDE heroes :)

Inhibiting screen Power Management

You are probably already familiar with suspension inhibition, but now Solid provides you with a brand new killer feature: inhibiting screen power management! This is done through Solid::PowerManagement::beginSuppressingScreenPowerManagement, and works exactly like suspension inhibition. So many apps such as Okular, Dragon Player and friends might want to implement this feature in time for 4.6 – it’s just 3 lines of code, and will grant users with a much improved experience.

For this reason, the Presentation profile is gone: we no longer need it! At the moment, though, this still does not inhibits the screensaver. I’ll code up a patch for it and submit it for review for enabling this in the next days. By the way, this feature should be a big improvement to current KDE’s usabilty on mobile devices.

Notifying on resume

The brand new org.kde.Solid.PowerManagement DBus service/interface gained a new signal, resumingFromSuspend. Any app can hook into that for getting notified about a resume from suspension event, which can easily fix annoying bugs such as this one.

And now, to users!

New UPower features embraced

Thanks to Lukas’ efforts, the new UPower backend saw some great improvements in features, such as keyboard backlight control. Unfortunately, some of the features will be available only with the upower backend (the resume signal is one of those), which shouldn’t be a big problem to anyone running linux nowadays.

Policy agent improvements

The policy agent has been vastly improved: it is now able to remove inhibitions if an app crashed or exited without releasing its cookies, and it has a much smarter handling of policies. Moreover, all of the actions gained policy control for free, so if your applications behave correctly, you should be fine with defaults!

Improved default profiles

The default profile generator got a big improvement since last time, and the generation of profiles is much more reliable, and adapts great to your PC’s configuration. Again, it should provide a very sensible default you should not need to change.

On a side note, today I’ve gone bug triaging and closed *lots* of bugs. Most of them were actually unmaintained, solved-but-not-closed and duplicates, and some were things which no longer exist or should have been fixed for 4.6. The reason why I’ve done this (apart from the fact that it was badly needed) is that I wanted to get b.k.o ready for the new Power Management daemon in 4.6, and keep a sensible bug list (and hopefully more maintained) of still unsolved issues and features request. So be sure to test the new KDE Power Management system with the first KDE 4.6 beta and give your feedback!

About these ads

~ by Dario on 10 November, 2010.

25 Responses to “Updates from KDE Power Management land: for Users and Developers!”

  1. I think it would be also good to keep the presentation profile to allow the user to disable screen power saving manually when running non-KDE applications (or even KDE apps that are not currently maintained to benefit from such nice improvements)

  2. Same for me : the presentation profile would be very nice to have when looking at films with VLC.

    • I will discuss this with other (usability) people, but I’m not really liking the idea, as it would show that the user has to do something to enable screen power management. I’d rather fix any application which provide this – also because the method is available also through DBus, so non-KDE applications can take advantage of this as well.

      (In any case, creating a presentation profile should be a matter of seconds, especially with the new UI)

      • Changing applications will take time, especially non-KDE ones. At the very least the presentation profile should be retained until the most commonly used apps have been converted to use this.

        I doubt whether many users would necessarily realise that you can add a new profile – I for one hadn’t noticed that possibility.

      • Another option is to add something to the plasma battery applet (and maybe the power runner) to trigger the inhibition, and then to release it again.

        BTW: is this interface documented anywhere? There should probably be a techbase page for application programmers about interacting with the power management systems.

  3. Same here: I’m regularly listening to hour-long podcasts in Amarok while taking a bath, and I don’t want PowerDevil to suspend after some 15 minutes.

  4. Well, a global Presentation profile would also be handy for cases where one would want to globally put the computer in “no economy” mode, letting all the applications settings as they are.

  5. Spectacular news, especially the wake-from-suspend handle. Beyond the clock, it should solve stuff like the marble wallpaper timing of the sun, KMail not being able to get email after wake up, and possibly also the kwin crashes I experience after waking up from suspend.
    Looking forward to it!

  6. Question: what is the correct mailing list for sending patches etc. to? Or should I use reviewboard? If so, who should I include as reviewers?

  7. thanks for your work.
    Like other people mention, it is handy when you can (temporarily) disable screen power management manually when some app does not support it (flash player for example?)
    This used to be pretty simple in KDE3: just configure some screencorner to do just that. Last time I checked, it was not possible in KDE4. Would it be possible to enable this screen corner action again using powerdevil?

    thanks

  8. Sorry for the (partial) OT: I’ve just seen your work on PowerDevil 2 on the KDE Commit-digest, and I just wanna know if there are some plan to integrate the cpu scaling (interacting with the cpufreq kernel subsystem).

    • Not really, or at least not officially. Nowadays the kernel should be able to manage cpufreq itself, and userspace tools such as UPower no longer offer the possibility of changing the CPU frequency. For this reason, there won’t be an official possibility for doing that, but I’m pretty sure somebody will code up an action soon.

      • Well, I don’t know about UPower motivations, but I assure you my machine cannot relies upon “automagick” cpu auto-frequency: as I use it, the tempereature soon reach 100°C and the pc shutdown himself.
        I found the cpufreq-utils programs able to set the cpu to the “powersave” governor as the only way to use my pc for more than ten minutes…

        well, I can always use the “run script” facility…

    • (This is really a reply to your later comment, but WordPress won’t allow threads to get that deep).

      If you have to run your computer in powersave to stop it overheating, you’ve got serious hardware problems. Your computer’s cooling system is clearly not adequate. This isn’t something that KDE’s power management system should be dealing with.

      Of course, if you want a quick hack, add a line to your /etc/rc.local script to change the cpu governor on startup.

      • Just ran across this thread, and thought I’d second Zed’s concern. Like it or not, there are many systems out there that WILL overheat when the cpu governor decides that an app needs full frequency for an extended period of time. I don’t know that I’ve ever seen a laptop that has an ‘adequate cooling system’ – mine certainly doesn’t. Telling the users to upgrade their hardware isn’t much of a solution here, as this is a design limitation of the machine.

        The way I see it, there are a few possible solutions:
        1) rely on the governor for everything – your current solution
        – not an option, because it doesn’t know about temperature.
        2) code something on the back end to handle temperatures so you don’t have to expose this feature to the users
        – horribly impractical due to the sheer volume of hardware configurations.
        3) add the few lines of code that are necessary to expose this feature to the end users.
        – everybody’s problems go away, because many users will never need/find it, but those that DO need it will have it waiting for them.

        I *love* kde, but can’t believe that the dev team for a platform that sold (and continues to sell) users on OPTIONS has decided to take away what appears to be pretty common sense option.

  9. Wow. You’ve removed the ‘presentation’ profile, hidden the option to recreate it, there’s no easy way to do the same thing another way, and you’ve done it before even every KDE application (i.e. DragonPlayer) has been updated to call your new DBUS magic system, never mind everything else that might need to like OpenOffice (presentation mode).

    What happens if a given application doesn’t add your magic code – I’m thinking of Eclipse, for instance, often used in presentations ? Are users expected to jump through the horrible hoops req. to create a new profile ?

    Bit of a fail guys, put it back how it was.

    • Hidden the option to create a new profile? It’s where it was in 4.5. Oh – do you want to create a presentation profile? It’s rather easy: click on the “new profile” button, name it Presentation, and save. Everything is disabled by default – here you have one. Is it too hard for you or do you think you can sustain the horrible hoop of 2 mouse clicks?

  10. I didn’t quite understand whether profiles in the new power-management system affect the power saving modes of the CPU? Since it’s power-related software, it should provide users a way of tweak/change power settings, whether they are handled by the kernel or not. That’s why KDE is DE – to ease users in configuring their system, not only screen brightness and etc.

    I was pretty happy with PowerDevil’s capabilities of changing the CPU policy (preformance, ondemand-conservative and ondemand) and now when I’d be forced to use the command line to change those settings I feel restricted. Even though this functionality is moved to the kernel, the UI of the power management should integrate with it.

    After all powersaving settings are hardware related.

  11. Hi, I’m wondering why there isn’t a Suspending() signal in PowerDevil. It could come in handy: clean disconnection from IM services not relying on server side timeouts (same goes for IMAP, bittorrent and anything with remote connections). There is one in UPower (Sleeping()). I also agree that the CPU frequency scaling should be manageable by PowerDevil. Digging through laptop-mode *.confs isn’t really appealing.

    • About the sleeping signal, please file a wish in bugs.kde.org so that I won’t forget it. About the cpufreq stuff, it has been removed from userspace tools as well, and will soon post an update on why it is not provided as a config option.

  12. I thought I’d leave my tuppence worth.
    I am running KDE on OpenSuse 11.3 on a Samsung NC10, a HP laptop and two Athlon 64X2s with Gigabyte MB desktop PCs.
    Powerdevil has been LITERALLY a devil… of a thing to setup (Nearly as bad as polkit).
    I have spent two days seeking out (1) why FTP between PCs was failing (Standard OpenSuse default Powerdevil setup allows Powerdevil to put the PCs into powersaving mode dropping NIC connection mid file transfer (!) causing FTP to appear broken on large file copies) and (2) how to definitely resolve it.
    While I (not a standard user) know how to set CPUfreq from the command-line etc. and edit the Profiles in default.powerdevilprofiles I don’t quite understand why there is a desire to move so much setup away from the user session environment.
    My first action to resolve my problem was to use Presentation mode on both PCs which revealed that Powerdevil was causing the problem – but above you’ve said you’ve dropped Presentation as a standard option now(!!) meaning another user might not find out what the problem is in future – potentially leading to perhaps days investigating the FTP client instead of the power-saving setup of the machine.
    Meanwhile, I am particularly unhappy that PowerDevil is not well documented – what IS the difference between System Settings – performance and System Settings – powersaving? Try Googling it…

    And furthermore, I am most concerned about the settings being taken away from the user environment when those settings are not documented – especially if they lead to broken functionality in another application, as happened in my case.

    KDE is far and away the best Linux DE but Powerdevil has been its most irritating “feature” in my several years of use.
    Users are not dimwits and if they are using Linux they LIKE to muck about… so make it obvious how to change things and EXPLAIN the results of the changes those users wish to make.
    Thought you’d like to hear how not every enhancement is actually received as an enhancement…
    Mike
    P.S. While polkit documentation isn’t the best, at least it exists!!

    • Sorry to hear your disappointment. (before I answer, let me remind you that bugs can exist and should be reported, bugs.kde.org).

      About (1), I’m a bit, well, torn. The power management system does no action whatsoever on the CPU frequency, which is done by the kernel with cpufreq governors. The userspace action which are taken are 1. screen powermanagement 2. suspension. From what I understood, your PC is not suspending, but going into a some sort of “power management mode”, which is no way handled by powerdevil (at least, not the upstream version – any opensuse guys around?). It would be nice if you could actually investigate more on that.

      About documentation, you are right, but that’s also where you can help. I am definitely going to improve docs for 4.7, but my time is limited and writing documentation is a very time consuming task. So consider joining in, and make everyone benefit from your knowledge :)

  13. DrFav,
    Thanks for replying.
    I apologise for the “steamed” comment above – it was probably due to how I was feeling at the end of the two days of work to establish what was going on.
    I don’t begrudge you for the situation I faced… and I would say it led me on a research odyssey from which I gained several outcomes I wouldn’t have obtained without the interaction of PowerDevil with other aspects of OpenSuSE. With the benefit of hindsight – that was NOT wasted time. So, thank you :-)
    However, I was observing that by disabling the Presentation mode – you were making it more difficult for others to go on the same odyssey.
    I entirely understand how difficult it is to write documentation when you are focussed on the intellectual challenge of re-writing the code (which is your number 1 priority) – that happens for me too.
    However, I was drawing to your attention that to ensure others don’t just disable the package (which I now have setup fine – although the System Setting – powersave/performance matter is still unresolved – any clues?) – you need to put up some basic documentation about the meanings of settings.
    To be honest, simple aspects of the setup aren’t the things that need documenting… but the “quiet place”s do… :-)
    Now – on the documentation front – where exactly would you want me to write something?
    I think I’d probably start the documentation on how it is possible for an user to create a “Presentation” mode ;-)
    Best regards,
    Mike
    P.S. If you have seen some of the correspondence on the ext4 fs – you’ll note that Linus, too, can be pretty direct in his comments… I think it’s a “The Wolf” (Harvey Keitel – Pulp Fiction) situation. ;-)

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: