4K camera not working on ROCK5C

Before posting this, I read all the posts about 4K cameras in the forum.

I have enabled the 4k camera in Overlays

radxa@rock-5c:~$ v4l2-ctl --list-devices
rkisp-statistics (platform: rkisp):
/dev/video18
/dev/video19
rkcif-mipi-lvds2 (platform:rkcif):
/dev/media0
rkcif (platform:rkcif-mipi-lvds2):
/dev/video0
/dev/video1
/dev/video2
/dev/video3
/dev/video4
/dev/video5
/dev/video6
/dev/video7
/dev/video8
/dev/video9
/dev/video10
rkisp_mainpath (platform:rkisp0-vir0):
/dev/video11
/dev/video12
/dev/video13
/dev/video14
/dev/video15
/dev/video16
/dev/video17
/dev/media1

radxa@rock-5c:~$ v4l2-ctl --list-formats-ext --device=/dev/video11
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture Multiplanar
[0]: ‘UYVY’ (UYVY 4:2:2)
Size: Stepwise 32x16 - 3840x2160 with step 8/8
[1]: ‘NV16’ (Y/CbCr 4:2:2)
Size: Stepwise 32x16 - 3840x2160 with step 8/8
[2]: ‘NV61’ (Y/CrCb 4:2:2)
Size: Stepwise 32x16 - 3840x2160 with step 8/8
[3]: ‘NV21’ (Y/CrCb 4:2:0)
Size: Stepwise 32x16 - 3840x2160 with step 8/8
[4]: ‘NV12’ (Y/CbCr 4:2:0)
Size: Stepwise 32x16 - 3840x2160 with step 8/8
[5]: ‘NM21’ (Y/CrCb 4:2:0 (N-C))
Size: Stepwise 32x16 - 3840x2160 with step 8/8
[6]: ‘NM12’ (Y/CbCr 4:2:0 (N-C))
Size: Stepwise 32x16 - 3840x2160 with step 8/8

radxa@rock-5c:~$ v4l2-ctl --device=/dev/video11 --all
Driver Info:
Driver name : rkisp_v6
Card type : rkisp_mainpath
Bus info : platform:rkisp0-vir0
Driver version : 2.0.0
Capabilities : 0x84201000
Video Capture Multiplanar
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04201000
Video Capture Multiplanar
Streaming
Extended Pix Format
Media Driver Info:
Driver name : rkisp0-vir0
Model : rkisp0
Serial :
Bus info :
Media version : 5.10.110
Hardware revision: 0x00000000 (0)
Driver version : 5.10.110
Interface Info:
ID : 0x03000007
Type : V4L Video
Entity Info:
ID : 0x00000006 (6)
Name : rkisp_mainpath
Function : V4L2 I/O
Pad 0x01000009 : 0: Sink
Link 0x0200000a: from remote pad 0x1000004 of entity ‘rkisp-isp-subdev’: Data, Enabled
Priority: 2
Format Video Capture Multiplanar:
Width/Height : 800/600
Pixel Format : ‘NV12’ (Y/CbCr 4:2:0)
Field : None
Number of planes : 1
Flags :
Colorspace : BT.2020
Transfer Function : Rec. 709
YCbCr/HSV Encoding: BT.2020
Quantization : Full Range
Plane 0 :
Bytes per Line : 800
Size Image : 720000
Selection Video Capture: crop, Left 0, Top 0, Width 800, Height 600, Flags:
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 3840, Height 2160, Flags:
Selection Video Output: crop, Left 0, Top 0, Width 800, Height 600, Flags:
Selection Video Output: crop_bounds, Left 0, Top 0, Width 3840, Height 2160, Flags:
Image Processing Controls
pixel_rate 0x009f0902 (int64) : min=0 max=1000000000 step=1 default=1000000000 value=356800000 flags=read-only, volatile

I tried to output the video file using the command line:

radxa@rock-5c:~$ v4l2-ctl --verbose -d /dev/video11 --set-fmt-video=width=800,height=600,pixelformat=‘NV12’ --stream-mmap=4 --set-selection=target=crop,flags=0,top=0,left=0,width=800,height=600 --stream-to=out.yuv
VIDIOC_QUERYCAP: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture Multiplanar:
Width/Height : 800/600
Pixel Format : ‘NV12’ (Y/CbCr 4:2:0)
Field : None
Number of planes : 1
Flags :
Colorspace : BT.2020
Transfer Function : Rec. 709
YCbCr/HSV Encoding: BT.2020
Quantization : Full Range
Plane 0 :
Bytes per Line : 800
Size Image : 720000
VIDIOC_G_SELECTION: ok
VIDIOC_S_SELECTION: ok
VIDIOC_REQBUFS returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_STREAMON returned 0 (Success)

The process is hangs here…

When I try to export 1.jpg, the process hangs

radxa@rock-5c:~$ gst-launch-1.0 v4l2src device=/dev/video11 io-mode=dmabuf num-buffers=1 ! video/x-raw,format=NV12,width=640,height=480 ! mppjpegenc ! filesink location=1.jpg
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Pipeline is PREROLLED …
Setting pipeline to PLAYING …
New clock: GstSystemClock

The same is true for outputting MP4, the process hangs

radxa@rock-5c:~$ gst-launch-1.0 v4l2src device=/dev/video11 io-mode=dmabuf ! video/x-raw,format=NV12,width=640,height=480,framerate=30/1 ! mpph264enc ! filesink location=1.mp4
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Pipeline is PREROLLED …
Setting pipeline to PLAYING …
New clock: GstSystemClock

Is anyone having the same problem as me?

You need kernel 6.1 for the camera to work on Rock-5c.

1 Like

Thanks.

Radxa has not released an official 6.1 kernel image yet. Do you have any recommendations?

Are you using 6.1.43 here?

I now use my custom-built image.

You can try the desktop image, the cli image has no HDMI output set but DRM works fine with the ‘capture’ you can find here: Glitchy video capture

./capture -d /dev/video11 -f NV12 -c 2000 -s 1920x1080

[https://github.com/radxa-build/rock-5c-6_1/releases]

2 Likes

Thank you very much for sharing it :smile:

I have a similar problem, but the suggested solution did not work for me.
When hanging, the logs (dmesg) constantly output: “mipi-csi 2-hw ERR 1:0x10000000 (ecc 2)”.
What could be the problem?
One more question: do you know what the 2011XDF encryption chip on the camera board is for?
Thanks.

I am using rock-5c-6_1_bookworm_kde_t7.output.img, you can go here to download and try it(make sure the FPC cable is connected perfectly)

I didn’t find this chip either:joy:

I looked at the module schematics of other imx415 designs and found no special chips needed anywhere.
Generation of 4 voltages: 5V->3.3V, 3.3V->2.9V, 3.3V->1.8V, 3.33V->1.1V

In addition, there is a 37.125MHz crystal oscillator and I2C level conversion

It worked! The problem was only in the FPC cable.
I use the firmware from “Getting Started”, namely “ROCK 5C Desktop System Image: Debian12 KDE b1” (aka “rock-5c_bookworm_kde_b1.output.img.xz”).
I think it will work the same with other firmware.
If someone else has the same problem, start by replacing the cable.
Maybe someone will find the information useful.

Congratulations!