rscam icon indicating copy to clipboard operation
rscam copied to clipboard

Failing to create camera with EINVAL in mmap

Open porglezomp opened this issue 7 years ago • 2 comments

I'm trying to use a PS Eye with a Raspberry pi, and when I try to run the example script in the docs, the mmap returns an OS Error (EINVAL). The exact code adapted for acceptable framerates, resolutions, etc. is:

extern crate rscam;

use rscam::{Camera, Config};

fn main() {
    let mut camera = Camera::new("/dev/video0").unwrap();

    camera.start(&Config {
        interval: (1, 30),
        resolution: (320, 240),
        format: b"RGB3",
        ..Default::default()
    }).unwrap();

    for i in 0..10 {
        let frame = camera.capture().unwrap();
    }
}

porglezomp avatar Jan 21 '17 22:01 porglezomp

@porglezomp I know this is an old issue, but I just ran into #18, which seems like the same issue. Did you ever find a resolution to this?

joelgallant avatar Sep 26 '18 17:09 joelgallant

Got it! See https://github.com/loyd/rscam/pull/31

eifert avatar Dec 17 '20 12:12 eifert