OESF Portal | OESF Forum | OESF Wiki | LinuxPDA | #planetgemini chat on matrix.org | #zaurus and #alarmz chat on freenode.net | ELSI (coming soon) | Ibiblio

IPB

Welcome Guest ( Log In | Register )

8 Pages V   1 2 3 > »   
Reply to this topicStart new topic
> Mb-applet-powerctrl, 0.0.2 Released, support speedstep now
ecc_hy
post Jun 15 2007, 09:26 AM
Post #1





Group: Members
Posts: 125
Joined: 5-January 07
Member No.: 13,705



Changelog:

2007-07-15
Bump to 0.0.2
add "overclocktimeout" to powerctrl.cfg

2007-07-02
clean the paint code
add paint config to powerctrl.cfg

2007-06-30
dpms_set() back to "xset", give up DPMSGetTimeouts()
new function: dpms_read(), read dpms status from "xset q"
add "Attention:" to powerctrl.cfg
speedstep over unstable freq

2007-06-29:
Big fixed
Display better.
Add powerctrl.cfg, you can modify almost everthing in it.

2007-06-23

Make the three bars wider, which would make them much more visible, and look better.

Change and test ok for screensaver and suspend options. It really confuse me. Now the function is:
1. Screensaver and suspend options is opened when startup, read lightnpower config at first, but not set dpms really.
2. If you disable or enable those options, read lightnpower config, and set dpms.
3. When power changed, read lightnpower config, change backlight.
4. If mb-applet-battery runnging, powerctrl would not set dpms.
5. If mb-applet-battery not runnging, powerctrl would set dpms. Keep disable if you disabled before, Otherwiase, set dpms according lightnpower config.

Add config of usage AC higher and usage battery higher. This should satisfy meanie's idea: when on battery power, it will only underclock and not overclock, while on the other hand, if its on AC power, it can automatically overclock.

Function list:
Blanker/suspend control, no support XMMS key control
CPU/Mem monitor, battery monitor, CPU clock monitor
Low battery warn
Set CPU Clock manually and very fast, replace cpuoverclock.py.
Set backlight manually and very fast, replace lightnpower.py.
Auto speedstep according CPU usage.

Source is not cleaned, if you want to compile:
make clean
make distclean
./configure
make

No debug infor:
delete line:
#define DEBUG

Install binary mb_applet_powerctrl_0.0.1.tar.gz:
tar zvfx mb_applet_powerctrl_0.0.1.tar.gz
and copy the files according to the directory

After install:
click and hold on applet for 2 seconds
select "add" -> "power control"

You may run mb-applet-powerctrl in terminal when you getting problem.

This post has been edited by ecc_hy: Jul 15 2007, 03:25 AM
Attached image(s)
Attached Image
 

Attached File(s)
Attached File  mb_applet_powerctrl_0.0.2_3_armv5tel.ipk ( 39.44K ) Number of downloads: 99
Attached File  mb_applet_powerctrl_0.0.2_3.src.tar.gz ( 262.37K ) Number of downloads: 49
 
Go to the top of the page
 
+Quote Post
zi99y
post Jun 21 2007, 06:04 AM
Post #2





Group: Members
Posts: 282
Joined: 9-August 06
Member No.: 10,709



looks really useful, I will try it tonight. What is the memory use like, I try to use few mb-applets to save memory.

anyone tried this yet?
Go to the top of the page
 
+Quote Post
zi99y
post Jun 21 2007, 01:24 PM
Post #3





Group: Members
Posts: 282
Joined: 9-August 06
Member No.: 10,709



unfortunately it crashes on loading, any ideas?
CODE
$ mb-applet-powerctrl
mbmenu: no _MB_THEME set on root window
Segmentation fault
Go to the top of the page
 
+Quote Post
ecc_hy
post Jun 22 2007, 05:48 AM
Post #4





Group: Members
Posts: 125
Joined: 5-January 07
Member No.: 13,705



I have not test in C3200 and icewm yet.

This program develop in PDAXROM 1.1 beta3 on C1000. It support other zaurus, but may need more test. For other zaurus, you may tell me some information as below when you get problem:
product identify -> /proc/deviceinfo/product
cpu clock -> /proc/cccr_change and /proc/zaurus/VCORE
backlight -> /proc/driver/fl/corgi-bl

It can not support kernel 2.6 now.
But new release will come soon.

As you mind. the powerctlr really does:
1. Save display screen. It merged battery, cpu usage, mem usage, and cpu clock display.
2. Optimize the display program, display changed pixel of tray icon only.
3. Change the backlight and cpu clock by simple click tray icon, it is very fast.
4. Speedstep CPU Clock according to CPU usage, when usage greater than 80%, set clock higher; when usage less than 20%. set clock lower.
Go to the top of the page
 
+Quote Post
Meanie
post Jun 22 2007, 05:58 AM
Post #5





Group: Members
Posts: 2,803
Joined: 21-March 05
From: Sydney, Australia
Member No.: 6,686



QUOTE(ecc_hy @ Jun 22 2007, 11:48 PM)
I have not test in C3200 and icewm yet.

This program develop in PDAXROM 1.1 beta3 on C1000. It support other zaurus, but may need more test. For other zaurus, you may tell me some information as below when you get problem:
product identify -> /proc/deviceinfo/product
cpu clock -> /proc/cccr_change and /proc/zaurus/VCORE
backlight -> /proc/driver/fl/corgi-bl

It can not support kernel 2.6 now.
But new release will come soon.

As you mind. the powerctlr really does:
1. Save display screen. It merged battery, cpu usage, mem usage, and cpu clock display.
2. Optimize the display program, display changed pixel of tray icon only.
3. Change the backlight and cpu clock by simple click tray icon, it is very fast.
4. Speedstep CPU Clock according to CPU usage, when usage greater than 80%, set clock higher; when usage less than 20%. set clock lower.
*


it runs fine on my c3000 running icewm 1.2.26
Go to the top of the page
 
+Quote Post
daniel3000
post Jun 22 2007, 06:22 AM
Post #6





Group: Members
Posts: 1,001
Joined: 28-April 05
From: Germany
Member No.: 7,027



Great approach! Thank you!

Some ideas:
You could make the three bars wider, which would make them much more visible.
Now they are quite hard to see.

Blank screeen once did not work, and now it segfaults here.
Do you hae an ide why?

I see "Max speed" and "Max save" can both be unchecked which is probably setting the CPU speed to default behavior (i.e. don't change at all and set to 416MHz).
But I think it would be good to have an explicit third option "Default speed" so te user really knows that the applet doesn't change anything. It is not obvious instantly that the optoins canno only be "cross-checked" but also unchecked at all.

Did you use Meanie's algorithms from his banker applet hack for the blanker equivalent options?

Maybe the volume applet could also be integrated? smile.gif

daniel
Go to the top of the page
 
+Quote Post
climber
post Jun 22 2007, 06:43 AM
Post #7





Group: Members
Posts: 189
Joined: 21-November 05
Member No.: 8,574



This sound very interesting!

As I'm not the linux specialist what have I to to with the "mb_applet_powerctrl_0.0.1.tar.gz?"

I extracted the file and there are a few folders like the zaurus already has. I think there's should be a command how to get these data to the right folders!?

Thanks
climber
Go to the top of the page
 
+Quote Post
Meanie
post Jun 22 2007, 08:37 PM
Post #8





Group: Members
Posts: 2,803
Joined: 21-March 05
From: Sydney, Australia
Member No.: 6,686



i packaged it up.


i like the new features it adds, but since i am using icewm which already has the monitoring bits i am inclined to rather not have it show those monitors. what i intend to do is use the code from powerctrl and merge it back into my custom blanker applet (which also has the xmms stuff removed but handles the screensaver/suspend functionality a bit better).
so i intend to add the cpu and backlight settings parts to blanker applet, but i want to add some logic to the power step feature where when on battery power, it will only underclock and not overclock, while on the other hand, if its on AC power, it can automatically overclock.
Attached File(s)
Attached File  mb_applet_powerctrl_0.0.1_armv5tel.ipk ( 26.06K ) Number of downloads: 38
 
Go to the top of the page
 
+Quote Post
Meanie
post Jun 23 2007, 06:03 AM
Post #9





Group: Members
Posts: 2,803
Joined: 21-March 05
From: Sydney, Australia
Member No.: 6,686



there is a bug, the SL-C3200 is ignored and thus the overclocking will fail for it.
Go to the top of the page
 
+Quote Post
ecc_hy
post Jun 23 2007, 09:26 PM
Post #10





Group: Members
Posts: 125
Joined: 5-January 07
Member No.: 13,705



QUOTE(Meanie @ Jun 23 2007, 06:03 AM)
there is a bug, the SL-C3200 is ignored and thus the overclocking will fail for it.
*


Writing the zaurus model as hard code is not good idea.

Next version, I should make a config file.
Go to the top of the page
 
+Quote Post
Meanie
post Jun 24 2007, 12:51 AM
Post #11





Group: Members
Posts: 2,803
Joined: 21-March 05
From: Sydney, Australia
Member No.: 6,686



ok, then you are going to change the following code to read a config instead?

(memcmp(sLine, "SL-C1000", 7) == 0 || memcmp(sLine, "SL-C3100", 7) == 0 || memcmp(sLine, "SL-C3000", 7) == 0)

Don't forget to add the SL-C3200 to that config list.

In addition, in 2.4.20 kernel, you can easily determine the model name, but in 2.6.x kernel, this info is not easily available. Instead, you can only get the dog name, ie Akita, Spitz, Borzoi, Terrier, etc.. so if you use that information instead, then the applet could also work in new pdaXrom that is using 2.6.x kernel...I have added the following into postinst:

HARDWARE=`cat /proc/cpuinfo | grep 'Hardware' | cut -d':' -f2 | cut -d' ' -f3` > /etc/hardware

because there is no /proc/deviceinfo under 2.6.x kernel

so instead of reading /proc/deviceinfo/product, I read /etc/hardware instead and instead of checking whether the model is SL-C1000, SL-C3100, etc... I check for Akita, Borzoi, etc... instead... This would make it work for all versions of pdaXrom...




Also, can you add another option so you can choose whether you want to display cpu info/memory info/battery status or the suspend/screensaver status which the original blanker is displaying?

Another nice to have feature would be an extra option to turn on/off swap...
Go to the top of the page
 
+Quote Post
Meanie
post Jun 24 2007, 02:36 AM
Post #12





Group: Members
Posts: 2,803
Joined: 21-March 05
From: Sydney, Australia
Member No.: 6,686



QUOTE(ecc_hy @ Jun 16 2007, 03:26 AM)
Change and test ok for screensaver and suspend options. It really confuse me. Now the function is:
1. Screensaver and suspend options is opened when startup, read lightnpower config at first, but not set dpms really.
2. If you disable or enable those options, read lightnpower config, and set dpms.
3. When power changed, read lightnpower config, change backlight.
4. If mb-applet-battery runnging, powerctrl would not set dpms.
5. If mb-applet-battery not runnging, powerctrl would set dpms. Keep disable if you disabled before, Otherwiase, set dpms according lightnpower config.


This is what I intended for the blanker when I hacked it:

1. In the original blanker, screensaver and suspend option were always enabled by default when you start the applet (even when they really were enabled or disabled), so I changed the code to check whether those features really were enabled or disabled when the applet started and had it show the status accordingly.

2. Yep, I also found that xset didn't properly set those options so made it call xset-wrapper instead which when fiddled with the options to set things properly, ie if you have xscreensaver installed, it would also enabled/disable xscreensaver as well and not only the build in screensaver in X

3. Exactly. power.cfg has backlight settings for AC and battery mode, so set backlight according to what is set there.

4. Battery applet calls lightnpower.py to set dpms when power changes between AC/battery, so when it is running, blanker/powerctrl does not need to do anything

5. since there is no battery applet, powerctrl applet needs to change settings. maybe it should check whether blanker applet is running as well.
Go to the top of the page
 
+Quote Post
Meanie
post Jun 24 2007, 04:08 AM
Post #13





Group: Members
Posts: 2,803
Joined: 21-March 05
From: Sydney, Australia
Member No.: 6,686



the speedstep feature has a problem. when i am on battery power and doing nothing it correctly steps down to a lower cpu frequency, however, when i am plugged into the AC and do a compile, i can see it steps up the cpu frequency but then it shuts down my Zaurus and I have to reset it...
Go to the top of the page
 
+Quote Post
ecc_hy
post Jun 24 2007, 06:44 AM
Post #14





Group: Members
Posts: 125
Joined: 5-January 07
Member No.: 13,705



QUOTE(Meanie @ Jun 24 2007, 04:08 AM)
ok, then you are going to change the following code to read a config instead?

Yes, the config file should be copy to /etc/powerctrl.cfg or ~/Choice/powerctrl.cfg. Puting the config file to HOME should avoid the problem of user right.
The /proc/cpuinfo can be used or not? Only cpu model stored in it.

QUOTE(Meanie @ Jun 24 2007, 04:08 AM)
Also, can you add another option so you can choose whether you want to display cpu info/memory info/battery status or the suspend/screensaver status which the original blanker is displaying?

This maybe not easy if you want to change the status bar on tray image. As you know, the all drawing work is based the icon file. If you really want to do this, drawing the whole icon's backgroud is needed.
If you just wat ignore it and leave the bar no change, it should by more easy.

QUOTE(Meanie @ Jun 24 2007, 04:08 AM)
1. In the original blanker, screensaver and suspend option were always enabled by default when you start the applet (even when they really were enabled or disabled), so I changed the code to check whether those features really were enabled or disabled when the applet started and had it show the status accordingly.

Do you mean check lightnpower.cfg?
Disable screen save or suspend if the value of config file is 0. Yes, I have done it.

QUOTE(Meanie @ Jun 24 2007, 04:08 AM)
2. Yep, I also found that xset didn't properly set those options so made it call xset-wrapper instead which when fiddled with the options to set things properly, ie if you have xscreensaver installed, it would also enabled/disable xscreensaver as well and not only the build in screensaver in X

I have copy it from your blanker, even do not know why. Now you explain it.

QUOTE(Meanie @ Jun 24 2007, 04:08 AM)
3. Exactly. power.cfg has backlight settings for AC and battery mode, so set backlight according to what is set there.

Yes. powerctrl read lightnpower.cfg to get the baklight config, and also read
/proc/driver/fl/corgi-bl to get current backlight value.

QUOTE(Meanie @ Jun 24 2007, 04:08 AM)
4. Battery applet calls lightnpower.py to set dpms when power changes between AC/battery, so when it is running, blanker/powerctrl does not need to do anything
I have copy it from your blanker, and check battery applet is running or not.


QUOTE(Meanie @ Jun 24 2007, 04:08 AM)
5. since there is no battery applet, powerctrl applet needs to change settings. maybe it should check whether blanker applet is running as well.

In fact, I want to replace replace battery applet and blanker applet. Any way, I shill check the blanker.

QUOTE(Meanie @ Jun 24 2007, 04:08 AM)
Another nice to have feature would be an extra option to turn on/off swap...

This should be easy by exec "swapon -a" and "swapoff -a". I will try.

QUOTE(Meanie @ Jun 24 2007, 04:08 AM)
the speedstep feature has a problem. when i am on battery power and doing nothing it correctly steps down to a lower cpu frequency, however, when i am plugged into the AC and do a compile, i can see it steps up the cpu frequency but then it shuts down my Zaurus and I have to reset it...
*


I have found the "make" program may be error when overclock.
The same problem occurs one times before modify the screensaver and suspend control. It seems powerctrl always call dpms_set.

Now the new ipk and source is changed screensaver and suspend control according meanies' blanker. I have not shuts down after modified.

You may try new ipk and source.

Someone said, overclock may not safe, and suggest 7500 can not over clock for 30 minutes, and C1000 can not for one hour. Is it truth? I can design a time protect. Is it nessary?

Thanks meanie very much, I will conside those ideas carefully.
Go to the top of the page
 
+Quote Post
Meanie
post Jun 24 2007, 03:55 PM
Post #15





Group: Members
Posts: 2,803
Joined: 21-March 05
From: Sydney, Australia
Member No.: 6,686



QUOTE(ecc_hy @ Jun 25 2007, 12:44 AM)
The /proc/cpuinfo can be used or not? Only cpu model stored in it.

Yes but it contains extra info which you need to strip out first and it only has dog name but no model name.

QUOTE(ecc_hy @ Jun 25 2007, 12:44 AM)
QUOTE(Meanie @ Jun 24 2007, 04:08 AM)
Also, can you add another option so you can choose whether you want to display cpu info/memory info/battery status or the suspend/screensaver status which the original blanker is displaying?

This maybe not easy if you want to change the status bar on tray image. As you know, the all drawing work is based the icon file. If you really want to do this, drawing the whole icon's backgroud is needed.
If you just wat ignore it and leave the bar no change, it should by more easy.

Those bars are really of no use to me, so I rather have the old icons back.

QUOTE(ecc_hy @ Jun 25 2007, 12:44 AM)
QUOTE(Meanie @ Jun 24 2007, 04:08 AM)
Another nice to have feature would be an extra option to turn on/off swap...

This should be easy by exec "swapon -a" and "swapoff -a". I will try.


I changed the CPU frequency for the overclocking using the values from Cacko instead and it didnt shutdown or turn into a white screen smile.gif

I also rearranged the order of the popup items a bit to suit my own preferenes...
Attached File(s)
Attached File  mb_applet_powerctrl.zip ( 13.21K ) Number of downloads: 27
 
Go to the top of the page
 
+Quote Post

8 Pages V   1 2 3 > » 
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 16th January 2018 - 04:00 AM