Orin MIPI D-PHY&MIPI C-PHY

Hello teachers, I have a few questions on my side that I would like to ask teachers to help answer.

What we’re trying so far:

  1. Configure the deserializer MAX96712 to query the MAX96712 CSI PLL status register with the CSI signal output by C-PHY; The oscilloscope detects the presence of data output.
  2. Modification of the device tree:
    /hardware/nvidia/platform/t23x/common/kernel-dts/t234-common-modules/tegra234-camera-mux-16ch-gmsl.dtsi:
    All phy_mode = “DPHY” ->phy_mode = “CPHY” under this file

Second, the current phenomenon is: the /dev/video inside Orin can be detected, but the image input cannot be received in the /dev/video node; Serial port debugging information:
III. Questions that need to be asked about you:

  1. How should the Orin side receive and parse MIPI C-PHY for further modification?
  2. If the signal reception is not normal, is there any debugging means that can be investigated?
  1. Please apply below patch if your configure isn’t 3 lanes config.
diff --git a/drivers/media/platform/tegra/camera/nvcsi/csi5_fops.c b/drivers/media/platform/tegra/camera/nvcsi/csi5_fops.c
index 7a50ce354..5c8f6a5ff 100644
--- a/drivers/media/platform/tegra/camera/nvcsi/csi5_fops.c
+++ b/drivers/media/platform/tegra/camera/nvcsi/csi5_fops.c
@@ -217,7 +217,8 @@ static int csi5_stream_set_config(struct tegra_csi_channel *chan, u32 stream_id,
        struct CAPTURE_CONTROL_MSG msg;
        struct nvcsi_brick_config brick_config;
        struct nvcsi_cil_config cil_config;
-       bool is_cphy = (csi_lanes == 3);
+       u32 phy_mode = read_phy_mode_from_dt(chan);
+       bool is_cphy = (phy_mode == CSI_PHY_MODE_CPHY);
        dev_dbg(csi->dev, "%s: stream_id=%u, csi_port=%u\n",
                __func__, stream_id, csi_port);

Okay, thank you teacher. I’ll try it first.

Referring to your reply, it is now possible to display a frame image on Orin.

The current situation is:

  1. Only the picture of the first frame can be displayed, and due to the reception timeout reset, resulting in a splash screen, see the attachment for the display situation
  2. Serial port output display: reset once to display the screen.
    How can I modify the above situation?

Get the trace log to analysis.

https://elinux.org/Jetson/l4t/Camera_BringUp

Ok thanks!

Hello, we tried to increase the clock rate, but it didn’t help.
The situation is now:

  1. I can get an image with this command, but not a video;
$ gst-launch-1.0 -v v4l2src device="/dev/video0" ! video/x-raw,framerate=30/1,width=1920,height=1080,format=UYVY ! xvimagesink &
$ gst-launch-1.0 -v v4l2src device="/dev/video1" ! video/x-raw,framerate=30/1,width=1920,height=1080,format=UYVY ! xvimagesink &
$ gst-launch-1.0 -v v4l2src device="/dev/video2" ! video/x-raw,framerate=30/1,width=1920,height=1080,format=UYVY ! xvimagesink &
$ gst-launch-1.0 -v v4l2src device="/dev/video3" ! video/x-raw,framerate=30/1,width=1920,height=1080,format=UYVY ! xvimagesink &

  1. When I close the window and use the command again, the image is updated and still not the video output.

According to your reminder, I checked the log again

This is dmesg log:

[  394.953054] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 4194400
[  394.954862] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 20971616
[  394.980412] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 4194400
[  394.998334] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 20971616
[  395.008958] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 4194400
[  395.025842] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 20971616
[  395.043801] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 20971616
[  395.045156] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[  395.071293] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 20971616
[  395.089231] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 4194400

and this is trace log:

     kworker/4:0-3847    [004] ....   669.333389: rtcpu_vinotify_event: tstamp:21672660992 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:693524874144 data:0x379d580010000000
     kworker/4:0-3847    [004] ....   669.333391: rtcpu_vinotify_event: tstamp:21672661125 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:693524880832 data:0x0000000031000001
     kworker/4:0-3847    [004] ....   669.333392: rtcpu_vinotify_event: tstamp:21672661280 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:693524923008 data:0x379d550010000000
     kworker/4:0-3847    [004] ....   669.333392: rtcpu_vinotify_event: tstamp:21672661409 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:693524929792 data:0x0000000031000002
 vi-output, ar02-4395    [001] ....   669.561655: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1080 fmt 13
     kworker/4:0-3847    [004] ....   669.613397: rtcpu_vinotify_event: tstamp:21680774066 cch:2 vi:0 tag:VIFALC_TDSTATE channel:0x21 frame:0 vi_tstamp:693779757024 data:0x379d4c0010000000
     kworker/4:0-3847    [004] ....   669.613400: rtcpu_vinotify_event: tstamp:21680774201 cch:2 vi:0 tag:VIFALC_TDSTATE channel:0x21 frame:0 vi_tstamp:693779763744 data:0x0000000031000001
     kworker/4:0-3847    [004] ....   669.613401: rtcpu_vinotify_event: tstamp:21680774350 cch:2 vi:0 tag:VIFALC_TDSTATE channel:0x21 frame:0 vi_tstamp:693779800320 data:0x379d490010000000
     kworker/4:0-3847    [004] ....   669.613401: rtcpu_vinotify_event: tstamp:21680774480 cch:2 vi:0 tag:VIFALC_TDSTATE channel:0x21 frame:0 vi_tstamp:693779807104 data:0x0000000031000002
 vi-output, ar02-4394    [002] ....   669.817622: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1080 fmt 13
     kworker/4:0-3847    [004] ....   669.837390: rtcpu_vinotify_event: tstamp:21688887129 cch:1 vi:0 tag:VIFALC_TDSTATE channel:0x22 frame:0 vi_tstamp:694035720352 data:0x379d520010000000
     kworker/4:0-3847    [004] ....   669.837392: rtcpu_vinotify_event: tstamp:21688887269 cch:1 vi:0 tag:VIFALC_TDSTATE channel:0x22 frame:0 vi_tstamp:694035727040 data:0x0000000031000001
     kworker/4:0-3847    [004] ....   669.837392: rtcpu_vinotify_event: tstamp:21688887420 cch:1 vi:0 tag:VIFALC_TDSTATE channel:0x22 frame:0 vi_tstamp:694035763648 data:0x379d4f0010000000
     kworker/4:0-3847    [004] ....   669.837392: rtcpu_vinotify_event: tstamp:21688887549 cch:1 vi:0 tag:VIFALC_TDSTATE channel:0x22 frame:0 vi_tstamp:694035770432 data:0x0000000031000002
 vi-output, ar02-4392    [003] ....   670.073737: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1080 fmt 13:
     kworker/4:0-3847    [004] ....   670.117396: rtcpu_vinotify_event: tstamp:21696622567 cch:3 vi:0 tag:VIFALC_TDSTATE channel:0x20 frame:0 vi_tstamp:694291854496 data:0x379d460010000000
     kworker/4:0-3847    [004] ....   670.117399: rtcpu_vinotify_event: tstamp:21696622702 cch:3 vi:0 tag:VIFALC_TDSTATE channel:0x20 frame:0 vi_tstamp:694291861184 data:0x0000000031000001
     kworker/4:0-3847    [004] ....   670.117400: rtcpu_vinotify_event: tstamp:21696622854 cch:3 vi:0 tag:VIFALC_TDSTATE channel:0x20 frame:0 vi_tstamp:694291897760 data:0x379d430010000000
     kworker/4:0-3847    [004] ....   670.117400: rtcpu_vinotify_event: tstamp:21696622982 cch:3 vi:0 tag:VIFALC_TDSTATE channel:0x20 frame:0 vi_tstamp:694291904544 data:0x0000000031000002

What do these mean and how can we achieve video output?

Hi @chenweiqian please help to open a new topic for your issue. Thanks

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