Code Monkey home page Code Monkey logo

Comments (10)

raymanfx avatar raymanfx commented on July 23, 2024 1

Yeah sorry, I forgot to actually publish 0.10.1 on crates.io. Can you try again now?

from libv4l-rs.

raymanfx avatar raymanfx commented on July 23, 2024

Your cross-compile target is 32 bit. I tested this crate on a Raspberry Pi 3b+, but I'm using an aarch64 kernel.

I'll have to investigate this some more. On a first glance, the mmap signature looks like this: https://docs.rs/libc/0.2.1/libc/fn.mmap.html, where the last parameter is of type off_t which is i64. Perhaps the docs were generated on a 64 bit host though.

from libv4l-rs.

raymanfx avatar raymanfx commented on July 23, 2024

Could you please test the 0.10.1 version I just prepared in the next branch [1]?
I was able to cross compile for i686 and fix the errors you encountered.
Trying to compile for armv7-unknown-linux-gnueabihf gave me some strange relocation errors. We'll have to dig a bit deeper in case you face those as well.

[1] https://github.com/raymanfx/libv4l-rs/tree/next

from libv4l-rs.

fenjalien avatar fenjalien commented on July 23, 2024

Hi, it compiles!
However running it then produces:

thread 'main' panicked at 'Failed to open video device: Custom { kind: Other, error: "No suitable backend available" }', src/main.rs:7:19
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I don't think this is directly due to the crate more I don't have v4l installed on my rpi. I just need to hook it up to the internet(currently not).

Another side note is that I'm using cross instead of cargo.

from libv4l-rs.

fenjalien avatar fenjalien commented on July 23, 2024

I don't think this is directly due to the crate more I don't have v4l installed on my rpi. I just need to hook it up to the internet(currently not).

Ok i've instllad the v4l dependency and I'm getting the same error. Bit lost now.

The full backtrace of the error:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "No suitable backend available" }', src/main.rs:7:19
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1076
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1537
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:198
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:218
  10: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:486
  11: rust_begin_unwind
             at src/libstd/panicking.rs:388
  12: core::panicking::panic_fmt
             at src/libcore/panicking.rs:101
  13: core::option::expect_none_failed
             at src/libcore/option.rs:1272
  14: core::result::Result<T,E>::unwrap
             at /rust/lib/rustlib/src/rust/src/libcore/result.rs:1005
  15: cam_test::main
             at src/main.rs:7
  16: std::rt::lang_start::{{closure}}
             at /rust/lib/rustlib/src/rust/src/libstd/rt.rs:67
  17: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:52
  18: std::panicking::try::do_call
             at src/libstd/panicking.rs:297
  19: std::panicking::try
             at src/libstd/panicking.rs:274
  20: std::panic::catch_unwind
             at src/libstd/panic.rs:394
  21: std::rt::lang_start_internal
             at src/libstd/rt.rs:51
  22: std::rt::lang_start
             at /rust/lib/rustlib/src/rust/src/libstd/rt.rs:67
  23: main
  24: __libc_start_main
             at /build/glibc-FUvrFr/glibc-2.28/csu/libc-start.c:308

from libv4l-rs.

raymanfx avatar raymanfx commented on July 23, 2024

Hmm, that error indicates that you built eye-rs without the v4l feature: https://github.com/raymanfx/eye-rs/blob/dd35f7a1bc5612f3188e31031d87b9364f790c56/src/hal/device.rs#L42.

Can you show me how exactly you built eye-rs? Please try to use the next branch of eye-rs too, and explicitly enable the v4l feature.

Just to be clear: You don't need libv4l or anything installed. The v4l crate together with eye-rs are enough for camera capture to work. They will also automatically decode JPEG to RGB frames and so on.

from libv4l-rs.

fenjalien avatar fenjalien commented on July 23, 2024

Cargo.toml:

[dependencies.v4l]
git = "https://github.com/raymanfx/libv4l-rs/"
branch = "next"

[dependencies.eye]
version = "0.2"
default-features = false
features = ["jpeg"]

I now realise that disables the v4l feature but I can't find a way to set eye to use a different v4l crate version.

from libv4l-rs.

raymanfx avatar raymanfx commented on July 23, 2024

I just pushed the next branch of eye-rs so it pulls in v4l 0.10. That should hopefully get you going once you use the git dependency instead of the one from crates.io. Let me know if that works for you.

from libv4l-rs.

fenjalien avatar fenjalien commented on July 23, 2024

Hi, thanks for the quick responses.
Unfortunately its trying to use v4l-0.10.0 instead of 0.10.1

from libv4l-rs.

fenjalien avatar fenjalien commented on July 23, 2024

Works nicely now thank you!

from libv4l-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.