?

Log in

No account? Create an account
Desktop Power Management - Technical Blog of Richard Hughes

Richard Hughes
Date: 2007-01-08 16:12
Subject: Desktop Power Management
Security: Public
GNOME Power Manager already has quite a comprehensive DBUS API to allow it to interface with stuff like the brightness applet and gnome-logout screens.


Brightness applet working hand-in-hand with g-p-m

I think this is something that should be cross-desktop compatible, so that XFCE, KDE and GNOME applications can all play nicely. Something like a session service name of org.freedesktop.PowerManagement would be lovely. Of course, this requires standardization of a set API, which traditionally has been hard to agree on.
I've put up a list of the new DBUS API that gnome-power-manager presents, but before anyone stresses out about API compatibility the old API is present as well, except not documented there.
Please have a look through and tell me about any method or signal naming funnies, or areas that don't look right - or even descriptions that don't make sense to mere mortals. When I've got some initial feedback, I'll make the important changes to the new API, and suggest just the "required" DBUS methods to xdg-list for comments about using a org.freedesktop namespace.
p.s. Don't comment too much about the Register() and UnRegister() methods yet, they are just stub functions at the moment, and not tested by gnome-power-self-test at all.
Thanks for any help,
Richard.
Post A Comment | 10 Comments | Share | Link






User: (Anonymous)
Date: 2007-01-08 19:51 (UTC)
Subject: (no subject)
A method to retrieve the system idle time would definitely be useful, right now you have to poke X to provide this.

I'd also include more options for device powermanagement, for example CPU, harddisks, wireless card and others as you already included with display. And while at it, shouldn't the screensaver be able to told to lock the display?
Reply | Thread | Link



Richard Hughes
User: hughsient
Date: 2007-01-08 20:01 (UTC)
Subject: (no subject)
Use the gnome-screensaver methods for this, they do exactly as you describe. If g-s and g-p-m ever merge, then this will me added to the spec.
Reply | Parent | Thread | Link



User: (Anonymous)
Date: 2007-01-09 00:02 (UTC)
Subject: (no subject)
I'm one of the developers of the power manager application in Kubuntu, and we're currently indeed using the screensaver. For better cross-desktop interoperability, it would be useful to have those methods available via one unified interface.

cpufreq support has just been added to HAL, so that should be considered as another item as well -- with keeping an eye on other hardware's powermanagement features for the future.
Reply | Parent | Thread | Link



Richard Hughes
User: hughsient
Date: 2007-01-13 17:27 (UTC)
Subject: (no subject)
>it would be useful to have those methods

Sure, I'll see what I can do.

>cpufreq support has just been added to HAL

Already supported in 2.17.x... :-)
Reply | Parent | Thread | Link



User: kaiw
Date: 2007-01-09 01:06 (UTC)
Subject: (no subject)
...I hope you meant it about the feedback. I noticed a couple of typos, but then ended up reading the whole thing. I'm not a developer of anything in particular, so feel free to ignore any and/or all of the following.


User Interface Frontends:
* "i.e. the icon and description": should be parenthesised?
* "a abstract power interface" -> "an abstract power interface"

GetLowPowerMode():
* "depending on the users policy" -> "depending on the user's policy"
* ", and only perform cache-updates when absolutely required.": What does this refer to? If it's just an example of something you shouldn't do in low power mode, that should probably be stated.

Inhibit System Sleep:
* "detects an idle session and system": Is there a difference between an idle session and an idle system as far as the API is concerned?
* RequestCookie() and ClearCookie() aren't the most intuitive names. Similarly for IsValid() and IsValidChanged; 'valid' seems to be a roundabout way of saying 'has been inhibited by someone'.
* ClearCookie(): "Allows the computer to perform the idle sleep action." Presumably if there are three cookies outstanding, clearing one cookie doesn't allow sleep.
* IsValid(): The description makes it sound like the function will always return False if there have ever been any inhibit cookies taken, regardless of whether they've been returned or not.


Statistics Data:
* GetAxisType(): "(and entry from GetTypes())" -> "(an entry from GetTypes())" I think?
* "for instancing showing" -> "for instance showing"

The "Statistics Data" section is the only one that, for me, fails the "descriptions that don't make sense to mere mortals" criteria. I see that it's not a required interface, so this may not matter much to you. My basic issue with the interface is that it would seem that the most common usage would be to pass in a dependant variable and get back a time vs. that variable dataset, and this API doesn't make it obvious how to do that. Without going into details, unclear parts are:
* What constitutes a 'type of data' in GetTypes()?
* In what situation is your Y-axis from GetAxisType() *not* going to be the type you passed in; and in what situation is your X-axis type *not* going to be time?
* GetData() reads like it returns 4 dimensional data: time, X, Y and value.
Reply | Thread | Link



Yuan Yijun
User: bbbush
Date: 2007-01-20 14:20 (UTC)
Subject: (no subject)
this applet prompts "Cannot get laptop panel brightness" on my Dell 1405/640m laptop (fedora 6). It has been a long time that I cannot adjust brightness by press the Fn+up/down key. I guess this has something to do with udev because the function keys works when booting, but not after udev service has been loaded. Besides that, I still could echo brightness values to proc interface, to adjust brightness; but the initial "current" value is "0". Where can I find a bugzilla ticker for this?

[root@mstar LCD]# pwd
/proc/acpi/video/VID/LCD
[root@mstar LCD]# cat brightness
levels: 84 72 12 24 36 48 60 72 84 100
current: 0
Reply | Thread | Link



Richard Hughes
User: hughsient
Date: 2007-01-21 19:34 (UTC)
Subject: (no subject)
Do you use libsmbios to change the brightness? What does "lshal |grep laptop_panel" print?
Reply | Parent | Thread | Link



Yuan Yijun
User: bbbush
Date: 2007-01-22 15:20 (UTC)
Subject: (no subject)
1. no, I don't use libsmbios.
2. nothing for "panel", only 1 found for "laptop": "system.formfactor = 'laptop' (string)"

I'm mixing fedora 6 and rawhide packages on my laptop, maybe there is some incompatible? What can I help?
Reply | Parent | Thread | Link



Yuan Yijun
User: bbbush
Date: 2007-02-28 03:08 (UTC)
Subject: (no subject)
previously was using kernel-2.6.18 from fc6 updates repo. Now switch to rawhide kernel-2.6.20-2942, it works! :D
Reply | Parent | Thread | Link



User: (Anonymous)
Date: 2007-01-22 22:52 (UTC)
Subject: Great work!
Great resource. keep it up!!Thanks a lot for interesting discussion, I found a lot of useful information!With the best regards!
David
Reply | Thread | Link



browse
my journal
April 2008