Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
powermgr - unified power management for Gentoo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
ttuttle
Tux's lil' helper
Tux's lil' helper


Joined: 03 Oct 2004
Posts: 131

PostPosted: Tue Jul 12, 2005 3:48 am    Post subject: powermgr - unified power management for Gentoo Reply with quote

I have just finished moving powermgr over to sourceforge and just released version 0.0.7. Powermgr is a daemon written in Perl that "glues" together all the power management features of a Linux system (CPU throttling/scaling, laptop mode, display brightness, wireless power management, fan state, etc...) and switches between "power profiles" based on the state of the system. This means when you unplug your system, all the components will go into a lower-power state automatically.

I have just finished adding support for Dell and IBM ACPI extensions, which means powermgr now supports Asus, Dell, IBM, Omnibook, and Toshiba laptop extensions, as well as standard ACPI features. I'm looking for beta testers, especially for these new features, since I don't personally have a laptop with any of those features.

Comments, suggestions (especially for new inputs and outputs), constructive criticism, and so on is welcomed. Just reply to this post, or leave me a note on Sourceforge. (You're probably better off posting here since I'm just getting used to SF and all its nooks and crannies.)
Back to top
View user's profile Send private message
baeksu
l33t
l33t


Joined: 26 Sep 2004
Posts: 609
Location: Seoul, Korea

PostPosted: Tue Jul 12, 2005 6:24 am    Post subject: Reply with quote

I've been trying the daemon with my own rules. Plugging/unplugging ac works, but I haven't been able to get the other parts to work.

I have a centrino-based laptop. Mainly, I'm interested in making a rule set that would keep the cpu frequency down unless two conditions are satisfied: a) load average rises above a certain level (say 2) and b) temperature is low enough (55 C).

In the end, I tried these simple rules: (There's some battery stuff before this.)
Code:
Rule
ac adapter = on
load average(1) = <2
profile = low
EndRule

Rule
ac adapter = on
temperature = >55
profile = low
EndRule

Rule
ac adapter = on
profile = high
EndRule

The idea is that if neither a) or b) (meaning low load or high temperature) is satisfied it should switch to profile "high" (which chooses "performance" as cpu governor).

But when I run powermgr in debug mode I get:
Quote:

reading acpi file /proc/acpi/ac_adapter/ADP1/state
/proc/acpi/ac_adapter/ADP1/state/state = on-line
input ac adapter = 1
input load average(1) = 1.62
reading acpi file /proc/acpi/thermal_zone/THRM/temperature
/proc/acpi/thermal_zone/THRM/temperature/temperature = 50 C
input temperature = 50
switching to profile low
doing periodic update
reading acpi file /proc/acpi/ac_adapter/ADP1/state
/proc/acpi/ac_adapter/ADP1/state/state = on-line
input ac adapter = 1
input load average(1) = 1.97
reading acpi file /proc/acpi/thermal_zone/THRM/temperature
/proc/acpi/thermal_zone/THRM/temperature/temperature = 50 C
input temperature = 50
switching to profile low
doing periodic update
reading acpi file /proc/acpi/ac_adapter/ADP1/state
/proc/acpi/ac_adapter/ADP1/state/state = on-line
input ac adapter = 1
input load average(1) = 2.21
reading acpi file /proc/acpi/thermal_zone/THRM/temperature
/proc/acpi/thermal_zone/THRM/temperature/temperature = 50 C
input temperature = 50
switching to profile low

I did 'cat /dev/urandom > /dev/null' to get the load average higher. You can see that in the last update, both conditions for temperature (<55) and load averages (>2) was satisfied, yet it didn't switch to profile "high". What am I doing wrong?
_________________
Gnome:
1. A legendary being.
2. A never ending quest to make unix friendly to people who don't want unix and excruciating for those that do.
Back to top
View user's profile Send private message
ttuttle
Tux's lil' helper
Tux's lil' helper


Joined: 03 Oct 2004
Posts: 131

PostPosted: Tue Jul 12, 2005 11:19 am    Post subject: Reply with quote

That behavior seems odd, it obviously shouldn't be doing that. Can you try turning up debug mode to 4 or 5 (you can pass a number to -d)? (It will show more detailed info about how the rules match.)

Does the default powermgr.conf work for you? (Just curious.)

Why don't you just do this instead? It would be simpler.

Code:

Rule
ac adapter = on
load average = >2
temperature = <50
profile = high
EndRule

Rule
profile = low
EndRule
Back to top
View user's profile Send private message
ttuttle
Tux's lil' helper
Tux's lil' helper


Joined: 03 Oct 2004
Posts: 131

PostPosted: Tue Jul 12, 2005 2:57 pm    Post subject: Reply with quote

Never mind, I found the bug. (I was comparing the entire string "<50" with the input's value, and "<50" == 0 as far as Perl is concerned, and unless you're in Antarctica, your computer is usually more than 0 degrees Celsius). There's a new release on sourceforge. (http://www.sourceforge.net/projects/powermgr/) I added you to the CREDITS file. If you'd like a real name instead of your forums nickname, and/or an email address, I can change it.

Try 0.0.8. It should work; I tested a similar powermgr.conf to the one you used and it seemed to work properly.

Thanks for the help!
Back to top
View user's profile Send private message
ttuttle
Tux's lil' helper
Tux's lil' helper


Joined: 03 Oct 2004
Posts: 131

PostPosted: Tue Jul 12, 2005 3:06 pm    Post subject: Reply with quote

NEW VERSION 0.0.8! Get it at http://www.sourceforge.net/projects/powermgr/!

Here's a list of the current input and output support in powermgr. If your laptop manufacturer is listed, please give it a try and see if the manufacturer-specific extensions work. I only have an Asus laptop, and I've only worked with someone on the Omnibook and Toshiba outputs, so the Dell and IBM ones are in need of testing.

Inputs:

ac adapter (ACPI, Omnibook)
battery (ACPI, Omnibook)
fan (ACPI, Dell, Omnibook, Toshiba)
temperature (ACPI, Dell, IBM, Omnibook)
hard drive temperature (hddtemp)
load average
running programs

Outputs:

brightness (Asus, IBM, Omnibook, Toshiba)
cpufreq governor, min/cur/max speed (any cpu with kernel support)
fan (ACPI, Dell, IBM, Toshiba)
speedfreq policy
wireless power management (any card with iwconfig power support, ipw2200)
laptop mode
runlevel
services
execute program
write file

Powermgr will configure itself for your laptop each time you run it (it checks for the proper files in /proc to determine which inputs and outputs to register). The default configuration file should control all of the features it can find. My goal is to have powermgr in a state where I can release the program and a single powermgr.conf and it will do a decent job at managing power on any system, regardless of components.

Comments, suggestions, and bug reports are gratefully accepted! Tell me if something doesn't work so I can fix it, and tell me if it does work so I can be happy. ;-) If there's a piece of controllable hardware in your laptop that isn't supported, tell me how the interface works or point me to a web page and I will add support for it.

Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum