Overwriting nativewindow.ws.name to force x11 on R-Pi resuls in UnsatisfiedLinkError

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Overwriting nativewindow.ws.name to force x11 on R-Pi resuls in UnsatisfiedLinkError

gohai
Hello all,

Not sure if this is the right place to fill bug reports, but here we go:

When I set the property nativewindow.ws.name to "jogamp.newt.driver.x11" in order not to use the Raspberry Pi specific driver, I get an UnsatisfiedLinkError for setX11ErrorHandler0(ZZ)V. This is on a system running Eric Anholt's vc4 driver [sortof] running, but the binary vc driver still in place at /opt/vc. It does work when I remove the binary driver from the local jogl looks for it.

I don't know the root cause of this, but I believe it's due to NativeWindowFactory.java mixing nativeWindowingTypePure (here: TYPE_BCM_VC_IV due to the auto-detect) and nativeWindowingTypeCustom for its functionality.

And hints to (properly) solve this would be greatly appreciated. I can probably hack around this issue for now by removing the binary driver, but I rather not make the situation any more complicated for the Raspberry Pi users..

Thanks
Gottfried
Reply | Threaded
Open this post in threaded view
|

Re: Overwriting nativewindow.ws.name to force x11 on R-Pi resuls in UnsatisfiedLinkError

Xerxes Rånby
gohai wrote
Hello all,

Not sure if this is the right place to fill bug reports, but here we go:

When I set the property nativewindow.ws.name to "jogamp.newt.driver.x11" in order not to use the Raspberry Pi specific driver, I get an UnsatisfiedLinkError for setX11ErrorHandler0(ZZ)V. This is on a system running Eric Anholt's vc4 driver [sortof] running, but the binary vc driver still in place at /opt/vc. It does work when I remove the binary driver from the local jogl looks for it.

I don't know the root cause of this, but I believe it's due to NativeWindowFactory.java mixing nativeWindowingTypePure (here: TYPE_BCM_VC_IV due to the auto-detect) and nativeWindowingTypeCustom for its functionality.

And hints to (properly) solve this would be greatly appreciated. I can probably hack around this issue for now by removing the binary driver, but I rather not make the situation any more complicated for the Raspberry Pi users..

Thanks
Gottfried
The autodetection code in NativeWindowFactory think it is on a raspberry pi system using the bcm opengl es library if it can find the /opt/vc/lib/libbcm_host.so
src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java:                    "/opt/vc/lib/libbcm_host.so");

Most ARM GNU/Linux systems uses OpenGL ES with X11 but on the Raspberry Pi using the video core drivers OpenGL ES is using broadcom specific dispmanx surfaces without X11.

If you are using a kernel with Eric Anholt's vc4 driver then i expect you to use X11 with Glamour thus you should only use the mesa OpenGL driver that you have compiled.
Thus it is correct that you should remove the  /opt/vc/lib/ on systems using Erics X11 vc4 drivers.

We need to write some new clever heuristics if both OpenGL drivers can be used on the same Pi system.
Reply | Threaded
Open this post in threaded view
|

Re: Overwriting nativewindow.ws.name to force x11 on R-Pi resuls in UnsatisfiedLinkError

gohai
Thanks for your message! I am indeed trying Eric Anholt's vc4 driver. I followed his suggestion to compile & install the various packages needed in /usr/local, so that I can from the command line either boot the (legacy) Raspbian X Server, or the one with Glamour and VC4 - very convenient for testing purposes!

That's why I thought that setting "nativewindow.ws.name" to "jogamp.newt.driver.x11" would be sufficient to disable the Pi auto-detection. But it appears it is not..

Would you consider a (tested) patch that makes it so that any (set) property of "nativewindow.ws.name" by the user overrules the auto-detection in NativeWindowFactory.java? (basically using nativewindow.ws.name also for nativeWindowingTypePure, if set)

Best
Gottfried
Reply | Threaded
Open this post in threaded view
|

Re: Overwriting nativewindow.ws.name to force x11 on R-Pi resuls in UnsatisfiedLinkError

Sven Gothel
Administrator
On 06/16/2015 12:05 AM, gohai [via jogamp] wrote:

> Thanks for your message! I am indeed trying Eric Anholt's vc4 driver. I
> followed his suggestion to compile & install the various packages needed in
> /usr/local, so that I can from the command line either boot the (legacy)
> Raspbian X Server, or the one with Glamour and VC4 - very convenient for
> testing purposes!
>
> That's why I thought that setting "nativewindow.ws.name" to
> "jogamp.newt.driver.x11" would be sufficient to disable the Pi auto-detection.
> But it appears it is not..
>
> Would you consider a (tested) patch that makes it so that any (set) property
> of "nativewindow.ws.name" by the user overrules the auto-detection in
> NativeWindowFactory.java?
For the Rasp-Pi WS mode, we shall use nativeWindowingType
instead of nativeWindowingTypePure, allowing to use X11/GL.

Great finding.

-> Bug report -> git patch [and test if possible] -> merge

Thank you!

> (basically using nativewindow.ws.name also for
> nativeWindowingTypePure, if set)
That not.

~Sven



signature.asc (828 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Overwriting nativewindow.ws.name to force x11 on R-Pi resuls in UnsatisfiedLinkError

Xerxes Rånby
In reply to this post by gohai
gohai wrote
Thanks for your message! I am indeed trying Eric Anholt's vc4 driver. I followed his suggestion to compile & install the various packages needed in /usr/local, so that I can from the command line either boot the (legacy) Raspbian X Server, or the one with Glamour and VC4 - very convenient for testing purposes!
please post the links to Eric Anholt's instructions or write down instructions how you compiled and installed the various packages.

I have several tests i want to run using his driver if there is a reliable way to build and use it.

Reply | Threaded
Open this post in threaded view
|

Re: Overwriting nativewindow.ws.name to force x11 on R-Pi resuls in UnsatisfiedLinkError

gohai
In reply to this post by Sven Gothel
Hi Sven, Something like this (still untested, trying to set up a JOGL build environment right now):
--- a/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java
@@ -201,6 +201,10 @@ public abstract class NativeWindowFactory {
             nativeWindowingTypeCustom = nativeWindowingTypePure;
         } else {
             nativeWindowingTypeCustom = _tmp[0].intern(); // canonical representation
+            // for testing X11 on Broadcom VC
+            if ( TYPE_BCM_VC_IV == nativeWindowingTypePure ) {
+                nativeWindowingTypePure = nativeWindowingTypeCustom;
+            }
         }
     }
 
Branch Best G