A caught error exception occurred on Raspberry Pi

Hi, while working with processing on raspberry pi I was attempting to have a second screen pop up with data I had gathered in a separate method. On short runs (about 1 minute or less), the code is able to make this without issue. On longer runs (above 1 minute) it pops up this error message in the console:

RunnableTask.run(): A caught exception occured on thread Animation Thread-Display-.x11_:0.0-2-EDT-1: RunnableTask[enqueued true[executed false, flushed false], tTotal 0 ms, tExec 0 ms, tQueue 0 ms, attachment null, throwable java.lang.RuntimeException: Waited 5000ms for: <127debe, 14323ef>[count 1, qsz 0, owner <Animation Thread-FPSAWTAnimator#00-Timer0>] - ]
java.lang.RuntimeException: Waited 5000ms for: <127debe, 14323ef>[count 1, qsz 0, owner <Animation Thread-FPSAWTAnimator#00-Timer0>] -
at jogamp.common.util.locks.RecursiveLockImpl01Unfairish.lock(RecursiveLockImpl01Unfairish.java:198)
at jogamp.newt.WindowImpl.getLocationOnScreen(WindowImpl.java:1159)
at jogamp.newt.driver.x11.X11UnderlayTracker.windowMoved(X11UnderlayTracker.java:141)
at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:4386)
at jogamp.newt.WindowImpl.sendWindowEvent(WindowImpl.java:4317)
at jogamp.newt.WindowImpl.positionChanged(WindowImpl.java:4558)
at jogamp.newt.WindowImpl.sizePosMaxInsetsVisibleChanged(WindowImpl.java:4865)
at jogamp.newt.driver.x11.DisplayDriver.DispatchMessages0(Native Method)
at jogamp.newt.driver.x11.DisplayDriver.dispatchMessagesNative(DisplayDriver.java:112)
at jogamp.newt.WindowImpl.waitForVisible(WindowImpl.java:4449)
at jogamp.newt.WindowImpl.waitForVisible(WindowImpl.java:4443)
at jogamp.newt.WindowImpl.createNative(WindowImpl.java:777)
at jogamp.newt.WindowImpl.setVisibleActionImpl(WindowImpl.java:1248)
at jogamp.newt.WindowImpl$VisibleAction.run(WindowImpl.java:1318)
at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:127)
at jogamp.newt.DefaultEDTUtil$NEDT.run(DefaultEDTUtil.java:375)
DefaultEDT.run(): Caught exception occured on thread Animation Thread-Display-.x11_:0.0-2-EDT-1: RunnableTask[enqueued false[executed true, flushed false], tTotal 8481 ms, tExec 8481 ms, tQueue 0 ms, attachment null, throwable java.lang.RuntimeException: Waited 5000ms for: <127debe, 14323ef>[count 1, qsz 0, owner <Animation Thread-FPSAWTAnimator#00-Timer0>] - ]
java.lang.RuntimeException: Waited 5000ms for: <127debe, 14323ef>[count 1, qsz 0, owner <Animation Thread-FPSAWTAnimator#00-Timer0>] -
at jogamp.common.util.locks.RecursiveLockImpl01Unfairish.lock(RecursiveLockImpl01Unfairish.java:198)
at jogamp.newt.WindowImpl.getLocationOnScreen(WindowImpl.java:1159)
at jogamp.newt.driver.x11.X11UnderlayTracker.windowMoved(X11UnderlayTracker.java:141)
at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:4386)
at jogamp.newt.WindowImpl.sendWindowEvent(WindowImpl.java:4317)
at jogamp.newt.WindowImpl.positionChanged(WindowImpl.java:4558)
at jogamp.newt.WindowImpl.sizePosMaxInsetsVisibleChanged(WindowImpl.java:4865)
at jogamp.newt.driver.x11.DisplayDriver.DispatchMessages0(Native Method)
at jogamp.newt.driver.x11.DisplayDriver.dispatchMessagesNative(DisplayDriver.java:112)
at jogamp.newt.WindowImpl.waitForVisible(WindowImpl.java:4449)
at jogamp.newt.WindowImpl.waitForVisible(WindowImpl.java:4443)
at jogamp.newt.WindowImpl.createNative(WindowImpl.java:777)
at jogamp.newt.WindowImpl.setVisibleActionImpl(WindowImpl.java:1248)
at jogamp.newt.WindowImpl$VisibleAction.run(WindowImpl.java:1318)
at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:127)
at jogamp.newt.DefaultEDTUtil$NEDT.run(DefaultEDTUtil.java:375)

After displaying this error it does end up graphing the G4P window without issue which is very weird. If anyone has any ideas on what this error could be, or any possible fixes I would greatly appreciate it. I’m sorry if this is a stupid question I don’t have a ton of experience coding :sweat_smile:

My full code can be found here: Dropbox - Data_Baseline - Simplify your life

The error I believe is coming from the “Second_Screen” file, though the whole code is included just in case. Please let me know if you need any additional information, as I’m more than happy to provide it. Thanks again for any help that you can give :grinning:

If you post to multiple websites, please link between crossposts. This question already has an answer here:

This above is in your error message. It looks like you are holding the main thread in one of your functions. Sorry, no time to check all your source code. You should post the relevant code here or make an mcve.

Now, if after displaying the error and the program displays the graphs, does it continue working normally? If so, I would treat the above as a warning. If I were in your shoes, I would fix it only if it creates some undesirable behavior in my code.

Kf

1 Like

Hi kfrajer Thank you for the response! In the stack overflow question I found some way to disable the error message. It didn’t change anything functionally, but I just didn’t want to see the error message. The link to the solution can be found here: https://stackoverflow.com/questions/50951468/a-caught-exception-occurred-while-trying-to-draw-a-graph-in-processing. Kind of a weird solution and I’m not sure how it works, but the error message is gone so I’m happy. Thanks again for the help though!

Thank you for sharing your solution. From limited experience I believe the error is because you are trying to access the OpenGL renderer a second time while it has been taken by your main window. JAVA2D is the default renderer in Processing. These two statements are the same: size(400,600) and size(400,600,JAVA2D). When you use this renderer, all the graphics calculations are done by the CPU. Therefore, if you have lots of graphical operations, your sketch will lag. On the other hand, if you use size(400,600,P3D) (or P2D), you are using the OpenGL channel to process your graphics operations, which uses your computer’s GPU to accomplish these tasks. In essence, graphical operations experience better performance when compared to the default renderer. As a note, there is a third renderer available in P3, FX2D which is faster than JAVA2D at a cost of less graphics details.

In your case, only one sketch is allowed to use the P3D renderer. Any other sketch should use the JAVA2D.

Kf

1 Like

Awesome thank you for explaining that makes a lot of sense! I have super limited experience in this so that explanation makes this insanely clearer. Thanks a ton! I have to do more graphics in the future and this is going to be very helpful!