We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, as the title says, im having trouble when trying to access a USB webcam, im using the GL video library.
Is there any step to make this work? (i'm ready to reinstall if necessary), plus (if it helps) i'm exporting the application from my windows pc
The code that im trying to use is the SimpleCapture and the error is the following:
RunnableTask.run(): A caught exception occured on thread main-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: <1d0892e, 1ed8535>[count 1, qsz 0, owner <main-FPSAWTAnimator#00-Timer0>] - <main-Display-.x11_:0.0-2-EDT-1>]
java.lang.RuntimeException: Waited 5000ms for: <1d0892e, 1ed8535>[count 1, qsz 0, owner <main-FPSAWTAnimator#00-Timer0>] - <main-Display-.x11_:0.0-2-EDT-1>
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 main-Display-.x11_:0.0-2-EDT-1: RunnableTask[enqueued false[executed true, flushed false], tTotal 14020 ms, tExec 14020 ms, tQueue 0 ms, attachment null, throwable java.lang.RuntimeException: Waited 5000ms for: <1d0892e, 1ed8535>[count 1, qsz 0, owner <main-FPSAWTAnimator#00-Timer0>] - <main-Display-.x11_:0.0-2-EDT-1>]
java.lang.RuntimeException: Waited 5000ms for: <1d0892e, 1ed8535>[count 1, qsz 0, owner <main-FPSAWTAnimator#00-Timer0>] - <main-Display-.x11_:0.0-2-EDT-1>
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)
Final caps: video/x-raw(memory:GLMemory), width=(int)640, height=(int)480, framerate=(fraction)30/1, format=(string)RGBA, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, texture-target=(string)2D
Answers
Tagging @gohai
Kf
@erwrow The error essentially means that some part of the process of rendering a frame stalled for so long that JOGL essentially gave up at some point.
Couple of options:
you might want to try the regular Video library, since the USB webcam is not hardware-accelerated on the Pi anyhow
you might want to try using a lower resolution or framerate, to see if this improves things
using a camera module for the Raspberry Pi should also be much faster
@gohai
the regular video library isn't available for processing on raspbian (as far as i know)
I just tried with the lowest resolution (and framerate) that my camera allows me (160*120 at 15 fps) and the error that throws me i've passed it at the bottom of this answer.
i don't have the camera module and on my country is expensive :/
from already thank you very much for the answer
the error:
RunnableTask.run(): A caught exception occured on thread main-Display-.x11_:0.0-2-EDT-1: RunnableTask[enqueued true[executed false, flushed false], tTotal 1 ms, tExec 0 ms, tQueue 1 ms, attachment null, throwable java.lang.RuntimeException: Waited 5000ms for: <1626a8, 131bf2a>[count 1, qsz 0, owner <main-FPSAWTAnimator#00-Timer0>] - <main-Display-.x11_:0.0-2-EDT-1>] java.lang.RuntimeException: Waited 5000ms for: <1626a8, 131bf2a>[count 1, qsz 0, owner <main-FPSAWTAnimator#00-Timer0>] - <main-Display-.x11_:0.0-2-EDT-1> 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 main-Display-.x11_:0.0-2-EDT-1: RunnableTask[enqueued false[executed true, flushed false], tTotal 13516 ms, tExec 13515 ms, tQueue 1 ms, attachment null, throwable java.lang.RuntimeException: Waited 5000ms for: <1626a8, 131bf2a>[count 1, qsz 0, owner <main-FPSAWTAnimator#00-Timer0>] - <main-Display-.x11_:0.0-2-EDT-1>] java.lang.RuntimeException: Waited 5000ms for: <1626a8, 131bf2a>[count 1, qsz 0, owner <main-FPSAWTAnimator#00-Timer0>] - <main-Display-.x11_:0.0-2-EDT-1> 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) Final caps: video/x-raw(memory:GLMemory), width=(int)160, height=(int)120, framerate=(fraction)15/1, format=(string)RGBA, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, texture-target=(string)2D EGLDisplayUtil.EGLDisplays: Shutdown (open: 1) EGLDisplayUtil: Open EGL Display Connections: 1 EGLDisplayUtil: Open[0]: 0x1: EGLDisplayRef[0x1: refCnt 2]
@erwrow Which Raspberry Pi model are you trying this with?
The regular Video library does work - but you might need to install the package
gstreamer0.10-plugins-good
. See: https://github.com/processing/processing/wiki/Raspberry-Pi#video-library-capture@gohai
Raspberry Pi 3 b with raspbian
Yes, i was that (you're a genius jaja).
Thank you very much!!!
Hi,
In the error logs shown before what means "that some part of the process of rendering a frame stalled for so long that JOGL essentially gave up at some point."? Is it "Final caps: video/x-raw(memory:GLMemory), width=(int)640, height=(int)480, framerate=(fraction)30/1, format=(string)RGBA, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, texture-target=(string)2D"? It's the only output I have with a sketch which works with an USB webcam but not the raspicam module.