Bug 875 - Regression of Bug 862 fix: InternalError GLES1ProcAddressTable not matching jogamp.opengl.es3.GLES3
Summary: Regression of Bug 862 fix: InternalError GLES1ProcAddressTable not matching j...
Status: RESOLVED FIXED
Alias: None
Product: Jogl
Classification: JogAmp
Component: embedded (show other bugs)
Version: 2
Hardware: embedded_arm other
: --- critical
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2013-10-28 21:07 CET by Brice Figureau
Modified: 2013-10-30 18:40 CET (History)
0 users

See Also:
Type: ---
SCM Refs:
85be81387d33224036b3fe2b02d74aab2926e028 9ce3f5f0d47f21a7dc229f0df03ac0fbda295f35 2481774c4a4a5d734dbeb2f7d8963f45d1b2a437
Workaround: ---


Attachments
jogl 2.1.2 - logcat - failing to find a profile (214.99 KB, text/plain)
2013-10-28 21:07 CET, Brice Figureau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brice Figureau 2013-10-28 21:07:25 CET
Created attachment 530 [details]
jogl 2.1.2 - logcat - failing to find a profile

Note: this only happens on the Sony Xperia ZL, running android 4.1.2. All our other devices seems to work normally.

Last jogl working on this platform: 2.1.0
First non-working version: 2.1.1
Latest non-working: 2.1.2-rc-20131025

When trying to get a GL2ES2 profile, it ultimately fails, and doesn't find any profile at all.

Attached the full logcat from this device.

Things to note that are different from the working 2.1.0 are the following InternalError:

> java.lang.InternalError: GLContext GL ProcAddressTable mapped key(.egl_decon_0-0x3000008 - 3.0 (ES profile, hardware)) -> jogamp.opengl.es1.GLES1ProcAddressTable not matching jogamp.opengl.es3.GLES3
> 	at jogamp.opengl.GLContextImpl.setGLFunctionAvailability(GLContextImpl.java:1508)
> 	at jogamp.opengl.egl.EGLContext.createImpl(EGLContext.java:225)
> 	at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(GLContextImpl.java:656)
> 	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:562)
> 	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:519)
> 	at jogamp.opengl.egl.EGLDrawableFactory.mapAvailableEGLESConfig(EGLDrawableFactory.java:482)
> 	at jogamp.opengl.egl.EGLDrawableFactory.createEGLSharedResourceImpl(EGLDrawableFactory.java:617)
> 	at jogamp.opengl.egl.EGLDrawableFactory.getOrCreateSharedResourceImpl(EGLDrawableFactory.java:574)
> 	at jogamp.opengl.egl.EGLDrawableFactory.getOrCreateSharedResourceImpl(EGLDrawableFactory.java:84)
> 	at jogamp.opengl.GLDrawableFactoryImpl.getOrCreateSharedResource(GLDrawableFactoryImpl.java:94)
> 	at jogamp.opengl.GLDrawableFactoryImpl.createSharedResourceImpl(GLDrawableFactoryImpl.java:123)
> 	at javax.media.opengl.GLDrawableFactory.createSharedResource(GLDrawableFactory.java:323)
> 	at javax.media.opengl.GLProfile.initProfilesForDeviceCritical(GLProfile.java:1765)
> 	at javax.media.opengl.GLProfile.initProfilesForDevice(GLProfile.java:1698)
> 	at javax.media.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1666)
> 	at javax.media.opengl.GLProfile.access$100(GLProfile.java:76)
> 	at javax.media.opengl.GLProfile$1.run(GLProfile.java:155)
> 	at java.security.AccessController.doPrivileged(AccessController.java:45)
> 	at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:123)
> 	at javax.media.opengl.GLProfile.getProfileMap(GLProfile.java:2063)
> 	at javax.media.opengl.GLProfile.get(GLProfile.java:906)
> 	at javax.media.opengl.GLProfile.getGL2ES2(GLProfile.java:827)
> 	at com.daysofwonder.tt.android.TTActivity.getGLProfile(TTActivity.java:450)
> 	at com.daysofwonder.tt.android.TTActivity.onCreate(TTActivity.java:197)
> 	at android.app.Activity.performCreate(Activity.java:5008)
> 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
> 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2034)
> 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2095)
> 	at android.app.ActivityThread.access$600(ActivityThread.java:137)
> 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1206)
> 	at android.os.Handler.dispatchMessage(Handler.java:99)
> 	at android.os.Looper.loop(Looper.java:213)
> 	at android.app.ActivityThread.main(ActivityThread.java:4791)
> 	at java.lang.reflect.Method.invokeNative(Native Method)
> 	at java.lang.reflect.Method.invoke(Method.java:511)
> 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
> 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
> 	at dalvik.system.NativeStart.main(Native Method)

Maybe more relevant:

Non working, just before:

> main: Initializing EGLextension address table: EGL-.egl_decon_0
> main: GLContext EGL ProcAddressTable mapping key(EGL-.egl_decon_0) -> 0x4302fc60
> main: GLContext.setGLFuncAvail: Given EGLGraphicsDevice[type .egl, connection decon, unitID 0, handle 0x1, owner true, NullToolkitLock[]] - 1.0 (ES profile, hardware) - OpenGL ES-CM 1.1 V@6.0 AU@04.01.02.44.002
> main: GLContext.setGLFuncAvail: Pre version verification - expected 1.0 (ES profile, hardware), strictMatch false
> main: GLContext.setGLFuncAvail: Version verification (Int): OpenGL ES-CM 1.1 V@6.0 AU@04.01.02.44.002, 3.0
> main: GLContext.setGLFuncAvail: Post version verification req 1.0 (ES profile, hardware) -> has 3.0 (ES profile, hardware), strictMatch false, versionValidated true, versionGL3IntFailed false
> Quirks local: []
> Quirks sticky on EGLGraphicsDevice[type .egl, connection decon, unitID 0, handle 0x1, owner true, NullToolkitLock[]]: []
> main: GLContext.setGLFuncAvail.0 validated FQN: .egl_decon_0-0x3000008 - 3.0 (ES profile, hardware) - OpenGL ES-CM 1.1 V@6.0 AU@04.01.02.44.002
> main: GLContext GL ProcAddressTable mapping key(.egl_decon_0-0x3000008) -> 0x43083ad8
> main:ExtensionAvailabilityCache: Pre-caching init jogamp.opengl.es1.GLES1Impl@425ff348, OpenGL 3.0 (ES profile, hardware) - OpenGL ES-CM 1.1 V@6.0 AU@04.01.02.44.002
> main:ExtensionAvailabilityCache: Pre-caching extension availability OpenGL 3.0 (ES profile, hardware) - OpenGL ES-CM 1.1 V@6.0 AU@04.01.02.44.002, use glGetString
> main:ExtensionAvailabilityCache: GL_EXTENSIONS: 36, used glGetString
> EGL extensions: EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_fence_sync EGL_ANDROID_image_native_buffer 
> main:ExtensionAvailabilityCache: GLX_EXTENSIONS: 7
> main:ExtensionAvailabilityCache: GL vendor: Qualcomm
> main:ExtensionAvailabilityCache: ALL EXTENSIONS: 43
> main:ExtensionAvailabilityCache: Added GL_ES_VERSION_3_0 to known extensions
> main:ExtensionAvailabilityCache: Added GL_ES_VERSION_2_0 to known extensions
> main: GLContext GL ExtensionAvailabilityCache mapping key(.egl_decon_0-0x3000008) -> 0x42b2ae90 - entries: 46
> main: GLContext.setGLFuncAvail.X: OK .egl_decon_0-0x3000008 - 3.0 (ES profile, ES2 compat, ES3 compat, FBO, hardware) - glErr 0x0
> main: GLContext.ContextSwitch[makeCurrent.1]: Context lock.unlock() due to error, res CONTEXT_NOT_CURRENT, <4309ec88, 4309ec98>[count 1, qsz 0, owner <main>]
> EGLDrawableFactory.mapAvailableEGLESConfig: INFO: context create/makeCurrent failed
> javax.media.opengl.GLException: Not a GL3ES3 implementation
> 	at jogamp.opengl.es1.GLES1Impl.getGL3ES3(GLES1Impl.java:4935)
> 	at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(GLContextImpl.java:659)
> 	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:562)
> 	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:519)
> 	at jogamp.opengl.egl.EGLDrawableFactory.mapAvailableEGLESConfig(EGLDrawableFactory.java:482)
> 	at jogamp.opengl.egl.EGLDrawableFactory.createEGLSharedResourceImpl(EGLDrawableFactory.java:612)
> 	at jogamp.opengl.egl.EGLDrawableFactory.getOrCreateSharedResourceImpl(EGLDrawableFactory.java:574)
> 	at jogamp.opengl.egl.EGLDrawableFactory.getOrCreateSharedResourceImpl(EGLDrawableFactory.java:84)
> 	at jogamp.opengl.GLDrawableFactoryImpl.getOrCreateSharedResource(GLDrawableFactoryImpl.java:94)
> 	at jogamp.opengl.GLDrawableFactoryImpl.createSharedResourceImpl(GLDrawableFactoryImpl.java:123)
> 	at javax.media.opengl.GLDrawableFactory.createSharedResource(GLDrawableFactory.java:323)
> 	at javax.media.opengl.GLProfile.initProfilesForDeviceCritical(GLProfile.java:1765)
> 	at javax.media.opengl.GLProfile.initProfilesForDevice(GLProfile.java:1698)
> 	at javax.media.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1666)
> 	at javax.media.opengl.GLProfile.access$100(GLProfile.java:76)

But in the working 2.1.0, the same log passage gives:

> main: GLContext EGL ProcAddressTable mapping key(EGL-.egl_decon_0) -> 0x4257f6a8
> main: GLContext.setGLFuncAvail: Given EGLGraphicsDevice[type .egl, connection decon, unitID 0, handle 0x1, owner true, NullToolkitLock[]] - 1.0 (ES profile, hardware) - OpenGL ES-CM 1.1 V@6.0 AU@04.01.02.44.002
> main: GLContext.setGLFuncAvail: Pre version verification - expected 1.0 (ES profile, hardware), strictMatch false
> main: GLContext.setGLFuncAvail: version verification (Int): OpenGL ES-CM 1.1 V@6.0 AU@04.01.02.44.002, 3.0
> main: GLContext.setGLFuncAvail: post version verification 1.0 (ES profile, hardware), strictMatch false, versionValidated true, versionGL3IntFailed false
> main: GLContext.setGLFuncAvail.0 validated FQN: .egl_decon_0-0x1000008 - 1.0 (ES profile, hardware) - OpenGL ES-CM 1.1 V@6.0 AU@04.01.02.44.002
> main: GLContext GL ProcAddressTable mapping key(.egl_decon_0-0x1000008) -> 0x42556d08
> main:ExtensionAvailabilityCache: Pre-caching init jogamp.opengl.es1.GLES1Impl@42ae1a58, OpenGL 1.0 (ES profile, hardware) - OpenGL ES-CM 1.1 V@6.0 AU@04.01.02.44.002
> main:ExtensionAvailabilityCache: Pre-caching extension availability OpenGL 1.0 (ES profile, hardware) - OpenGL ES-CM 1.1 V@6.0 AU@04.01.02.44.002, use glGetString
> main:ExtensionAvailabilityCache: GL_EXTENSIONS: 36, used glGetString
> EGL extensions: EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_fence_sync EGL_ANDROID_image_native_buffer 
> main:ExtensionAvailabilityCache: GLX_EXTENSIONS: 7
> main:ExtensionAvailabilityCache: GL vendor: Qualcomm
> main:ExtensionAvailabilityCache: ALL EXTENSIONS: 43
> main:ExtensionAvailabilityCache: Added GL_ES_VERSION_1_0 to known extensions
> main: GLContext GL ExtensionAvailabilityCache mapping key(.egl_decon_0-0x1000008) -> 0x429b3008 - entries: 45
> main: GLContext.setGLFuncAvail.X: OK .egl_decon_0-0x1000008 - 1.0 (ES profile, FP32 compat-api, hardware) - glErr 0x0
> main: Create GL context OK: obj 0x427a76f0, ctx 0x6896dc08, surf 0x68170658 for jogamp.opengl.egl.EGLContext - 1.0 (ES profile, FP32 compat-api, hardware) - OpenGL ES-CM 1.1 V@6.0 AU@04.01.02.44.002
> GLDebugMessageHandler.init(false)
> GLDebugMessageHandler: GL DEBUG not set in ARB ctx options: 1.0 (ES profile, FP32 compat-api, hardware) - OpenGL ES-CM 1.1 V@6.0 AU@04.01.02.44.002
> GLDebugMessageHandler.init(false) .. n/a
> GLContext.mapAvailableGLVersion: EGLGraphicsDevice[type .egl, connection decon, unitID 0, handle 0x1, owner true, NullToolkitLock[]]: 1.0 (ES profile, hardware) -> 1.0 (ES profile, FP32 compat-api, hardware)



I think the bug #862 introduced this regression.
Comment 1 Brice Figureau 2013-10-29 10:02:02 CET
The devices that work are all ES2.0, the one that doesn't (Sony Xperia ZL) uses and Adreno 320 and is able of ES3.0.
Comment 2 Brice Figureau 2013-10-29 10:07:44 CET
Reading the differences in log between in 2.1.0 and 2.1.2, I see that the contextFQN used to set the proc address table map is not the same between both version when initializing the context for ES1.0.

The 2.1.2 gives:
> GLContext.setGLFuncAvail.0 validated FQN: .egl_decon_0-0x3000008 - 3.0 (ES profile, hardware) - OpenGL ES-CM 1.1 V@6.0 AU@04.01.02.44.002

the 2.1.0 gives:
> GLContext.setGLFuncAvail.0 validated FQN: .egl_decon_0-0x1000008 - 1.0 (ES profile, hardware) - OpenGL ES-CM 1.1 V@6.0 AU@04.01.02.44.002

So my understanding is that later on, when jogl tries to map that to a GLES1 kind of jogl class, it fails with:
>EGLDrawableFactory.mapAvailableEGLESConfig: INFO: context create/makeCurrent failed
>javax.media.opengl.GLException: Not a GL3ES3 implementation
> at jogamp.opengl.es1.GLES1Impl.getGL3ES3(GLES1Impl.java:4935)
> at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(GLContextImpl.java:659)
> at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:562)
> at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:519)
> at jogamp.opengl.egl.EGLDrawableFactory.mapAvailableEGLESConfig(EGLDrawableFactory.java:482)
> at jogamp.opengl.egl.EGLDrawableFactory.createEGLSharedResourceImpl(EGLDrawableFactory.java:612)
> at jogamp.opengl.egl.EGLDrawableFactory.getOrCreateSharedResourceImpl(EGLDrawableFactory.java:574)
> at jogamp.opengl.egl.EGLDrawableFactory.getOrCreateSharedResourceImpl(EGLDrawableFactory.java:84)
> at jogamp.opengl.GLDrawableFactoryImpl.getOrCreateSharedResource(GLDrawableFactoryImpl.java:94)
> at jogamp.opengl.GLDrawableFactoryImpl.createSharedResourceImpl(GLDrawableFactoryImpl.java:123)
> at javax.media.opengl.GLDrawableFactory.createSharedResource(GLDrawableFactory.java:323)
> at javax.media.opengl.GLProfile.initProfilesForDeviceCritical(GLProfile.java:1765)
> at javax.media.opengl.GLProfile.initProfilesForDevice(GLProfile.java:1698)
> at javax.media.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1666)
> at javax.media.opengl.GLProfile.access$100(GLProfile.java:76)
> at javax.media.opengl.GLProfile$1.run(GLProfile.java:155)
> at java.security.AccessController.doPrivileged(AccessController.java:45)
> at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:123)
> at javax.media.opengl.GLProfile.getProfileMap(GLProfile.java:2063)
> at javax.media.opengl.GLProfile.get(GLProfile.java:906)
> at javax.media.opengl.GLProfile.getGL2ES2(GLProfile.java:827)
> at com.daysofwonder.tt.android.TTActivity.getGLProfile(TTActivity.java:450)
> at com.daysofwonder.tt.android.TTActivity.onCreate(TTActivity.java:197)
> at android.app.Activity.performCreate(Activity.java:5008)
> at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
> at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2034)
> at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2095)
> at android.app.ActivityThread.access$600(ActivityThread.java:137)
> at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1206)
> at android.os.Handler.dispatchMessage(Handler.java:99)
> at android.os.Looper.loop(Looper.java:213)
> at android.app.ActivityThread.main(ActivityThread.java:4791)
> at java.lang.reflect.Method.invokeNative(Native Method)
> at java.lang.reflect.Method.invoke(Method.java:511)
> at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
> at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
> at dalvik.system.NativeStart.main(Native Method)

I'm looking now at the GLContextImpl.setGLFuncAvailability.
Comment 3 Brice Figureau 2013-10-29 15:50:09 CET
I pushed a github pull request that fixes the problem on our ES3 and ES2 devices, and that apparently still works on desktop:
https://github.com/sgothel/jogl/pull/72
Comment 4 Sven Gothel 2013-10-30 18:34:44 CET
Regression introduced w/ fix for Bug 862 commit 34b35c5a0a379a6b4c0b23b9d347a0b1338f0239
Comment 5 Sven Gothel 2013-10-30 18:35:11 CET
2481774c4a4a5d734dbeb2f7d8963f45d1b2a437

    - Cleanup branch using VersionNumber (fix 'Int' check strictMatch minor) and reuse isES
    
    - EGLContext: Use strictMatch for setGLFunctionAvailability() and handle failure
      On ES, we require strictMatch, cleanup if failing.
    
    - EGLDrawableFactory: Either detect ES3 or ES2.
      Both only available with proper EGL context creation for ES profiles (TODO)
Comment 6 Sven Gothel 2013-10-30 18:40:48 CET
.. adding prereq. commits - complete now

85be81387d33224036b3fe2b02d74aab2926e028
  ES version should be strictly validated

9ce3f5f0d47f21a7dc229f0df03ac0fbda295f35
  Safeguard setGLFunctionAvailability(.. strictMatch=false.. ) operation, throw InternalError if failing

2481774c4a4a5d734dbeb2f7d8963f45d1b2a437
   See comment 5