Bug 397 - Invalid result 11 from GLCapabilitiesChooser
Summary: Invalid result 11 from GLCapabilitiesChooser
Status: VERIFIED FIXED
Alias: None
Product: Jogl
Classification: JogAmp
Component: windows (show other bugs)
Version: 2
Hardware: pc_all windows
: P3 major
Assignee: Sven Gothel
URL:
: 405 410 428 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-04-26 21:53 CEST by robertmachardy
Modified: 2010-11-26 05:26 CET (History)
7 users (show)

See Also:
Type: DEFECT
SCM Refs:
7262641429b542929efc699e392f410f1dee2187
Workaround: ---


Attachments
test application (1.84 MB, application/x-zip-compressed)
2010-04-26 21:55 CEST, robertmachardy
Details
log (43.09 KB, application/octet-stream)
2010-04-26 22:20 CEST, robertmachardy
Details
Debug output for b229 showing the same error as before (18.65 KB, text/plain)
2010-11-23 14:21 CET, Wade Walker
Details
win7-64, SWT 3.7M3, jogl-a77abd78367fd8e172b6bae0fa742ac3c89bb243 (deleted)
2010-11-26 05:07 CET, Sven Gothel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description robertmachardy 2010-04-26 21:53:41 CEST
All,

My application crashes with the following exception:

Exception in thread "main" javax.media.opengl.GLException: Invalid result 11 from GLCapabilitiesChooser (should be between 1 and 6)

The exception is thrown when I call capabilities.setSampleBuffers(true) and capabilities.setNumSamples(2).  See http://www.javagaming.org/index.php?topic=21900.0 for a forum discussion.

The attached zip contains jar, dll, java, and batch files that I have used to reproduce the error on several machines with different graphics cards.  See exception.txt for crash details.  Build.bat and run.bat may be used to compile and run the application.

Thank you,
Robert
Comment 1 robertmachardy 2010-04-26 21:55:36 CEST
Created attachment 142 [details]
test application
Comment 2 robertmachardy 2010-04-26 22:20:15 CEST
Created attachment 143 [details]
log

Logging with -Dnewt.debug=all -Dnativewindow.debug=all -Djogl.debug=all
Comment 3 Sven Gothel 2010-11-19 00:22:52 CET
*** Bug 410 has been marked as a duplicate of this bug. ***
Comment 4 Sven Gothel 2010-11-19 00:24:16 CET
Will fix this see on Windows. See #410, where it's working on X11.
Comment 5 Sven Gothel 2010-11-19 04:10:21 CET
*** Bug 429 has been marked as a duplicate of this bug. ***
Comment 6 Sven Gothel 2010-11-19 04:14:58 CET
*** Bug 428 has been marked as a duplicate of this bug. ***
Comment 7 Sven Gothel 2010-11-19 04:16:46 CET
I am within reworking the Windows Capabilities -> WGL GraphicsConfiguration code.

Stay tuned ..
Comment 8 Sven Gothel 2010-11-19 04:23:19 CET
*** Bug 405 has been marked as a duplicate of this bug. ***
Comment 9 Sven Gothel 2010-11-22 17:58:12 CET
    Tested on Window7-x86 (amd/nvidia), WinXP-x32-VirtualBox.
    
    Solution:
    
    Cleaned up X11/GLX code to use it as a correct boilerplate
    for the new WGL selection, which now duplicates the same behavior.
    
    X11/GLX and WGL follow the common logic:
    
    - 1st try:
      - get GLCapabilities based on users GLCapabilities
      - setting recommendedIndex as preferred choice
    
    - 2nd try:
      - get all GLCapabilities available
      - no preferred recommendedIndex available
    
    If no recommendedIndex has been selected and no chooser has been passed,
    we use the DefaultGLCapabilitiesChooser.
    
    Choose the GLCapabilities if a chooser is given (or see above).
Comment 10 Sven Gothel 2010-11-22 21:14:35 CET
*** Bug 427 has been marked as a duplicate of this bug. ***
Comment 11 Wade Walker 2010-11-23 14:21:39 CET
Created attachment 173 [details]
Debug output for b229 showing the same error as before

Hi Sven,

I tested b229 which looks like it contains this fix, and I get the same error as before. I've attached the new trace, which looks very similar to my previous trace in bug 429 (http://jogamp.org/bugzilla/show_bug.cgi?id=429).

This is on the same machine as in bug 429:

Windows XP SP2 32-bit
Java 1.6.0_17
!MESSAGE 
GL_VENDOR: NVIDIA Corporation
GL_RENDERER: GeForce FX 5200/AGP/SSE2
GL_VERSION: 2.1.2
Comment 12 Wade Walker 2010-11-23 14:23:44 CET
Reopened since this doesn't fix bug 429 (sorry if this is a breach of protocol, just let me know if you don't want me to reopen bugs).

I've attached a new output log showing the same error as before, but with the line numbers slightly different :)
Comment 13 Sven Gothel 2010-11-23 16:32:48 CET
Reduced prio/severity, due to it's impact to non ARB WGL driver,
where WGL ARB pixelformat extension is even supported within VirtualBox.

Wade, no it's completely ok to reopen it, and I thank you for that.

As you can see in my test matrix, my test machines all ran with the WGL ARB extension,
and your test ran with the GDI pixelformat code path.
The latter seems to still have a bug, I will check on this after the release work.

Cheers, Sven
Comment 14 Wade Walker 2010-11-23 19:21:07 CET
(In reply to comment #13)
> As you can see in my test matrix, my test machines all ran with the WGL ARB
> extension,
> and your test ran with the GDI pixelformat code path.

Should I add my test to the unit tests perhaps? That way we can see if this problem can be duplicated on your test machines.
Comment 15 Sven Gothel 2010-11-23 19:56:13 CET
that would be awesome .. (you know the wiki/bugreport/junit test, I assume)

after the 1st release candidate .. I will try to set up an 'old fashion' machine with kinda no WGL modern OpenGL .. hmm .. maybe just with SW GL :)
Comment 16 Wade Walker 2010-11-24 14:39:35 CET
I forgot to mention -- a workaround for this bug is to put "GDI.GetDC(glcanvas.handle);" right after the first "glcanvas.setCurrent();" call in the app.

If you do that, the pixelformat error goes away and the program works normally, but this obviously only works on Windows, so it's not a real fix. But it might give you some insisight into the root cause.
Comment 17 Sven Gothel 2010-11-26 05:07:08 CET
Created attachment 178 [details]
win7-64, SWT 3.7M3, jogl-a77abd78367fd8e172b6bae0fa742ac3c89bb243
Comment 18 Sven Gothel 2010-11-26 05:22:48 CET
The content of attachment 178 [details] has been deleted by
    Sven Gothel <sgothel@jausoft.com>
without providing any reason.

The token used to delete this attachment was generated at 2010-11-26 05:22:25 MST.
Comment 19 Sven Gothel 2010-11-26 05:26:03 CET
Wade's original bug report is not a duplicate of this one, as it turns out.

Hence #429 is reopened, this one closed.