PaulsCode Forum

Mupen64Plus AE => General Discussion => Topic started by: Paul on April 15, 2013, 01:56:06 PM

Title: All Testers -- SDL 2.0 Upgrade!
Post by: Paul on April 15, 2013, 01:56:06 PM
Littleguy added compatibility for SDL 2.0.  This is a major update, and we now need all testers to help identify any problems.  Spread the word among your friends and networks!

Please provide feedback on performance and compatibility.  In particular, we are interested in results from older devices, devices that have performance issues like the Galaxy S3 US version, and devices with unique rendering problems like the Droid Razr.

SDL 2 Test A (http://www.paulscode.com/source/Mupen64Plus-AE/15APR2013/mupen64plus-sdl2.apk)

SDL 2 Test B (http://www.paulscode.com/source/Mupen64Plus-AE/16APR2013/mupen64plus-sdl2.apk)

SDL 2 Test C (http://www.paulscode.com/source/Mupen64Plus-AE/16APR2013/mupen64plus-sdl2.apk)

SDL 2 Test D (http://www.paulscode.com/source/Mupen64Plus-AE/02MAY2013/mupen64plus-ae.apk)
Title: Re: All Testers -- SDL 2.0 Upgrade!
Post by: Pau on April 15, 2013, 02:16:14 PM
You manifest minsdkversion and the jni APP_PLATFORM is wrong. The SDL2 Android readme says that the correct setting has to be at least 10 and not 5 and 9 (which is wrong from the beginning because they have conflicting values with minsdk 5 < platform 9)
Title: Re: All Testers -- SDL 2.0 Upgrade!
Post by: Paul on April 15, 2013, 02:47:29 PM
It's not strictly incorrect to have minsdk less than 10, depending on if those API level 10 features are used by the app or not.  Before changing anything, I would like to see if it crashes on these devices, because there is still a non-trivial percentage of Mupen64Plus AE users with pre-2.3.3.

As for the question of APP_PLATFORM, it has been sitting at 9 for some time, and never caused any problems.  I would have to do some research to see what the implications are (the fact that Eclipse or ant do not fail when minSDK is less than APP_PLATFORM would lead me to believe this is not necessarily an error).
Title: Re: All Testers -- SDL 2.0 Upgrade!
Post by: littleguy on April 15, 2013, 05:38:00 PM
It's not strictly an error if you're sure about what you're doing.  SDK 9 is required only on the native side, only to build the special library for the Xperia PLAY touchpad.  If you were to exclude that library from the build you could build everything for SDK 5.  I.e. we're not using any APIs above 5 anywhere else in the native code.  If SDL 2 truly requires API 10 then it just wouldn't build, plain and simple.

I'm not sure why the SDL2 readme says that API 10 is needed, but the Java Android code provided with SDL 2 is just a hello world example and we're not using it.  We are using some higher APIs in the Java code but the version is always run-time tested before executing any of that code.

Edit: Also, only in the latest NDK (8e) does ndk-build even throw a warning about API mismatch between native and java side.

Edit2: Ok, I tried my own suggestion and you're right, SDL 2 does require platform-9 for EGL headers (though it seems only for some macro constants).

As Paul said, let's see if anyone with a pre-2.3.3 device can run it before throwing in the towel.
Title: Re: All Testers -- SDL 2.0 Upgrade!
Post by: littleguy on April 15, 2013, 06:05:18 PM
Well now you piqued my curiosity.  SDL2's dependency on platform-9 comes down to just a few constants defined in egl.h
Code: [Select]
#define EGL_BUFFER_SIZE         0x3020
#define EGL_ALPHA_SIZE          0x3021
#define EGL_BLUE_SIZE           0x3022
#define EGL_GREEN_SIZE          0x3023
#define EGL_RED_SIZE            0x3024
#define EGL_DEPTH_SIZE          0x3025
#define EGL_STENCIL_SIZE        0x3026
#define EGL_SAMPLES             0x3031
#define EGL_SAMPLE_BUFFERS      0x3032
#define EGL_NONE                0x3038
#define EGL_RENDERABLE_TYPE     0x3040
#define EGL_OPENGL_ES_BIT       0x0001
#define EGL_OPENGL_ES2_BIT      0x0004

If you cut and paste those into SDL_android.cpp in place of #include <EGL/egl.h> the whole thing builds with platform-5 (excluding the xperia play library of course).  Not saying we should do that, just wanted to make a clarification about how thin SDL2's dependency is on platform-9.
Title: Re: All Testers -- SDL 2.0 Upgrade!
Post by: littleguy on April 15, 2013, 09:49:26 PM
Just discovered that the gl context is not being created properly on my xperia play.  It's the new sdl interface that allows sdl to specify the configuration (GameSurface.createGLContext( int majorVersion, int minorVersion, int[] configSpec )... apparently my device isn't happy with what SDL is requesting.  Have to look into that tomorrow....
Title: Re: All Testers -- SDL 2.0 Upgrade!
Post by: WinSuk on April 16, 2013, 03:12:13 AM
Android 2.2.2 (on a Motorola Flipside): On-screen controller is shown for a bit, then it backs out to the Play screen.

Log: https://dl.dropboxusercontent.com/u/1077120/mupentesting/froyosdl2log.txt
Title: Re: All Testers -- SDL 2.0 Upgrade!
Post by: littleguy on April 16, 2013, 06:13:05 AM
Very similar to my issue, but possibly a different cause.  I remembered late last night that I forgot to make one other change in the java side when migrating to SDL 2.0 (forgot to cherry pick a commit from one of my experimental branches).  I'll try to have an update tonight.  In the meantime, this is still a worthwhile test for folks to run if they can get past the loading stage.
Title: Re: All Testers -- SDL 2.0 Upgrade!
Post by: littleguy on April 16, 2013, 09:10:06 AM
Ok I fixed the crash on my xperia play, and may have fixed winsuk's crash as well.

Paul - Ready to go for round 2 of testing.
Title: Re: All Testers -- SDL 2.0 Upgrade!
Post by: Paul on April 16, 2013, 09:55:20 AM
Here is the updated version (as of commit 3f7b8d6902 (https://github.com/paulscode/mupen64plus-ae/commit/3f7b8d69026fed7d3ec870f49d48c3d7856828f8)):

SDL 2 Test B (http://www.paulscode.com/source/Mupen64Plus-AE/16APR2013/mupen64plus-sdl2.apk)
Title: Re: All Testers -- SDL 2.0 Upgrade!
Post by: WinSuk on April 16, 2013, 08:47:06 PM
Nope, that didn't fix it..

Log again if needed: https://dl.dropboxusercontent.com/u/1077120/mupentesting/froyosdl2log2.txt
Title: Re: All Testers -- SDL 2.0 Upgrade!
Post by: littleguy on April 16, 2013, 08:56:55 PM
Thanks much for the log.  Here's the key section, looks like we can't get a valid rendering context, even with the fallback I added:

Code: [Select]
04-16 18:42:19.147  6198  6833 D gles2n64: Initializing SDL video subsystem...
04-16 18:42:19.147  6198  6833 D gles2n64: Setting video mode 480x320...
04-16 18:42:19.147  6198  6833 V GameSurface: Starting up OpenGL ES 2.0
04-16 18:42:19.147  6198  6833 D libEGL  : loaded /system/lib/egl/libGLES_android.so
04-16 18:42:19.155  6198  6833 D libEGL  : loaded /system/lib/egl/libEGL_POWERVR_SGX530_121.so
04-16 18:42:19.163  6198  6833 D libEGL  : loaded /system/lib/egl/libGLESv1_CM_POWERVR_SGX530_121.so
04-16 18:42:19.170  6198  6833 D libEGL  : loaded /system/lib/egl/libGLESv2_POWERVR_SGX530_121.so
04-16 18:42:19.225  6198  6833 E GameSurface: Couldn't create EGL window surface
04-16 18:42:19.225  6198  6833 W CoreInterfaceNative: Retrying GL context creation without EGL_BUFFER_SIZE=0
04-16 18:42:19.225  6198  6833 V GameSurface: Starting up OpenGL ES 2.0
04-16 18:42:19.241  6198  6833 E GameSurface: Couldn't create EGL window surface
04-16 18:42:19.241  6198  6833 V GameSurface: Starting up OpenGL ES 1.1
04-16 18:42:19.256  6198  6833 E GameSurface: Couldn't create EGL window surface
04-16 18:42:19.256  6198  6833 W CoreInterfaceNative: Retrying GL context creation without EGL_BUFFER_SIZE=0
04-16 18:42:19.256  6198  6833 V GameSurface: Starting up OpenGL ES 1.1
04-16 18:42:19.272  6198  6833 E GameSurface: Couldn't create EGL window surface
04-16 18:42:19.272  6198  6833 D gles2n64: Problem setting videomode 480x320: No hardware accelerated renderers available
...
04-16 18:42:21.920  6198  6833 E libEGL  : call to OpenGL ES API with no current context (logged once per thread)
04-16 18:42:21.920  6198  6833 E libEGL  : call to OpenGL ES API with no current context (logged once per thread)
04-16 18:42:21.920  6198  6833 E libEGL  : call to OpenGL ES API with no current context (logged once per thread)
(etc...)
Title: Re: All Testers -- SDL 2.0 Upgrade!
Post by: WinSuk on April 16, 2013, 10:09:23 PM
Just tried it on a different phone (HTC Aria) with CyanogenMod 6 (Android 2.2.1), and it works fine there. Doesn't seem to be using the fallback either ("Retrying GL context creation without EGL_BUFFER_SIZE=0" isn't in the log like it is on the Flipside)

I was hoping CyanogenMod would have more debugging output if it failed..

Probably won't help much, but here's the log anyway :) https://dl.dropboxusercontent.com/u/1077120/mupentesting/froyosdl2logliberty.txt
Title: Re: All Testers -- SDL 2.0 Upgrade!
Post by: littleguy on April 16, 2013, 10:19:06 PM
Thanks for all the testing.  I just pushed another change, which adds a deeper fallback if the first fallback fails.  I'll be really surprised if this doesn't fix the problem.

Paul - ready when you are.  Sorry to give you so much work  :-[
Title: Re: All Testers -- SDL 2.0 Upgrade!
Post by: Paul on April 16, 2013, 10:56:03 PM
No problem, you are doing the work.  I'm just building :)

I'll post the next test in the morning.
Title: Re: All Testers -- SDL 2.0 Upgrade!
Post by: Paul on April 17, 2013, 09:03:59 AM
Here is the updated version (as of commit da92b9aaea (https://github.com/paulscode/mupen64plus-ae/commit/da92b9aaeadd6a9e5e38a9d863601cc162930d30)):

SDL 2 Test C (http://www.paulscode.com/source/Mupen64Plus-AE/17APR2013/mupen64plus-sdl2.apk)
Title: Re: All Testers -- SDL 2.0 Upgrade!
Post by: WinSuk on April 17, 2013, 05:46:56 PM
Works again :)

Code: [Select]
04-17 15:44:02.069  7844  7897 E GameSurface: Couldn't create EGL window surface
04-17 15:44:02.069  7844  7897 W CoreInterfaceNative: Retrying GL context creation without EGL_BUFFER_SIZE=0
04-17 15:44:02.069  7844  7897 V GameSurface: Starting up OpenGL ES 2.0
04-17 15:44:02.085  7844  7897 E GameSurface: Couldn't create EGL window surface
04-17 15:44:02.085  7844  7897 W CoreInterfaceNative: Retrying GL context creation using legacy settings
04-17 15:44:02.085  7844  7897 V GameSurface: Starting up OpenGL ES 2.0
04-17 15:44:02.108  7844  7897 I SDL     : [STUB] GL_SetSwapInterval
04-17 15:44:02.116  7844  7897 I SDL     : [STUB] GL_GetSwapInterval
Title: Re: All Testers -- SDL 2.0 Upgrade!
Post by: littleguy on April 23, 2013, 10:30:31 AM
Paul - I suggest we publish version 2.2.1 (current master, with SDL 1.3), since there are a few bugfixes and controller fixes.

Then we may as well go ahead and merge this to master.  I feel a little stalled right now because there are three major branches (master, sdl2, and glide) and any more branches would really complicate things.  Worst case scenario, we can always compile with SDL 1.3 even after the merge by changing just a few lines of code (makefile and lib loading in java).  (The only drawback is that including both versions increases the APK size.)  No rush to publish the merged version, but when we do I suggest we bump the version to 2.3.0.
Title: Re: All Testers -- SDL 2.0 Upgrade!
Post by: Paul on April 23, 2013, 11:15:50 AM
Sounds good.  I'll have time to publish 2.2.1 tomorrow.  Then we can merge sdl2 into master to help simplify the maze of branches.  ;D
Title: Re: All Testers -- SDL 2.0 Upgrade!
Post by: littleguy on April 23, 2013, 11:52:37 AM
I renamed the 'glide-sdl2' branch 'glide' and dropped the original 'glide' branch.  If anyone wants to use glide and SDL 1.3 they can just branch from an earlier commit... no need to keep a branch hanging around just for that.
Title: Re: All Testers -- SDL 2.0 Upgrade!
Post by: Paul on May 02, 2013, 04:05:32 PM
Here is the latest SDL2 test build (from head revision on master branch):

SDL 2 Test D (http://www.paulscode.com/source/Mupen64Plus-AE/02MAY2013/mupen64plus-ae.apk)
Title: Re: All Testers -- SDL 2.0 Upgrade!
Post by: layzer253 on May 20, 2013, 11:58:01 PM
The google play version barely gave me over 10fps on my T-mo SGS4, running cm10.1 Version D you have posted has greatly improved my minimum framerate, but it still experiences frame drops. Keep up the good work!