OV5640 camera module reg read error - Printable Version +- PINE64 (https://forum.pine64.org) +-- Forum: PineCube (https://forum.pine64.org/forumdisplay.php?fid=149) +--- Forum: General Discussion on PineCube (https://forum.pine64.org/forumdisplay.php?fid=150) +--- Thread: OV5640 camera module reg read error (/showthread.php?tid=13094) |
OV5640 camera module reg read error - FrancisTheodoreCat - 02-12-2021 Got my PineCube today, and ran into a snag getting the camera working. I'm running the latest Armbian Focal build (21.02.1 on kernel 5.10.12-sunxi), and whenever I try and access the camera module, whether via ffmpeg or gstreamer, I get the following errors in the syslog: Quote:[ 2518.009350] ov5640 1-003c: ov5640_read_reg: error: reg=300a Also happens about 13 seconds after boot. Checked the CSI cable, and it seems to be properly seated on both ends. Any ideas? (I think I got the cedar hardware H264 acceleration gstreamer plugin working, but this kinda derailed any actual testing.) RE: OV5640 camera module reg read error - FrancisTheodoreCat - 02-13-2021 I now get the following errors printed to the syslog when I try to access the camera via /dev/video0: Quote:[ 125.371915] i2c i2c-1: mv64xxx_i2c_fsm: Ctlr Error -- state: 0x2, status: 0x0, addr: 0x3c, flags: 0x0 This happens regardless of kernel version, and even when using the trunk build image from the wiki, which I presume works on other PineCubes. Is this a hardware issue, or a kernel/device-tree regression? From my searches on that particular ov5640 error, it's usually a device-tree misconfiguration causing it. I did check continuity from connector to connector for the CSI cable, and it passed. So if it were a hardware issue, it's likely the camera module itself, which I don't have a spare of to test with. If anyone else with a working PineCube and a working copy of Armbian is willing to test, I put together a script for using the H3's Cedar H264 acceleration to serve up an HLS stream page: https://github.com/francistheodorecatte/useful-scripts/blob/master/pinecube/gstreamer_hls.sh RE: OV5640 camera module reg read error - metabenic - 02-15-2021 I confirmed my camera is working on the Armbian image from the wiki. I tried the "gstreamer: h264 HLS" example from the wiki (software encoding) and I can see images from the camera in my browser. Then I tried to do hardware encoding with your script, but I was unable to get it working. After following your instructions, here's what I get: Code: Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ... And when I load the webpage, I get a blank screen and this in the console: Code: 192.168.4.30 - - [15/Feb/2021 03:58:40] "GET / HTTP/1.1" 200 - Any ideas to fix the error? RE: OV5640 camera module reg read error - FrancisTheodoreCat - 02-15-2021 Interesting. The blank webpage is due to gstreamer not outputting a playlist.m3u8 file for the hls.js script to pull from. The error you're getting from gstreamer is probably due to the cedar acceleration only being able to parse NV12 or NV16 color space information, which is YUV4:2:0 and YUV4:2:2 respectively (I think). I haven't been able to test that bit, due to the camera on my PineCube... not working. The relevant part of the script to change is this line: Quote:media-ctl --set-v4l2 '"ov5640 1-003c":0[fmt:UYVY8_2X8/1920x1080@1/15]' I think the format needs to be YUV420 UYVY instead of UYVU8_2X8, like so: Quote:media-ctl --set-v4l2 '"ov5640 1-003c":0[fmt:YUVY/1920x1080@1/15]' I'll update my script to reflect that. Can you try it out? edit: If that doesn't work, the pixel format will probably have to be changed to YUV422(?), and the gstreamer input format to NV16. RE: OV5640 camera module reg read error - metabenic - 02-16-2021 When I tried these settings: Code: '"ov5640 1-003c":0[fmt:UYVY/1920x1080@1/15]' I get this error: Code: Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ... I tried various other combinations of formats but I either get the same error as before, or I get this error: Code: Unable to setup formats: Invalid argument (22) RE: OV5640 camera module reg read error - FrancisTheodoreCat - 02-20-2021 Hm, it's probably down to the video color space format. I know the Cedar accelerator can only handle NV12 and NV16 color spaces, but I don't know what the equivalent V4L2 format is. I'll poke at it more once I get a working camera on my PineCube. edit: Try the updated script. I did some more reading on color space stuff, and I think I got it right. Also removed the x/raw bit of the pipeline that cedarh264enc didn't like. gstreamer now only spits out the following: Quote:0:00:01.044829353 1974 0x1dda840 ERROR cedar_h264enc gstcedarh264enc.c:340:gst_cedarh264enc_change_state: Cannot open VE Along with the ever-present dmesg errors: Quote:[ 1511.713485] ov5640 1-003c: ov5640_read_reg: error: reg=300a I will note, media-ctl --print-topology does show the camera on /dev/video0: Quote:Media controller API version 5.10.0All I can think is the camera module, or the CSI cable, is bad. Or both. RE: OV5640 camera module reg read error - JuanEsf - 02-21-2021 Hello everyone. I have not had the opportunity to try armbian with gstreamer, at the moment I am trying to compile openwrt that can consume less resources, although openwrt already starts, I still need to add the camera and video engine modules. Based on that I can say that the armbian image uses the megous kernel which has no video-engine node in dts file. Martin cerny is enabling the graphics processor in allwinner v3s and he can find the missing nodes. Video-engine node: https://github.com/mcerveny/linux/commit/c33d83051ed100fb33fc92a98e45787463be1495 dts v3s: https://github.com/megous/linux/blob/orange-pi-5.11/arch/arm/boot/dts/sun8i-v3s.dtsi dts pinecube: https://github.com/megous/linux/blob/orange-pi-5.11/arch/arm/boot/dts/sun8i-s3-pinecube.dts My u-boot with dts changes for audio and video nodes: https://github.com/juanesf/u-boot/blob/audio-codec/arch/arm/dts/sun8i-v3s.dtsi RE: OV5640 camera module reg read error - cooler - 12-20-2021 (02-15-2021, 10:47 AM)FrancisTheodoreCat Wrote: The error you're getting from gstreamer is probably due to the cedar acceleration only being able to parse NV12 or NV16 color space information, which is YUV4:2:0 and YUV4:2:2 respectively (I think). I haven't been able to test that bit, due to the camera on my PineCube... not working. Could anyone point me on what are these YUV, UYVY, NV16 and other abbrevations mean? What are the relations between "fmt:" media-ctl values and "video/x-raw,format=" in gstreamer pipeline? PS. These questions are because hardware encoder only accepts *something* NV12, but camera node outputs *something* UYVY. And there is a recoding step in gstreamer pipeline consuming CPU and probably loosing FPS. While I could not find a list of supported media-ctl settings to do a bruteforce or try to understand the relation with this "format". |