QUOTE(miskinis @ Mar 15 2006, 07:05 PM)
Hi,
I consider correct power management a high priority for any battery-operated device
I own, especially a handheld computer I will rely on away from wired power sources.
SO, I'm somewhat willing to try to help out pdaXrom in this regard. From what I gather
so far, it seems the "stock/default" pdaXrom using the matchbox project applets, does
accomplish this very well, but folks are having difficulty getting the applets to run
in other window managers.
This is most likely due to the fact that the applets differ somewhat from standard X
clients. And if this is true, I suspect that the "meat and potatoes" code inside the
applet, could be wrapped up into a standard X client, thus being able to be run
under any window manager. (I could probably do this easily)
Unfortunately, the one piece I do not know about, is how the power-on button press
is detected, and what happens. When the machine is running, I suspect that a
regular X event for a key press is generated, and intercepted by the WM and passed
on to the (correct) applet.
BUT, what happens when the machine is already suspended, and the power-on
button is pressed? Something else must happen, and I would need to know what.
If anyone knows these details, or knows that any of my suspicions above are incorrect,
please post!
Thanks, John
As I understand it, this power management is a core feature of the pxa processor. When put to sleep/suspended, registers are set determining what will wake the machine up, and everything but the RTC and some sort of edge-detect mechanism is turned off. Obviously the power button being held is one of the wakeup events, as is the RTC alarm once set and switched on. All these suspend items are set when the device is put to sleep, and is part of the kernel code.
I tried running xev to capture the power button, but didn't get anything (aside from switching the power on and off if I hold it down!) Regardless, this aspect works fine in any window manager.
The only issue really is switching between battery and AC power. All battery monitors seem to detect the change, but we need to run a script (probably just '/usr/bin/lightnpower.py --loadandquit') each time this happens to change the power settings to suit. There is currently no way to do this.
It also needs to happen upon resume, just in case it has changed modes while asleep. It is possible to add scripts in this instance, which I have tried to do. Initially it failed completely. Having a 'sleep' command in the script for a few seconds prior to running the lightnpower applet caused the backlight settings to be changed successfully, but I never managed to get the suspend timeout settings to change.
I don't think this is specifically related to X in any way - if X is not running, there is no power management at the command line either. I need to try out the battery applet on its own (without the matchbox panel) again in xfce and enlightenment to find out if it does monitor this correctly.
The other thought I had was to perhaps find (or modify) a battery applet that will allow running a command when power mode changes. Then it could just be scripted.
Everyone please feel free to correct the likely numerous inaccuracies above