Orin series v4l2 cam0 port cannot be used

Hi nvidia engineers, I’m a developer from Arducam.

I’m adapting the Arducam camera on the latest system and I’m having some problems, I hope you can help me.

My hardware:
Orin Nano , Orin Nx(All are official kits)
My system:
Jetpack 5.1.2/L4T 35.4.1

My problem:
According to the orin series related manuals, you can see that CSI_0_D1 and CSI_1_D0 have P/N swapped on the module.

When I use nvidia isp framework:

or cam0, I can use lane_polarity according to the manual description to solve the problem of P/N confusion. I only need to add a line of configuration to the device tree.


But when I use V4L2 Interface directly


I also set lane_polarity to 6, but it doesn’t seem to take effect. Could this parameter theoretically be used in the V4L2 framework? If it doesn’t work, are there any other solutions?

hello edward18,

did you meant you’re able to fetch the stream via nvarguscamerasrc, but it failed with v4l2 IOCTL?
please check you’re accessing to the same node, since it’s not always /dev/video0 maps to sensor-id=0.

@JerryChang

Sorry, I may have caused you to misunderstand.

For some cameras (imx519) I used the isp framework. I can use the camera directly by modifying the device tree lane_polarity parameter.Both cam0 and cam1 work fine

What I am adapting now is another camera. For some reasons, I do not use an isp. Setting lane_polarity in the device tree does not allow me to use the cam0 interface. I can’t get the data using v4l2-ctl.Neither v4l2 nor gstreamer can get the data.

hello edward18,

I see, it might not an issue with lane_polarity config.
please review Sensor Pixel Clock section, you must be set correctly to avoid potential issues.
please also check To verify the port binding result and Debugging Tips for troubleshooting.

@JerryChang

I understand what you mean.
But my device tree and configuration can run on Jetson Nano and Jetson Xavier Nx. Is there anything else we should pay attention to in the orin series?

What I explained before may be a bit redundant, but what you said here is correct. For example, when I am on imx519, I can receive data using nvarguscamerasrc, but v4l2 IOCTL cannot.

In both methods I explicitly specified video0

v4l2:

v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat='RG10' --stream-mmap --stream-count=-1 --set-ctrl=sensor_mode=2

nvarguscamerasrc

gst-launch-1.0 nvarguscamerasrc sensor_id=0 !    'video/x-raw(memory:NVMM),width=1920, height=1080, framerate=10/1, format=NV12' !    nvvidconv flip-method=0 ! 'video/x-raw,width=960, height=720' !    nvvidconv ! nvegltransform ! nveglglessink -e

hello edward18,

as mentioned, it’s not always /dev/video0 maps to sensor-id=0.
you may also check the position property in the tegra-camera-platform fields.
taking dual camera as an example, it’s sensor-id=0 to enable camera with position="rear",
whereas it’s sensor-id=1 to enable camera with position="front"

hence,
please double check you’re accessing to the same node.

@JerryChang

If I only connect one camera and only one video0 node, will this position still be affected?

I compared my device tree with that of imx219 and imx477, and the positions are consistent.

yes. it sometimes affect if you have two nodes defined in the system.

Hi @Arducam_Edward,
I would also suggest adding the bypass_mode=0 as this might be required to avoid using the ISP and get RAW capture

v4l2-ctl  -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat='RG10' --stream-mmap --stream-count=-1 --set-ctrl=sensor_mode=2 --set-ctrl bypass_mode=0

@JerryChang

I’ve tried modifying the position and making sure they correspond, but the state doesn’t change. Everything is fine in the status of cam1, but cam0 does not work.

@jafeth.garcia

Thanks for your suggestion, the status remains the same. cam1 is normal, but cam0 always has no data.

hello Arducam_Edward,

please point-out the CSI brick used by Cam0, and please also share the correspond device tree settings for reference. thanks

@JerryChang @jafeth.garcia

I combined your suggestions. Give more detailed information.

command and dmesg

trace more:

echo 1 > /sys/kernel/debug/tracing/tracing_on
echo 30720 > /sys/kernel/debug/tracing/buffer_size_kb
echo 1 > /sys/kernel/debug/tracing/events/tegra_rtcpu/enable
echo 1 > /sys/kernel/debug/tracing/events/freertos/enable
echo 2 > /sys/kernel/debug/camrtc/log-level
echo 1 > /sys/kernel/debug/tracing/events/camera_common/enable
echo > /sys/kernel/debug/tracing/trace
     kworker/3:9-174     [003] ....   190.107229: rtcpu_nvcsi_intr: tstamp:6952085305 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x00000044
     kworker/3:9-174     [003] ....   190.107229: rtcpu_nvcsi_intr: tstamp:6952088936 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x10000000
     kworker/3:9-174     [003] ....   190.107229: rtcpu_nvcsi_intr: tstamp:6952089653 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x00000044
     kworker/3:9-174     [003] ....   190.107229: rtcpu_nvcsi_intr: tstamp:6952091436 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x10000000
     kworker/3:9-174     [003] ....   190.107230: rtcpu_nvcsi_intr: tstamp:6952092157 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x10000000
     kworker/3:9-174     [003] ....   190.107230: rtcpu_nvcsi_intr: tstamp:6952093810 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x10000000
     kworker/3:9-174     [003] ....   190.107230: rtcpu_nvcsi_intr: tstamp:6952098478 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x10000044
     kworker/3:9-174     [003] ....   190.107230: rtcpu_nvcsi_intr: tstamp:6952099596 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x10000000
     kworker/3:9-174     [003] ....   190.107230: rtcpu_nvcsi_intr: tstamp:6952100825 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x10000000
     kworker/3:9-174     [003] ....   190.107231: rtcpu_nvcsi_intr: tstamp:6952107691 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x10000000
     kworker/3:9-174     [003] ....   190.107231: rtcpu_nvcsi_intr: tstamp:6952109366 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x00000004
     kworker/3:9-174     [003] ....   190.107231: rtcpu_nvcsi_intr: tstamp:6952109740 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x14000000
     kworker/3:9-174     [003] ....   190.107231: rtcpu_nvcsi_intr: tstamp:6952110344 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x10000000
     kworker/3:9-174     [003] ....   190.107231: rtcpu_nvcsi_intr: tstamp:6952112931 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x10000000
     kworker/3:9-174     [003] ....   190.107231: rtcpu_nvcsi_intr: tstamp:6952116144 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x10000000
     kworker/3:9-174     [003] ....   190.107232: rtcpu_nvcsi_intr: tstamp:6952116520 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x10000000
     kworker/3:9-174     [003] ....   190.107232: rtcpu_nvcsi_intr: tstamp:6952119107 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x10000000
     kworker/3:9-174     [003] ....   190.107232: rtcpu_nvcsi_intr: tstamp:6952119478 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x00000044
     kworker/3:9-174     [003] ....   190.107232: rtcpu_nvcsi_intr: tstamp:6952122411 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x10000000
     kworker/3:9-174     [003] ....   190.107232: rtcpu_nvcsi_intr: tstamp:6952126253 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x10000000
     kworker/3:9-174     [003] ....   190.107233: rtcpu_nvcsi_intr: tstamp:6952129951 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x10000000
     kworker/3:9-174     [003] ....   190.107233: rtcpu_nvcsi_intr: tstamp:6952130548 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x00000044
     kworker/3:9-174     [003] ....   190.107233: rtcpu_nvcsi_intr: tstamp:6952131781 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x10000000
     kworker/3:9-174     [003] ....   190.107233: rtcpu_nvcsi_intr: tstamp:6952132921 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x10000000
     kworker/3:9-174     [003] ....   190.107233: rtcpu_nvcsi_intr: tstamp:6952134143 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x10000000
     kworker/3:9-174     [003] ....   190.107234: rtcpu_nvcsi_intr: tstamp:6952135095 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x08000000
     kworker/3:9-174     [003] ....   190.107234: rtcpu_nvcsi_intr: tstamp:6952138263 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x04000004

I tried to explain this error using your tool

root@ubuntu:/home/jetson# /opt/nvidia/camera/nvcapture-status-decoder 190.107234: rtcpu_nvcsi_intr: tstamp:6952138263 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x04000004
NVIDIA camera capture status decoder utility (Version 2.00)
Copyright (C) 2019-2020, NVIDIA Corporation. All rights reserved.

Class: Global
Type: PHY_Interrupt0
PHY: 0
CIL: 1
Stream: 0
VC: 0
Status: 67108868
Timestamp: 6952138263

PHY_Interrupt0 : 0x0000000004000004
    -cil_data_lane_sot_mb_err0    [ 2]: 1
        More than one bit error detected on the data lane [A/B]0 sync word

    -dphy_cil_deskew_calib_err_lane1    [26]: 1
        DPHY deskew calibration not complete on data lane [A/B]1. Happen when the calibration sequence length is not long enough

hello Arducam_Edward,

is it one-lane on CSI-B to report the issue? please try to configure lane_polarity = "4"; //0100 for testing.
besides, are you using Orin NX/Nano developer kits, or, it’s Orin SOM on Xavier NX carrier board?

@JerryChang

Sure, thank you for your advice

i will try right now.

My hardware connect:

ORIN NX official kit

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.