Uncontrolled flicker

Hi GKW

Here’s the results of running Gears with your jogl.jar and jogl.zip on my Dell 510m laptop:

CANVAS GL IS: net.java.games.jogl.impl.windows.WindowsGLImpl
CANVAS GLU IS: net.java.games.jogl.impl.GLUImpl
!!! Initializing GLU extension address table
!!! Initializing OpenGL extension address table
Used wglChoosePixelFormatARB to recommend pixel format 6
net.java.games.jogl.GLException: Unable to enumerate pixel formats of window using wglGetPixelFormatAttribivARB: 0
at net.java.games.jogl.impl.windows.WindowsGLContext.choosePixelFormatAndCreateContext(WindowsGLContext.java:390)
at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.create(WindowsOnscreenGLContext.java:211)
at net.java.games.jogl.impl.windows.WindowsGLContext.makeCurrent(WindowsGLContext.java:133)
at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.makeCurrent(WindowsOnscreenGLContext.java:110)
at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:254)
at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:208)
at net.java.games.jogl.GLCanvas.display(GLCanvas.java:75)
at net.java.games.jogl.Animator$1.run(Animator.java:107)
at java.lang.Thread.run(Thread.java:534)

Cheers
David

I tried these jars out on my laptop which has been running windowed mode just fine. I tried both fullscreen and windowed. Windowed continues to run fine, but fullscreen only worked once. The second time I tried to run fullscreen, I got the same white screen. Interestingly enough, I had no debugging lines at all on that 2nd fullscreen run.

Ahh, I think I’ve solved my fullscreen problems.

[quote]You may have run into a higher level problem with the code initialisation order. JOGL requires some very specific ordering of instructions otherwise a lot of stuff just fails to even get going. For example, don’t try to add the GLCanvas before the main Frame has been made visible, etc. What this ends up translating to is that the GLContext may be available on one card before it is on another, so code that works on one machine doesn’t work on another.
[/quote]
And my init code was doing it backwards. I swapped the order and it reliably enters fullscreen on this machine.

One more try if you gentlemen would be so kind. I had Kens ATI work around turned off but now it is back on. Maybe that will fix it. Also if you could post your videocard make and driver version I would appreciate it. I assume you guys have ATI cards.

I also experience flicker on my laptop with the latest JOGL.

Intel 82852/82855 GM/GME Graphics Controller

I found a jogl jar and dll from an old project I made in february - and it causes no flicker.

It crashes with the new version at GKW’s page.


!!! Initializing GLU extension address table
!!! Initializing OpenGL extension address table
Used wglChoosePixelFormatARB to recommend pixel format 6
net.java.games.jogl.GLException: Unable to enumerate pixel formats of window using wglGetPixelFormatAttribivARB: 0
      at net.java.games.jogl.impl.windows.WindowsGLContext.choosePixelFormatAndCreateContext(WindowsGLContext.java:390)
      at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.create(WindowsOnscreenGLContext.java:211)
      at net.java.games.jogl.impl.windows.WindowsGLContext.makeCurrent(WindowsGLContext.java:133)
      at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.makeCurrent(WindowsOnscreenGLContext.java:110)
      at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:254)
      at net.java.games.jogl.GLCanvas.reshape(GLCanvas.java:112)

Oh and btw. I am running in windowed mode. The above is the output if I set the desktop 32 bit.

If I change the desktop to 16 bit I get:


!!! Initializing GLU extension address table
!!! Initializing OpenGL extension address table
wglChoosePixelFormatARB didn't recommend a pixel format
net.java.games.jogl.GLException: Unable to enumerate pixel formats of window using wglGetPixelFormatAttribivARB: 0
      at net.java.games.jogl.impl.windows.WindowsGLContext.choosePixelFormatAndCreateContext(WindowsGLContext.java:390)
      at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.create(WindowsOnscreenGLContext.java:211)
      at net.java.games.jogl.impl.windows.WindowsGLContext.makeCurrent(WindowsGLContext.java:133)
      at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.makeCurrent(WindowsOnscreenGLContext.java:110)
      at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:254)
      at net.java.games.jogl.GLCanvas.reshape(GLCanvas.java:112)

I don’t have the flickering problem with my lowly
Pentium III, Windows 98, Intel 82815 graphics, but over the weekend I tried updating my drivers, and for both the Gears demo and the race viewer under jogl b04 dated 14 May:

4.12.01.2607 = OK
4.13.01.3196 = “Unable to enumerate pixel formats…”

Both are windowed apps and neither request any special capabilities:

GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());

Don’t know if that helps…

Daymark found the flicker problem was not present with jogl 1.0, but happens under every version thereafter. He has the same Intel 82852/82855 GM/GME as Giddy.

I have reports of the flickering problem with Intel 82845 and the same problem was reported in this thread by davec67 with an ATI Radeon 7000 DDR x86/SSE.

Kevin

GKW, just downloaded your jogl.jar and jogldll.zip again and ran Gears but still getting the exception (no display):

CANVAS GL IS: net.java.games.jogl.impl.windows.WindowsGLImpl
CANVAS GLU IS: net.java.games.jogl.impl.GLUImpl
!!! Initializing GLU extension address table
!!! Initializing OpenGL extension address table
Used wglChoosePixelFormatARB to recommend pixel format 6
net.java.games.jogl.GLException: Unable to enumerate pixel formats of window using wglGetPixelFormatAttribivARB: 0
at net.java.games.jogl.impl.windows.WindowsGLContext.choosePixelFormatAndCreateContext(WindowsGLContext.java:390)
at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.create(WindowsOnscreenGLContext.java:211)
at net.java.games.jogl.impl.windows.WindowsGLContext.makeCurrent(WindowsGLContext.java:133)
at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.makeCurrent(WindowsOnscreenGLContext.java:110)
at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:254)
at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:208)
at net.java.games.jogl.GLCanvas.display(GLCanvas.java:75)
at net.java.games.jogl.Animator$1.run(Animator.java:107)
at java.lang.Thread.run(Thread.java:534)

Machine spec:

Model: Dell Inspiron 510m laptop, 1.4GHz Pentium M, 512MB
OS: XP-Pro SP1.
Graphics adapter: Intel 82852/82855 GM/GME, 64MB
Graphics driver: Intel Corporation 6.14.10.3701

I have also tried the latest Intel driver which also flickered, but I reverted back to the Dell-provided version due to instability.

[quote]One more try if you gentlemen would be so kind. I had Kens ATI work around turned off but now it is back on. Maybe that will fix it. Also if you could post your videocard make and driver version I would appreciate it. I assume you guys have ATI cards.
[/quote]
Still crashing.

C:\Development\Projects\jogl\nehe\lesson07>java Lesson07
!!! Initializing GLU extension address table
Using ATI workaround of dispatching display() on event thread
!!! Initializing OpenGL extension address table
wglChoosePixelFormatARB didn’t recommend a pixel format
net.java.games.jogl.GLException: Unable to enumerate pixel formats of window using wglGetPixelFormatAttribivARB: 0
at net.java.games.jogl.impl.windows.WindowsGLContext.choosePixelFormatAndCreateContext(WindowsGLContext.java:390)
at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.create(WindowsOnscreenGLContext.java:211)
at net.java.games.jogl.impl.windows.WindowsGLContext.makeCurrent(WindowsGLContext.java:133)
at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.makeCurrent(WindowsOnscreenGLContext.java:110)
at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:254)
at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:208)
at net.java.games.jogl.GLCanvas.display(GLCanvas.java:75)
at net.java.games.jogl.Animator$1.run(Animator.java:107)
at java.lang.Thread.run(Unknown Source)

Specs are unchanged:

Operating System: Windows XP Professional (5.1, Build 2600) Service Pack 1 (2600.xpsp2.030422-1633)
System Manufacturer: Dell Computer Corporation
System Model: OptiPlex GX240
Processor: Intel® Pentium® 4 CPU 2.20GHz
Memory: 512MB RAM
Card name: 16MB ATI Rage 128 Ultra
Manufacturer: ATI Technologies Inc.
Chip type: RAGE128 PRO II, (AGP 4X/PCI)
DAC type: Internal DAC (350Mhz)

And just to confirm, the jars are:

Directory of C:\Program Files\Java\j2re1.4.2_04\lib\ext

06/03/2004 01:52 PM 1,092,001 jogl.dll
07/12/2004 09:28 AM 734,238 jogl.jar
09/05/2003 11:02 AM 40,960 jogl_cg.dll

We kind of use a zombie opengl context to check for valid pixel formats, I guess ATI and Intel don’t like us doing that. I have a couple ideas I want to try out. Thanks for the help guys, I should have something up later today that will hopefully fix the problem.

Alright I went back to a different way of creating the zombie context. I doubt this will work but we will see. I wish my ATI card had this problem, it would be a lot easier to fix. Thanks in advanced for the new error codes.

Well, this is a little better, I guess. The app doesn’t crash and gets a display up, but flickers as before.

If I owned this card, I’d gladly rip it out and send it to you.

Using ChoosePixelFormat because no wglChoosePixelFormatARB: dummyGL = null
Using ChoosePixelFormat because no wglChoosePixelFormatARB: dummyGL = null
Choosing window system’s recommended choice of 4
GLCapabilities [DoubleBuffered: false, Stereo: false, HardwareAccelerated: false, DepthBits: 32, StencilBits: 8, Red: 8, Green: 8, Blue: 8, Alpha: 0, Red Accum: 16, Green Accum: 16, Blue Accum: 16, Alpha Accum: 0 ]
Chosen pixel format (4):
GLCapabilities [DoubleBuffered: false, Stereo: false, HardwareAccelerated: false, DepthBits: 32, StencilBits: 8, Red: 8, Green: 8, Blue: 8, Alpha: 0, Red Accum: 16, Green Accum: 16, Blue Accum: 16, Alpha Accum: 0 ]
!!! Created OpenGL context 65536
!!! Created GL context for net.java.games.jogl.impl.windows.WindowsOnscreenGLContext
!!! Initializing GLU extension address table
!!! Initializing OpenGL extension address table
Making context net.java.games.jogl.impl.windows.WindowsOnscreenGLContext@17ee8b8 current
Freeing context net.java.games.jogl.impl.windows.WindowsOnscreenGLContext@17ee8b8
!!! Destroyed OpenGL context 65536
Choosing window system’s recommended choice of 4
GLCapabilities [DoubleBuffered: false, Stereo: false, HardwareAccelerated: false, DepthBits: 32, StencilBits: 8, Red: 8, Green: 8, Blue: 8, Alpha: 0, Red Accum: 16, Green Accum: 16, Blue Accum: 16, Alpha Accum: 0 ]
Chosen pixel format (4):
GLCapabilities [DoubleBuffered: false, Stereo: false, HardwareAccelerated: false, DepthBits: 32, StencilBits: 8, Red: 8, Green: 8, Blue: 8, Alpha: 0, Red Accum: 16, Green Accum: 16, Blue Accum: 16, Alpha Accum: 0 ]
!!! Created OpenGL context 131072
!!! Created GL context for net.java.games.jogl.impl.windows.WindowsOnscreenGLContext
!!! Initializing OpenGL extension address table
Making context net.java.games.jogl.impl.windows.WindowsOnscreenGLContext@d08633 current
Vendor: Microsoft Corporation
Renderer: GDI Generic
Version: 1.1.0
Extensions: GL_WIN_swap_hint GL_EXT_bgra GL_EXT_paletted_texture

[quote]Alright I went back to a different way of creating the zombie context. I doubt this will work but we will see. I wish my ATI card had this problem, it would be a lot easier to fix. Thanks in advanced for the new error codes.
[/quote]
It does display this time but is still flickering.

CANVAS GL IS: net.java.games.jogl.impl.windows.WindowsGLImpl
CANVAS GLU IS: net.java.games.jogl.impl.GLUImpl
Using ChoosePixelFormat because no wglChoosePixelFormatARB: dummyGL = null
Using ChoosePixelFormat because no wglChoosePixelFormatARB: dummyGL = null
Choosing window system’s recommended choice of 6
GLCapabilities [DoubleBuffered: false, Stereo: false, HardwareAccelerated: false, DepthBits: 32, StencilBits: 8, Red: 8, Gree
n: 8, Blue: 8, Alpha: 0, Red Accum: 16, Green Accum: 16, Blue Accum: 16, Alpha Accum: 0 ]
Chosen pixel format (6):
GLCapabilities [DoubleBuffered: false, Stereo: false, HardwareAccelerated: false, DepthBits: 32, StencilBits: 8, Red: 8, Gree
n: 8, Blue: 8, Alpha: 0, Red Accum: 16, Green Accum: 16, Blue Accum: 16, Alpha Accum: 0 ]
Choosing window system’s recommended choice of 6
GLCapabilities [DoubleBuffered: false, Stereo: false, HardwareAccelerated: false, DepthBits: 32, StencilBits: 8, Red: 8, Gree
n: 8, Blue: 8, Alpha: 0, Red Accum: 16, Green Accum: 16, Blue Accum: 16, Alpha Accum: 0 ]
Chosen pixel format (6):
GLCapabilities [DoubleBuffered: false, Stereo: false, HardwareAccelerated: false, DepthBits: 32, StencilBits: 8, Red: 8, Gree
n: 8, Blue: 8, Alpha: 0, Red Accum: 16, Green Accum: 16, Blue Accum: 16, Alpha Accum: 0 ]
!!! Created OpenGL context 65536
!!! Created GL context for net.java.games.jogl.impl.windows.WindowsOnscreenGLContext
!!! Initializing GLU extension address table
!!! Created OpenGL context 65537
!!! Created GL context for net.java.games.jogl.impl.windows.WindowsOnscreenGLContext
!!! Initializing OpenGL extension address table
Making context net.java.games.jogl.impl.windows.WindowsOnscreenGLContext@10bc49d current
Freeing context net.java.games.jogl.impl.windows.WindowsOnscreenGLContext@10bc49d
!!! Destroyed OpenGL context 65536
!!! Initializing OpenGL extension address table
INIT GL IS: net.java.games.jogl.impl.windows.WindowsGLImpl
Making context net.java.games.jogl.impl.windows.WindowsOnscreenGLContext@6025e7 current
GL_VENDOR: Microsoft Corporation
GL_RENDERER: GDI Generic
GL_VERSION: 1.1.0

I added a call to GLCapabilities.toString() in my app and executed against jogl 1.0 (April 12th). I’m pasting it to show what I think I should be getting.

C:\Development\Projects\jogl\nehe\lesson07>java Lesson07
GLCapabilities [DoubleBuffered: true, Stereo: false, HardwareAccelerated: true,DepthBits: 24, StencilBits: 0, Red: 8, Green: 8, Blue: 8, Alpha: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0 ]
Vendor: ATI Technologies Inc.
Renderer: RAGE 128 Pro Ultra x86/SSE2
Version: 1.2.1716 WinXP Release
Extensions: GL_ARB_multitexture GL_ARB_texture_border_clamp GL_ARB_texture_env_add GL_ARB_transpose_matrix GL_ARB_vertex_blend GL_ARB_window_pos GL_ATI_texture_mirror_once GL_ATI_vertex_streams GL_ATIX_vertex_shader_output_point_size GL_EXT_abgr GL_EXT_bgra GL_EXT_clip_volume_hint GL_EXT_compiled_vertex_array GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_packed_pixels GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_stencil_wrap GL_EXT_texgen_reflection GL_EXT_texture_env_add GL_EXT_texture3D GL_EXT_texture_edge_clamp GL_EXT_texture_env_combine GL_EXT_texture_object GL_EXT_vertex_array GL_KTX_buffer_region GL_NV_texgen_reflection GL_SGI_texture_edge_clamp GL_SGIS_texture_border_clamp GL_SGIS_texture_lod GL_SGIS_multitexture GL_WIN_swap_hint WGL_EXT_extensions_string WGL_EXT_swap_control

Thanks guys. It looks like the problem is that you guys are getting the MS software implementation. I think its software blitting is the cause of the flickering. I will include a little code to figure out what pixelformats are available to be picked from and hopefully we will be able to figure out why they are not being picked.

I think have found a logic error so try the new jar. Also I am assuming that you guys are not requesting a 32bit zbuffer. Most commercial cards don’t support it so if you are change it to 24bits and give that a try.

Yes!!! Runs without flicker. Well done :smiley:

Console output is too long to post, would you like me to email it ?

Cheers
David

As long as everyone says it works now don’t bother with the debug info. It looks like when windows said to pick pixelformat 6 we were using pixelformat 7. If this works for everyone I will post a version that won’t spit out all the debug info and I will email Ken to get teh change in the CVS.

Erm. Yeah, it runs now without flicker, BUT I seem to have lost all keyboard inputs except Escape.

Again, comparing with the 1.0 version of jogl, same code, the keyboard inputs work fine.

Worse yet, now running the same code with the new jogl.jar, I get an exception outside the VM.

Here is a snippet of the log. I suspect I’ll need to reboot to clean this up as it is continuing to happen.

!!! Initializing GLU extension address table
Using ATI workaround of dispatching display() on event thread
!!! Initializing OpenGL extension address table
Making context net.java.games.jogl.impl.windows.WindowsOnscreenGLContext@1995d80 current
Freeing context net.java.games.jogl.impl.windows.WindowsOnscreenGLContext@1995d80

!!! Destroyed OpenGL context 65536
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x6902FD5E
Function=glPushClientAttrib+0x11AE
Library=C:\WINDOWS\SYSTEM32\atioglaa.dll

Current Java thread:
at net.java.games.jogl.impl.windows.WindowsGLImpl.dispatch_wglChoosePixelFormatARB(Native Method)
at net.java.games.jogl.impl.windows.WindowsGLImpl.wglChoosePixelFormatARB(WindowsGLImpl.java:33092)

I spoke too soon. This happened a couple of times in a dozen or so runs (Gears):


Chosen pixel format (6):
GLCapabilities [DoubleBuffered: false, Stereo: false, HardwareAccelerated: false, DepthBits: 32, StencilBits: 8, Red: 8, Gree
n: 8, Blue: 8, Alpha: 0, Red Accum: 16, Green Accum: 16, Blue Accum: 16, Alpha Accum: 0 ]
!!! Created OpenGL context 65536
!!! Created GL context for net.java.games.jogl.impl.windows.WindowsOnscreenGLContext
!!! Initializing GLU extension address table
!!! Initializing OpenGL extension address table
Making context net.java.games.jogl.impl.windows.WindowsOnscreenGLContext@10bc49d current
Freeing context net.java.games.jogl.impl.windows.WindowsOnscreenGLContext@10bc49d
!!! Destroyed OpenGL context 65536
Used wglChoosePixelFormatARB to recommend pixel format 6
net.java.games.jogl.GLException: Unable to enumerate pixel formats of window using wglGetPixelFormatAttribivARB: 0
at net.java.games.jogl.impl.windows.WindowsGLContext.choosePixelFormatAndCreateContext(WindowsGLContext.java:390)
at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.create(WindowsOnscreenGLContext.java:211)
at net.java.games.jogl.impl.windows.WindowsGLContext.makeCurrent(WindowsGLContext.java:133)
at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.makeCurrent(WindowsOnscreenGLContext.java:110)
at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:254)
at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:208)
at net.java.games.jogl.GLCanvas.display(GLCanvas.java:75)
at net.java.games.jogl.Animator$1.run(Animator.java:107)
at java.lang.Thread.run(Thread.java:534)

PS Its midnight here in the UK, so I’m signing off. Night night all.

Ok, a little further testing shows that the Animator does not appear to be running. I display the first frame and then freeze.

There appears to be some sort of race condition as sometimes I crash on startup with that exception outside the VM and other times it starts up and displays the first frame.

Doing a full thread dump doesn’t show any obvious differences between the two versions of jogl.

I think that is teh ATI workaround which you can shut off by setting a system property to false. Try -DATI_WORKAROUND=false at the command line. I can shut it off for everyone but Ken added it for a reason. It doesn’t work on my ATI machine either that’s why I had it shut off before but use the command line please with the new jar I just uploaded.