Author Topic: Mb-applet-powerctrl  (Read 34486 times)

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #15 on: June 25, 2007, 02:44:42 am »
Powerctrl can put amost everything in config file. For example:

[powerctrl]
productfile=/proc/deviceinfo/product
 or
productfile=/etc/hardware

bCheckBankerApplet = 1
bCheckBatteryApplet = 1

[SL-C1000]
CCCR=/proc/cccr_change
CCCRFormat="%x"
VCORE=/proc/zaurus/VCORE
VCOREFormat="%02x"

freqnum = 6
freq5=624,2000310,0e
...

[Akita]
CCCR=/proc/cccr_change
CCCRFormat="%x"
VCORE=/proc/zaurus/VCORE
VCOREFormat="%02x"

freqnum = 6
freq5=624,2000310,0e
...

Some problem should conside:
1. put the powerctrl.cfg to HOME directyory or /etc, or maybe both
2. Is it safe? The error config may hurt zaurus.
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Mb-applet-powerctrl
« Reply #16 on: June 25, 2007, 02:58:11 am »
Quote
Powerctrl can put amost everything in config file. For example:

[powerctrl]
productfile=/proc/deviceinfo/product
 or
productfile=/etc/hardware

bCheckBankerApplet = 1
bCheckBatteryApplet = 1

[SL-C1000]
CCCR=/proc/cccr_change
CCCRFormat="%x"
VCORE=/proc/zaurus/VCORE
VCOREFormat="%02x"

freqnum = 6
freq5=624,2000310,0e
...

[Akita]
CCCR=/proc/cccr_change
CCCRFormat="%x"
VCORE=/proc/zaurus/VCORE
VCOREFormat="%02x"

freqnum = 6
freq5=624,2000310,0e
...

Some problem should conside:
1. put the powerctrl.cfg to HOME directyory or /etc, or maybe both
2. Is it safe? The error config may hurt zaurus.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=163687\"][{POST_SNAPBACK}][/a][/div]

I think it should look in $HOME first, if it finds it then use that, otherwise, copy default config from /etc to $HOME.

PS: I think there should be a maxtime for the overclocking when it automatically steps down again so not to cook the Zaurus CPU. better safe than sorry
« Last Edit: June 25, 2007, 03:01:10 am by Meanie »
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #17 on: June 25, 2007, 01:51:52 pm »
only for test:
Merge Meanie's modify
Add powerctrl.cfg, you should copy it to ~/Choice/

Please check powerctrl.cfg
[powerctrl]
PathModel0=/proc/deviceinfo/product
PathModel1=/etc/hardware

SL-C700=PXA250
Corgi=PXA250

SL-C750=PXA255
SL-C7500=PXA255
SL-7500=PXA255
Shepherd=PXA255

SL-C760=PXA255
SL-C860=PXA255
Husky=PXA255
Boxer=PXA255

SL-6000=PXA255
Tosa=PXA255

SL-C1000=PXA270
SL-C3100=PXA270
SL-C3000=PXA270
SL-C3200=PXA270
Akita=PXA270
Spitz=PXA270
Borzoi=PXA270
Terrier=PXA270

[PXA250]
BatteryWarn=15
bSpeedStep=False
StepDelay=3
acUsageHigher=80
acUsageLower=20
acMaxFreq=2
acMinFreq=1
baUsageHigher=80
baUsageLower=20
baMaxFreq=2
baMinFreq=0

# do not change below
PathCCCR=/proc/cccr_change
PathVCORE=
MaxFreq=2
DefaultFreq=2
backlight0=1
backlight1=5
backlight2=b
backlight3=105
backlight4=10b
backlight5=11f

freq0=199
cccr0=141

freq1=398
cccr1=241

freq2=472
cccr2=272

[PXA255]
BatteryWarn=15
bSpeedStep=False
StepDelay=3
acUsageHigher=80
acUsageLower=20
acMaxFreq=2
acMinFreq=1
baUsageHigher=80
baUsageLower=20
baMaxFreq=2
baMinFreq=0

# do not change below
PathCCCR=/proc/cccr_change
PathVCORE=
MaxFreq=3
DefaultFreq=2
backlight0=1
backlight1=5
backlight2=b
backlight3=105
backlight4=10b
backlight5=11f
freq0=199
cccr0=141

freq1=398
cccr1=161

freq2=472
cccr2=162

freq3=531
cccr3=163

[PXA270]
BatteryWarn=15
bSpeedStep=False
StepDelay=3
acUsageHigher=80
acUsageLower=20
acMaxFreq=5
acMinFreq=3
baUsageHigher=80
baUsageLower=20
baMaxFreq=5
baMinFreq=1

# do not change below
PathCCCR=/proc/zaurus/CCCR
PathVCORE=/proc/zaurus/VCORE
MaxFreq=5
DefaultFreq=3
backlight0=10000
backlight1=10001
backlight2=10007
backlight3=10101
backlight4=10107
backlight5=10111

freq0=104
cccr0=2000204
vcore0=4

freq1=208
cccr1=2000206
vcore1=6

freq2=312
cccr2=2000208
vcore2=8

freq3=416
cccr3=2000210
vcore3=a

freq4=502
cccr4=2000290
vcore4=c

freq5=624
cccr5=2000310
vcore5=e
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #18 on: June 25, 2007, 01:56:20 pm »
If no problem, I should continue to work on:
1. overclock safe control, overclock whithout overheat
2. swap on/off
3. volume control maybe
4. try to make the tray icon wider, and include volume display bar

It is really many works todo, but the most hard work has finished.
« Last Edit: June 25, 2007, 01:58:12 pm by ecc_hy »
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Mb-applet-powerctrl
« Reply #19 on: June 25, 2007, 11:24:37 pm »
Quote
If no problem, I should continue to work on:
1. overclock safe control, overclock whithout overheat
2. swap on/off
3. volume control maybe
4. try to make the tray icon wider, and include volume display bar

It is really many works todo, but the most hard work has finished.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=163718\"][{POST_SNAPBACK}][/a][/div]

so far, I can overclock fine, the speed step works beautifullly when I am connected to AC and compiling things, however, when on battery power, the underclocking results in the screen flickering and flashing. I tried other cpu frequencies but have not found one that does not cause flickering yet...
« Last Edit: June 25, 2007, 11:25:02 pm by Meanie »
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #20 on: June 26, 2007, 01:50:15 am »
Quote
so far, I can overclock fine, the speed step works beautifullly when I am connected to AC and compiling things, however, when on battery power, the underclocking results in the screen flickering and flashing. I tried other cpu frequencies but have not found one that does not cause flickering yet...
[div align=\"right\"][a href=\"index.php?act=findpost&pid=163751\"][{POST_SNAPBACK}][/a][/div]

My zaurus is C1000-pdaxrom 1.1 beta3

1. "make" always error when overclock. If set to default clock, "make" is ok.
2. the screen flickering only when:
    underclock
    on battery power
    connect PC as USB Disk mode (CF/SD)
    copy file between pc and CF/SD
« Last Edit: June 26, 2007, 01:53:47 am by ecc_hy »
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Mb-applet-powerctrl
« Reply #21 on: June 26, 2007, 02:19:35 am »
Quote
Quote
so far, I can overclock fine, the speed step works beautifullly when I am connected to AC and compiling things, however, when on battery power, the underclocking results in the screen flickering and flashing. I tried other cpu frequencies but have not found one that does not cause flickering yet...
[div align=\"right\"][a href=\"index.php?act=findpost&pid=163751\"][{POST_SNAPBACK}][/a][/div]

My zaurus is C1000-pdaxrom 1.1 beta3

1. "make" always error when overclock. If set to default clock, "make" is ok.
2. the screen flickering only when:
    underclock
    on battery power
    connect PC as USB Disk mode (CF/SD)
    copy file between pc and CF/SD
[div align=\"right\"][a href=\"index.php?act=findpost&pid=163754\"][{POST_SNAPBACK}][/a][/div]


overclocking and underclocking is not always reliable and depends pretty much on the individual CPUs in the unit. it is good that you now have a config files where these values are stored and can be changed, ie not hardcoded in the binary/code anymore.
the same values may not work for everyone, so it probably would be a good idea to have several known values that work in the config files, but commented out and let the advanced users uncommment the appropriate value.

for example (note that these are not actual working values, but just some values to give as an example)

#freq2=312
# cccr2=2000208
# cccr2=a000208
# cccr2=2000210

if freq2 and one of the cccr2 is uncommented, 312 is shown as an option in the applet, otherwise, it is not.

this way, the users can test which settings work and only have the frequencies that work for his/her Zaurus shown and used in the applet.

alternatively, the config files could have a default value and alternate values commented out so if the user finds that the default value is not working, try the other ones and if none of them work, disable that frequency altogether by commenting out the whole section.

On my C3000, the old values for overclocking would shutdown my Zaurus or the screen would turn white. With the new values, it works without problems, ie I can run make and many other things... tetsu has a list of many overclocking values on his website which you can try. unfortunately, there are not that many underclocking values, so when I underclock, the screen flickers.
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #22 on: June 26, 2007, 04:44:53 am »
Just for compiler and test:
Change config file format, more simple, especial backlight and cpu clock freq.
menu will not display the freq commented.

Question to Meanie:
How do ajust the frquence config? Just try it  one by one, or you can read the hardware value, or not?
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Mb-applet-powerctrl
« Reply #23 on: June 26, 2007, 10:08:26 am »
Quote
Just for compiler and test:
Change config file format, more simple, especial backlight and cpu clock freq.
menu will not display the freq commented.

Question to Meanie:
How do ajust the frquence config? Just try it  one by one, or you can read the hardware value, or not?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=163763\"][{POST_SNAPBACK}][/a][/div]

need to try one by one. it will be different for each Zaurus. For example, there could be 10 people with C3100 who can use one value but for 5 other users also with C3100 that value crashes their Z and they need to use different value. Only trial and crash can tell which value  is correct for your own Z.
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Mb-applet-powerctrl
« Reply #24 on: June 26, 2007, 10:25:37 pm »
ok, now with this latest code, when I comment out a frequency, ie freq3, it does not get displayed, however, the applet picks an invalid default freqency when it starts up, in my case, freq1. the problem seems to be that when changing frequencies, it always steps by one frequency level and if one is commented out, it gets confused and goes to the wrong one.
It also does not have the default 416 ticked when it starts up (when all the freq in the config files are uncommented at default settings).

other enhancements that would be nice:

The MEM indicator shows the total of both physical memory and swap, hence I get 195%
can you separate them out like in your alpha version?

The screensaver and suspend options are ticked/unticked according to the values stored in lightnpower.cfg, but it would be nicer if they displayed the actual status of those settings, ie according to what `xset q` says maybe...
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #25 on: June 28, 2007, 12:20:00 am »
Quote
ok, now with this latest code, when I comment out a frequency, ie freq3, it does not get displayed, however, the applet picks an invalid default freqency when it starts up, in my case, freq1. the problem seems to be that when changing frequencies, it always steps by one frequency level and if one is commented out, it gets confused and goes to the wrong one.
It also does not have the default 416 ticked when it starts up (when all the freq in the config files are uncommented at default settings).
It is real confuse me.
If comment some freq, we lost those value.
As my experience, if change clock from level 1 to leve 3 directly, zaurus may crash, so middle freq level can not be throw.
If keep the unstable middle level, it is very hard to contrl speedstep, and do not stay the unstable for a long time.
Otherwise, speedstep always stay on min freq set by powerctrl. If only the lowest or highest level is not stable, the problem is simple, it is enough if we change the min / max freq in powerctrl.
Finally, I just add a new config (1, stable / 0, unstable) at the end of freq define. The unstable is not displayed in menu. It means, you can not set to unstable manually. but auot speedstep do not check.

Quote
other enhancements that would be nice:

The MEM indicator shows the total of both physical memory and swap, hence I get 195%
can you separate them out like in your alpha version?
Finished, check please.

Quote
The screensaver and suspend options are ticked/unticked according to the values stored in lightnpower.cfg, but it would be nicer if they displayed the actual status of those settings, ie according to what `xset q` says maybe...
[div align=\"right\"][a href=\"index.php?act=findpost&pid=163811\"][{POST_SNAPBACK}][/a][/div]
Following is come from the pdaxrom builder's patch, I do not sure is it for all pdaxrom version? I am sure it is working for me, c1k, 1.1 beta3

   if (DPMSQueryExtension(g_pDisplay, &dummy, &dummy))
   {
      if (DPMSCapable(g_pDisplay))
      {
         DPMSGetTimeouts(g_pDisplay, &standby, &suspend, &off);
         if ((standby != a) || (off != )
            DPMSSetTimeouts(g_pDisplay, a, 0, ;
      }
   }

New function:
Include font define in powerctrl.cfg
« Last Edit: June 28, 2007, 12:21:46 am by ecc_hy »
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Mb-applet-powerctrl
« Reply #26 on: June 28, 2007, 11:27:13 pm »
hiding the unwanted frequencies now work if you set the value to 0 at the end, and they do not appear on the applet menu any more, however, the speed step still uses them. for me the lowest two frequencies cause flickering so i rather not have them being used. i can set MinFreq to 2 and speed step won't use freq 0 and 1. however, what if freq 0 and 2 were not working for me and only freq 1 did? also, speed step is set to true by default which might be a nice idea once all is working perfectly, but for the time being it is better set to false.
the filename for the suspend icon is mispelled, you forgot the ctrl after power
and finally, the DPMSQueryExtension code crashes my Z. it just turned off and I had to pull the battery when I toggled the auto suspend. toggling the screensaver was ok . not sure why as the code looks ok.
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #27 on: June 29, 2007, 01:26:55 am »
We have two solutions:
1. Compress the freq list, and throw the unstable freq level. It may cause system unstable when over step, like step from 3 direct to 1, skip level 2.
2. Reserved the unstable. It will make the speedstep() too complex. We should conside  in very detail and test more.

I will use method 2, and find a way to make it simple, you know, use function freq_stepset().

and finally, the DPMSQueryExtension code crashes my Z. it just turned off and I had to pull the battery when I toggled the auto suspend. toggling the screensaver was ok . not sure why as the code looks ok.

It is not problem of DPMSQueryExtension().
I have found the problem from xset's source. Please check:
The mb-applet-blanker patch from pdaxrom builder do not call DPMSEnable() before set. xset of pdaxrom 1.1 have same problem also.

So, someone add "xset -dpms" this to blanker:

I decide to use xset after read the source of xset. xset should be easy when powerctrl is migrated to other computer.

PS:
I have read dpms para and status from "xset q", but not sure how to use it.
Any suggestion?
« Last Edit: June 29, 2007, 12:05:49 pm by ecc_hy »
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #28 on: June 30, 2007, 12:31:51 pm »
2007-06-30  Hu Yong  <ecc_hy@hotmail.com>

   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
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Mb-applet-powerctrl
« Reply #29 on: July 02, 2007, 03:41:48 am »
Quote
2007-06-30  Hu Yong  <ecc_hy@hotmail.com>

   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
[div align=\"right\"][a href=\"index.php?act=findpost&pid=164032\"][{POST_SNAPBACK}][/a][/div]

its getting there. everything seems to be working as it should except when overclocking for too long, the Z gets warm and locks up
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K