Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualize Windows does not work on Raspbian / RaspberryPi #47

Closed
derFrickler opened this issue Feb 13, 2013 · 21 comments

Comments

Projects
None yet
9 participants
@derFrickler
Copy link

commented Feb 13, 2013

Just tried to get the new Visualizer Window running on my RaspberryPi running raspbian
Found some issues here.

First, 2 more libs for the arm Platform are needed, which can be found in the Processing project:

gluegen-rt-natives-linux-armv6hf.jar
jogl-all-natives-linux-armv6hf.jar

With this libs added, UniversalGcodeSender compiles and starts.

Then if i try to open the Visualizer Windows via the Visualize Button i get the following Exception:

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.media.nativewindow.DefaultGraphicsConfiguration cannot be cast to com.jogamp.nativewindow.awt.AWTGraphicsConfiguration
at javax.media.opengl.awt.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java:1096)
at javax.media.opengl.awt.GLCanvas.addNotify(GLCanvas.java:529)
at java.awt.Container.addNotify(Container.java:2769)
at javax.swing.JComponent.addNotify(JComponent.java:4734)
at java.awt.Container.addNotify(Container.java:2769)
at javax.swing.JComponent.addNotify(JComponent.java:4734)
at java.awt.Container.addNotify(Container.java:2769)
at javax.swing.JComponent.addNotify(JComponent.java:4734)
at javax.swing.JRootPane.addNotify(JRootPane.java:756)
at java.awt.Container.addNotify(Container.java:2769)
at java.awt.Window.addNotify(Window.java:770)
at java.awt.Frame.addNotify(Frame.java:487)
at java.awt.Window.pack(Window.java:807)
at com.willwinder.universalgcodesender.VisualizerWindow.(Unknown Source)
at com.willwinder.universalgcodesender.MainWindow.visualizeButtonActionPerformed(Unknown Source)
at com.willwinder.universalgcodesender.MainWindow.access$600(Unknown Source)
at com.willwinder.universalgcodesender.MainWindow$8.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)

Might be a bug with jogl on the arm platform, i will try to find out how to fix this.

@derFrickler

This comment has been minimized.

Copy link
Author

commented Feb 13, 2013

Just confirmed that the jogl demos work fine on the Raspberry

https://gist.github.com/xranby/55de4fd65bfadae26203

seems to be a problem with the GCodeSender Code...will try to get into that when i get time...

@winder

This comment has been minimized.

Copy link
Owner

commented Feb 13, 2013

Thanks for looking into this. I'm also interested in finding a way to get the RXTX libraries included for the RP, but haven't been able to figure it out yet.

@derFrickler

This comment has been minimized.

Copy link
Author

commented Feb 13, 2013

Yes, that would be nice.
If i get it right, the rxtx lib copies the matching librxtxSerial.so for the current platform to the temp dir and loads it from there. I think you will just need to add the librxtxSerial.so for armhf to the right lib/natives folder.
Problem will be where to get that for your version of RXTX. The one provided in raspbian is newer:

WARNING: RXTX Version mismatch
Jar version = RXTX-2.1-7
native lib Version = RXTX-2.2pre2

@derFrickler

This comment has been minimized.

Copy link
Author

commented Feb 13, 2013

Wrong, will not work like that.
Copy the right librxtxSerial.so for armhf to the /natives/armhf/ dir
and create a new Task in the build.xml. That should do the job.

Bundling: OneJAR is preparing ${standalone.jar.name}-raspbian.jar










raspbian_ant_task
Will try that the next days.

@winder

This comment has been minimized.

Copy link
Owner

commented Feb 13, 2013

The lib folder is how I organize them, in the ant build.xml they are copied to the same place which causes name collisions. That is why I've gone with separate 32/64 bit releases and why I haven't added the new .so for RP.

The jar/native mismatch warning can be ignored for now (the windows build has been mismatched all along), but should probably be fixed at some point anyway.

@winder

This comment has been minimized.

Copy link
Owner

commented Feb 13, 2013

There are a lot of legacy targets in the build.xml, the all-in-one builds end with -all and -all64

@derFrickler

This comment has been minimized.

Copy link
Author

commented Feb 13, 2013

Yes, but why not just making an extra target for the raspberry with the right native-lib in it.
i just sent it to you by mail.

@winder

This comment has been minimized.

Copy link
Owner

commented Feb 27, 2013

I think I found a way to get everything into one build, 32/64 bit for windows/linux/macosx and RaspberryPi.

As for the issue you found with the visualizer window, it looks like there is a solution here:
http://forum.jogamp.org/JME3-Unified-Renderer-Canvas-Use-Issue-td4028152.html#a4028168

The change to use NEWT instead of AWT is something I wanted to do anyway as a sort of optimization, so this is a nice bonus.

@derFrickler

This comment has been minimized.

Copy link
Author

commented Feb 27, 2013

Great!
Is this already in the Code?

@winder

This comment has been minimized.

Copy link
Owner

commented Feb 27, 2013

Windows/linux/macosx 32/64 are in, RaspberryPi all that needs to change is adding the library to the /lib/natives/ directory (not in a folder). The One-Jar package is limited to picking windows/linux/macosx native libraries from hardcoded folder names, but allows one "default" that isn't in a folder (maybe its a bug, but I'm willing to exploit it).

edit: RP also needs to have the visualizer window changed to NEWT, that isn't done yet.

@samitray

This comment has been minimized.

Copy link

commented May 3, 2013

tried a quick shot at converting Visualizer window to NWT, changes compile OK and seems to move forward, however there are issue with the arm jars not being found , i did add them into the jar file inside /lib ...couldn’t figure how to fix the jar paths. here is the exception after all changes (not much though)

[JarClassLoader] INFO: findResource() found: "com/jogamp/common/os/Platform.class" for caller null in codebase lib/gluegen-rt.jar
Catched FileNotFoundException: JAR entry lib/gluegen-rt-natives-linux-armv6.jar!/ not found in /home/pi/UGS/UniversalGcodeSender .jar, while TempJarCache.bootstrapNativeLib() of jar:file:/home/pi/UGS/UniversalGcodeSender%20.jar!/lib/gluegen-rt-natives-linux-armv6.jar!/ (file:/home/pi/UGS/UniversalGcodeSender%20.jar!/lib/ + gluegen-rt-natives-linux-armv6.jar)
[JarClassLoader] INFO: findResource() found: "jogamp/nativewindow/NWJNILibLoader.class" for caller null in codebase lib/jogl-all.jar
Catched FileNotFoundException: JAR entry lib/jogl-all-natives-linux-armv6.jar!/ not found in /home/pi/UGS/UniversalGcodeSender .jar, while addNativeJarLibsImpl(classFromJavaJar class jogamp.nativewindow.NWJNILibLoader, classJarURL jar:file:/home/pi/UGS/UniversalGcodeSender%20.jar!/lib/jogl-all.jar!/jogamp/nativewindow/NWJNILibLoader.class, nativeJarBaseName jogl-all): jogl-all-natives-linux-armv6.jar + file:/home/pi/UGS/UniversalGcodeSender%20.jar!/lib/ -> jar:file:/home/pi/UGS/UniversalGcodeSender%20.jar!/lib/jogl-all-natives-linux-armv6.jar!/
[JarClassLoader] INFO: findResource() found: "jogamp/nativewindow/NWJNILibLoader.class" for caller null in codebase lib/jogl-all.jar
Catched IOException: TempJarCache: addNativeLibs: jar:file:/home/pi/UGS/UniversalGcodeSender%20.jar!/lib/jogl-all-natives-linux-armv6.jar!/, previous load attempt failed, while addNativeJarLibsImpl(classFromJavaJar class jogamp.nativewindow.NWJNILibLoader, classJarURL jar:file:/home/pi/UGS/UniversalGcodeSender%20.jar!/lib/jogl-all.jar!/jogamp/nativewindow/NWJNILibLoader.class, nativeJarBaseName jogl-all): jogl-all-natives-linux-armv6.jar + file:/home/pi/UGS/UniversalGcodeSender%20.jar!/lib/ -> jar:file:/home/pi/UGS/UniversalGcodeSender%20.jar!/lib/jogl-all-natives-linux-armv6.jar!/
[JarClassLoader] INFO: findResource() found: "jogamp/nativewindow/NWJNILibLoader.class" for caller null in codebase lib/jogl-all.jar
Catched IOException: TempJarCache: addNativeLibs: jar:file:/home/pi/UGS/UniversalGcodeSender%20.jar!/lib/jogl-all-natives-linux-armv6.jar!/, previous load attempt failed, while addNativeJarLibsImpl(classFromJavaJar class jogamp.nativewindow.NWJNILibLoader, classJarURL jar:file:/home/pi/UGS/UniversalGcodeSender%20.jar!/lib/jogl-all.jar!/jogamp/nativewindow/NWJNILibLoader.class, nativeJarBaseName jogl-all): jogl-all-natives-linux-armv6.jar + file:/home/pi/UGS/UniversalGcodeSender%20.jar!/lib/ -> jar:file:/home/pi/UGS/UniversalGcodeSender%20.jar!/lib/jogl-all-natives-linux-armv6.jar!/
BCM.Display initIDs ok
BCM.Screen initIDs ok
BCM.Window initIDs ok
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Native windowing type .bcm.vc.iv (custom) not yet supported, platform reported native windowing type: .bcm.vc.iv
at jogamp.nativewindow.NativeWindowFactoryImpl.getAWTNativeWindow(NativeWindowFactoryImpl.java:99)
at jogamp.nativewindow.NativeWindowFactoryImpl.getNativeWindowImpl(NativeWindowFactoryImpl.java:65)
at javax.media.nativewindow.NativeWindowFactory.getNativeWindow(NativeWindowFactory.java:477)
at jogamp.newt.awt.NewtFactoryAWT.getNativeWindow(NewtFactoryAWT.java:70)
at com.jogamp.newt.awt.NewtCanvasAWT.reparentWindow(NewtCanvasAWT.java:428)
at com.jogamp.newt.awt.NewtCanvasAWT.addNotify(NewtCanvasAWT.java:391)
at java.awt.Container.addNotify(Container.java:2769)
at javax.swing.JComponent.addNotify(JComponent.java:4748)
at java.awt.Container.addNotify(Container.java:2769)
at javax.swing.JComponent.addNotify(JComponent.java:4748)
at java.awt.Container.addNotify(Container.java:2769)
at javax.swing.JComponent.addNotify(JComponent.java:4748)
at javax.swing.JRootPane.addNotify(JRootPane.java:757)
at java.awt.Container.addNotify(Container.java:2769)
at java.awt.Window.addNotify(Window.java:770)
at java.awt.Frame.addNotify(Frame.java:487)
at java.awt.Window.pack(Window.java:807)
at com.willwinder.universalgcodesender.visualizer.VisualizerWindow.(VisualizerWindow.java:105)
at com.willwinder.universalgcodesender.MainWindow.visualizeButtonActionPerformed(MainWindow.java:1187)
at com.willwinder.universalgcodesender.MainWindow.access$700(MainWindow.java:62)
at com.willwinder.universalgcodesender.MainWindow$9.actionPerformed(MainWindow.java:336)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)

@winder

This comment has been minimized.

Copy link
Owner

commented May 3, 2013

@samitray are you building a UGS package? I'm wondering if the .jar file is missing the native libraries.

@winder

This comment has been minimized.

Copy link
Owner

commented May 3, 2013

@samitray also, I'm not using the native jar's, I couldn't get them to work when bundled inside a One-Jar package (got the same error you get here). The binaries in the /lib/natives/arm/ directory should contain everything thats needed. I ended up patching One-Jar to look for that arm directory instead of patching JOGL.

Details about the problem are here: http://forum.jogamp.org/ZipException-when-loading-native-jars-td4027387.html

@samitray

This comment has been minimized.

Copy link

commented May 6, 2013

will try patching oneJar, however further reading on the NWT issue on jogamp forum leads me to believe that visualizer may still not work because (gotta hunt up the link) only full frame buffer works anything with xterminal is not yet supported on Rpi, however i will it it one more try and keep you posted.

@pelowitz

This comment has been minimized.

Copy link

commented Jun 17, 2017

It seems that there has been no forward movement (in four years) on fixing the "Visualize" on the RPi. I'd donate an RPi to someone willing to fix this problem I'd also donate $$$ to the project to see this gets addressed!

@awd86

This comment has been minimized.

Copy link

commented Aug 10, 2017

I'll second that

@goloplo

This comment has been minimized.

Copy link

commented Nov 16, 2017

Any chance to see the visualiser working on RPI in the future?

@trilitheum

This comment has been minimized.

Copy link

commented Jan 31, 2018

@winder Would love to see the visualizer get fixed on the RPi as well!

@Flugpaul

This comment has been minimized.

Copy link

commented Dec 15, 2018

Hello, is there any result for solving the RP - UGS -Plattform "visulize Window" Problem? I just build a CNC Milling mashine (UGS Platform, Raspberry PI, Arduino with GRBL). I can work with UGS on the rasp, but I can't see the milling progress in the window. Only when I connect instead of the RP my windows-Notebook I have the visulize window working.

@pelowitz

This comment has been minimized.

Copy link

commented Dec 15, 2018

@breiler

This comment has been minimized.

Copy link
Collaborator

commented Apr 25, 2019

Finally got this working. See these instructions to get it working here: https://github.com/winder/Universal-G-Code-Sender/wiki/Raspberry-Pi

@breiler breiler closed this Apr 25, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.