Gp2x Energy Saver. New Utility.


kounch

Still Fresh
Joined
Dec 20, 2005
Messages
84
Website
Visit site
I have made a new utility, which will help to save batteries with the GP2X. It is called GP2X EnergySaver and works much like TV-Out Fixer.

Once activated, the utility launches a background proccesss (with low CPU consumption) wich, at stablished time intervales, if no button is pressed and it is not in TV-Out mode, switchs CPU Speed to minimum and turns off the LCD Screen, reactivating everything whenever a button is pressed.

You can also use it on your own, instead of using the interface i have made. You only have to copy the file setbl of the package, and use it from a script, passing as an argument the time in seconds that you want to set.
[CUT]
Simple example to launch with MAME, with a refresh time of 30 seconds:
Code:
#!/bin/sh
./setbl 30 &
exec ./mame_gp2x.gpe
You cand download it from GP32Spain (http://gp32spain.com/foros/showthread.php?t=31964 and http://www.gp32spain.com/foros/downloads.php?do=file&id=713) or, if you tell me where, i can upload it to another place.

Please see the Readme included for more details (like changing the language of the interface).

Regards
kounch[/CUT]
 
Rather neat. It'd be nice if you could run it like a daemon at boot via an autorun script and have it automagically operate with ANY program in the foreground.

Also some Q's:
- Does it disable the 940T or at least lower its clockrate? IIRC it is, by default, still running at 200 Mhz, just held in RESET state.
- What is 'minimum' 920T clockrate? Mine is stable to ~33 MHz if I recall correctly. I'd like to go that low.
 
reset state=power as if off
im sure this utility will be of good use for some people.
What im waiting for is a demon that monitors cpu usage and adjust the clockspeed according to it, well you cant have evrything.
 
techFreak posted on May 29 2006 at 09:58 AM said:
I'd appreciate if you can upload it to archive.gp2x.de because i have no access to Spanish forum as I don't understand Spanish. :)
Didn't know that it was free to upload to gp2x.de :D

Here you have
http://www.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,8,1557



Epicenter posted on May 29 2006 at 10:02 AM said:
Rather neat. It'd be nice if you could run it like a daemon at boot via an autorun script and have it automagically operate with ANY program in the foreground.

Also some Q's:
- Does it disable the 940T or at least lower its clockrate? IIRC it is, by default, still running at 200 Mhz, just held in RESET state.
- What is 'minimum' 920T clockrate? Mine is stable to ~33 MHz if I recall correctly. I'd like to go that low.
Check the source code (which is included) for all the details, or to change it accordingly to your needs ;)
I think that the function int bajoconsumo (void) in the file setbl.c is the one you are looking for.
 
Last edited by a moderator:
It well goes to sleep but it doesn't reactivate when i press a button. I use fw2.0 but a different skin loaded.

Also tested with Music player. :ph34r: Maybe you should control if music player or Mplayer running. Maybe you can add a control to only turn off the LCD without adjusting clock if Music Player running and do nothing while MPlayer running. :)

BTW I'm ready to translate your application to Turkish and English. B)

Thanks!
 
techFreak posted on May 29 2006 at 01:11 PM said:
It well goes to sleep but it doesn't reactivate when i press a button. I use fw2.0 but a different skin loaded.

Also tested with Music player. :ph34r: Maybe you should control if music player or Mplayer running. Maybe you can add a control to only turn off the LCD without adjusting clock if Music Player running and do nothing while MPlayer running. :)

BTW I'm ready to translate your application to Turkish and English. B)
Sometimes it is necessary to press a button twice or a longer time to wake from sleep (What button were you pressing?). Please check that it still doesn´t work doing this, and then i will try to find out why.

Adding support to detect other processes is something that will be possibly added to the next version but please note that Music Player has already an option to disable the screen using Select Button (check the GP2X Official Manual for more details: http://gp2x.com/product/04/4-3.asp?part=04).

The application is already translated to English (see the Readme for details to change it).

Please send me the turkish strings by editing the following (please use ISO-8859-1 character set):
Code:
strcpy(langStrings[0],"Wrong arguments, detected %i, there should be only one.\n");
	strcpy(langStrings[1],"Config file path: %s\n");
	strcpy(langStrings[2],"Error while reading config file :-(\n");
	strcpy(langStrings[3],"Error in user interface routine.\n");
	strcpy(langStrings[4],"Analyzing file %s...\n");
	strcpy(langStrings[5],"Error while opening file.\n");
	strcpy(langStrings[6],"Found key %s with value %s");
	strcpy(langStrings[7],"Found loop.pid file with value %i.\n");
	strcpy(langStrings[8],"loop.pid file not found.\n");
	strcpy(langStrings[9],"Firmware Version: %s CPU Speed: %iMHz");
	strcpy(langStrings[10],"Video Out: %s");
	strcpy(langStrings[11],"TV Standard: %s");
	strcpy(langStrings[12],"Energy Saver: %s");
	strcpy(langStrings[13],"Refresh Time: %i second(s)");
	strcpy(langStrings[14],"Press B or X to enable/disable");
	strcpy(langStrings[15],"Use L and R to choose the refresh time");
	strcpy(langStrings[16],"Press Start to Exit");
	strcpy(langStrings[17],"Error reading firmware file version.\n");
	strcpy(langStrings[18],"Loading...");
Regards
kounch
 
Last edited by a moderator:
Hi Kounch,

Thank you for your reply.

kounch posted on May 29 2006 at 02:45 PM said:
Adding support to detect other processes is something that will be possibly added to the next version but please note that Music Player has already an option to disable the screen using Select Button (check the GP2X Official Manual for more details: http://gp2x.com/product/04/4-3.asp?part=04).

I know that Music Player has a funciton like that. :blink: What I try to explain you is that if I execute your program and open Music Player, it will stop playing music because energy saver reduce the CPU speed. I think it will be a problem if someone decides to use your energy saver as a default screen saver. ;)

Regarding to reactivate problem; yes i tried it with several buttons and I also keep pressing. It didn't work. I'll connect my serial cable to see what's going on. :unsure:

Thanks!
techFreak
 
Last edited by a moderator:
techFreak posted on May 29 2006 at 02:05 PM said:
What I try to explain you is that if I execute your program and open Music Player, it will stop playing music because energy saver reduce the CPU speed. I think it will be a problem if someone decides to use your energy saver as a default screen saver. ;)

Regarding to reactivate problem; yes i tried it with several buttons and I also keep pressing. It didn't work. I'll connect my serial cable to see what's going on. :unsure:
The new version 0.2 which i have sent for update on gp2x.de, includes the option to disable it while some programs are running.
Have been trying hard to reproduce your problem but it doesn't happen to me at all :blink: I also have firmware 2.0.0 with a custom skin so that should not be the reason. Do you have any special configuration apart from that?
 
Last edited by a moderator:
kounch posted on May 29 2006 at 04:13 PM said:
techFreak posted on May 29 2006 at 02:05 PM said:
What I try to explain you is that if I execute your program and open Music Player, it will stop playing music because energy saver reduce the CPU speed. I think it will be a problem if someone decides to use your energy saver as a default screen saver. ;)

Regarding to reactivate problem; yes i tried it with several buttons and I also keep pressing. It didn't work. I'll connect my serial cable to see what's going on. :unsure:
The new version 0.2 which i have sent for update on gp2x.de, includes the option to disable it while some programs are running.
Have been trying hard to reproduce your problem but it doesn't happen to me at all :blink: I also have firmware 2.0.0 with a custom skin so that should not be the reason. Do you have any special configuration apart from that?
maybe something to do with first edition / non first / MK2?
 
Last edited by a moderator:
kounch posted on May 29 2006 at 11:13 PM said:
techFreak posted on May 29 2006 at 02:05 PM said:
What I try to explain you is that if I execute your program and open Music Player, it will stop playing music because energy saver reduce the CPU speed. I think it will be a problem if someone decides to use your energy saver as a default screen saver. ;)

Regarding to reactivate problem; yes i tried it with several buttons and I also keep pressing. It didn't work. I'll connect my serial cable to see what's going on. :unsure:
The new version 0.2 which i have sent for update on gp2x.de, includes the option to disable it while some programs are running.
Have been trying hard to reproduce your problem but it doesn't happen to me at all :blink: I also have firmware 2.0.0 with a custom skin so that should not be the reason. Do you have any special configuration apart from that?

I couldn't find the new version on gp2x.de. I'll try it when I got.

I don't have any special configuration. It's a quite standard unit from second batch.

I think it will be one of the most usefull program made for GP2X. Keep on working Kounch!
 
Last edited by a moderator:
techFreak posted on May 29 2006 at 11:34 PM said:
I couldn't find the new version on gp2x.de. I'll try it when I got.

I don't have any special configuration. It's a quite standard unit from second batch.

I think it will be one of the most usefull program made for GP2X. Keep on working Kounch!
I have checked and version 0.2 is now available (http://www.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,8,1557).
I will ask a friend to try it, as mine is a first edition and his is from a later bach.
 
Last edited by a moderator:
kounch posted on May 30 2006 at 11:21 AM said:
techFreak posted on May 29 2006 at 11:34 PM said:
I couldn't find the new version on gp2x.de. I'll try it when I got.

I don't have any special configuration. It's a quite standard unit from second batch.

I think it will be one of the most usefull program made for GP2X. Keep on working Kounch!
I have checked and version 0.2 is now available (http://www.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,8,1557).
I will ask a friend to try it, as mine is a first edition and his is from a later bach.
My friend has lent me his GP2X and fortunately :( it hangs, so i have found and solved the bug (at least for his console). I have uploaded version 0.3 with the fix to gp2x.de so it will be available soon for download.

It would be nice if someone with a MK2 model can try it, as i expect this version is compatible with F-100 First Edition and F-100 non MK2 models.
 
Last edited by a moderator:
PokeParadox posted on May 30 2006 at 11:56 PM said:
Kounch, do you intend to do something like adaptive clock setting, based on CPU load in the future?
That is something that i will investigate. But i can't promise anything until i know if i can implement it.
 
Last edited by a moderator:
PokeParadox posted on May 30 2006 at 10:56 PM said:
Kounch, do you intend to do something like adaptive clock setting, based on CPU load in the future?

Linux already does this by itself very well. When no process is waiting to be scheduled, it places the processor into LPM WFI, which is a low power mode in which the processor is stopped until an interrupt occurs. Of course, it can only work if the process that is running doesn't sit in a tight loop, but release some cycles back to the OS, such as calls to sleep, usleep, nanosleep, select, etc..
 
Last edited by a moderator:
Is it possible to make the screen fade just before sleeping?

Also you can blink or fade in/out power led. I don't know if it's possible but it may look good. :wub:
 
Back
Top