Port-arm archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
USB camera on ARM64 RPi3
Hello -- I have an RPi3 running GENERIC Aarch64 NetBSD 10-RELEASE. It
has generally been good. Recently I'm trying to get an OpenCV 4.x build
to work. With some minimal cmake file changes, I've had success on a
RockPro64 and Pinebook Pro -- same Rockchip SoC. Motivation is that
current pkgsrc OpenCV 3.x doesn't work (ARM64 nor AMD64) with USB
cameras (separate thread on that, related to buffer reallocation to
change resolution). Okay, plot is set.
On the RPi3, I see an error I don't on the Rockchip devices. It's a
simple 1) open cam, 2) read image, 3) write image, 4) close. I'll start
with naive debugging:
Could there be a chipset difference that could be causing the failure
only on one?
With opencv debugging output on, here is where the failure is:
[DEBUG:0@0.499] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_DQBUF(3227014673), ...)
=> -1 errno=35 (Resource temporarily unavailable)
[ WARN:0@10.504] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (1021) tryIoctl
VIDEOIO(V4L2:/dev/video0): select() timeout.
[DEBUG:0@10.505] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (957)
read_frame_v4l2 VIDEOIO(V4L2:/dev/video0): can't read frame
(VIDIOC_DQBUF): errno=0 (Undefined error: 0)
[DEBUG:0@10.505] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_STREAMOFF(2147767827),
failIfBusy=1)
It's failing on a select() call at
opencv/modules/videoio/src/cap_v4l.cpp:982.
Here's the successful trace on the RockPro64:
[DEBUG:0@0.226] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_DQBUF(3227014673), ...)
=> -1 errno=35 (Resource temporarily unavailable)
[DEBUG:0@0.498] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (1025) tryIoctl
VIDEOIO(V4L2:/dev/video0): select(5) => 1 errno = 0 (Undefined error: 0)
[DEBUG:0@0.498] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_DQBUF(3227014673), ...)
=> 0 errno=0 (Undefined error: 0)
[DEBUG:0@0.498] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QBUF(3227014671),
failIfBusy=1)
Can anyONE guide me to further understand why the select() fails on one
chipset and not another, using the same GENERIC ARM64 NetBSD?
BTW: No luck with pkgsrc ffmpeg5 either -- still debugging that.
Thanks - Joel
Below is the entire failed trace on the RPi3:
[DEBUG:0@0.147] global
/home/joelp/repos/opencv/modules/python/src2/cv2.cpp (95)
pycvRegisterMatType pycvRegisterMatType 0xfb443b59b790 0xfb443bb7ac10
[DEBUG:0@0.330] global
/home/joelp/repos/opencv/modules/videoio/src/videoio_registry.cpp (197)
VideoBackendRegistry VIDEOIO: Builtin backends(3): V4L_BSD(1000);
CV_IMAGES(990); CV_MJPEG(980)
[DEBUG:0@0.330] global
/home/joelp/repos/opencv/modules/videoio/src/videoio_registry.cpp (221)
VideoBackendRegistry VIDEOIO: Available backends(3): V4L_BSD(1000);
CV_IMAGES(990); CV_MJPEG(980)
[ INFO:0@0.330] global
/home/joelp/repos/opencv/modules/videoio/src/videoio_registry.cpp (223)
VideoBackendRegistry VIDEOIO: Enabled backends(3, sorted by priority):
V4L_BSD(1000); CV_IMAGES(990); CV_MJPEG(980)
[ WARN:0@0.330] global
/home/joelp/repos/opencv/modules/videoio/src/cap.cpp (130) open
VIDEOIO(V4L_BSD): trying capture filename='/dev/video0' ...
[DEBUG:0@0.331] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (918) open
VIDEOIO(V4L2:/dev/video0): opening...
[DEBUG:0@0.383] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (934) open
VIDEOIO(V4L2:/dev/video0): deviceHandle=5
[DEBUG:0@0.384] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QUERYCAP(1080579584),
failIfBusy=1)
[DEBUG:0@0.384] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QUERYCAP(1080579584),
...) => 0 errno=0 (Undefined error: 0)
[DEBUG:0@0.384] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_G_FMT(3234878980),
failIfBusy=1)
[DEBUG:0@0.384] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_G_FMT(3234878980), ...)
=> 0 errno=0 (Undefined error: 0)
[DEBUG:0@0.384] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_S_FMT(3234878981),
failIfBusy=1)
[DEBUG:0@0.385] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_S_FMT(3234878981), ...)
=> -1 errno=22 (Invalid argument)
[DEBUG:0@0.385] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_S_FMT(3234878981),
failIfBusy=1)
[DEBUG:0@0.385] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_S_FMT(3234878981), ...)
=> -1 errno=22 (Invalid argument)
[DEBUG:0@0.385] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_S_FMT(3234878981),
failIfBusy=1)
[DEBUG:0@0.385] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_S_FMT(3234878981), ...)
=> -1 errno=22 (Invalid argument)
[DEBUG:0@0.385] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_S_FMT(3234878981),
failIfBusy=1)
[DEBUG:0@0.386] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_S_FMT(3234878981), ...)
=> -1 errno=22 (Invalid argument)
[DEBUG:0@0.386] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_S_FMT(3234878981),
failIfBusy=1)
[DEBUG:0@0.386] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_S_FMT(3234878981), ...)
=> -1 errno=22 (Invalid argument)
[DEBUG:0@0.386] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_S_FMT(3234878981),
failIfBusy=1)
[DEBUG:0@0.443] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_S_FMT(3234878981), ...)
=> 0 errno=0 (Undefined error: 0)
[DEBUG:0@0.443] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_S_PARM(3234616854),
failIfBusy=1)
[DEBUG:0@0.443] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_S_PARM(3234616854), ...)
=> 0 errno=0 (Undefined error: 0)
[DEBUG:0@0.443] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_G_PARM(3234616853),
failIfBusy=1)
[DEBUG:0@0.444] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_G_PARM(3234616853), ...)
=> 0 errno=0 (Undefined error: 0)
[DEBUG:0@0.444] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (623) setFps
VIDEOIO(V4L2:/dev/video0): FPS=30/1
[DEBUG:0@0.444] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_REQBUFS(3222558216),
failIfBusy=1)
[DEBUG:0@0.445] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_REQBUFS(3222558216),
...) => 0 errno=0 (Undefined error: 0)
[DEBUG:0@0.445] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QUERYBUF(3227014665),
failIfBusy=1)
[DEBUG:0@0.445] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QUERYBUF(3227014665),
...) => 0 errno=0 (Undefined error: 0)
[DEBUG:0@0.446] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QUERYBUF(3227014665),
failIfBusy=1)
[DEBUG:0@0.446] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QUERYBUF(3227014665),
...) => 0 errno=0 (Undefined error: 0)
[DEBUG:0@0.447] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QUERYBUF(3227014665),
failIfBusy=1)
[DEBUG:0@0.447] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QUERYBUF(3227014665),
...) => 0 errno=0 (Undefined error: 0)
[DEBUG:0@0.448] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QUERYBUF(3227014665),
failIfBusy=1)
[DEBUG:0@0.449] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QUERYBUF(3227014665),
...) => 0 errno=0 (Undefined error: 0)
[ WARN:0@0.450] global
/home/joelp/repos/opencv/modules/videoio/src/cap.cpp (142) open
VIDEOIO(V4L_BSD): created, isOpened=1
[DEBUG:0@0.450] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QBUF(3227014671),
failIfBusy=1)
[DEBUG:0@0.450] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QBUF(3227014671), ...)
=> 0 errno=0 (Undefined error: 0)
[DEBUG:0@0.451] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QBUF(3227014671),
failIfBusy=1)
[DEBUG:0@0.451] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QBUF(3227014671), ...)
=> 0 errno=0 (Undefined error: 0)
[DEBUG:0@0.451] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QBUF(3227014671),
failIfBusy=1)
[DEBUG:0@0.451] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QBUF(3227014671), ...)
=> 0 errno=0 (Undefined error: 0)
[DEBUG:0@0.451] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_QBUF(3227014671),
failIfBusy=1)
[DEBUG:0@0.452] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_QBUF(3227014671), ...)
=> 0 errno=0 (Undefined error: 0)
[DEBUG:0@0.452] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_STREAMON(2147767826),
failIfBusy=1)
[DEBUG:0@0.499] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_STREAMON(2147767826),
...) => 0 errno=0 (Undefined error: 0)
[DEBUG:0@0.499] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_DQBUF(3227014673),
failIfBusy=1)
[DEBUG:0@0.499] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_DQBUF(3227014673), ...)
=> -1 errno=35 (Resource temporarily unavailable)
[ WARN:0@10.504] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (1021) tryIoctl
VIDEOIO(V4L2:/dev/video0): select() timeout.
[DEBUG:0@10.505] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (957)
read_frame_v4l2 VIDEOIO(V4L2:/dev/video0): can't read frame
(VIDIOC_DQBUF): errno=0 (Undefined error: 0)
[DEBUG:0@10.505] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_STREAMOFF(2147767827),
failIfBusy=1)
[DEBUG:0@11.685] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_STREAMOFF(2147767827),
...) => 0 errno=0 (Undefined error: 0)
[DEBUG:0@11.685] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (976) tryIoctl
VIDEOIO(V4L2:/dev/video0): tryIoctl(5, VIDIOC_REQBUFS(3222558216),
failIfBusy=1)
[DEBUG:0@11.686] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (984) tryIoctl
VIDEOIO(V4L2:/dev/video0): call ioctl(5, VIDIOC_REQBUFS(3222558216),
...) => 0 errno=0 (Undefined error: 0)
[DEBUG:0@11.686] global
/home/joelp/repos/opencv/modules/videoio/src/cap_v4l.cpp (469)
closeDevice VIDEOIO(V4L2:/dev/video0): close(5)
Home |
Main Index |
Thread Index |
Old Index