GP2X High Battery Usage


JonHolland

Still Fresh
Joined
Dec 17, 2006
Messages
26
I've found that the few small programs I've written for the GP2x require a fully charged battery or the AC adapter to run, otherwise they just go to a black screen.

However, programs such as SquidgeSnes and the menu run just fine with a low battery.

Is this from using SDL? I'm talking about a program that initilizes SDL, and then waits for an event, and nothing else and it still needs fully charged batteries.
 
There's nothing wrong with SDL (the menu is written using it, and so are most other apps), unless you just happen to have found a very strange lib somewhere.
 
are you somehow overclocking without meaning to? also what does your polling code look like? using something similar to what's in the wiki, i haven't had that problem.

SDL_Event event;
while(SDL_PollEvent(&event))

etc...

also, when you say, go to a black screen, do you mean you lose the display or the program halts completely? if you aren't doing so already, i'd recommend logging into the gp2x via telnet over the usb cable, then running your programs from there. that way you get to see the console output. but if you're already doing that then i apologize :/
 
rokdcasbah posted on Dec 24 2006 at 11:40 AM said:
are you somehow overclocking without meaning to? also what does your polling code look like? using something similar to what's in the wiki, i haven't had that problem.

SDL_Event event;
while(SDL_PollEvent(&event))

Yes, exactly like that.

also, when you say, go to a black screen, do you mean you lose the display or the program halts completely? if you aren't doing so already, i'd recommend logging into the gp2x via telnet over the usb cable, then running your programs from there. that way you get to see the console output. but if you're already doing that then i apologize :/

My buddy has the Gp2x so I can't always be there to test stuff, but he does use the console. I'll have to ask him if it locks teh unit or just dumps back to the console
 
Last edited by a moderator:
unless you're calling the program with a script that executes the gp2x menu after the program exits, it's just going to look frozen when it's done, because even though linux is running, you don't have a way of seeing the console on the screen. whatever the last thing you sent to the screen was stays there until you run another program.

but you said the screen is black, which makes things a little more mysterious.

in any case, you'll want these:
http://archive.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,15,1473 (linux)
http://archive.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,15,1290 (windows)

they are the drivers so that you can use ethernet over usb with the gp2x. then you just treat it like a network device. this doesn't mean you'll always know exactly what's going on, but it's a start.

also it gives you some neat options like sending data to the output stream (values of variables, keys pressed, whatever) for debugging. like a sweet dual screen setup. except one runs on AA batteries so you can't leave it on while you're coding :)
 
rokdcasbah posted on Dec 24 2006 at 12:04 PM said:
unless you're calling the program with a script that executes the gp2x menu after the program exits, it's just going to look frozen when it's done, because even though linux is running, you don't have a way of seeing the console on the screen. whatever the last thing you sent to the screen was stays there until you run another program.

but you said the screen is black, which makes things a little more mysterious.

in any case, you'll want these:
http://archive.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,15,1473 (linux)
http://archive.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,15,1290 (windows)

they are the drivers so that you can use ethernet over usb with the gp2x. then you just treat it like a network device. this doesn't mean you'll always know exactly what's going on, but it's a start.

also it gives you some neat options like sending data to the output stream (values of variables, keys pressed, whatever) for debugging. like a sweet dual screen setup. except one runs on AA batteries so you can't leave it on while you're coding :)

The menu is executed upon shutdown, the program is obviously hanging when the batteries are too low. The black screen makes me think it is after initializing SDL.
 
Last edited by a moderator:
gotcha. sorry if i seemed patronizing but i'm a beginner so i can only talk about the little bit that i know. i was just hoping that i could help a little but it's going to take someone who knows more. hope you get it sorted out soon...debugging by means of your friend is gonna be a pain either way :)
 
Back
Top