Comments (6)
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.
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.
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.
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.
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.
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)
- Documentation for Camera::resolutions HOT 1
- Iterator<Item=(u32, u32)> for Discrete/Stepwise enums (`ResolutionInfo` and `IntervalInfo`)
- Fails to compile on MacOS HOT 5
- v4l2 support in Rust HOT 3
- Jpeg files written from captured frames are corrupted HOT 6
- Using "RGB3" mode crashes system HOT 1
- Pushing a frame to a vector causing unbounded blocking HOT 1
- Is this being maintained ? HOT 4
- camera struct does not destruct properly HOT 1
- Bad Support for RGB3 frame format
- Pi Camera Module 3 not working with rscam HOT 1
- Relicense under dual MIT/Apache-2.0 HOT 1
- Performance issues, no possibility enable V4L2_MEMORY_MMAP HOT 4
- Add a way to query the colorspace from a frame
- Failing to create camera with EINVAL in mmap HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rscam.