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

Not works on raspberry pi. Rasbian armhf #176

Open
gppsoft opened this issue Feb 10, 2014 · 13 comments
Open

Not works on raspberry pi. Rasbian armhf #176

gppsoft opened this issue Feb 10, 2014 · 13 comments

Comments

@gppsoft
Copy link

gppsoft commented Feb 10, 2014

Hello. Don't works on raspberry(webcam-capture-0.3.10-RC6). I have error. How to fix this? Sorry for my English please.

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Java HotSpot(TM) Client VM warning: You have loaded library /tmp/BridJExtractedLibraries4249008632717087345/libbridj.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries4249008632717087345/OpenIMAJGrabber.so'
    at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
    at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
    at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
    at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:765)
    at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:1016)
    at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:898)
    at org.bridj.CRuntime$CTypeInfo.initialize(CRuntime.java:270)
    at org.bridj.BridJ.initialize(BridJ.java:1117)
    at org.bridj.NativeObject.<init>(NativeObject.java:50)
    at org.bridj.StructObject.<init>(StructObject.java:46)
    at org.bridj.cpp.CPPObject.<init>(CPPObject.java:55)
    at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<init>(OpenIMAJGrabber.java:64)
    at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
    at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)
@sarxos
Copy link
Owner

sarxos commented Feb 10, 2014

Hi @gppsoft

Which version are you using?

@gppsoft
Copy link
Author

gppsoft commented Feb 10, 2014

Hi @sarxos
webcam-capture-0.3.10-RC6

@sarxos
Copy link
Owner

sarxos commented Feb 10, 2014

Can you please try with the newest BridJ JAR (just replace the one that is delivered along with webcam capture)?

https://oss.sonatype.org/content/repositories/snapshots/com/nativelibs4java/bridj/0.7-SNAPSHOT/bridj-0.7-20140122.002307-56.jar

@gppsoft
Copy link
Author

gppsoft commented Feb 10, 2014

@sarxos Not working :(

java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries498444117057269331/OpenIMAJGrabber.so'
    at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
    at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
    at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
    at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:765)
    at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:1016)
    at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:898)
    at org.bridj.CRuntime$CTypeInfo.initialize(CRuntime.java:270)
    at org.bridj.BridJ.initialize(BridJ.java:1117)
    at org.bridj.NativeObject.<init>(NativeObject.java:50)
    at org.bridj.StructObject.<init>(StructObject.java:46)
    at org.bridj.cpp.CPPObject.<init>(CPPObject.java:55)
    at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<init>(OpenIMAJGrabber.java:64)
    at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
    at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)

@sarxos
Copy link
Owner

sarxos commented Feb 11, 2014

Ok, so let's try to lower BridJ and use v0.3.6 (this is the lowest version for ARMs):

https://oss.sonatype.org/content/repositories/snapshots/com/nativelibs4java/bridj/0.6.3-SNAPSHOT/bridj-0.6.3-20130316.190111-13.jar

Can you also give me some more details of what operating system you have installed on your Pi?

Additionally, can you please follow up with the steps (all from 1 to 6) enabling debug prints in the code and paste the details here?

https://github.com/sarxos/webcam-capture/wiki/How-To-Enable-Dubug-Logs

@sarxos
Copy link
Owner

sarxos commented Feb 17, 2014

@gppsoft can you please enable debug logs and post the output?

@gppsoft
Copy link
Author

gppsoft commented Feb 17, 2014

@sarxos Yes, of course. Tomorrow I will try. Just do not have time.

@gppsoft
Copy link
Author

gppsoft commented Feb 18, 2014

Logs not working for me. Sorry :( This is console logs after use webcams libs. I use raspberry pi with Raspbian OS (Linux raspberrypi 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l GNU/Linux). Java version "1.7.0_40" Java(TM) SE Runtime Environment (build 1.7.0_40-b43) Java HotSpot(TM) Client VM (build 24.0-b56, mixed mode). Hope this helps.

public static ArrayList<String> getDevices(){
        ArrayList<String> cams = new ArrayList<String>();
        for (Webcam webCam : Webcam.getWebcams()) {
            cams.add(webCam.getName());
        }
        return cams;
    }
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Java HotSpot(TM) Client VM warning: You have loaded library /tmp/BridJExtractedLibraries4001441421156620325/libbridj.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries4001441421156620325/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries4001441421156620325/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries4001441421156620325/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries4001441421156620325/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries4001441421156620325/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries4001441421156620325/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries4001441421156620325/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries4001441421156620325/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries4001441421156620325/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries4001441421156620325/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries4001441421156620325/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries4001441421156620325/OpenIMAJGrabber.so'
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
        at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:765)
        at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:1016)
        at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:898)
        at org.bridj.CRuntime$CTypeInfo.initialize(CRuntime.java:270)
        at org.bridj.BridJ.initialize(BridJ.java:1117)
        at org.bridj.NativeObject.<init>(NativeObject.java:50)
        at org.bridj.StructObject.<init>(StructObject.java:46)
        at org.bridj.cpp.CPPObject.<init>(CPPObject.java:55)
        at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<init>(OpenIMAJGrabber.java:64)
        at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
        at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)
com.github.sarxos.webcam.WebcamException: java.util.concurrent.ExecutionException: com.github.sarxos.webcam.WebcamException: Cannot execute task
        at com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:123)
        at com.github.sarxos.webcam.Webcam.getWebcams(Webcam.java:706)
        at com.github.sarxos.webcam.Webcam.getWebcams(Webcam.java:679)
        at com.github.sarxos.webcam.Webcam.getWebcams(Webcam.java:659)
        at gppserver.core.WebCamCapture.getDevices(WebCamCapture.java:49)
        at gppserver.core.ClientSession.onPacket(ClientSession.java:156)
        at gppserver.core.DirectSession.onPacket(DirectSession.java:42)
        at gppserver.core.PacketSplitter.splitData(PacketSplitter.java:96)
        at gppserver.core.PacketSplitter.setStream(PacketSplitter.java:43)
        at gppserver.core.Session$ClientDataRead.run(Session.java:107)
        at java.lang.Thread.run(Thread.java:724)
Caused by: java.util.concurrent.ExecutionException: com.github.sarxos.webcam.WebcamException: Cannot execute task
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:188)
        at com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:115)
        ... 10 more
Caused by: com.github.sarxos.webcam.WebcamException: Cannot execute task
        at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.process(WebcamProcessor.java:57)
        at com.github.sarxos.webcam.WebcamProcessor.process(WebcamProcessor.java:122)
        at com.github.sarxos.webcam.WebcamTask.process(WebcamTask.java:38)
        at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.newGrabber(WebcamDefaultDriver.java:46)
        at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver.getDevices(WebcamDefaultDriver.java:118)
        at com.github.sarxos.webcam.WebcamDiscoveryService$WebcamsDiscovery.call(WebcamDiscoveryService.java:36)
        at com.github.sarxos.webcam.WebcamDiscoveryService$WebcamsDiscovery.call(WebcamDiscoveryService.java:26)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        ... 1 more
Caused by: java.lang.RuntimeException: Failed to allocate new instance of type class com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber
        at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:806)
        at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:1016)
        at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:898)
        at org.bridj.CRuntime$CTypeInfo.initialize(CRuntime.java:270)
        at org.bridj.BridJ.initialize(BridJ.java:1117)
        at org.bridj.NativeObject.<init>(NativeObject.java:50)
        at org.bridj.StructObject.<init>(StructObject.java:46)
        at org.bridj.cpp.CPPObject.<init>(CPPObject.java:55)
        at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<init>(OpenIMAJGrabber.java:64)
        at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
        at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
        ... 3 more
Caused by: java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries4001441421156620325/OpenIMAJGrabber.so'
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
        at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:765)
        ... 13 more

@sarxos
Copy link
Owner

sarxos commented Feb 18, 2014

@gppsoft,

You have the answer to the problem in logs:

... libv4l2.so.0: cannot open shared object file: No such file or directory

It seems like you do not have it (libv4l2, libv4l) installed or you use invalid version.

@sarxos
Copy link
Owner

sarxos commented Feb 18, 2014

sarxos@sarxos:~$ apt-cache search libv4l
libv4l-0 - Collection of video4linux support libraries
libv4l-dev - Collection of video4linux support libraries (development files)
libv4lconvert0 - Video4linux frame format conversion library
sarxos@sarxos:~$ sudo apt-get install libv4l-0 libv4l-dev libv4lconvert0

@gppsoft
Copy link
Author

gppsoft commented Feb 19, 2014

@sarxos Ok. Thx. Now new errors:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Java HotSpot(TM) Client VM warning: You have loaded library /tmp/BridJExtractedLibraries8757747577742413862/libbridj.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
com.github.sarxos.webcam.WebcamException: Cannot execute task
    at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.process(WebcamProcessor.java:57)
    at com.github.sarxos.webcam.WebcamProcessor.process(WebcamProcessor.java:122)
    at com.github.sarxos.webcam.WebcamTask.process(WebcamTask.java:38)
    at com.github.sarxos.webcam.ds.cgt.WebcamOpenTask.open(WebcamOpenTask.java:20)
    at com.github.sarxos.webcam.Webcam.open(Webcam.java:189)
    at com.github.sarxos.webcam.Webcam.open(Webcam.java:149)
    at gppserver.core.WebCamCapture.start(WebCamCapture.java:28)
    at gppserver.core.ClientSession.onPacket(ClientSession.java:163)
    at gppserver.core.HubSession.onPacket(HubSession.java:65)
    at gppserver.core.PacketSplitter.splitData(PacketSplitter.java:96)
    at gppserver.core.PacketSplitter.setStream(PacketSplitter.java:43)
    at gppserver.core.Session$ClientDataRead.run(Session.java:107)
    at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.NullPointerException
    at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.startSession(Native Method)
    at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDevice.open(WebcamDefaultDevice.java:253)
    at com.github.sarxos.webcam.ds.cgt.WebcamOpenTask.handle(WebcamOpenTask.java:38)
    at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    ... 1 more
java.lang.IllegalArgumentException: image == null!
    at javax.imageio.ImageTypeSpecifier.createFromRenderedImage(ImageTypeSpecifier.java:925)
    at javax.imageio.ImageIO.getWriter(ImageIO.java:1591)
    at javax.imageio.ImageIO.write(ImageIO.java:1578)
    at gppserver.core.WebCamCapture.sendFrame(WebCamCapture.java:40)
    at gppserver.core.ClientSession.onPacket(ClientSession.java:169)
    at gppserver.core.HubSession.onPacket(HubSession.java:65)
    at gppserver.core.PacketSplitter.splitData(PacketSplitter.java:96)
    at gppserver.core.PacketSplitter.setStream(PacketSplitter.java:43)
    at gppserver.core.Session$ClientDataRead.run(Session.java:107)
    at java.lang.Thread.run(Thread.java:724)

@sarxos
Copy link
Owner

sarxos commented Feb 20, 2014

Ok, but it's hard to tell anything without more verbose logs.

Did you tried Webcam Capture gstreamer driver instead of default one? I believe it should work fine on RasPi.

  1. Install gstreamer sudo apt-get install libgstreamer0.10-0
  2. Add gstreamer driver JAR + dependencies to classpath
  3. Set it in the code

ZIP with JAR and all dependencies can be found here:

http://repo.sarxos.pl/maven2/com/github/sarxos/webcam-capture-driver-gstreamer/0.3.10-RC6/webcam-capture-driver-gstreamer-0.3.10-RC6-dist.zip

And in the code you will have to:

static {
    Webcam.setDriver(new GStreamerDriver());
}

public static void main(String[] args) {

    WebcamPanel panel = new WebcamPanel(Webcam.getWebcams().get(0));
    panel.setFPSDisplayed(true);

    JFrame frame = new JFrame("GStreamer Webcam Capture Driver Demo");
    frame.add(panel);
    frame.pack();
    frame.setVisible(true);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}

@Nesh108
Copy link

Nesh108 commented Mar 18, 2014

Hello Sarxos,

I am having similar issues and I tried this last solution and it still won't work...

Now I get:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/jna/jna7790254728696229696.tmp: /tmp/jna/jna7790254728696229696.tmp: cannot open shared object file: No such file or directory
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1957)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1882)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1843)
    at java.lang.Runtime.load0(Runtime.java:795)
    at java.lang.System.load(System.java:1061)
    at com.sun.jna.Native.loadNativeLibraryFromJar(Native.java:771)
    at com.sun.jna.Native.loadNativeLibrary(Native.java:697)
    at com.sun.jna.Native.<clinit>(Native.java:127)
    at org.gstreamer.lowlevel.GNative.loadNativeLibrary(GNative.java:48)
    at org.gstreamer.lowlevel.GNative.loadLibrary(GNative.java:45)
    at org.gstreamer.lowlevel.GstNative.load(GstNative.java:42)
    at org.gstreamer.lowlevel.GstNative.load(GstNative.java:39)
    at org.gstreamer.Gst.<clinit>(Gst.java:59)
    at com.github.sarxos.webcam.ds.gstreamer.GStreamerDriver.init(GStreamerDriver.java:90)
    at com.github.sarxos.webcam.ds.gstreamer.GStreamerDriver.<init>(GStreamerDriver.java:49)
    at WebcamTest.<clinit>(WebcamTest.java:10)

Any suggestion?

sarxos added a commit that referenced this issue Feb 26, 2015
refs #286
refs #315
refs #244
refs #219
refs #194
refs #192
refs #189
refs #184
refs #176
refs #153
refs #152
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants