The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Huge problems with SDL 2.0 for x86 Android, and SDL archive
Elmar Krieger
Guest

Hi Richard,

many thanks for your reply. I now got one step further and caught the
emulator reproducibly overwriting parts of my application's memory as
soon as the emulation uses OpenGL hardware acceleration, instead of
software rendering.

Since this is such a severe problem, my guess is that this affects my OS
(Linux) only, but not Windows/MacOSX. Am I right that you are using
Windows or MacOSX to develop your application?

Best regards,
Elmar

P.S.: To stevo5800:

Quote:
I just downloaded it on Mac and the emulator it self is slow and it
seems that it uses Quartz now also I get these error message on launch

Quote:
Starting emulator for AVD 'Android4.1'
2012-08-06 12:20:42.500 emulator-arm[25920:f07] Warning once:

'emulator-arm' looks like the normal ARM emulator, not the Intel x86



On 08/06/2012 10:08 PM, Richard Tew wrote:
Quote:
On Tue, Aug 7, 2012 at 3:10 AM, Elmar Krieger wrote:
Quote:
I've 10 years of extensive SDL experience, but my attempt to port my
application to x86 Android (i.e. Android running on Intel's Medfield Atom
CPU) is currently hitting a wall of memory corruption and other problems
already at the very basic level, so that I can't even get a "Hello World"
running.

Before I go into details: Has anyone of you ever successfully built and run
an SDL 2.0 application in one of Intel's two currently available Android
Virtual Devices

"Intel Atom x86 System Image (Intel Corporation) - API Level 10" (Android
2.3)

I am currently running my SDL 2.0 application in the emulator named
above this paragraph. I am also selling it with x86 binaries on the
Android store:

https://play.google.com/store/apps/details?id=org.disinterest.broguex

The sale statistics do not give a breakdown of what architecture is
being used by which installee. The source code to a stripped down
version is here:

https://bitbucket.org/jice/libtcod

If you compile the modified version of the SDL2 Android starter
project which comes with that, then it should work for you. I don't
believe it is set up to compile x86 by default, but you know how to do
that. If it doesn't work.. then I imagine that something is wrong
with your environment. Note that I am using revision efd48af40ec3,
just because I am too lazy to merge. My only modifications are the
currently outstanding Android keyboard patch in bugzilla, as the
existing keyboard mapping is very limited and insufficient for normal
keyboard use.

Hope this helps! :-)

Cheers,
Richard.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


--
Elmar Krieger, PhD
YASARA Biosciences GmbH & CMBI Outstation Austria
Wagramer Strasse 25/3/45
1220 Vienna
Austria/Europe
www.YASARA.org
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Re: Huge problems with SDL 2.0 for x86 Android, and SDL arch
stevo5800


Joined: 30 Jun 2012
Posts: 49
So I would just need to download x86 emulator?

And I'm running on mac but I don't have SDL running yet just the examples the SDK came with would you know the steps to getting SDL off the ground?

What I've done so fare is download the Android mac SDK, then Eclipse Mobile and installed the add ons. I comment out the 3 errors from SDL and compiled it with ./configure then make then sudo make install and everything seems to be in the local directory compiled no errors. Then in Eclipse I Create project from existing source and select the android-project folder that was in SDL SDK from mercurial. Not sure if I need more files or I'm not linking SDL? Maybe you would know the steps to settings this environment?

not really in a hurry to get this going but would be nice I'm still working on iOS app but gonna port it to Android as soon as I'm done figured it wouldn't be a bad idea having a bit of practice

Elmar Krieger wrote:
Hi Richard,

many thanks for your reply. I now got one step further and caught the
emulator reproducibly overwriting parts of my application's memory as
soon as the emulation uses OpenGL hardware acceleration, instead of
software rendering.

Since this is such a severe problem, my guess is that this affects my OS
(Linux) only, but not Windows/MacOSX. Am I right that you are using
Windows or MacOSX to develop your application?

Best regards,
Elmar

P.S.: To stevo5800:

Quote:
I just downloaded it on Mac and the emulator it self is slow and it
seems that it uses Quartz now also I get these error message on launch

Quote:
Starting emulator for AVD 'Android4.1'
2012-08-06 12:20:42.500 emulator-arm[25920:f07] Warning once:

'emulator-arm' looks like the normal ARM emulator, not the Intel x86



On 08/06/2012 10:08 PM, Richard Tew wrote:
Quote:
On Tue, Aug 7, 2012 at 3:10 AM, Elmar Krieger wrote:
Quote:
I've 10 years of extensive SDL experience, but my attempt to port my
application to x86 Android (i.e. Android running on Intel's Medfield Atom
CPU) is currently hitting a wall of memory corruption and other problems
already at the very basic level, so that I can't even get a "Hello World"
running.

Before I go into details: Has anyone of you ever successfully built and run
an SDL 2.0 application in one of Intel's two currently available Android
Virtual Devices

"Intel Atom x86 System Image (Intel Corporation) - API Level 10" (Android
2.3)

I am currently running my SDL 2.0 application in the emulator named
above this paragraph. I am also selling it with x86 binaries on the
Android store:

https://play.google.com/store/apps/details?id=org.disinterest.broguex

The sale statistics do not give a breakdown of what architecture is
being used by which installee. The source code to a stripped down
version is here:

https://bitbucket.org/jice/libtcod

If you compile the modified version of the SDL2 Android starter
project which comes with that, then it should work for you. I don't
believe it is set up to compile x86 by default, but you know how to do
that. If it doesn't work.. then I imagine that something is wrong
with your environment. Note that I am using revision efd48af40ec3,
just because I am too lazy to merge. My only modifications are the
currently outstanding Android keyboard patch in bugzilla, as the
existing keyboard mapping is very limited and insufficient for normal
keyboard use.

Hope this helps! :-)

Cheers,
Richard.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


--
Elmar Krieger, PhD
YASARA Biosciences GmbH & CMBI Outstation Austria
Wagramer Strasse 25/3/45
1220 Vienna
Austria/Europe
www.YASARA.org
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Re: Huge problems with SDL 2.0 for x86 Android, and SDL arch
stevo5800


Joined: 30 Jun 2012
Posts: 49
ok nvm got this working now

here are my steps for future reference and I'm using OXS 10.8

download latest SDL from mercurial(got 3 errors and just comment them out and builds fine)

Step 1

Download latest Android SDK package
Download latest NDK package
Download Eclipse Mobile

-extract all the downloads above
-access the Android-SDK folder from command prompt and change to the tools directory then type ./android
-the SDL tool should come up and you will be able to install the tool and additional SDK/API package check mark all the ones you want to install

-once you extract Eclipse you can run it then follow the steps from the webpage bellow to install the Android plugin
-steps to install Eclipse plugin http://developer.android.com/sdk/installing/installing-adt.html required for Android development
-Once you have Eclipse installed with new plugin you will need to tell the directory of the Android-SDK(wherever you saved it)

Step 2:

if you don't already have SDL on your system

in command console type

hg clone http://hg.libsdl.org/SDL
cd ./SDL (or where ever you saved the SDL folder from mercurial)
./configure
make
sudo make install

this will install SDL on your system

Step 3:
-then copy the android-project folder somewhere else found in SDL folder
-add a c or cpp files in the <project>/jni/src directory
-modify the Android.mk file in <project>/jni/src directory to point to your newly created c or cpp file
-Copy the entire SDL folder into the <project>/jni folder
-delete the android-project folder from the newly copied SDL folder
-you can also add data folder for your data in <project>/jni folder

note if you want to add SDL_Mixer, SDL_image, SDL_ttf or SDL_net the steps are the same just add the entire folder in the <project>/jni folder

then modify the Android.mk file in <project>/jni/src directory

example Android.mk file

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := main

SDL_PATH := ../SDL

LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/$(SDL_PATH)/include \
$(LOCAL_PATH)/../SDL_image \
$(LOCAL_PATH)/../SDL_mixer \
$(LOCAL_PATH)/../SDL_ttf

# Add any compilation flags for your project here...
LOCAL_CFLAGS := \
-DPLAY_MOD

# Add your application source files here...
LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.cpp \
YourProjectFile.c

LOCAL_SHARED_LIBRARIES := SDL SDL_image SDL_mixer SDL_ttf

LOCAL_LDLIBS := -lGLESv1_CM -llog

include $(BUILD_SHARED_LIBRARY)


Step 4:

-In Eclipse go to File>New>Other then select Android Project From Existing Code
-Then pick the android-project folder
-You might get something like saying that its missing a build path
-expand the project and select project.properties and add target=android-16(API-16 seems to be the latest one note API 4 did not work for me) or what ever target you downloaded pretty sure you will need API 7 or up to compile OpenGL ES 2.0 after that the errors should go away
-dont run nothing yet
-if you happen to run it, it will crash just make sure to clean the project next time you go to run it

Step 5:

-I renamed the Android-NDK folder to ndk then copy is to the android-project(your project folder)
-Command prompt and change directory to the newly copied ndk folder then type ./ndk-build
-Might take a few minutes since its gonna compile the entire SDL library
-Once succeeded then just go back the Eclipse and run your project


stevo5800 wrote:
So I would just need to download x86 emulator?

And I'm running on mac but I don't have SDL running yet just the examples the SDK came with would you know the steps to getting SDL off the ground?

What I've done so fare is download the Android mac SDK, then Eclipse Mobile and installed the add ons. I comment out the 3 errors from SDL and compiled it with ./configure then make then sudo make install and everything seems to be in the local directory compiled no errors. Then in Eclipse I Create project from existing source and select the android-project folder that was in SDL SDK from mercurial. Not sure if I need more files or I'm not linking SDL? Maybe you would know the steps to settings this environment?

not really in a hurry to get this going but would be nice I'm still working on iOS app but gonna port it to Android as soon as I'm done figured it wouldn't be a bad idea having a bit of practice

Elmar Krieger wrote:
Hi Richard,

many thanks for your reply. I now got one step further and caught the
emulator reproducibly overwriting parts of my application's memory as
soon as the emulation uses OpenGL hardware acceleration, instead of
software rendering.

Since this is such a severe problem, my guess is that this affects my OS
(Linux) only, but not Windows/MacOSX. Am I right that you are using
Windows or MacOSX to develop your application?

Best regards,
Elmar

P.S.: To stevo5800:

Quote:
I just downloaded it on Mac and the emulator it self is slow and it
seems that it uses Quartz now also I get these error message on launch

Quote:
Starting emulator for AVD 'Android4.1'
2012-08-06 12:20:42.500 emulator-arm[25920:f07] Warning once:

'emulator-arm' looks like the normal ARM emulator, not the Intel x86



On 08/06/2012 10:08 PM, Richard Tew wrote:
Quote:
On Tue, Aug 7, 2012 at 3:10 AM, Elmar Krieger wrote:
Quote:
I've 10 years of extensive SDL experience, but my attempt to port my
application to x86 Android (i.e. Android running on Intel's Medfield Atom
CPU) is currently hitting a wall of memory corruption and other problems
already at the very basic level, so that I can't even get a "Hello World"
running.

Before I go into details: Has anyone of you ever successfully built and run
an SDL 2.0 application in one of Intel's two currently available Android
Virtual Devices

"Intel Atom x86 System Image (Intel Corporation) - API Level 10" (Android
2.3)

I am currently running my SDL 2.0 application in the emulator named
above this paragraph. I am also selling it with x86 binaries on the
Android store:

https://play.google.com/store/apps/details?id=org.disinterest.broguex

The sale statistics do not give a breakdown of what architecture is
being used by which installee. The source code to a stripped down
version is here:

https://bitbucket.org/jice/libtcod

If you compile the modified version of the SDL2 Android starter
project which comes with that, then it should work for you. I don't
believe it is set up to compile x86 by default, but you know how to do
that. If it doesn't work.. then I imagine that something is wrong
with your environment. Note that I am using revision efd48af40ec3,
just because I am too lazy to merge. My only modifications are the
currently outstanding Android keyboard patch in bugzilla, as the
existing keyboard mapping is very limited and insufficient for normal
keyboard use.

Hope this helps! :-)

Cheers,
Richard.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


--
Elmar Krieger, PhD
YASARA Biosciences GmbH & CMBI Outstation Austria
Wagramer Strasse 25/3/45
1220 Vienna
Austria/Europe
www.YASARA.org
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Huge problems with SDL 2.0 for x86 Android, and SDL archive
Elmar Krieger
Guest

Hi Steven,

Quote:
And I'm running on mac but I don't have SDL running yet just the
examples the SDK came with would you know the steps to getting SDL off
the ground?

I'm using Linux only, and no Eclipse. I just followed the instructions
in sdl-2.0.0/README.android, and this worked out of the box.

Quote:
So I would just need to download x86 emulator?

The x86 emulator is only for the new Intel Medfield Atom x86 CPU, which
is sort of a niche in Android:

http://www.anandtech.com/show/5770/lava-xolo-x900-review-the-first-intel-medfield-phone/

If you want to port your app from iOS, then just stay with normal ARM
CPU based Android for the moment.


BTW, in the mean time I could confirm the massive memory corruption on
two computers with nVIDIA and AMD cards, and in both cases it
disappeared when hardware acceleration was disabled. So this is not an
SDL problem, but the Android emulator OpenGL acceleration is broken (at
least in Linux). So while it is tempting to use accelerated OpenGL ES
2.0 in the emulator, it seems like software OpenGL ES 1.0 rendering is
all we get at the moment. I reported the problem to Intel here:

http://software.intel.com/en-us/forums/showthread.php?t=107090

(Maybe Intel one day posts a solution there...)


Best regards,
Elmar


On 08/07/2012 02:03 AM, stevo5800 wrote:
Quote:
So I would just need to download x86 emulator?

And I'm running on mac but I don't have SDL running yet just the
examples the SDK came with would you know the steps to getting SDL off
the ground?

What I've done so fare is download the Android mac SDK, then Eclipse
Mobile and installed the add ons. I comment out the 3 errors from SDL
and compiled it with ./configure then make then sudo make install and
everything seems to be in the local directory compiled no errors. Then
in Eclipse I Create project from existing source and select the
android-project folder that was in SDL SDK from mercurial. Not sure if I
need more files or I'm not linking SDL? Maybe you would know the steps
to settings this environment?

not really in a hurry to get this going but would be nice I'm still
working on iOS app but gonna port it to Android as soon as I'm done
figured it wouldn't be a bad idea having a bit of practice



Elmar Krieger wrote:


Hi Richard,

many thanks for your reply. I now got one step further and caught the
emulator reproducibly overwriting parts of my application's memory as
soon as the emulation uses OpenGL hardware acceleration, instead of
software rendering.

Since this is such a severe problem, my guess is that this affects my OS
(Linux) only, but not Windows/MacOSX. Am I right that you are using
Windows or MacOSX to develop your application?

Best regards,
Elmar

P.S.: To stevo5800:



Quote:


I just downloaded it on Mac and the emulator it self is slow and it
seems that it uses Quartz now also I get these error message on launch






_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org