Here’s what I get when BLOCK_ON_PAUSE is 1:
03-29 12:22:31.844: W/SDL/APP(12394): Pump
03-29 12:22:31.860: W/SDL/APP(12394): Pump
03-29 12:22:31.875: W/SDL/APP(12394): Pump
03-29 12:22:31.899: W/SDL/APP(12394): Pump
03-29 12:22:31.907: V/SDL(12394): surfaceDestroyed()
03-29 12:22:31.907: W/SDL/APP(12394): nativePause
03-29 12:22:31.907: W/SDL/APP(12394): Android_Window
03-29 12:22:31.907: W/SDL/APP(12394): Post PauseSem
03-29 12:22:31.907: W/SDL/APP(12394): Sending pause events
03-29 12:22:31.954: W/SDL/APP(12394): Pump
03-29 12:22:31.954: D/OpenGLRenderer(12394): Flushing caches (mode 0)
03-29 12:22:31.954: W/SDL/APP(12394): Pausing
03-29 12:22:31.954: E/APPLICATION(12394): SDL_WINDOWEVENT_SIZE_CHANGED
03-29 12:22:31.954: W/SDL/APP(12394): Pump
03-29 12:22:31.954: W/SDL/APP(12394): Pausing
03-29 12:22:31.954: E/APPLICATION(12394): SDL_WINDOWEVENT_FOCUS_LOST
03-29 12:22:31.954: W/SDL/APP(12394): Pump
03-29 12:22:31.954: W/SDL/APP(12394): Pausing
03-29 12:22:31.954: E/APPLICATION(12394): SDL_WINDOWEVENT_MINIMIZED
03-29 12:22:31.961: W/SDL/APP(12394): Pump
03-29 12:22:31.961: W/SDL/APP(12394): Pausing
03-29 12:22:32.079: W/SDL/APP(12394): Pump
03-29 12:22:32.079: W/SDL/APP(12394): isPaused && !isPausing
03-29 12:22:32.086: D/OpenGLRenderer(12394): Flushing caches (mode 1)
Then it blocks and is in the background…
When I resume…
03-29 12:22:50.602: V/SDL(12394): surfaceCreated()
03-29 12:22:50.633: V/SDL(12394): surfaceChanged()
03-29 12:22:50.633: V/SDL(12394): pixel format RGB_565
03-29 12:22:50.633: V/SDL(12394): Window size:800x1280
Then nothing else. Black screen, no input response.
With BLOCK_ON_PAUSE set to 0, the same sort of thing happens. When the app
is paused, it repeats Pump, isPaused, and this queue error continually.
Then it does this on resume:
03-29 12:25:56.711: W/SDL/APP(12790): Pump
03-29 12:25:56.711: W/SDL/APP(12790): isPaused
03-29 12:25:56.711: E/SurfaceTextureClient(12790): queueBuffer: error
queuing buffer to SurfaceTexture, -19
03-29 12:25:56.719: W/SDL/APP(12790): Pump
03-29 12:25:56.719: W/SDL/APP(12790): isPaused
03-29 12:25:56.727: E/SurfaceTextureClient(12790): queueBuffer: error
queuing buffer to SurfaceTexture, -19
03-29 12:25:56.735: W/SDL/APP(12790): Pump
03-29 12:25:56.735: W/SDL/APP(12790): isPaused
03-29 12:25:56.743: E/SurfaceTextureClient(12790): queueBuffer: error
queuing buffer to SurfaceTexture, -19
03-29 12:25:56.750: V/SDL(12790): surfaceCreated()
03-29 12:25:56.758: W/SDL/APP(12790): Pump
03-29 12:25:56.758: W/SDL/APP(12790): isPaused
03-29 12:25:56.758: E/SurfaceTextureClient(12790): queueBuffer: error
queuing buffer to SurfaceTexture, -19
03-29 12:25:56.766: W/SDL/APP(12790): Pump
03-29 12:25:56.766: W/SDL/APP(12790): isPaused
03-29 12:25:56.766: E/SurfaceTextureClient(12790): queueBuffer: error
queuing buffer to SurfaceTexture, -19
03-29 12:25:56.782: W/SDL/APP(12790): Pump
03-29 12:25:56.782: W/SDL/APP(12790): isPaused
03-29 12:25:56.782: E/SurfaceTextureClient(12790): queueBuffer: error
queuing buffer to SurfaceTexture, -19
03-29 12:25:56.790: V/SDL(12790): surfaceChanged()
03-29 12:25:56.790: V/SDL(12790): pixel format RGB_565
03-29 12:25:56.790: V/SDL(12790): Window size:800x1280
03-29 12:25:56.790: W/SDL/APP(12790): Pump
03-29 12:25:56.790: W/SDL/APP(12790): isPaused
03-29 12:25:56.790: E/SurfaceTextureClient(12790): queueBuffer: error
queuing buffer to SurfaceTexture, -19
03-29 12:25:56.805: W/SDL/APP(12790): Pump
03-29 12:25:56.805: W/SDL/APP(12790): isPaused
03-29 12:25:56.805: E/SurfaceTextureClient(12790): queueBuffer: error
queuing buffer to SurfaceTexture, -19
03-29 12:25:56.821: W/SDL/APP(12790): Pump
03-29 12:25:56.821: W/SDL/APP(12790): isPaused
Then it repeats the Pump, isPaused, and queue error forever with a black
screen and no interaction. So, essentially the same as with BLOCK_ON_PAUSE.
Jonny DOn Fri, Mar 29, 2013 at 10:49 AM, Gabriel Jacobo wrote:
2013/3/29 Jonathan Dearborn <@Jonathan_Dearborn>
I’ve been having trouble getting my Android app to behave acceptably when
resumed from pause. I receive SDL_WINDOWEVENT_FOCUS_LOST
and SDL_WINDOWEVENT_MINIMIZED, but I never
receive SDL_WINDOWEVENT_FOCUS_GAINED or SDL_WINDOWEVENT_RESTORED.
Whether or not I enable SDL_ANDROID_BLOCK_ON_PAUSE, the app comes back
from pause as a black screen and it seems that I can’t interact with it at
all. When SDL_ANDROID_BLOCK_ON_PAUSE is 0, control remains with my code,
but subsequent OpenGL calls do nothing.
Perhaps my GL context is being lost? Maybe a Java thread remains blocked?
I’m running Android 4.0.3 on a Kindle Fire HD 7.
Jonny D
You do need to keep the message pump going until the app blocks itself,
other than that I’ve no suggestions.
Can you add a few print statements
in Java_org_libsdl_app_SDLActivity_nativePause,
Java_org_libsdl_app_SDLActivity_nativeResume and Android_PumpEvents to see
where it may be getting stuck?
–
Gabriel.
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org