heronarts / LXStudio

LXStudio Digital Lighting Workstation
http://lx.studio
Other
103 stars 4 forks source link

Packaging for Raspberry Pi #3

Closed Toby66 closed 2 years ago

Toby66 commented 2 years ago

Hi there, I'm trying to compile the LXStudio-IDE to put over onto a RaspberryPi but I'm getting the following error on terminal when launching.

[LX 2021/11/10 23:19:18] Initializing LX version 0.2.1 WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.jogamp.common.os.NativeLibrary$3 (file:/home/pi/Desktop/LXStudio-IDE.jar) to method java.lang.ClassLoader.findLibrary(java.lang.String) WARNING: Please consider reporting this to the maintainers of com.jogamp.common.os.NativeLibrary$3 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release [LX 2021/11/10 23:19:26] Project loaded successfully from /home/pi/Projects/TESTPROJECT.lxp handleDraw() called before finishing com.jogamp.opengl.GLException: Caught ThreadDeath: null on thread main-FPSAWTAnimator#00-Timer0 at com.jogamp.opengl.GLException.newGLException(GLException.java:76) at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1327) at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147) at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759) at jogamp.opengl.GLAutoDrawableBase.defaultWindowResizedOp(GLAutoDrawableBase.java:260) at com.jogamp.newt.opengl.GLWindow.access$200(GLWindow.java:119) at com.jogamp.newt.opengl.GLWindow$2.windowResized(GLWindow.java:141) at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:4383) at jogamp.newt.WindowImpl.sendWindowEvent(WindowImpl.java:4317) at jogamp.newt.WindowImpl.sizeChanged(WindowImpl.java:4520) at jogamp.newt.driver.bcm.vc.iv.WindowDriver.reconfigure0(Native Method) at jogamp.newt.driver.bcm.vc.iv.WindowDriver.reconfigureWindowImpl(WindowDriver.java:268) at jogamp.newt.WindowImpl$SetSizeAction.run(WindowImpl.java:1368) at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:2780) at jogamp.newt.WindowImpl.setSize(WindowImpl.java:1394) at com.jogamp.newt.opengl.GLWindow.setSize(GLWindow.java:588) at processing.opengl.PSurfaceJOGL.setSize(PSurfaceJOGL.java:770) at heronarts.p3lx.ui.UI.pre(UI.java:832) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at processing.core.PApplet$RegisteredMethods.handle(PApplet.java:1436) at processing.core.PApplet$RegisteredMethods.handle(PApplet.java:1429) at processing.core.PApplet.handleMethods(PApplet.java:1628) at processing.core.PApplet.handleDraw(PApplet.java:2473) at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:866) at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692) at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674) at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:443) at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293) at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147) at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759) at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81) at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452) at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178) at java.base/java.util.TimerThread.mainLoop(Timer.java:556) at java.base/java.util.TimerThread.run(Timer.java:506) Caused by: java.lang.ThreadDeath at java.base/java.lang.Thread.stop(Thread.java:937) at com.jogamp.newt.opengl.GLWindow$GLLifecycleHook$1.run(GLWindow.java:724) at java.base/java.security.AccessController.doPrivileged(Native Method) at com.jogamp.newt.opengl.GLWindow$GLLifecycleHook.shutdownRenderingAction(GLWindow.java:719) at jogamp.newt.WindowImpl.shutdown(WindowImpl.java:635) at jogamp.newt.WindowImpl.shutdownAll(WindowImpl.java:123) at jogamp.newt.DisplayImpl$1.run(DisplayImpl.java:74) at com.jogamp.nativewindow.NativeWindowFactory.shutdown(NativeWindowFactory.java:274) at com.jogamp.nativewindow.NativeWindowFactory$2$1.run(NativeWindowFactory.java:192) at java.base/java.lang.Thread.run(Thread.java:829) EGLDisplayUtil.EGLDisplays: Shutdown (open: 1) EGLDisplayUtil: Open EGL Display Connections: 1 EGLDisplayUtil: Open[0]: 0x1: EGLDisplayRef[0x1: refCnt 2]

I'm using the LXStudioAPP class and have tried a fresh Pi install (with default-jdk installed) and with my own, an empty and the example LXP. I get the error both with a screen attached, where lines appear over the UI, and on VNC which gives just a black screen. Although it appears to open the project file, it doesn't output any data via artnet (checked the project file and all looks ok)

Also when running just over Putty/SSH with no screen attached I get the below;

[LX 2021/11/10 23:26:39] Initializing LX version 0.2.1 Cannot run sketch without a display. Read this for possible solutions: https://github.com/processing/processing/wiki/Running-without-a-Display

I just wanted to make sure I've not missed anything obvious or stumbling onto a known problem before digging deeper.

Thanks!

mcslee commented 2 years ago

Hrm I haven't seen that exact error before but it's definitely coming from the JOGL stack which does the openGL bootstrapping for Java/Processing.

Are you hoping/intending to run with a UI on the RaspPi? If not, then you should pass the --headless CLI flag when you invoke on RPi. https://github.com/heronarts/LXStudio-IDE/blob/master/src/main/java/heronarts/lx/app/LXStudioApp.java#L105

This will run without any of the Processing UI being bootstrapped up and should bypass all the code that's going to have problems with GL libraries.

Let me know how that goes? If still having trouble can you send me the details/commands you're using to invoke this from the CLI?

Toby66 commented 2 years ago

Hey Mark,

I've been having a little more look at this and headless works fine, I was just missing a '-' in the terminal before (it was late at night that's my excuse! ha)

I did a fresh install of Raspbian and compile which seemed to fix the UI error initially, allowing me to open and close the programme with the UI still working, but then as soon as you save or load a project and open it again, I get the same blank screen and errors in terminal. Even removing the project files and copying over a new compile still doesn't fix it so it seems to be saving something/triggering something on the Pi itself on the first run?

mcslee commented 2 years ago

Hey Toby - ah, glad headless was simple. Regarding the other error, I now see what's going on here. The difference between a fresh load and a file-restore-load is that there is a file containing the last used window size, which LXStudio will try to restore on subsequent launches. And some systems for some reason really don't like this setSize() call.

That's happening in here: https://github.com/heronarts/P3LX/blob/master/src/main/java/heronarts/p3lx/ui/UI.java#L838

Solution:

I don't know why this barfs on some systems and is fine on others. Hopefully it will work more broadly on Processing 4 with newer JOGL libraries (I'm going to upgrade soon).

As long as you can live with non-resizability, I think this will sort you out with a one-line fix. Let me know if that gets it properly working for you!

Toby66 commented 2 years ago

Thanks Mark, I made the amendments and has been working perfect this past week!