GP2X Hw Accelerated Sdl


Thanks ooPo, this is most helpfull, it means I can insert these libs into the GP2niX release almost imediately. :D

Thanks again payern, you are the equivalent of Jim Morrison in the GP2X relm ;)
 
New update.
README.GP2X has updated info again (it got overwritten at some point)
Fixed problem in surface memory manager - how that ever worked I don't know...
Fixed a rounding error if you specified a width that wasn't a multiple of 8.
Fixed an error in determining scale ratio.
Added a new function to get the screen size as it differs between TV and LCD.

Lemon: Don't know if any of this fixes your problem, let me know if it's still happening.
I'm going to be away until Sunday so I won't be able to fix any problems until then.
 
paeryn posted on Feb 1 2006 at 11:35 PM said:
New update.
README.GP2X has updated info again (it got overwritten at some point)
Fixed problem in surface memory manager - how that ever worked I don't know...
Fixed a rounding error if you specified a width that wasn't a multiple of 8.
Fixed an error in determining scale ratio.
Added a new function to get the screen size as it differs between TV and LCD.

Lemon: Don't know if any of this fixes your problem, let me know if it's still happening.
I'm going to be away until Sunday so I won't be able to fix any problems until then.

Awesome, thanks for the updates. Also, the last update I did addressed the timer lockup so thanks for that also.

I have one more issue remaining and it's probably something I'm doing. After I'm done showing a virtual keyboard I fill the entire screen w/ SDL_FillRect and a color of black and use NULL to do the whole screen (I've tried a rect too). It does seem to fill correctly but I still see the remnants of the virtual keyboard and it flickers. I am doing a flip() after this too. I don't see this when using SWSURFACES.

Any ideas?

~telengard
 
Last edited by a moderator:
paeryn posted on Feb 2 2006 at 05:35 AM said:
Lemon: Don't know if any of this fixes your problem, let me know if it's still happening.
I'm going to be away until Sunday so I won't be able to fix any problems until then.

I'll try it during this weekend.
I compiled plaympeg from the smpeg package, and I found the same problem when playing an mpeg1 video (320x240 so no scaling) with the rightmost column.
Anyway, whan playing a 320x176 (which is then scaled on play to 320x240) it seems to show ok...
 
Last edited by a moderator:
So... how close is this to being general-use ready? I've got a project in the works that I'd love to use this in, but I am having a hard time discerning from the thread comments what works and what doesn't at this point...
 
It seems pretty stable from what I've seen.
I recompiled my game with it and there was a significant speed-up. No major issues other than the lack of ogg and xm sound. Wav effects work great but ogg doesn't play (compiles and runs without segfaulting but just silence)
I may have missed something on getting full sound working though.

On a test porting an SDL game at 640*480 it worked very welll, hardware rescaling of the screen was very nice with an occasional flicker in places but nothing major.

Chimpoid
 
ooPo posted on Feb 3 2006 at 03:14 PM said:
That's strange, ogg playing works fine for me.
First of all, thanks very much for your toolchain building script - so easy to use! But, trying to build my programs, I can't get anything with SDL_mixer to link. Here is my compile command:
Code:
gp2x-g++ -O2 -fomit-frame-pointer *.cpp -o sigpe -static \
  `$GP2XDEV/bin/sdl-config --cflags --libs` \
  -lpthread -lSDL_mixer -lvorbis -lmikmod -lsmpeg -lSDL_image -lpng12 -ljpeg -lz -lSDL

Some of the errors:
Code:
/usr/local/gp2xdev/lib/libmikmod.a(mdriver.o): In function `MD_DropPrivileges':
../playercode/mdriver.c:919: warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/gp2xdev/lib/libSDL_mixer.a(music_ogg.o): In function `OGG_new':
/home/andrew/toolchainGP2X/SDL_mixer-1.2.6/music_ogg.c:74: undefined reference to `ov_open'
/usr/local/gp2xdev/lib/libSDL_mixer.a(music_ogg.o): In function `OGG_new_RW':
/home/andrew/toolchainGP2X/SDL_mixer-1.2.6/music_ogg.c:126: undefined reference to `ov_open_callbacks'
/usr/local/gp2xdev/lib/libSDL_mixer.a(music_ogg.o): In function `OGG_getsome':
/home/andrew/toolchainGP2X/SDL_mixer-1.2.6/music_ogg.c:158: undefined reference to `ov_read'
/home/andrew/toolchainGP2X/SDL_mixer-1.2.6/music_ogg.c:169: undefined reference to `ov_info'

I have had this working in the past with a setup involving open2x compiler chains and theoddbot's libs - the only "error" I had with that setup was the first warning which didn't seem to affect anything.

Am I doing something boneheaded here?
 
Last edited by a moderator:
The 'getpwnam' error can be safely ignored, it has to do with glibc not being fully static even when compiled with -static.

The other errors show you need to link to libvorbisfile and libogg. Try adding '-lvorbisfile -logg' after '-lvorbis'.
 
ooPo posted on Feb 3 2006 at 05:14 PM said:
The 'getpwnam' error can be safely ignored, it has to do with glibc not being fully static even when compiled with -static.

The other errors show you need to link to libvorbisfile and libogg. Try adding '-lvorbisfile -logg' after '-lvorbis'.
I should have said that I'd tried that. I get far more errors, of which here is a sample:

Code:
/usr/local/gp2xdev/lib/libvorbisfile.a(vorbisfile.o): In function `ov_clear':
vorbisfile.c:(.text+0xa8): undefined reference to `vorbis_block_clear'
vorbisfile.c:(.text+0xb0): undefined reference to `vorbis_dsp_clear'
vorbisfile.c:(.text+0x158): undefined reference to `vorbis_info_clear'
vorbisfile.c:(.text+0x164): undefined reference to `vorbis_comment_clear'
/usr/local/gp2xdev/lib/libvorbisfile.a(vorbisfile.o): In function `ov_halfrate_p':
vorbisfile.c:(.text+0x194): undefined reference to `vorbis_synthesis_halfrate_p'
/usr/local/gp2xdev/lib/libvorbisfile.a(vorbisfile.o): In function `ov_halfrate':
vorbisfile.c:(.text+0xbb8): undefined reference to `vorbis_synthesis_halfrate'
vorbisfile.c:(.text+0xc18): undefined reference to `vorbis_synthesis_halfrate'
vorbisfile.c:(.text+0xc50): undefined reference to `vorbis_dsp_clear'
vorbisfile.c:(.text+0xc58): undefined reference to `vorbis_block_clear'

Is there some relevance to the order in which the libs are listed? I have tried them in different orders but without any noticeable change in the results.

Andrew
 
Last edited by a moderator:
Last edited by a moderator:
Just tried the latest version with Quake. Hwsurface doesn't want to work right at the moment, but I think thats down to the way Quake is trying to use the surface and not an actual problem with SDL. Then I tried swsurface - with the old version of SDL quake benchmarks at 11.2 fps, with rlyeh's minilib I was getting 12 fps, and with this new version of SDL I'm getting 12.2 fps :). No problems with palette, scaling, or sound (quake uses normal audio, not sdl_mixer).
 
Hi,

Does anyone have a pre-built version of the HW accelerated sdl libs that I could grab a copy of, please? I'm developing on Windows at the moment, as my Windows HTPC is the fastest box I've got :(
 
critical posted on Feb 4 2006 at 05:53 PM said:
Hi,

Does anyone have a pre-built version of the HW accelerated sdl libs that I could grab a copy of, please? I'm developing on Windows at the moment, as my Windows HTPC is the fastest box I've got :(

Page 9, second post. There's pre-comiled there I think. If not then page 1. Those are the ones I'm using.

Chimpoid
 
Last edited by a moderator:
Just because I hope that this saves someone else some time/effort/hassle...

I downloaded the SDL-1.2.9-GP2X-paeryn.tar.bz2 file and compiled it under WinXP. Here's how I did it. I'll cut out all the mistakes, though. :)

Obviously, I unpacked it.
Then, I ran MINSYS. In MINSYS, I typed the following.
$ cd /d/GP2X/SDL-1.2.9-GP2X-paeryn
$ PATH=$PATH:/d/GP2X/devkitGP2X/bin
$ ./configure --host=arm-linux --disable-shared --prefix=/d/GP2X/devkitGP2X
$ make
$ make install

Then, I was able to re-compile my new GP2X game that I've been working on, and it's quite a bit faster.
 
Hi all,

With reference to my ogg problem, Anyone got any thoughts on why this is happening?
(trimmed for easiness) I'm pretty sure it worked prior to going to HW_SDL.

Code:
#include "SDL_mixer.h"
//references
Mix_Chunk *pop = NULL;
Mix_Music *music = NULL; 
//sdl init
if ( SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO) < 0 ) {
        ComplainAndExit();
    }
//audio init
if(Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 128) < 0) {
	fprintf(stderr, "Unable to initialize audio: %s\n", Mix_GetError());
	exit(1);
}
pop = Mix_LoadWAV("media/audio/pop.wav");
music = Mix_LoadMUS("media/audio/pik.ogg");

Mix_PlayMusic(music, 1); //fails
Mix_PlayChannel(-1, pop, 0); // works

Makefile is:
Code:
LIBS = `$(SDL_BASE)sdl-config --libs`
STATIC_LIBS = -lSDLmain -lSDL_image -lpng12 -ljpeg -lz -lc -lm -lgcc -lSDL_mixer -lvorbisidec -lmikmod -lSDL -lpthread

Have I just done something dumb? (highly likely)

Thanks
Chimpoid
 
Using ooPo's newtoolchain I get sound and music to work with PrBoom. So I did the same benchmark as before with sound and music. Here are the result:
* Without sound or music:
non-optimized: 119.4 FPS
optimized : 185 FPS
* With sound but without music:
non-optimized: 104 FPS
optimized : 162 FPS
* With sound and music
non-optimized: 86 FPS
optimized : 134 FPS
 
Back
Top