12 camera support

Brief System Description

  • JetPack 4.6.2 L4T 32.7.2
  • NVidia Jetson AGX Xavier Module 32GB - Non Industrial Version
  • Xavier is connected to 3 MAX96712 deserializers
  • All Cameras on all deserializers are identical

Each MAX96712 deserialzier is connected via a 4 lane CSI port to the Xavier AGX.

Using the existing vi ports and csi channel nodes as a pattern we have the vi ports and csi channel nodes in the device tree.

Currently we can successfully acquire images on cameras 0-3 connected to Xavier via port-index 0

Currently we can successfully acquire images on cameras 4-7 connected to Xavier via port-index 2

However we can NOT acquire images on cameras 8-11 connected to Xavier via port-index 4

All cameras serailizers and deserialziers are accessble on the I2C busses

Following command is used to perform test capture:
gst-launch-1.0 v4l2src device=/dev/gmsl/cam8 num-buffers=1 ! jpegenc ! filesink location=/home/root/pics/cam8.jpg;

Using the trace debugging commands we observe the following when attempting to acquire and image we observed the following:
trace-20240104-1330.BAD.txt (97.6 KB)

trace has many instances of the following excerpt
kworker/0:1-991 [000] … 175.295212: rtcpu_nvcsi_intr: tstamp:5825046047 class:GLOBAL type:PHY_INTR0 phy:2 cil:0 st:0 vc:0 status:0x00000001
kworker/0:1-991 [000] … 175.295213: rtcpu_nvcsi_intr: tstamp:5825050120 class:GLOBAL type:STREAM_NOVC phy:0 cil:0 st:4 vc:0 status:0x00000001
kworker/0:1-991 [000] … 175.295214: rtcpu_nvcsi_intr: tstamp:5825050120 class:CORRECTABLE_ERR type:STREAM_NOVC phy:0 cil:0 st:4 vc:0 status:0x00000001
kworker/0:1-991 [000] … 175.295214: rtcpu_nvcsi_intr: tstamp:5825051235 class:GLOBAL type:STREAM_NOVC phy:0 cil:0 st:4 vc:0 status:0x00000001
kworker/0:1-991 [000] … 175.295215: rtcpu_nvcsi_intr: tstamp:5825051235 class:CORRECTABLE_ERR type:STREAM_NOVC phy:0 cil:0 st:4 vc:0 status:0x00000001
kworker/0:1-991 [000] … 175.295215: rtcpu_nvcsi_intr: tstamp:5825052349 class:GLOBAL type:STREAM_NOVC phy:0 cil:0 st:4 vc:0 status:0x00000001
kworker/0:1-991 [000] … 175.295216: rtcpu_nvcsi_intr: tstamp:5825052349 class:CORRECTABLE_ERR type:STREAM_NOVC phy:0 cil:0 st:4 vc:0 status:0x00000001
kworker/0:1-991 [000] … 175.295216: rtcpu_nvcsi_intr: tstamp:5825053464 class:GLOBAL type:STREAM_NOVC phy:0 cil:0 st:4 vc:0 status:0x00000001
kworker/0:1-991 [000] … 175.295217: rtcpu_nvcsi_intr: tstamp:5825053464 class:CORRECTABLE_ERR type:STREAM_NOVC phy:0 cil:0 st:4 vc:0 status:0x00000001

Looking further we found a reference to “NOVC” in the TRM


Looks like output indicates a multibit error in the stream.

Hard to imagine that is happening since all 3 deserializers are programmed virtually identicaly. The first 2 deserializers work fine and the third deserializer experiences this error with known good cameras.

So is their anything different about Xavier port-index 4 vs. (port-index 0 and port-index 2)?

hello elitewompa,

the only difference for point-index=4 is there’s only single VI brick. but, this may not the root cause of your failure.
you may see-also Port Index section for reference.

anyways,
please give it a try with below commands to boost all the VI/CSI/ISP clocks.
for instance,

sudo su
echo 1 > /sys/kernel/debug/bpmp/debug/clk/vi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/isp/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/nvcsi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/emc/mrq_rate_locked
cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate |tee /sys/kernel/debug/bpmp/debug/clk/vi/rate
cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/isp/rate
cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate
cat /sys/kernel/debug/bpmp/debug/clk/emc/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/emc/rate

Hey @JerryChang , thanks for your response.

We did try boosting the clocks

However the “NOVC” errors persist

We verified the following in the live devicetree /sys/firmware/devicetree/base:

  1. For the camera that produces the NOVC errors we followed the phandle “links” between the camera, csi, and vi nodes and verified that:
    *The vc-id property in the camera and phandle linked vi port all had vc-id property = 1
    *The port-index property in the camera and phandle linked csi channel and phandle linked vi port all had port-index property = 4
  2. verified in live /host1x/nvcsi@15a00000/num-channels = 12
  3. verified /host1x/vi@15c00000/num-channels = 12
  4. verified /tegra-camera-platform/num_csi_lanes = 12

@JerryChang could you give these values a quick look to see if you see any problems/concerns?

@JerryChang can you verify that port-index = <4>; is the correct value for the port-index when the CSI lanes are connected to Xavier CSI 4 and CSI 5 lanes?

hello elitewompa,

yes, that’s correct. you may also share the device tree setting for reference, please re-cap part of settings of camera8-11 for checking.

anyways,
PHY_INTR0 with error code 0x01 it means there’s LP sequence error has detected on clock lane.
please give it a try to tune set_mode_delay_ms and cil_settletime property settings by Sensor Software Driver Programming.

@JerryChang Thank you for your response.

We have attached an excerpt from the live device tree (/sys/firmware/devicetree/base/…) of the camera, csi, vi, and module device tree nodes for cameras 8-11 for you to check.
devtreeExcerptForCheck.txt (27.6 KB)

We will now tune the paramters set_mode_delay_ms and cil_settletime

To set cil_settletime we used the following for a reference

Where 1 lp clock period = 1/204 MHz = 4.901960784 ns

We derived UI from the following excerpt from the MIPI CSI-2 spec

Our MIPI data rate from the deserializer is 800MHz.
Based on the above diagram 1 UI is half of the DDR clock period. (1 / 400MHz) / 2 = 1.25 ns = 1 UI

85 ns + 6 * UI < (cil_settletime + 6) * (lp_clock_period) < 145 ns + 10 * UI
85 ns + 7.5 < (cil_settletime + 6) * (lp_clock_period) < 145 ns + 12.5
92.5 ns < (cil_settletime + 6) * (lp_clock_period) < 157.5 ns
18.87 < (cil_settletime + 6) < 32.13
12.87 < cil_settletime < 26.13

@JerryChang Do these calculations look correct for cil_settltime values?

hello elitewompa,

your VI/CSI/Sensor port bindings looks correct.
please also execute v4l2-compliance for sanity test… i.e. $ v4l2-compliance -d /dev/video<n>

I suspect you have duplicated position properties for those camera nodes.
for instance,

    tegra-camera-platform {
            module8 {
                position = "centerleft";

            module9 {
                position = "centerright";

            module10 {
                position = "topleft";

            module11 {
                position = "topright";

please check all these 12 camera nodes were using different position property values.
per developer guide, it’s only given example for 6-cam system, you may try using hex values instead for your use-case.

and… this may be minor.
please try remove those focuser node definitions.

    tegra-camera-platform {
        modules {
            name = "modules";

            module8 {
                ...
                drivernode1 {
                    proc-device-tree = "/proc/device-tree/e3326_focuser_ov10635@P5V27C/";
                    status = "disabled";
                    pcl_id = "v4l2_focuser_stub";
                    linux,phandle = <0x1f7>;
                    phandle = <0x1f7>;
                    name = "drivernode1";
                };

@JerryChang Following are the results of the tests we ran for set_mode_delay_ms and cil_settletime parameters.

We assigned set_mode_delay_ms = “100”; and tested cil_settletime = “[13-27]”.
The results of all 15 tests were no successful image acquisition with the same “NOVC” errors.

All of our MIPI clock and data pairs are matched length for each of the 3 deserializers.
The table below shows the length differences as well as the corresponding time delay for the length difference.


One can see that the delay is less than 1 picosecond for any of the buses.
So unless delay added in the Xavier module, the signals should be arriving virtualy simultaneously.

FYI
-the buses for the derserializers that work are MIPI-0 and MIPI-1.
-the bus for the deserializer that does not work is MIPI-2.

hello elitewompa,

let’s try updating the position properties for those camera nodes.
furthermore, please also give it a try to increase serdes pixel clock for MIPI-2.

Hello @JerryChang,

We have made the following changes to the device tree

  1. Changed the /tegra-camera-platform/modules position property values to be unique among all position property values.
  2. Changed the camera, csi, vi and modules nodes to use hex values for node names.
  3. Removed focuser node definitions from all module nodes.

See attached updated device tree excerpt:
devtreeExcerptForCheck.txt (17.3 KB)

We tested cameras 8,9,A,B with updated device tree and the “NOVC” errors persist.


Currently the deserializer MIPI output frequency is 800MHz for each MIPI lane.
Currently the serdes_pix_clk_hz is set to 320000000.

Test 1: We increasesd deserializer output to 1000MHz and increased serdes_pix_clk_hz to 400000000.
Test 1 Result: “NOVC” errors persist.

Test 2: We left deserializer output at 800MHz and increased serdes_pix_clk_hz to 400000000.
Test 2 Result: “NOVC” errors persist.


FYI we also tested the working deserializers during all the above tests and they continued to work.

hello elitewompa,

the root cause should be PHY_INTR0 instead of STREAM_NOVC.
there’s workaround to ignore CRC/ECC report (but… I don’t kept r32.7.2 code base, is it possible for moving to r32.7.4?)

anyways,
PHY_INTR0 with error code 0x01 it means there’s LP sequence error has detected on clock lane.
some experience to resolve such failure is adding software reset on serdes chip before s_stream().

may I also know what’s your hardware setups for testing camera:8-11?
for example, did you have all 3 sets of SerDes chips connected?

@JerryChang Thank you for the response

Moving from 32.7.2 would require a great deal of work. Before deciding to move to another version we would like to try the work arround.

@JerryChang Is it possible for you to show me the work around logic that needs to be placed in the code?
If you show me the lines of code for the work arround in a another version I can place them in the right spot in 32.7.2.

Our test setup for testing cameras 8 - 11 is shown below.

  • All cameras are known good cameras.
  • Cameras 0-7 are known to work.
  • Durning the tests that have have been running only cams 8-11 and cam 2 were connected.
    We had cam 2 connected just to have a known working camera avaiable during testing.
  • Cameras 0,1,3-7 are grayed out to show they were not connected during the tests.

hello elitewompa,

sorry, part of workaround to ignore CRC/ECC was handled by rce-fw, so, sharing the kernel change cannot helps.

this connection diagram helps greatly.
the truth is… camera device tree settings must be identical with your physical setups.
so,
you may give another try by disconnect deserializer0, deserializer1, and also removing those DT settings for confirmation.

hello @JerryChang,

We have the ability to power down the deserializers on our board. So we powered down deserializers 0 and 1.
We also removed all camera, csi, vi, and module device tree nodes from the device tree that were not being used to supoort the cameras on deserializer 2.
We have included a copy of this modifyed device tree, just in case you would like to see how we changed the device tree.
devtreeExcerptForCheck2.txt (17.3 KB)

We enabled the debug trace.
We then attempted to capture an image.

We observed the following dmesg output while trying to capture image:

We observed the following debug trace output while trying to capture image:
trace-20240112-1057.short.txt (12.8 KB)

Looks like the PHY_INTR0 error persists.

according to the kernel logs. you should have <bus>-<address> for each SerDes.
please confirm… is this still indicate your camera nodes from 1st deserializer? i.e. 0-000c.

  gst-launch-1.0-18647 [000] ....   307.676949: tegra_channel_open: vi-output, ov10635 0-000c
  gst-launch-1.0-18647 [000] ....   307.678872: tegra_channel_set_power: ov10635 0-000c : 0x1

for instance,
it should enable camera node on bus-2, i.e. 2-000c, since you’ve to enable deserializer-2,

Hello @JerryChang,

We can confirm:

  • deserializer 0 is on I2C bus 2.
  • deserializer 1 is on I2C bus 2.
  • deserializer 2 is on I2c bus 0.

The camera nodes for deserializer 2 as well as deserialzier are shown by the following i2cdetect output.

device tree port bindings looks correct.
please download Jetson AGX Xavier Series OEM Product Design Guide, for checking [10.1.1 CSI D-PHY Design Guidelines] of Signal Routing Requirements.
and, please see-also [Figure 10-2. Camera CSI D-PHY Connections], to confirm it’s using CSI_4_CLK_P/N only for 4-lane sensor on CSI-E/F.

@JerryChang

We verified via schematic and PCB that CSI-E/F uses CSI_4_CLK_P/N.

We are working on checking Jetson AGX Xavier Series OEM Product Design Guide [10.1.1 CSI D-PHY Design Guidelines] Signal Routing Requirements.

We will let you know the results when complete

Is this still an issue to support? Any result can be shared?

@JerryChang we have found that the MIPI CLK + DATA do not look correct coming out of deserializer. We will continue to look into this matter and report back what we find.