Author Topic: Power Management  (Read 13678 times)

karlto

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
    • http://
Power Management
« on: March 09, 2006, 02:42:22 pm »
Hi all

Matchbox has some shortcomings, but that's OK because there are plenty of other choices on pdaXrom!

However, there is one thing that Matchbox does that other window managers seem to lack entirely - power management for switching between power modes, backlighting etc. The light and power config applet sets up AC power and battery modes, and selects the right one whenever run (it is run initially in most .xinitrc files). From there, Matchbox will continue to monitor changes in power status and change modes as necessary, whereas other WMs just ignore.

As far as I can tell, something in the Matchbox panel is providing this functionality (I loaded it in xfce4 and it worked, but that is far from usable). I have tried running '/usr/bin/lightnpower.py --loadandquit' in various apm scripts, but it either doesn't get called (most suspend commands use 'xset dpms force off' rather than 'apm -s') or it only half works for some strange reason (e.g. will change back lighting but not time to suspend).

Does anyone know how the power monitoring functionality can be added to other window managers?

Thanks

Karl
SL6000-L, RC12

silencer51

  • Full Member
  • ***
  • Posts: 172
    • View Profile
    • http://tchalikias.blogspot.com
Power Management
« Reply #1 on: March 09, 2006, 11:01:12 pm »
Indeed, in all other WMs (i.e. XFCE4) when you are for example running on battery power and have the backlight set to 1, when you plug in AC power the backlight doesn't automatically go to level 6. You have to manually start the Light & Power applet to make the system understand the change. Bummer...
Zaurus SL-5500 with:
128MB CF Card                                    
128MB SD Card
Symbol WiFi CF Card (working, sorta... overheats and shuts down!)
OZ 3.5.4 & GPE

Zaurus SL-C3100 with:
pdaXrom 1.1.0beta3 & XFCE4, /dev/hda1 256MB swap, /dev/hda2 512MB ext3, /dev/hda3 3328MB FAT32 for stuff
D-Link DCF-660 WiFi CF Card
1GB SD Card
128MB SD Card
128MB CF Card (for flashing)
USB Host Cable

& a Sony VAIO PCG-C1XD Picturebook with accessories...

[img]http://img58.imageshack.us/img58/7319/usbar21mw.gif\" border=\"0\" class=\"linked-sig-image\" /]

Chero

  • Hero Member
  • *****
  • Posts: 1140
    • View Profile
    • http://users.telenet.be/zaurususer/Chero
Power Management
« Reply #2 on: March 10, 2006, 02:42:06 am »
I'm running a combo of xfce4(xfdesktop) and fbpanel (instead of xfce4-panel).

The benefit of this is :
- a panel on each screen
- taskbar of running apps
- dropdown menu with all apps (fn+click or menu button)
- shortcuts (e.g. "alt-f" to toggle apps fullscreen = without borders, titles or panels)
- nice themes
- working power management when the battery applet is running in the fbpanel systray

Have fun,
Chero.
« Last Edit: March 10, 2006, 02:43:22 am by Chero »
HP-95LX -> HP Jornada 680 -> SL-C860 -> SL-C3100 -> Fuji u810 -> SL-C1000 -> HTC uni -> SL-C860 -> SL-C760.
March 12 2009 : Back because the Zaurus is one of a kind.
SL-C760 : pdaXrom
Pandora pre-ordered -> received and tested : great device but not my cup of tea -> sold.

karlto

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
    • http://
Power Management
« Reply #3 on: March 12, 2006, 02:17:36 pm »
Quote
- working power management when the battery applet is running in the fbpanel systray

Hi Chero

That sounds like the fix we are all looking for - is the battery applet the part that does the power management? Running this in various different window managers would be a lot simpler and nicer than an entire panel....

Thanks
SL6000-L, RC12

vimes

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • http://www.morpork.org/
Power Management
« Reply #4 on: March 14, 2006, 03:17:37 pm »
Quote
I'm running a combo of xfce4(xfdesktop) and fbpanel (instead of xfce4-panel).

The benefit of this is :
- a panel on each screen
- taskbar of running apps
- dropdown menu with all apps (fn+click or menu button)
- shortcuts (e.g. "alt-f" to toggle apps fullscreen = without borders, titles or panels)
- nice themes
- working power management when the battery applet is running in the fbpanel systray

Have fun,
Chero.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=117868\"][{POST_SNAPBACK}][/a][/div]

You've confused me now chero... I am using your build with xfce4-panel and have all of the above features except dropdown menu with all apps (which I assume you mean running tasks)... what/where is fbpanel and since the above works with xfce4-panel why bother ?
am I missing something ?
C3000 - Debian EABI - Kernel 2.6.23 of Angstrom

Chero

  • Hero Member
  • *****
  • Posts: 1140
    • View Profile
    • http://users.telenet.be/zaurususer/Chero
Power Management
« Reply #5 on: March 14, 2006, 03:26:28 pm »
Quote
Quote
- working power management when the battery applet is running in the fbpanel systray

Hi Chero

That sounds like the fix we are all looking for - is the battery applet the part that does the power management? Running this in various different window managers would be a lot simpler and nicer than an entire panel....

Thanks
[div align=\"right\"][{POST_SNAPBACK}][/a][/div]

It seems to be the battery applet indeed. Running it in other WM's could solve the problem, if it could run correctly. In my case, it didn't seem to be running as it should. It showed everything correct, even when you plug ac, but the backlight and suspend settings didn't change automatically.
So I tried fbpanel, and added the same battery applet, now it works.

A screenshot can be found here : [a href=\"https://www.oesf.org/forums/index.php?showtopic=18239]https://www.oesf.org/forums/index.php?showtopic=18239[/url] (post 3)

Have fun,
Chero.
HP-95LX -> HP Jornada 680 -> SL-C860 -> SL-C3100 -> Fuji u810 -> SL-C1000 -> HTC uni -> SL-C860 -> SL-C760.
March 12 2009 : Back because the Zaurus is one of a kind.
SL-C760 : pdaXrom
Pandora pre-ordered -> received and tested : great device but not my cup of tea -> sold.

Chero

  • Hero Member
  • *****
  • Posts: 1140
    • View Profile
    • http://users.telenet.be/zaurususer/Chero
Power Management
« Reply #6 on: March 14, 2006, 03:37:31 pm »
Quote
Quote
I'm running a combo of xfce4(xfdesktop) and fbpanel (instead of xfce4-panel).

The benefit of this is :
- a panel on each screen
- taskbar of running apps
- dropdown menu with all apps (fn+click or menu button)
- shortcuts (e.g. "alt-f" to toggle apps fullscreen = without borders, titles or panels)
- nice themes
- working power management when the battery applet is running in the fbpanel systray

Have fun,
Chero.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=117868\"][{POST_SNAPBACK}][/a][/div]

You've confused me now chero... I am using your build with xfce4-panel and have all of the above features except dropdown menu with all apps (which I assume you mean running tasks)... what/where is fbpanel and since the above works with xfce4-panel why bother ?
am I missing something ?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118564\"][{POST_SNAPBACK}][/a][/div]

About power : see previous post.

The drop-down menu with running apps : middle-click (shift-tap)
The drop-down menu with all apps : right-click (fn-tap) If you want to test it : type "xfdesktop -menu" at command prompt.
If you don't get it with fn-tap, your keyboard settings are probably wrong. The original startxfce4 script was written for a C860, it has to be changed for CXXXX.
I'll try to put mine online asap.

Another reason to use a different panel : xfce4-panel likes to crash, fbpanel seems more stable to me.

Where is fbpanel : not packed yet(at least, not by me).

Have fun,
Chero (just had a shower !!)  
HP-95LX -> HP Jornada 680 -> SL-C860 -> SL-C3100 -> Fuji u810 -> SL-C1000 -> HTC uni -> SL-C860 -> SL-C760.
March 12 2009 : Back because the Zaurus is one of a kind.
SL-C760 : pdaXrom
Pandora pre-ordered -> received and tested : great device but not my cup of tea -> sold.

vimes

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • http://www.morpork.org/
Power Management
« Reply #7 on: March 14, 2006, 03:50:28 pm »
Quote
About power : see previous post.

The drop-down menu with running apps : middle-click (shift-tap)
The drop-down menu with all apps : right-click (fn-tap) If you want to test it : type "xfdesktop -menu" at command prompt.
If you don't get it with fn-tap, your keyboard settings are probably wrong. The original startxfce4 script was written for a C860, it has to be changed for CXXXX.
I'll try to put mine online asap.

Another reason to use a different panel : xfce4-panel likes to crash, fbpanel seems more stable to me.

Where is fbpanel : not packed yet(at least, not by me).

Have fun,
Chero (just had a shower !!) 
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118567\"][{POST_SNAPBACK}][/a][/div]

5 euro's poorer hey

... now I understand - i have menu on both right mouse and menu-key (although yes xfce4-panel doesn't seem to have a tasks menu).
fyi, power functions all work fine for me using mb-applet-battery in xfce4-panel except suspend on lid close which I ain't worked out yet.  Also, thanks to your kind self I have not had 1 crash of xfce4-panel since I started using it about 3 weeks ago.

Thanks for a lovely zaurus desktop
C3000 - Debian EABI - Kernel 2.6.23 of Angstrom

Chero

  • Hero Member
  • *****
  • Posts: 1140
    • View Profile
    • http://users.telenet.be/zaurususer/Chero
Power Management
« Reply #8 on: March 14, 2006, 04:02:15 pm »
Quote
5 euro's poorer hey

... now I understand - i have menu on both right mouse and menu-key (although yes xfce4-panel doesn't seem to have a tasks menu).
fyi, power functions all work fine for me using mb-applet-battery in xfce4-panel except suspend on lid close which I ain't worked out yet.  Also, thanks to your kind self I have not had 1 crash of xfce4-panel since I started using it about 3 weeks ago.

Thanks for a lovely zaurus desktop
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118570\"][{POST_SNAPBACK}][/a][/div]

Just 2,5 euro's, it was a quick shower.

Maybe the next version will be more compatible. I think it would at least solve some problems when changing to 4.2.3.2. I'll do it anyway to be able to compile the new thunar-release (though I'm waiting for the first beta, which will be released real soon). I'd better start working on xfce and be ready for thunar beta1.

Chero.
HP-95LX -> HP Jornada 680 -> SL-C860 -> SL-C3100 -> Fuji u810 -> SL-C1000 -> HTC uni -> SL-C860 -> SL-C760.
March 12 2009 : Back because the Zaurus is one of a kind.
SL-C760 : pdaXrom
Pandora pre-ordered -> received and tested : great device but not my cup of tea -> sold.

vimes

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • http://www.morpork.org/
Power Management
« Reply #9 on: March 14, 2006, 06:57:53 pm »
Chero, while I'm on about xfce4-panel, can you tell me how I can fix/configure stuff in the
--- include ---            system
menu entry in xfce4-menu's ? It works fine except games & system settings get mixed up (oh and no icon on 'other' submenu) - see screenshot
 [ Invalid Attachment ]

Thanks
C3000 - Debian EABI - Kernel 2.6.23 of Angstrom

karlto

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
    • http://
Power Management
« Reply #10 on: March 14, 2006, 11:29:42 pm »
Quote
Quote
Quote
- working power management when the battery applet is running in the fbpanel systray

Hi Chero

That sounds like the fix we are all looking for - is the battery applet the part that does the power management? Running this in various different window managers would be a lot simpler and nicer than an entire panel....

Thanks
[div align=\"right\"][{POST_SNAPBACK}][/a][/div]

It seems to be the battery applet indeed. Running it in other WM's could solve the problem, if it could run correctly. In my case, it didn't seem to be running as it should. It showed everything correct, even when you plug ac, but the backlight and suspend settings didn't change automatically.
So I tried fbpanel, and added the same battery applet, now it works.

A screenshot can be found here : [a href=\"https://www.oesf.org/forums/index.php?showtopic=18239]https://www.oesf.org/forums/index.php?showtopic=18239[/url] (post 3)

Have fun,
Chero.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118565\"][{POST_SNAPBACK}][/a][/div]

I didn't realise you were talking about the matchbox applet - doesn't seem to work in the xfce4 panel, which is why I went to trying the whole matchbox panel. Must be some sort of combination if fbpanel does work...?

On a side note, the matchbox panel is much less cumbersome under enlightenment, because it minimises... :-\
SL6000-L, RC12

miskinis

  • Sr. Member
  • ****
  • Posts: 348
    • View Profile
    • http://
Power Management
« Reply #11 on: March 15, 2006, 01:05:05 am »
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
_John Miskinis_

karlto

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
    • http://
Power Management
« Reply #12 on: March 15, 2006, 02:26:19 pm »
Quote
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
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118630\"][{POST_SNAPBACK}][/a][/div]

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
SL6000-L, RC12

miskinis

  • Sr. Member
  • ****
  • Posts: 348
    • View Profile
    • http://
Power Management
« Reply #13 on: March 17, 2006, 02:18:02 am »
That was great info, thanks...

I forgot to ask about the battery charging light.  It seems that when I have power
connected to the SL-6000, when suspended at least, the battery charging light is
always on.  If I remember correctly, and it's been quite a while, but I think when I
got my unit and it was running  the Sharp ROM, the battery light would go off
when the battery was fully charged.

Is there a reason why this does not function on pdaXrom?  Is this true for all
the Zaurus models?

Thanks again for any info,  John
_John Miskinis_

vimes

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • http://www.morpork.org/
Power Management
« Reply #14 on: March 17, 2006, 05:41:11 am »
Quote
That was great info, thanks...

I forgot to ask about the battery charging light.  It seems that when I have power
connected to the SL-6000, when suspended at least, the battery charging light is
always on.  If I remember correctly, and it's been quite a while, but I think when I
got my unit and it was running  the Sharp ROM, the battery light would go off
when the battery was fully charged.

Is there a reason why this does not function on pdaXrom?  Is this true for all
the Zaurus models?

Thanks again for any info,  John
[div align=\"right\"][a href=\"index.php?act=findpost&pid=118976\"][{POST_SNAPBACK}][/a][/div]

The light goes off on my C3000 when battery is full...
Also you can run mb-applet-battery in xfce4 and e17 - you just need the appropriate systray plugin running.
« Last Edit: March 17, 2006, 05:41:39 am by vimes »
C3000 - Debian EABI - Kernel 2.6.23 of Angstrom