Permalink
Browse files

Front: Destroy previous EGL surface in createGLContext

The emulator might still flip buffers after "surfaceDestroyed" while going to pause state.
Or "eglSwapBuffers" will raise an exception if called while EGL surface is destroyed.
To fix this the previous EGL surface is now destroyed while resuming emulation.
  • Loading branch information...
Gillou68310 committed Oct 20, 2015
1 parent 39eef09 commit 460680e0b32279a0b655f9e28665775313c60b77
@@ -612,9 +612,9 @@ public void surfaceDestroyed( SurfaceHolder holder )
{
Log.i( "GameLifecycleHandler", "surfaceDestroyed" );
NativeExports.notifySDLSurfaceDestroyed();
+ mSurface.setEGLContextNotReady();
mIsSurface = false;
tryPausing();
- mSurface.destroyGLSurface();
}
public void onStop()
@@ -124,6 +124,15 @@ public GameSurface( Context context, AttributeSet attribs )
*/
public boolean createGLContext( int majorVersion, int minorVersion, int[] configSpec, boolean forceCreate )
{
+ if( mEglSurface != null && mEglSurface != EGL10.EGL_NO_SURFACE )
+ {
+ if( !unbindEGLContext() || !destroyEGLSurface() )
+ {
+ Log.e( TAG, "Failed to create GL context" );
+ return false;
+ }
+ }
+
Log.i( TAG, "Creating GL context" );
if( initializeEGL( majorVersion, minorVersion, configSpec ) )
{
@@ -181,34 +190,22 @@ public boolean destroyGLContext()
}
/**
- * Unbind the previously-created rendering context and destroy the window surface.
+ * Return the state of the EGL Context
*
- * @return True, if successful.
- * @see GameSurface#destroyGLSurface()
+ * @return True, if ready.
*/
- public boolean destroyGLSurface()
+ public boolean isEGLContextReady()
{
- Log.i( TAG, "Destroying GL surface" );
- if( unbindEGLContext() )
- {
- if( destroyEGLSurface() )
- {
- mIsEGLContextReady = false;
- return true;
- }
- }
- Log.e( TAG, "Failed to destroy GL surface" );
- return false;
+ return mIsEGLContextReady;
}
/**
- * Return the state of the EGL Context
+ * Set the state of the EGL Context to not ready
*
- * @return True, if ready.
*/
- public boolean isEGLContextReady()
+ public void setEGLContextNotReady()
{
- return mIsEGLContextReady;
+ mIsEGLContextReady = false;
}
/**

10 comments on commit 460680e

@fzurita

This comment has been minimized.

Show comment
Hide comment
@fzurita

fzurita Oct 22, 2015

Member

I finally got around to trying this. The exception is no longer being thrown. All I see is this now in the logcat:

10-21 23:21:00.293: V/OUYAF(25255): ODK version number: 62
10-21 23:21:00.293: W/OUYAF(25255): Not running on Ouya hardware: C6806
10-21 23:21:00.754: D/OpenGLRenderer(25255): Use EGL_SWAP_BEHAVIOR_PRESERVED: true
10-21 23:21:00.802: D/Atlas(25255): Validating map...
10-21 23:21:00.856: I/Adreno-EGL(25255): <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.BF.1.1.1_RB1.05.00.02.042.016_msm8974_LA.BF.1.1.1_RB1__release_AU ()
10-21 23:21:00.856: I/Adreno-EGL(25255): OpenGL ES Shader Compiler Version: E031.25.03.00
10-21 23:21:00.856: I/Adreno-EGL(25255): Build Date: 02/11/15 Wed
10-21 23:21:00.856: I/Adreno-EGL(25255): Local Branch: mybranch7539026
10-21 23:21:00.856: I/Adreno-EGL(25255): Remote Branch: quic/LA.BF.1.1.1_rb1.10
10-21 23:21:00.856: I/Adreno-EGL(25255): Local Patches: NONE
10-21 23:21:00.856: I/Adreno-EGL(25255): Reconstruct Branch: AU_LINUX_ANDROID_LA.BF.1.1.1_RB1.05.00.02.042.016 + 62ca4eb + acd831d + 9f8b442 + e027a02 + cba30ba + 53c303a + a649d79 + 23e16f8 + 5e97da7 + cbd2a44 + 33d072a + 7aacf06 + 72b33e7 + 28f6f60 + b4c13d8 +  NOTHING
10-21 23:21:00.870: I/OpenGLRenderer(25255): Initialized EGL, version 1.4
10-21 23:21:00.899: D/OpenGLRenderer(25255): Enabling debug mode 0
10-21 23:21:17.167: I/GameLifecycleHandler(25255): onCreate
10-21 23:21:17.168: E/MogaHack(25255): Somebody is trying to intercept our intent. Disabling MOGA controller for security.
10-21 23:21:17.856: I/GameLifecycleHandler(25255): onStart
10-21 23:21:17.856: I/GameLifecycleHandler(25255): onResume
10-21 23:21:17.860: I/Choreographer(25255): Skipped 45 frames!  The application may be doing too much work on its main thread.
10-21 23:21:17.869: V/RenderScript(25255): Application requested CPU execution
10-21 23:21:17.876: V/RenderScript(25255): 0xa297f600 Launching thread(s), CPUs 4
10-21 23:21:17.925: I/GameLifecycleHandler(25255): surfaceCreated
10-21 23:21:17.925: I/GameLifecycleHandler(25255): surfaceChanged
10-21 23:21:17.978: I/GameLifecycleHandler(25255): onWindowFocusChanged: true
10-21 23:21:17.980: I/ae-bridge(25255): Loading native libraries
10-21 23:21:17.989: I/input-android(25255): init()
10-21 23:21:17.989: I/ae-bridge(25255): Android_JNI_InitImports()
10-21 23:21:17.989: I/SDL(25255): SDL_Android_Init()
10-21 23:21:17.989: I/SDL(25255): SDL_Android_Init() finished!
10-21 23:21:17.989: V/UI-Console(25255):  __  __                         __   _  _   ____  _             
10-21 23:21:17.989: V/UI-Console(25255): |  \/  |_   _ _ __   ___ _ __  / /_ | || | |  _ \| |_   _ ___ 
10-21 23:21:17.989: V/UI-Console(25255): | |\/| | | | | '_ \ / _ \ '_ \| '_ \| || |_| |_) | | | | / __|  
10-21 23:21:17.989: V/UI-Console(25255): | |  | | |_| | |_) |  __/ | | | (_) |__   _|  __/| | |_| \__ \  
10-21 23:21:17.989: V/UI-Console(25255): |_|  |_|\__,_| .__/ \___|_| |_|\___/   |_| |_|   |_|\__,_|___/  
10-21 23:21:17.989: V/UI-Console(25255):              |_|         http://code.google.com/p/mupen64plus/  
10-21 23:21:17.989: V/UI-Console(25255): Mupen64Plus Console User-Interface Version 2.5.0
10-21 23:21:17.989: I/UI-Console(25255): attached to core library 'Mupen64Plus Core' version 2.5.0
10-21 23:21:17.990: I/UI-Console(25255):             Includes support for Dynamic Recompiler.
10-21 23:21:18.219: I/Core(25255): Goodname: Super Mario 64 (U) [!]
10-21 23:21:18.219: I/Core(25255): Name: SUPER MARIO 64      
10-21 23:21:18.219: I/Core(25255): MD5: 20B854B239203BAF6C961B850A4A51A2
10-21 23:21:18.219: I/Core(25255): CRC: 635A2BFF 8B022326
10-21 23:21:18.219: I/Core(25255): Imagetype: .z64 (native)
10-21 23:21:18.219: I/Core(25255): Rom size: 8388608 bytes (or 8 Mb or 64 Megabits)
10-21 23:21:18.219: I/Core(25255): Version: 1444
10-21 23:21:18.219: I/Core(25255): Manufacturer: Nintendo
10-21 23:21:18.219: I/Core(25255): Country: USA
10-21 23:21:18.221: D/UI-Console(25255): Cheat codes disabled.
10-21 23:21:18.225: I/UI-Console(25255): using Video plugin: 'GLideN64' v2.0.0
10-21 23:21:18.239: I/UI-Console(25255): using Audio plugin: 'Mupen64Plus OpenSLES Audio Plugin' v2.0.0
10-21 23:21:18.239: I/UI-Console(25255): using Input plugin: 'Mupen64Plus Android Input Plugin' v1.0.0
10-21 23:21:18.240: I/UI-Console(25255): using RSP plugin: 'Hacktarux/Azimer High-Level Emulation RSP Plugin' v2.5.0
10-21 23:21:18.240: D/Core(25255): Selected state slot: 8
10-21 23:21:18.281: I/Core(25255): Setting video mode: 1080x810
10-21 23:21:18.282: I/GameSurface(25255): Creating GL context
10-21 23:21:18.282: V/GameSurface(25255): Found EGL display connection
10-21 23:21:18.289: V/GameSurface(25255): Initialized EGL display connection
10-21 23:21:18.290: V/GameSurface(25255): Found compatible EGL frame buffer configuration
10-21 23:21:18.295: V/GameSurface(25255): Created EGL rendering context
10-21 23:21:18.296: V/GameSurface(25255): Created EGL window surface
10-21 23:21:18.297: V/GameSurface(25255): Bound EGL rendering context to EGL window surface
10-21 23:21:18.298: I/GameSurface(25255): Created GL context OpenGL ES 3.0 V@84.0 AU@05.00.02.042.016 (CL@)
10-21 23:21:18.323: W/Adreno-ES20(25255): <__load_uniform_int:359>: GL_INVALID_OPERATION
10-21 23:21:18.575: W/AudioTrack(25255): AUDIO_OUTPUT_FLAG_FAST denied by client
10-21 23:21:18.591: I/Core(25255): Starting R4300 emulator: Dynamic Recompiler
10-21 23:21:18.598: I/Core(25255): Init new dynarec
10-21 23:21:18.608: I/Core(25255): ARM CPU Features: SWP, Half, Thumb, FastMult, VFP, ESDP, NEON, VFPv3, TLS, VFPv4, IDIVa, IDIVt
10-21 23:21:18.893: D/Core(25255): State loaded from: 2015-10-21-22-59-15.sav
10-21 23:21:19.000: W/AudioTrack(25255): AUDIO_OUTPUT_FLAG_FAST denied by client
10-21 23:21:19.412: W/Adreno-ES20(25255): <__load_uniform_int:359>: GL_INVALID_OPERATION
10-21 23:21:22.459: D/Core(25255): Emulation paused.
10-21 23:21:22.479: W/Adreno-EGLSUB(25255): <SwapBuffers:1352>: Invalid native buffer. Failed to queueBuffer
10-21 23:21:22.484: W/Adreno-EGLSUB(25255): <updater_thread:428>: native buffer is NULL
10-21 23:21:22.687: I/GameLifecycleHandler(25255): onWindowFocusChanged: false
10-21 23:21:25.092: D/OpenGLRenderer(25255): endAllStagingAnimators on 0xa290ce80 (RippleDrawable) with handle 0x975055e0
10-21 23:21:25.106: I/GameLifecycleHandler(25255): onPause
10-21 23:21:25.424: I/GameLifecycleHandler(25255): surfaceDestroyed
10-21 23:21:25.424: V/SDL(25255): nativePause()
10-21 23:21:25.687: I/GameLifecycleHandler(25255): onStop
10-21 23:21:25.687: I/GameLifecycleHandler(25255): onDestroy
10-21 23:21:25.694: I/CoreInterface(25255): Saving file: /storage/emulated/0/mupen64plusae-v3-alpha/GameData/SUPER MARIO 64 (U) 20B854B239203BAF6C961B850A4A51A2/AutoSaves/2015-10-21-23-21-25.sav
10-21 23:21:25.697: I/GameAutoSaveManager(25255): Deleting old autosave file: 2015-10-21-22-59-15.sav
10-21 23:21:25.700: D/Core(25255): Stopping emulation.
10-21 23:21:26.657: D/Core(25255): Saved state to: 2015-10-21-23-21-25.sav
10-21 23:21:26.673: I/Core(25255): R4300 emulator finished.
10-21 23:21:26.685: W/Adreno-EGLSUB(25255): <DequeueBuffer:720>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
10-21 23:21:26.685: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
10-21 23:21:26.687: W/Adreno-EGLSUB(25255): <DequeueBuffer:720>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
10-21 23:21:26.687: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
10-21 23:21:26.688: W/Adreno-EGLSUB(25255): <DequeueBuffer:720>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
10-21 23:21:26.688: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
10-21 23:21:26.694: W/Adreno-EGLSUB(25255): <DequeueBuffer:720>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
10-21 23:21:26.694: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
10-21 23:21:26.694: W/Adreno-EGLSUB(25255): <DequeueBuffer:720>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
10-21 23:21:26.694: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
10-21 23:21:26.700: W/Adreno-EGLSUB(25255): <DequeueBuffer:720>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
10-21 23:21:26.700: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
10-21 23:21:26.703: W/Adreno-EGLSUB(25255): <DequeueBuffer:720>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
10-21 23:21:26.703: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
10-21 23:21:26.708: W/Adreno-EGLSUB(25255): <DequeueBuffer:720>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
10-21 23:21:26.708: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
10-21 23:21:26.714: W/Adreno-EGLSUB(25255): <DequeueBuffer:720>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
10-21 23:21:26.715: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
10-21 23:21:26.715: W/Adreno-EGLSUB(25255): <DequeueBuffer:720>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
10-21 23:21:26.715: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE

REPEATING OVER AND OVER

10-21 23:21:27.957: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
10-21 23:21:27.980: I/GameSurface(25255): Destroying GL context
10-21 23:21:27.986: V/GameSurface(25255): Unbound EGL rendering context from EGL window surface
10-21 23:21:27.988: V/GameSurface(25255): Destroyed EGL window surface
10-21 23:21:27.995: V/GameSurface(25255): Destroyed EGL rendering context
10-21 23:21:27.995: V/GameSurface(25255): Terminated EGL display connection
10-21 23:21:27.996: E/libEGL(25255): call to OpenGL ES API with no current context (logged once per thread)
10-21 23:21:28.012: D/Core(25255): Rom closed.
10-21 23:21:28.019: I/ae-bridge(25255): Unloading native libraries

Member

fzurita replied Oct 22, 2015

I finally got around to trying this. The exception is no longer being thrown. All I see is this now in the logcat:

10-21 23:21:00.293: V/OUYAF(25255): ODK version number: 62
10-21 23:21:00.293: W/OUYAF(25255): Not running on Ouya hardware: C6806
10-21 23:21:00.754: D/OpenGLRenderer(25255): Use EGL_SWAP_BEHAVIOR_PRESERVED: true
10-21 23:21:00.802: D/Atlas(25255): Validating map...
10-21 23:21:00.856: I/Adreno-EGL(25255): <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.BF.1.1.1_RB1.05.00.02.042.016_msm8974_LA.BF.1.1.1_RB1__release_AU ()
10-21 23:21:00.856: I/Adreno-EGL(25255): OpenGL ES Shader Compiler Version: E031.25.03.00
10-21 23:21:00.856: I/Adreno-EGL(25255): Build Date: 02/11/15 Wed
10-21 23:21:00.856: I/Adreno-EGL(25255): Local Branch: mybranch7539026
10-21 23:21:00.856: I/Adreno-EGL(25255): Remote Branch: quic/LA.BF.1.1.1_rb1.10
10-21 23:21:00.856: I/Adreno-EGL(25255): Local Patches: NONE
10-21 23:21:00.856: I/Adreno-EGL(25255): Reconstruct Branch: AU_LINUX_ANDROID_LA.BF.1.1.1_RB1.05.00.02.042.016 + 62ca4eb + acd831d + 9f8b442 + e027a02 + cba30ba + 53c303a + a649d79 + 23e16f8 + 5e97da7 + cbd2a44 + 33d072a + 7aacf06 + 72b33e7 + 28f6f60 + b4c13d8 +  NOTHING
10-21 23:21:00.870: I/OpenGLRenderer(25255): Initialized EGL, version 1.4
10-21 23:21:00.899: D/OpenGLRenderer(25255): Enabling debug mode 0
10-21 23:21:17.167: I/GameLifecycleHandler(25255): onCreate
10-21 23:21:17.168: E/MogaHack(25255): Somebody is trying to intercept our intent. Disabling MOGA controller for security.
10-21 23:21:17.856: I/GameLifecycleHandler(25255): onStart
10-21 23:21:17.856: I/GameLifecycleHandler(25255): onResume
10-21 23:21:17.860: I/Choreographer(25255): Skipped 45 frames!  The application may be doing too much work on its main thread.
10-21 23:21:17.869: V/RenderScript(25255): Application requested CPU execution
10-21 23:21:17.876: V/RenderScript(25255): 0xa297f600 Launching thread(s), CPUs 4
10-21 23:21:17.925: I/GameLifecycleHandler(25255): surfaceCreated
10-21 23:21:17.925: I/GameLifecycleHandler(25255): surfaceChanged
10-21 23:21:17.978: I/GameLifecycleHandler(25255): onWindowFocusChanged: true
10-21 23:21:17.980: I/ae-bridge(25255): Loading native libraries
10-21 23:21:17.989: I/input-android(25255): init()
10-21 23:21:17.989: I/ae-bridge(25255): Android_JNI_InitImports()
10-21 23:21:17.989: I/SDL(25255): SDL_Android_Init()
10-21 23:21:17.989: I/SDL(25255): SDL_Android_Init() finished!
10-21 23:21:17.989: V/UI-Console(25255):  __  __                         __   _  _   ____  _             
10-21 23:21:17.989: V/UI-Console(25255): |  \/  |_   _ _ __   ___ _ __  / /_ | || | |  _ \| |_   _ ___ 
10-21 23:21:17.989: V/UI-Console(25255): | |\/| | | | | '_ \ / _ \ '_ \| '_ \| || |_| |_) | | | | / __|  
10-21 23:21:17.989: V/UI-Console(25255): | |  | | |_| | |_) |  __/ | | | (_) |__   _|  __/| | |_| \__ \  
10-21 23:21:17.989: V/UI-Console(25255): |_|  |_|\__,_| .__/ \___|_| |_|\___/   |_| |_|   |_|\__,_|___/  
10-21 23:21:17.989: V/UI-Console(25255):              |_|         http://code.google.com/p/mupen64plus/  
10-21 23:21:17.989: V/UI-Console(25255): Mupen64Plus Console User-Interface Version 2.5.0
10-21 23:21:17.989: I/UI-Console(25255): attached to core library 'Mupen64Plus Core' version 2.5.0
10-21 23:21:17.990: I/UI-Console(25255):             Includes support for Dynamic Recompiler.
10-21 23:21:18.219: I/Core(25255): Goodname: Super Mario 64 (U) [!]
10-21 23:21:18.219: I/Core(25255): Name: SUPER MARIO 64      
10-21 23:21:18.219: I/Core(25255): MD5: 20B854B239203BAF6C961B850A4A51A2
10-21 23:21:18.219: I/Core(25255): CRC: 635A2BFF 8B022326
10-21 23:21:18.219: I/Core(25255): Imagetype: .z64 (native)
10-21 23:21:18.219: I/Core(25255): Rom size: 8388608 bytes (or 8 Mb or 64 Megabits)
10-21 23:21:18.219: I/Core(25255): Version: 1444
10-21 23:21:18.219: I/Core(25255): Manufacturer: Nintendo
10-21 23:21:18.219: I/Core(25255): Country: USA
10-21 23:21:18.221: D/UI-Console(25255): Cheat codes disabled.
10-21 23:21:18.225: I/UI-Console(25255): using Video plugin: 'GLideN64' v2.0.0
10-21 23:21:18.239: I/UI-Console(25255): using Audio plugin: 'Mupen64Plus OpenSLES Audio Plugin' v2.0.0
10-21 23:21:18.239: I/UI-Console(25255): using Input plugin: 'Mupen64Plus Android Input Plugin' v1.0.0
10-21 23:21:18.240: I/UI-Console(25255): using RSP plugin: 'Hacktarux/Azimer High-Level Emulation RSP Plugin' v2.5.0
10-21 23:21:18.240: D/Core(25255): Selected state slot: 8
10-21 23:21:18.281: I/Core(25255): Setting video mode: 1080x810
10-21 23:21:18.282: I/GameSurface(25255): Creating GL context
10-21 23:21:18.282: V/GameSurface(25255): Found EGL display connection
10-21 23:21:18.289: V/GameSurface(25255): Initialized EGL display connection
10-21 23:21:18.290: V/GameSurface(25255): Found compatible EGL frame buffer configuration
10-21 23:21:18.295: V/GameSurface(25255): Created EGL rendering context
10-21 23:21:18.296: V/GameSurface(25255): Created EGL window surface
10-21 23:21:18.297: V/GameSurface(25255): Bound EGL rendering context to EGL window surface
10-21 23:21:18.298: I/GameSurface(25255): Created GL context OpenGL ES 3.0 V@84.0 AU@05.00.02.042.016 (CL@)
10-21 23:21:18.323: W/Adreno-ES20(25255): <__load_uniform_int:359>: GL_INVALID_OPERATION
10-21 23:21:18.575: W/AudioTrack(25255): AUDIO_OUTPUT_FLAG_FAST denied by client
10-21 23:21:18.591: I/Core(25255): Starting R4300 emulator: Dynamic Recompiler
10-21 23:21:18.598: I/Core(25255): Init new dynarec
10-21 23:21:18.608: I/Core(25255): ARM CPU Features: SWP, Half, Thumb, FastMult, VFP, ESDP, NEON, VFPv3, TLS, VFPv4, IDIVa, IDIVt
10-21 23:21:18.893: D/Core(25255): State loaded from: 2015-10-21-22-59-15.sav
10-21 23:21:19.000: W/AudioTrack(25255): AUDIO_OUTPUT_FLAG_FAST denied by client
10-21 23:21:19.412: W/Adreno-ES20(25255): <__load_uniform_int:359>: GL_INVALID_OPERATION
10-21 23:21:22.459: D/Core(25255): Emulation paused.
10-21 23:21:22.479: W/Adreno-EGLSUB(25255): <SwapBuffers:1352>: Invalid native buffer. Failed to queueBuffer
10-21 23:21:22.484: W/Adreno-EGLSUB(25255): <updater_thread:428>: native buffer is NULL
10-21 23:21:22.687: I/GameLifecycleHandler(25255): onWindowFocusChanged: false
10-21 23:21:25.092: D/OpenGLRenderer(25255): endAllStagingAnimators on 0xa290ce80 (RippleDrawable) with handle 0x975055e0
10-21 23:21:25.106: I/GameLifecycleHandler(25255): onPause
10-21 23:21:25.424: I/GameLifecycleHandler(25255): surfaceDestroyed
10-21 23:21:25.424: V/SDL(25255): nativePause()
10-21 23:21:25.687: I/GameLifecycleHandler(25255): onStop
10-21 23:21:25.687: I/GameLifecycleHandler(25255): onDestroy
10-21 23:21:25.694: I/CoreInterface(25255): Saving file: /storage/emulated/0/mupen64plusae-v3-alpha/GameData/SUPER MARIO 64 (U) 20B854B239203BAF6C961B850A4A51A2/AutoSaves/2015-10-21-23-21-25.sav
10-21 23:21:25.697: I/GameAutoSaveManager(25255): Deleting old autosave file: 2015-10-21-22-59-15.sav
10-21 23:21:25.700: D/Core(25255): Stopping emulation.
10-21 23:21:26.657: D/Core(25255): Saved state to: 2015-10-21-23-21-25.sav
10-21 23:21:26.673: I/Core(25255): R4300 emulator finished.
10-21 23:21:26.685: W/Adreno-EGLSUB(25255): <DequeueBuffer:720>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
10-21 23:21:26.685: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
10-21 23:21:26.687: W/Adreno-EGLSUB(25255): <DequeueBuffer:720>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
10-21 23:21:26.687: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
10-21 23:21:26.688: W/Adreno-EGLSUB(25255): <DequeueBuffer:720>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
10-21 23:21:26.688: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
10-21 23:21:26.694: W/Adreno-EGLSUB(25255): <DequeueBuffer:720>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
10-21 23:21:26.694: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
10-21 23:21:26.694: W/Adreno-EGLSUB(25255): <DequeueBuffer:720>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
10-21 23:21:26.694: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
10-21 23:21:26.700: W/Adreno-EGLSUB(25255): <DequeueBuffer:720>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
10-21 23:21:26.700: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
10-21 23:21:26.703: W/Adreno-EGLSUB(25255): <DequeueBuffer:720>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
10-21 23:21:26.703: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
10-21 23:21:26.708: W/Adreno-EGLSUB(25255): <DequeueBuffer:720>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
10-21 23:21:26.708: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
10-21 23:21:26.714: W/Adreno-EGLSUB(25255): <DequeueBuffer:720>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
10-21 23:21:26.715: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
10-21 23:21:26.715: W/Adreno-EGLSUB(25255): <DequeueBuffer:720>: dequeue native buffer fail: No such device, buffer=0x0, handle=0x0
10-21 23:21:26.715: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE

REPEATING OVER AND OVER

10-21 23:21:27.957: W/Adreno-EGL(25255): <qeglDrvAPI_eglSwapBuffers:3702>: EGL_BAD_SURFACE
10-21 23:21:27.980: I/GameSurface(25255): Destroying GL context
10-21 23:21:27.986: V/GameSurface(25255): Unbound EGL rendering context from EGL window surface
10-21 23:21:27.988: V/GameSurface(25255): Destroyed EGL window surface
10-21 23:21:27.995: V/GameSurface(25255): Destroyed EGL rendering context
10-21 23:21:27.995: V/GameSurface(25255): Terminated EGL display connection
10-21 23:21:27.996: E/libEGL(25255): call to OpenGL ES API with no current context (logged once per thread)
10-21 23:21:28.012: D/Core(25255): Rom closed.
10-21 23:21:28.019: I/ae-bridge(25255): Unloading native libraries

@Gillou68310

This comment has been minimized.

Show comment
Hide comment
@Gillou68310

Gillou68310 Oct 22, 2015

Contributor

Thanks for the log, I'll see what I can do for all the EGL_BAD_SURFACE warning.
Could you do another log while pressing the home button + restoring app from background? I'd like to see what happens in this case.

Contributor

Gillou68310 replied Oct 22, 2015

Thanks for the log, I'll see what I can do for all the EGL_BAD_SURFACE warning.
Could you do another log while pressing the home button + restoring app from background? I'd like to see what happens in this case.

@Gillou68310

This comment has been minimized.

Show comment
Hide comment
@Gillou68310

Gillou68310 Oct 22, 2015

Contributor

Also could you check if the core really asked to flip buffers after stopping emulation? That sounds weird!
You can check that by adding DebugMessage(M64MSG_INFO, "VidExt_GL_SwapBuffers"); in VidExt_GL_SwapBuffers function (vidext.c)
The message will be printed in android logcat ;-)

Contributor

Gillou68310 replied Oct 22, 2015

Also could you check if the core really asked to flip buffers after stopping emulation? That sounds weird!
You can check that by adding DebugMessage(M64MSG_INFO, "VidExt_GL_SwapBuffers"); in VidExt_GL_SwapBuffers function (vidext.c)
The message will be printed in android logcat ;-)

@fzurita

This comment has been minimized.

Show comment
Hide comment
@fzurita

fzurita Oct 22, 2015

Member

Sure

Member

fzurita replied Oct 22, 2015

Sure

@Gillou68310

This comment has been minimized.

Show comment
Hide comment
@Gillou68310

Gillou68310 Oct 27, 2015

Contributor

Also don't forget about this ;-)

Contributor

Gillou68310 replied Oct 27, 2015

Also don't forget about this ;-)

@fzurita

This comment has been minimized.

Show comment
Hide comment
@fzurita

fzurita Oct 27, 2015

Member

Whoops, completely forgot about this.

Member

fzurita replied Oct 27, 2015

Whoops, completely forgot about this.

@Gillou68310

This comment has been minimized.

Show comment
Hide comment
@Gillou68310

Gillou68310 Oct 27, 2015

Contributor

No problem

Contributor

Gillou68310 replied Oct 27, 2015

No problem

@fzurita

This comment has been minimized.

Show comment
Hide comment
@fzurita

fzurita Oct 28, 2015

Member

Here is a log of me going home and restoring the app multiple times, then exiting:

https://drive.google.com/file/d/0B57Ioy26LWegTjE2VDRPU1dPTjQ/view?usp=sharing

Member

fzurita replied Oct 28, 2015

Here is a log of me going home and restoring the app multiple times, then exiting:

https://drive.google.com/file/d/0B57Ioy26LWegTjE2VDRPU1dPTjQ/view?usp=sharing

@fzurita

This comment has been minimized.

Show comment
Hide comment
@fzurita

fzurita Oct 28, 2015

Member

Here is a 2nd log file with the added logging in VidExt_GL_SwapBuffers:

https://drive.google.com/file/d/0B57Ioy26LWegeXltS2lfbnNSUUk/view?usp=sharing

Member

fzurita replied Oct 28, 2015

Here is a 2nd log file with the added logging in VidExt_GL_SwapBuffers:

https://drive.google.com/file/d/0B57Ioy26LWegeXltS2lfbnNSUUk/view?usp=sharing

@Gillou68310

This comment has been minimized.

Show comment
Hide comment
@Gillou68310

Gillou68310 Oct 28, 2015

Contributor

Thanks for the logs.
So everything is ok when pressing home button + restoring.
However I don't understand why the core still flip buffers after stopping emulation,
it's not happening on my device, I checked on PC and it's not happening either.

If this is happening with all video plugins this looks like a core issue.

Contributor

Gillou68310 replied Oct 28, 2015

Thanks for the logs.
So everything is ok when pressing home button + restoring.
However I don't understand why the core still flip buffers after stopping emulation,
it's not happening on my device, I checked on PC and it's not happening either.

If this is happening with all video plugins this looks like a core issue.

Please sign in to comment.