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

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Mb-applet-powerctrl
« Reply #75 on: July 19, 2007, 01:47:12 am »
Quote
tested some of the USB Function, ie switching between net and storage. did not test serial mode.
-> Not test serial too, never use it before. The progam is based on the usbfunction.py and checked carefully.

the mounts for the storage mode needs to be filtered.
-> There are two method.
1. use powerctrl.cfg, let user defined mount point, and good name like "SD card"/"CF card" can be easy added
2. use mtab to get all mount point, and filtered out. The exclude/inlcude types can be easy defined in powerctrl.cfg.

Which one is better?

tested the card applet functionality....
-> now powerctrl detects the usb host and usb serial device attached.
My question is: Do we need the deattach function? and how?
Waiting for meanie's qtopia-usb-applet, and try to modify it again.

Next:
swap on and off function should based on qtopia-memoryapplet.
swap off the item in /proc/swaps
create swapfile on sd/cf with different size which predefined in powerctrl.cfg.
check swap before eject sd/cf card.

auto swap on swapfile when sd/cf insert? the function I am not sure now.

About kernel 2.6:
I may add kernel 2.6 support to powerctrl, but can not test it now since only kernel 2.4 on my machine. The working should be very detail, something like file format, and hard to debug without kernel 2.6 env.
So I hope someone else develop and make it.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=165110\"][{POST_SNAPBACK}][/a][/div]

i think the better option would be to have a filter defined in powerctrl.cfg with the default just having vfat (and maybe ext2/ext3 as well) since most users just want to use the Zaurus as a usb storage device in Windows.

my qtopia usb applet does a decent job for handling the USB Host feature but it is not perfect. loading and unloading of the usb host modules should be handled automatically by the hotplug system.

the usb client feature (net/serial/storage) needs some improvements. The modules are not automatically unloaded by the hotplug system.

for the swap feature, both the SD and CF card have their own scripts for mounting and unmounting on insertion and those scripts can be enhanced to automatically enable swap, so the applet needs to be careful not to mount the swap again if its already automatically mounted by those scripts. maybe it can be an option to automount swap files but by default have this feature set to false.

i can enhance the applet to support 2.6 kernel when I have time, but in the meantime, i have added some code to disable those features that dont work yet in 2.6 kernel so the applet now also works in the latest pdaXrom distro with those features turned off until i get the time to implement them.
« Last Edit: July 19, 2007, 02:06:52 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

climber

  • Full Member
  • ***
  • Posts: 189
    • View Profile
Mb-applet-powerctrl
« Reply #76 on: July 19, 2007, 03:26:45 am »
If I click inside the applet menu on Screensave I can't deactivate it.
I'm not sure but could it be that the applet needs a lot of battery?

Regards
climber

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #77 on: July 19, 2007, 04:05:41 am »
Quote
i will try to find the source for qtopia-usb-applet and attach it here...

for the 2.6 kernel, it would be nice to also have an option to switch between speaker and headphones since that is not automatic like in the 2.4 kernel

/proc/driver/fl/corgi-bl equivalent in 2.6 kernel is /sys/class/backlight/corgi-bl//brightness
valid values are from 0 to 47 although anything above 7 is useless

for /proc/meminfo, the first 3 summary lines dont exist in 2.6 kernel, but the MemTotal, MemFree, SwapTotal,SwapFree values beneath are exactly the same.

for reading the current cpu frequency and voltage, use /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq and /sys/devices/system/cpu/cpu0/cpufreq/cpu-voltage respectively
[div align=\"right\"][a href=\"index.php?act=findpost&pid=165108\"][{POST_SNAPBACK}][/a][/div]

I have added some compatible code and more PATH define. We may test it in next release.

Quote
If I click inside the applet menu on Screensave I can't deactivate it.
I'm not sure but could it be that the applet needs a lot of battery?

Regards
climber
[div align=\"right\"][a href=\"index.php?act=findpost&pid=165145\"][{POST_SNAPBACK}][/a][/div]

It seems the user right problem.

You may try to run powerctrl as root:
sudo mb-applet-powerctrl

To meanie:
Could I change all fork_exec command to "sudo"?
« Last Edit: July 19, 2007, 04:40:53 am by ecc_hy »
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

kkazakov13

  • Sr. Member
  • ****
  • Posts: 408
    • View Profile
Mb-applet-powerctrl
« Reply #78 on: July 20, 2007, 02:34:07 am »
USB Client Function in 0.0.26 somehow not works as in prev. version ... I have 3 submenus - Serial / Network / Storage - when I click on Storage nothing happens (well, at least nothing visible). Is there any way to configure where the storage is ? I don't want it to be windows-mountable, i don't have FAT partitions, so ext2/3 is just fine for me.
SL-C3200 ** FOR SALE :( **
https://www.oesf.org/forum/index.php?showtopic=25969

Canon K30225 CF wireless card
Taxan iTax-LAN10 wired card
My packages for customized pdaXrom beta 3

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Mb-applet-powerctrl
« Reply #79 on: July 20, 2007, 03:57:15 am »
added sudo for the exec lines
added ext? filesystem to the mount filters for usbstorage
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 #80 on: July 20, 2007, 05:50:30 am »
Quote
USB Client Function in 0.0.26 somehow not works as in prev. version ... I have 3 submenus - Serial / Network / Storage - when I click on Storage nothing happens (well, at least nothing visible). Is there any way to configure where the storage is ? I don't want it to be windows-mountable, i don't have FAT partitions, so ext2/3 is just fine for me.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=165186\"][{POST_SNAPBACK}][/a][/div]

A little bug in 0.0.26, has been fixed.
New config for filter partition type has been added in powerctrl.

The swap file function cost much time.

New release will come soon, please wait.

To kkazakov13:
Thanks for your many new packages. I always downloaded from your site.
Did you compile the new version of matchbox? version 1.2?
« Last Edit: July 20, 2007, 09:36:13 am by ecc_hy »
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

kkazakov13

  • Sr. Member
  • ****
  • Posts: 408
    • View Profile
Mb-applet-powerctrl
« Reply #81 on: July 20, 2007, 09:09:53 am »
Thanks ! this version really works with ext2 + ext 3 now.

@ecc_hy, i haven't compiled it ( yet ). is there anything cool in this version?
SL-C3200 ** FOR SALE :( **
https://www.oesf.org/forum/index.php?showtopic=25969

Canon K30225 CF wireless card
Taxan iTax-LAN10 wired card
My packages for customized pdaXrom beta 3

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #82 on: July 20, 2007, 09:43:46 am »
Quote
Thanks ! this version really works with ext2 + ext 3 now.

@ecc_hy, i haven't compiled it ( yet ). is there anything cool in this version?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=165203\"][{POST_SNAPBACK}][/a][/div]

I am not sure. There is a long changlog.
I found a bug og matchbox when develop mb-applet-powerctrl.
As document, the tray message can be auto disapear when timeout. But indeed, the timeout is not working.

So I gues the new version may solve the bug. If tray message's timeout function is working, we do not need click always.
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #83 on: July 20, 2007, 11:21:48 am »
New release.
Add swap function
swap file and size can be pre-defined in powerctrl.cfg
Too more fresh code, need more testing.

Add some kernel 2.6 compatible code, not tested:

/proc/driver/fl/corgi-bl equivalent in 2.6 kernel is /sys/class/backlight/corgi-bl//brightness
valid values are from 0 to 47 although anything above 7 is useless
-> backlight file can be defined in powerctrl.cfg
-> valid values can be defined in powerctrl.cfg also

for /proc/meminfo, the first 3 summary lines dont exist in 2.6 kernel, but the MemTotal, MemFree, SwapTotal,SwapFree values beneath are exactly the same.
-> Now is compatible

for reading the current cpu frequency and voltage, use /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq and /sys/devices/system/cpu/cpu0/cpufreq/cpu-voltage respectively
-> can be defined in powerctrl.cfg

Todo:
analyze powerctrl's memory usuage, try to optimize
check swap acticed befroe eject card
enhance usb host function, try to support mouse, keyboard, etc

Know bug:
can not active swapfile on RAM, failed when:
swapon /home/root/.swapfile

https://www.oesf.org/forums/lofiversion/index.php/t2171.html

-> modify powerctrl.cfg, change swapcount to 2, delete [swap0], change [swap1] to [swap0], [swap2] to [swap1]
« Last Edit: July 20, 2007, 11:43:02 pm by ecc_hy »
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #84 on: July 21, 2007, 01:36:24 am »
Why powerctrl use almost 5M memory?

1. How to know powerctrl's memory usuage?
    run free before load powerctrl
    run free after load powerctrl

    Some older applet's memory usuage:
    cpu memory monitor,  680k
    volume-control, 980k
    blanker applet, 5.1M

    Now mb-ammplet-powerctrl is based on blanker, and it cost 4.9M. The question is who eat so much memory.

2. GtkWidget *g_wndBlanker? No.
    blanker is a fullscreen popup windows, used in blanker screen
    One blanker timer to keep backlight off
    One button event callback for blacklight on when clicked
    One key event callback to control xmms, and make zaurus as mp3 player. The function is disable now, since we are not use xmms now. It may enable by support mplayer in the future.

    Add a blankctrl enable/disable in powerctrl.cfg.
    The test result is Blanker function not eat too much memory.

3. mbmenu? Yes
App launcher use almost 5M on my machine.
After compared with powerctrl, they are same.

So the result is mbmenu cost too much memory. The memory maybe different, is it relate with font?

PS:
I have tried new matchbox, nothing speical, and want many patch, so give up.
« Last Edit: July 22, 2007, 05:09:07 am by ecc_hy »
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #85 on: July 23, 2007, 12:55:32 am »
Minor fix.
Support timeout tray message

The version should be 0.9.0, if anyone release it.

Todo:
May give up libmatchbox, because mbmenu eat many memory.
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #86 on: July 23, 2007, 06:48:57 am »
I have test in icewm. The bad news is mb-applet-powerctrl can not support icewm.

So I should conside to rewrite it, and make it run. Maybe based on egg tray icon is better choice?
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

tanjian2

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Mb-applet-powerctrl
« Reply #87 on: July 23, 2007, 07:06:05 am »
Quote
I have test in icewm. The bad news is mb-applet-powerctrl can not support icewm.

So I should conside to rewrite it, and make it run. Maybe based on egg tray icon is better choice?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=165278\"][{POST_SNAPBACK}][/a][/div]
I use mb-applet-powerctrl on icewm. It works - it does crash occasionally with a segment fault, and sometimes the icons are very strange (sometimes they just work fine).

I always get "Failed to open /proc/driver/battery/sharpsl_main_battery_voltage".

I have tried meanies compiled version and am currently running my own compiled version.

What is it that doesn't work in icewm?
SL-C3000(Spitz) - pdaXii13 5.5alpha + sound enhanced kernel - MD in 1 great big partition -  Ambicom CF Wifi + USB Ethernet  and NOW Zubuntu on a 4Gb SD

kkazakov13

  • Sr. Member
  • ****
  • Posts: 408
    • View Profile
Mb-applet-powerctrl
« Reply #88 on: July 23, 2007, 09:53:49 am »
Can you attach the full source for the latest? ready to build. Thanks
SL-C3200 ** FOR SALE :( **
https://www.oesf.org/forum/index.php?showtopic=25969

Canon K30225 CF wireless card
Taxan iTax-LAN10 wired card
My packages for customized pdaXrom beta 3

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #89 on: July 23, 2007, 10:11:13 pm »
Fixed icewm problem
"sudo" option is lost

Compile method:
tar zvfx mb-applet-powerctrl...tar.gz
configure --prefix=/usr

"--enable-startup_notification" is useless now.

How to use mb-applet-powerctrl in icewm?
1. Autorun when icewm startup
check & add line to ~/.xinitrc:
Code: [Select]
icewm 2>deve/null >/dev/null & wmpid=$!
icewmtray & >/dev/null
mb-applet-powerctrl & >dev/null

2. Use Menu to load powerctrl:
run makeicemenu in terminal after mb-applet-powerctrl installed.
the new menu item called "Power control" should be added into program->panel.
If you do not have panel yet, check
Quote
~/.icewm/programs
and delete char "#" before the line contain "folder panel"
« Last Edit: July 24, 2007, 12:47:03 am by ecc_hy »
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting