UNSOLVED radxa zero 3e, debian, linux 5.10, imx287: Inappropriate ioctl for device
-
Hi, I'm trying to use imx287 on radxa zero 3e using the same C code I successfully used for rpi zero 2w:
... int fd = open("/dev/video0", O_RDWR); ... int camIdx = 0; int input = camIdx; int ret = ioctl(m_cam_fd, VIDIOC_S_INPUT, &input); // ret < 0: strerror(errno) == "Inappropriate ioctl for device"Could you please tell if I'm missing something?
Do I need to select different device or VIDIOC_S_INPUT argument?After selecting the camera, I was going to use the same approach which worked for rpi zero 2w:
VIDIOC_TRY_FMT/VIDIOC_S_FMT/VIDIOC_REQBUFS/VIDIOC_QUERYBUF/VIDIOC_QBUF/VIDIOC_DQBUF, is it possible? Does driver support this?I'm able to set cam params using
mv_mipi_i2c_new.shand it works (I set differentmetimevalues - and I see that laser (connected to cam output) brightness is changing)v4l2-ctl --set-fmt-video=width=$WIDTH,height=$HEIGHT,pixelformat=GREY --stream-mmap --stream-count=-1 --stream-to=/dev/null./i2c_tools$ sudo ./mv_mipi_i2c_new.sh -b 2 -w metime 18 ./i2c_tools$ sudo ./mv_mipi_i2c_new.sh -b 2 -w metime 180$ media-ctl -p -d /dev/media0 Media controller API version 5.10.160 Media device information ------------------------ driver rkcif model rkcif_mipi_lvds serial bus info hw revision 0x0 driver version 5.10.160 Device topology - entity 1: stream_cif_mipi_id0 (1 pad, 4 links) type Node subtype V4L flags 0 device node name /dev/video0 pad0: Sink <- "rockchip-mipi-csi2":1 [ENABLED] <- "rockchip-mipi-csi2":2 [] <- "rockchip-mipi-csi2":3 [] <- "rockchip-mipi-csi2":4 [] - entity 5: stream_cif_mipi_id1 (1 pad, 4 links) type Node subtype V4L flags 0 device node name /dev/video1 pad0: Sink <- "rockchip-mipi-csi2":1 [] <- "rockchip-mipi-csi2":2 [ENABLED] <- "rockchip-mipi-csi2":3 [] <- "rockchip-mipi-csi2":4 [] - entity 9: stream_cif_mipi_id2 (1 pad, 4 links) type Node subtype V4L flags 0 device node name /dev/video2 pad0: Sink <- "rockchip-mipi-csi2":1 [] <- "rockchip-mipi-csi2":2 [] <- "rockchip-mipi-csi2":3 [ENABLED] <- "rockchip-mipi-csi2":4 [] - entity 13: stream_cif_mipi_id3 (1 pad, 4 links) type Node subtype V4L flags 0 device node name /dev/video3 pad0: Sink <- "rockchip-mipi-csi2":1 [] <- "rockchip-mipi-csi2":2 [] <- "rockchip-mipi-csi2":3 [] <- "rockchip-mipi-csi2":4 [ENABLED] - entity 17: rkcif_tools_id0 (1 pad, 4 links) type Node subtype V4L flags 0 device node name /dev/video4 pad0: Sink <- "rockchip-mipi-csi2":1 [] <- "rockchip-mipi-csi2":2 [] <- "rockchip-mipi-csi2":3 [] <- "rockchip-mipi-csi2":4 [] - entity 21: rkcif_tools_id1 (1 pad, 4 links) type Node subtype V4L flags 0 device node name /dev/video5 pad0: Sink <- "rockchip-mipi-csi2":1 [] <- "rockchip-mipi-csi2":2 [] <- "rockchip-mipi-csi2":3 [] <- "rockchip-mipi-csi2":4 [] - entity 25: rkcif_tools_id2 (1 pad, 4 links) type Node subtype V4L flags 0 device node name /dev/video6 pad0: Sink <- "rockchip-mipi-csi2":1 [] <- "rockchip-mipi-csi2":2 [] <- "rockchip-mipi-csi2":3 [] <- "rockchip-mipi-csi2":4 [] - entity 29: rkcif-mipi-luma (0 pad, 0 link) type Node subtype V4L flags 0 device node name /dev/video7 - entity 32: rockchip-mipi-csi2 (5 pads, 29 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev0 pad0: Sink [fmt:Y8_1X8/704x544 field:none crop.bounds:(0,0)/704x544 crop:(0,0)/704x544] <- "rockchip-csi2-dphy0":1 [ENABLED] pad1: Source -> "stream_cif_mipi_id0":0 [ENABLED] -> "stream_cif_mipi_id1":0 [] -> "stream_cif_mipi_id2":0 [] -> "stream_cif_mipi_id3":0 [] -> "rkcif_tools_id0":0 [] -> "rkcif_tools_id1":0 [] -> "rkcif_tools_id2":0 [] pad2: Source -> "stream_cif_mipi_id0":0 [] -> "stream_cif_mipi_id1":0 [ENABLED] -> "stream_cif_mipi_id2":0 [] -> "stream_cif_mipi_id3":0 [] -> "rkcif_tools_id0":0 [] -> "rkcif_tools_id1":0 [] -> "rkcif_tools_id2":0 [] pad3: Source -> "stream_cif_mipi_id0":0 [] -> "stream_cif_mipi_id1":0 [] -> "stream_cif_mipi_id2":0 [ENABLED] -> "stream_cif_mipi_id3":0 [] -> "rkcif_tools_id0":0 [] -> "rkcif_tools_id1":0 [] -> "rkcif_tools_id2":0 [] pad4: Source -> "stream_cif_mipi_id0":0 [] -> "stream_cif_mipi_id1":0 [] -> "stream_cif_mipi_id2":0 [] -> "stream_cif_mipi_id3":0 [ENABLED] -> "rkcif_tools_id0":0 [] -> "rkcif_tools_id1":0 [] -> "rkcif_tools_id2":0 [] - entity 38: rockchip-csi2-dphy0 (2 pads, 2 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev1 pad0: Sink [fmt:Y8_1X8/704x544@100/52300 field:none] <- "m00_b_mvcam 2-003b":0 [ENABLED] pad1: Source -> "rockchip-mipi-csi2":0 [ENABLED] - entity 43: m00_b_mvcam 2-003b (1 pad, 1 link) type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev2 pad0: Source [fmt:Y8_1X8/704x544@100/52300 field:none] -> "rockchip-csi2-dphy0":0 [ENABLED] -
@nkos
Below is a tutorial on using this camera module on Radxa boards.
https://wiki.veye.cc/index.php/MV_Camera_on_Radxa_BoardsUnlike the Raspberry Pi platform, on RK platforms, some preparatory work is required to use our module, which involves configuring the appropriate image parameters using
media-ctl.
However, based on the information you provided, it seems you have already set it up correctly.Once this preparation is complete, the process of capturing images is the same as on the Raspberry Pi.
If you encounter any issues, you can refer to the code example at:
https://wiki.veye.cc/index.php/MV_Camera_on_Radxa_Boards#Example_of_yavtaAdditionally, we have an open-source client software available for your use and reference.