Git Product home page Git Product logo

Comments (6)

joelgallant avatar joelgallant commented on July 17, 2024

On second look, I'm wrong about where the error is coming from - I believe it's alloc_buffers and mmap.

Specifically, v4l2_mmap returns usize::MAX and triggers the check_io!. The error is last_os_error, which is incorrect in this case as far as I can tell - it reports as InvalidArgument (which probably does make sense, since this is linking to v4l2_mmap, that doesn't report it's error using last_os_error).

from rscam.

loyd avatar loyd commented on July 17, 2024

this is linking to v4l2_mmap, that doesn't report it's error using last_os_error

v4l2_mmap uses errno, according to the documentation

It's worth mentioning that I am cross compiling for armv7-unknown-linux-gnueabihf.

I'll try to reproduce your problem as soon as I get my raspberry back.

from rscam.

joelgallant avatar joelgallant commented on July 17, 2024

I noticed that it does say it sets errno, when printing last_os_error before/after v4l2_mmap, it doesn't change - which doesn't mean it's not working.

from rscam.

skligys avatar skligys commented on July 17, 2024

I am seeing a similar error in Camera::start (also cross-compiling to Pi), also only in --release build:

I/O error: Value too large for defined data type (os error 75)

Strangely enough, if I clone rscam's source locally and build it:

[dependencies]
rscam = { path = "vendor/rscam" }

everything works just fine. Was the failure fixed since 0.5.4 release?

from rscam.

jbolila avatar jbolila commented on July 17, 2024

Compiling locally on a raspberry pi, also gives an error when compiled with --release.

Comparing both strace output the issue happens on the following call:

ioctl(3, VIDIOC_REQBUFS, {count=2, type=V4L2_BUF_TYPE_VIDEO_CAPTURE, memory=V4L2_MEMORY_MMAP}) = 0 ({count=2})
ioctl(3, VIDIOC_QUERYBUF, {type=V4L2_BUF_TYPE_VIDEO_CAPTURE, index=0, memory=V4L2_MEMORY_MMAP, m.offset=0, length=307200, bytesused=0, flags=0x2000 /* V4L2_BUF_FLAG_??? */, ...}) = 0
write(2, "thread '", 8thread ')                 = 8
write(2, "main", 4main)                     = 4
write(2, "' panicked at '", 15' panicked at ')         = 15
write(2, "called `Result::unwrap()` on an "..., 113called `Result::unwrap()` on an `Err` value: Io(Os { code: 22, kind: InvalidInput, message: "Invalid argument" })) = 113
write(2, "', ", 3', )                      = 3

compared with the debug version:

ioctl(3, VIDIOC_REQBUFS, {count=2, type=V4L2_BUF_TYPE_VIDEO_CAPTURE, memory=V4L2_MEMORY_MMAP}) = 0 ({count=2})
ioctl(3, VIDIOC_QUERYBUF, {type=V4L2_BUF_TYPE_VIDEO_CAPTURE, index=0, memory=V4L2_MEMORY_MMAP, m.offset=0, length=307200, bytesused=0, flags=0x2000 /* V4L2_BUF_FLAG_??? */, ...}) = 0
mmap2(NULL, 307200, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0) = 0x76c02000
ioctl(3, VIDIOC_QUERYBUF, {type=V4L2_BUF_TYPE_VIDEO_CAPTURE, index=1, memory=V4L2_MEMORY_MMAP, m.offset=0x4b000, length=307200, bytesused=0, flags=0x2000 /* V4L2_BUF_FLAG_??? */, ...}) = 0
mmap2(NULL, 307200, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0) = 0x767b5000
ioctl(3, VIDIOC_QBUF, {type=V4L2_BUF_TYPE_VIDEO_CAPTURE, index=0, memory=V4L2_MEMORY_MMAP, m.offset=0, length=307200, bytesused=0, flags=V4L2_BUF_FLAG_MAPPED|V4L2_BUF_FLAG_QUEUED|0x2000, ...}) = 0
ioctl(3, VIDIOC_QBUF, {type=V4L2_BUF_TYPE_VIDEO_CAPTURE, index=1, memory=V4L2_MEMORY_MMAP, m.offset=0x4b000, length=307200, bytesused=0, flags=V4L2_BUF_FLAG_QUEUED|0x2000, ...}) = 0
ioctl(3, VIDIOC_STREAMON, [V4L2_BUF_TYPE_VIDEO_CAPTURE]) = 0

I'm using the latest version (v0.5.4)

from rscam.

chris-ricketts avatar chris-ricketts commented on July 17, 2024

I've just encountered this cross-compiling to armv7-unknown-linux-gnueabihf as well.
However, in this case the error occurs when built in debug, with --release it works.

This is version 0.5.5

from rscam.

Related Issues (16)

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.