Andriod SDL lib

I’ve been working with the SDL ‘’ demo which Sam created.

I downloaded and installed it and it ran ok. It’s a good example. It hangs on the Back button in the emulator though (2.3.1).

So I built a second package with my own files and installed it just like the ‘aliens’ example and it works as well. Ok good.

But I noticed that my ‘aliens’ pkg disappeared when I installed my own package and that my own package disappeared when I installed the aliens package.

So then I noticed that both projects were building the exact same package. So I tried changing the package name and then started getting a bunch of errors and eventually just gave up on this.

So then I tried putting all the SDL stuff into an Andiod Libary package. And that went fairly well.

So then I redid the aliens package but removed all the internal SDL stuff and just created references to the andriod SDL library. Again this went fairly well. It all compiles and installs.

Now the only issue is that for whatever reason this new version based on using the SDL lib fails to init OpenGL.

Here’s a bit of the log using the andriod sdl lib:

D/dalvikvm( 525): Shared lib ‘/data/data/com.mydomain.test/lib/’ already loaded in same CL 0x40513218
D/dalvikvm( 525): Trying to load lib /data/data/com.mydomain.test/lib/ 0x40513218
D/dalvikvm( 525): Shared lib ‘/data/data/com.mydomain.test/lib/’ already loaded in same CL 0x40513218
D/dalvikvm( 525): Trying to load lib /data/data/com.mydomain.test/lib/ 0x40513218
D/dalvikvm( 525): Shared lib ‘/data/data/com.mydomain.test/lib/’ already loaded in same CL 0x40513218
I/SDL ( 525): SDL_Android_Init()
V/SDL ( 525): SDL audio: opening device
V/SDL ( 525): SDL audio: wanted mono 8-bit 11.025kHz, 512 frames buffer
V/SDL ( 525): SDL audio: got mono 8-bit 11.025kHz, 512 frames buffer
I/SDL ( 525): [STUB] GL_LoadLibrary
I/SDL ( 525): [STUB] GL_SetSwapInterval
I/SDL ( 525): [STUB] GL_GetSwapInterval
I/ActivityManager( 66): Displayed com.mydomain.test/.MySDLActivity: +3s90ms
W/AudioTrack( 525): obtainBuffer timed out (is the CPU pegged?) 0x2939c0 user=00000600, server=00000400
D/Zygote ( 33): Process 525 terminated by signal (11)
I/ActivityManager( 66): Process com.mydomain.test (pid 525) has died.

It’s getting a SEGV somewhere.
So maybe someone can help me figure out what is happening here so I can get it fully working.

Here is are the links to the lib and the app:

I understand andriod pretty well but I’m fairly new to SDL so go easy if you will.

Thanks a lot,

It’d be helpful if you got a debugger to find the source of the SIGSEGV. I’ve been fiddling with SDL on IOS and there is a reason that SDL 1.3 is considered ALPHA.

Yeah, try and track down the source of the bug in as much detail as possible. Since Sam started his new job, there isn’t an authoritative presence on this board and we’re all just trying to get things working as best we can. More info is good.

Good luck.

Ok, I tried compiling both the library and the app with debugging set true.

But, I run into a problem when I try to package the app:


[apkbuilder] Creating SDLApp-debug-unaligned.apk and signing it with a debug key…
[apkbuilder] Found duplicate file for APK: lib/armeabi/gdbserver
[apkbuilder] Origin 1: /home/greno/build/Android/2.2/my-project/libs/armeabi/gdbserver
[apkbuilder] Origin 2: /home/greno/build/Android/2.2/lib-SDL/libs/armeabi/gdbserver

Does anyone know how to solve this and yet keep the symbols available for both lib and app?


I tried compiling the lib without debugging and the app with debugging but no good:


$ ndk-gdb --start MySDL
GNU gdb 6.6
Copyright © 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for details.
This GDB was configured as “–host=x86_64-linux-gnu --target=arm-elf-linux”.
(no debugging symbols found)
/home/greno/build/Android/2.2/my-project/obj/local/armeabi/gdb.setup:4: Error in sourced command file:
Remote communication error: Connection reset by peer.

And the line it says has an error is this:

target remote :5039

Anybody have any ideas about how to de

After reading a bunch of posts about similar problems one of the Android folks said that error:

Remote communication error: Connection reset by peer.

is due to the process crashing before the debugger gets itself attached.

So the SEGV happens too quickly apparently.

So I guess I’ll try the brute force method of just putting log statements here and there and see if I can determine what is going wrong.