We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2134

Summary: [Android] Black screen after resume (sometimes)
Product: SDL Reporter: Martin Gerhardy <martin.gerhardy>
Component: *don't know*Assignee: Gabriel Jacobo <gabomdq>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: critical    
Priority: P2 CC: frankinshtein85, gabomdq
Version: HG 2.0   
Hardware: ARM   
OS: Android (All)   

Description Martin Gerhardy 2013-10-06 11:04:21 UTC
Hi,

I get the following in my logs - the libEGL error log looks like it might be the cause of it. But I'm not sure. The problem is that SDL does not render anything to the screen after a resume (this does not happen always). Input and sound is working as expected. I can even here my touch sounds and can go through the ui. I just can't see it.

V/SDL     (14728): onPause()
E/libEGL  (14728): call to OpenGL ES API with no current context (logged once per thread)
V/SDL     (14728): nativePause()
V/SDL     (14728): onWindowFocusChanged(): false
V/SDL     (14728): surfaceDestroyed()
I/ActivityManager(  435): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.foobar/.FooBar} from pid 769
V/SDL     (14728): onResume()
V/SDL     (14728): surfaceCreated()
V/SDL     (14728): surfaceChanged()
V/SDL     (14728): pixel format RGB_565
V/SDL     (14728): Window size:1280x736
V/SDL     (14728): onWindowFocusChanged(): true
V/SDL     (14728): nativeResume()
Comment 1 Martin Gerhardy 2013-10-06 11:07:48 UTC
oh. as a note. I'm using the latest hg from today. But i already noticed this problem a few days ago. Might be related to the egl backend code.
Comment 2 Gabriel Jacobo 2013-10-06 13:05:55 UTC
As I mentioned on the list, I've tried reproducing this on my app (uses both SDL_Render* and OpenGL calls), tried rotating, locking, going to home, etc, it seems to hold up fine. This is on a Android 4.3 Nexus 4

The EGL error is harmless AFAIK.

Please update with more information, see if you can debug the issue. Thanks!
Comment 3 dmuratshin 2013-10-08 21:05:56 UTC
latest hg,
repro rate 100%, could be reproduced with testgles.c
critical bug :(
Comment 4 Gabriel Jacobo 2013-10-09 14:38:05 UTC
I can reproduce a problem (not sure if it's the same Martin is having) with testgles, so expect a fix any day now :)
Comment 5 Gabriel Jacobo 2013-10-10 03:30:43 UTC
Should be fixed here: http://hg.libsdl.org/SDL/rev/6acc7df4a175