Max9295 + max9296 + imx390 serdes camera v4l2 status is no power

if using /dev/video0

     kworker/0:2-1172  [000] ....   261.747338: rtcpu_vinotify_event: tstamp:8323520421 tag:ATOMP_FE channel:0x00 frame:0 vi_tstamp:8323519969 data:0x00000000
     kworker/0:2-1172  [000] ....   261.747339: rtcpu_vinotify_event: tstamp:8323530327 tag:CHANSEL_PXL_SOF channel:0x00 frame:0 vi_tstamp:8323529833 data:0x00000001
     kworker/0:2-1172  [000] ....   261.747340: rtcpu_vinotify_event: tstamp:8323530492 tag:ATOMP_FS channel:0x00 frame:0 vi_tstamp:8323529851 data:0x00000000
     kworker/0:2-1172  [000] ....   261.747341: rtcpu_vinotify_event: tstamp:8323535835 tag:CHANSEL_LOAD_FRAMED channel:0x01 frame:0 vi_tstamp:8323535469 data:0x08000000
  gst-launch-1.0-8675  [004] ....   261.799047: tegra_channel_capture_done: eof:257.541383648
  gst-launch-1.0-8675  [000] ....   261.799694: tegra_channel_set_stream: enable : 0x0
  gst-launch-1.0-8675  [000] ....   261.799699: tegra_channel_set_stream: imx390 2-001b : 0x0
  gst-launch-1.0-8675  [000] ....   261.799754: tegra_channel_set_stream: 150c0000.nvcsi--2 : 0x0
  gst-launch-1.0-8675  [000] ....   261.799759: csi_s_stream: enable : 0x0
     kworker/0:2-1172  [000] ....   261.803457: rtcpu_vinotify_event: tstamp:8324551406 tag:CHANSEL_PXL_EOF channel:0x00 frame:0 vi_tstamp:8324550983 data:0x02cf0002
     kworker/0:2-1172  [000] ....   261.803462: rtcpu_vinotify_event: tstamp:8324555958 tag:ATOMP_FE channel:0x00 frame:0 vi_tstamp:8324555517 data:0x00000000
     kworker/0:2-1172  [000] ....   261.803464: rtcpu_vinotify_event: tstamp:8324565895 tag:CHANSEL_PXL_SOF channel:0x00 frame:0 vi_tstamp:8324565400 data:0x00000001
     kworker/0:2-1172  [000] ....   261.803466: rtcpu_vinotify_event: tstamp:8324566076 tag:ATOMP_FS channel:0x00 frame:0 vi_tstamp:8324565418 data:0x00000000
     kworker/0:2-1172  [000] ....   261.803468: rtcpu_vinotify_event: tstamp:8325586966 tag:CHANSEL_PXL_EOF channel:0x00 frame:0 vi_tstamp:8325586550 data:0x02cf0002

looks well and gstreamer works too but i cant understand why /dev/video1 is not work and v4l cant finding.

even no errors on boot log and call same function


- gst-device-monitor-1.0
root@test-desktop:/home/test# v4l2-ctl -d 1 -n
ioctl: VIDIOC_ENUMINPUT
	Input       : 0
	Name        : Camera 0
	Type        : 0x00000002 (Camera)
	Audioset    : 0x00000000
	Tuner       : 0x00000000
	Standard    : 0x0000000000000000 ()
	Status      : 0x00000001 (no power)
	Capabilities: 0x00000000 (not defined)

Device found:

        name  : vi-output, imx390 2-001b
        class : Video/Source
        caps  : video/x-raw, format=YUY2, width=1920, height=720, framerate=30/1
                video/x-raw, format=YUY2, width=1920, height=720, framerate=30/1
        properties:
                udev-probed = true
                device.bus_path = platform-15700000.vi
                sysfs.path = /sys/devices/13e10000.host1x/15700000.vi/video4linux/video0
                device.subsystem = video4linux
                device.product.name = "vi-output\,\ imx390\ 2-001b"
                device.capabilities = :capture:
                device.api = v4l2
                device.path = /dev/video0
                v4l2.device.driver = tegra-video
                v4l2.device.card = "vi-output\,\ imx390\ 2-001b"
                v4l2.device.bus_info = platform:15700000.vi:0
                v4l2.device.version = 264588 (0x0004098c)
                v4l2.device.capabilities = 2216689665 (0x84200001)
                v4l2.device.device_caps = 69206017 (0x04200001)
        gst-launch-1.0 v4l2src ! ...
//... 
Device found:
        name  : tegra-snd-t186ref-mobile-rt565x

i think that problem is senor configure problem. because i changed YUV → RGB on DT for /dev/video0.
gst-device-monitor-1.0 can’t discover devices. but i changed /dev/video0 and /dev/video1 to YUV.
gst find both but problem is RGB setting is jetpack 4.4 reference.

What do you mean can’t discover devices. What’s gstreamer command?

i mean gstremear kinds of gst-device-monitor-1.0 and

gst-launch-1.0 v4l2src device=/dev/video0 ! fakesink  
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.

i tested other options but results are always v4l2src0 error

I would suggest stay with v4l2-ctl command to capture and check the trace log when failed.
You may need to modify the width/height/pixelformat

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

i fixed RGB fpga chips and fixing wrong codes and enabled rgb888

root@test-desktop:/home/test# v4l2-ctl -d 1 --all
Driver Info (not using libv4l2):
	Driver name   : tegra-video
	Card type     : vi-output, imx390 2-001c
	Bus info      : platform:15700000.vi:0
	Driver version: 4.9.140
	Capabilities  : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps   : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format
Priority: 2
Video input : 0 (Camera 0: no power)
Format Video Capture:
	Width/Height      : 1920/720
	Pixel Format      : 'AR24'
	Field             : None
	Bytes per Line    : 7680
	Size Image        : 5529600
	Colorspace        : sRGB
	Transfer Function : Default (maps to sRGB)
	YCbCr/HSV Encoding: Default (maps to ITU-R 601)
	Quantization      : Default (maps to Full Range)
	Flags             : 

but video data isnt coming from max9296 or fpga

v4l2-ctl --verbose -w -d /dev/video1 --set-fmt-video=width=1920,height=720,pixelformat=AR24 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1

 vi-output, imx3-9082  [005] ....  1235.640002: tegra_channel_capture_setup: vnc_id 0 W 1920 H 720 fmt 41
 vi-output, imx3-9082  [005] ....  1235.640052: tegra_channel_capture_frame: sof:-549619122596.-268048213696
     kworker/5:1-8840  [005] ....  1235.659062: rtos_queue_send_from_isr_failed: tstamp:38757929673 queue:0x0b4a7258
     kworker/5:1-8840  [005] ....  1235.659068: rtos_queue_send_from_isr_failed: tstamp:38757929818 queue:0x0b4aad68
     kworker/5:1-8840  [005] ....  1235.659070: rtos_queue_send_from_isr_failed: tstamp:38757929962 queue:0x0b4ac998
     kworker/5:1-8840  [005] ....  1235.659073: rtos_queue_send_from_isr_failed: tstamp:38757930101 queue:0x0b4ae518
     kworker/5:1-8840  [005] ....  1235.659075: rtos_queue_send_from_isr_failed: tstamp:38757930237 queue:0x0b4af2d8
     kworker/5:1-8840  [005] ....  1235.659078: rtos_queue_send_from_isr_failed: tstamp:38757930396 queue:0x0b4b0098
     kworker/5:1-8840  [005] ....  1235.659080: rtos_queue_send_from_isr_failed: tstamp:38757930534 queue:0x0b4b0e58
     kworker/5:1-8840  [005] ....  1235.659083: rtos_queue_send_from_isr_failed: tstamp:38757930678 queue:0x0b4b1c18

I asked that and the FPGA sides answered that ’ we got nothing to wrong and check your SW settings’.
The HW and FPGA said video data is sending and serdes registers setting is works.
but data isnt coming. so i want to check DT for CSI and MIPI settings.

Anyway i have questions about serdes and csi .

my question is

  • Can I using Virtual Channel?
    reference using vc and i had same setting too. but my custom device is get yuvu and rgb888 data from serdes (max9296, max9295) .
    YUV is 16 bit and RGB is 24 bits so is it have to using different csi port on gmsl-link ?
    and how to changing that?

// remains for others
i read threads and changed Device tree and added rgb888.
RGB : [ Connecting RGB888 format camera device to TX2 ]

//  tegra186-camera-imx390-a00.dtsi
/*
					dynamic_pixel_bit_depth = "12";
					csi_pixel_bit_depth = "12";
					mode_type = "bayer";
					pixel_phase = "rggb";
*/

// imx390_a@1b 
					dynamic_pixel_bit_depth = "16";
					csi_pixel_bit_depth = "16";
					mode_type = "yuv";
					pixel_phase = "yuyv";
// ....
// imx390_b@1c 
					dynamic_pixel_bit_depth = "24";
					csi_pixel_bit_depth = "24";
					mode_type = "bayer"; 
					pixel_phase = "rgb";
// sensor_common.c
#if 1
	else if (strncmp(pixel_t, "bayer_rgb24", size) == 0) {
		printk("[%s : %d checking \n", __func__, __LINE__);
		*format = V4L2_PIX_FMT_RGB24;
	}
#endif 

// camera_common.c
// ...
	{
		MEDIA_BUS_FMT_RGB888_1X24,
		V4L2_COLORSPACE_RAW, 
		V4L2_PIX_FMT_RGB24,
	},	
	{ 
		MEDIA_BUS_FMT_RGB888_1X24,
		V4L2_COLORSPACE_ADOBERGB,
		V4L2_PIX_FMT_RGB24,
	},

Right you can reference to imx390 for virtual channel design.
RGB888 is should be like below.

					dynamic_pixel_bit_depth = "24";
					csi_pixel_bit_depth = "24";
					mode_type = "rgb"; 
					pixel_phase = "rgb888";

i have question with fourcc
mipi still not work and i checking channel .

chan->fmtinfo->fourcc = 875713089 and it means V4L2_PIX_FMT_ABGR32
but i set V4L2_PIX_FMT_RGB24.

is it ignored?


[   62.393242] [__tegra_channel_try_format : 1893 ] fmtinfo  fourcc  : 875713089  
[   62.393245] [__tegra_channel_try_format : 1894 ] fmtinfo  tegra_vf_code : 9  // RGB888
[   62.393247] [__tegra_channel_try_format : 1895 ] fmtinfo  code : 4106  
[   62.393249] [__tegra_channel_try_format : 1896 ] fmtinfo  img_dt : 36  // RGB888
[   62.393252] [__tegra_channel_try_format : 1897 ] fmtinfo  bpp : deno : 1  : numerator : 4 
[   62.393254] [__tegra_channel_try_format : 1898 ] fmtinfo  desc : BGRA-8-8-8-8

	TEGRA_VIDEO_FORMAT(RGB888, 24, RGB888_1X24, 4, 1, T_A8R8G8B8,
				RGB888, ABGR32, "BGRA-8-8-8-8"),

Looks fine due to VI memory layout didn’t support 24bit.
Have check the Table 357 from TRM.

Thx to reply ShaneCCC

Result is still not work … because mipi didnt get any data …
so i asked FPGA and they said that ‘Check DT and csi or mipi setting before adjust registers’.

my Question is i want to know about CSI’s pin point
so my CSI pin points are here and Am I missing some points?


hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-modules/tegra186-camera-imx390-a00.dtsi

	nvcsi@150c0000 {
			num-channels = <2>;
			#address-cells = <1>;
			#size-cells = <0>;
			channel@0 {
				reg = <0>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						imx390_csi_in0: endpoint@0 {
							port-index = <0>; // vc
							bus-width = <2>;
							remote-endpoint = <&imx390_imx390_out0>;
						};
					};
					port@1 {
						reg = <1>;
						imx390_csi_out0: endpoint@1 {
							remote-endpoint = <&imx390_vi_in0>;
						};
					};
				};
			};
			channel@1 {
				reg = <1>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						imx390_csi_in1: endpoint@2 {
							port-index = <0>;  // vc
							bus-width = <2>;
							remote-endpoint = <&imx390_imx390_out1>;
						};
					};
					port@1 {
						reg = <1>;
						imx390_csi_out1: endpoint@3 {
							remote-endpoint = <&imx390_vi_in1>;
						};
					};
				};
			};
		};
	};



//.. 

i2c@3180000
imx390_b@1c // check reply!
dynamic_pixel_bit_depth = “24”;
csi_pixel_bit_depth = “24”;
mode_type = “rgb”;
pixel_phase = “rgb888”;
//…

tegra-camera-platform {
	compatible = "nvidia, tegra-camera-platform";
            // ...
	num_csi_lanes = <2>;
	max_lane_speed = <4000000>;
	min_bits_per_pixel = <10>;
	vi_peak_byte_per_pixel = <2>;
	vi_bw_margin_pct = <25>;
	isp_peak_byte_per_pixel = <5>;
	isp_bw_margin_pct = <25>;

	i2c@3180000 {
			imx390_a@1b {
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						imx390_imx390_out0: endpoint {
							status = "okay";
							vc-id = <0>;
							port-index = <0>;
							bus-width = <2>;
							remote-endpoint = <&imx390_csi_in0>;
							};
						};
					};

// ...
				gmsl-link {
					src-csi-port = "b";
					dst-csi-port = "b"; // HW dependency
					serdes-csi-link = "a";
					csi-mode = "1x4";
					st-vc = <0>;
					vc-id = <0>;
					num-lanes = <2>;
					//streams = "ued-u1", "raw12";
					streams = "ued-u1", "rgb888"; // TEST
					};

imx390_b@1c {


				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						imx390_imx390_out1: endpoint {
							vc-id = <1>;
							port-index = <0>;
							bus-width = <2>;
							remote-endpoint = <&imx390_csi_in1>;
							};
						};
					};
				gmsl-link {
					src-csi-port = "b";
					dst-csi-port = "b"; ; // HW dependency
					serdes-csi-link = "b";
					csi-mode = "1x4";
					st-vc = <0>;
					vc-id = <1>;
					num-lanes = <2>;
					streams = "ued-u1", "rgb888"; // // TEST
					};

Looks like lost the "vc-id = <>;"in the imx390_imx390_out0/imx390_imx390_out1, But shouldn’t matter with NVCSI/VI didn’t receive validate data. Did you probe the MIPI signal to confirm it?

Thx to reply

Code was mixed up when i edit comment anyway…

MIPI signal is not reached so i struggled that.
I think that FPGA and SERDES register setting is not matched
but FPGA sides said my DT and CSI setting is wrong .

I never using Tegra before and not sure is it right. that is reason why i ask that

finally i fixed DT and devices and success to capture from v4l2-ctl
captureing data is works good but gstreamer is not working


VIDIOC_QUERYCAP: ok
VIDIOC_S_EXT_CTRLS: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture:
        Width/Height      : 1920/720
        Pixel Format      : 'AR24'
        Field             : None
        Bytes per Line    : 7680
        Size Image        : 5529600
        Colorspace        : sRGB
        Transfer Function : Default (maps to sRGB)
        YCbCr/HSV Encoding: Default (maps to ITU-R 601)
        Quantization      : Default (maps to Full Range)
        Flags             :
VIDIOC_REQBUFS: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_STREAMON: ok
VIDIOC_STREAMOFF: ok
data is looks fine 

(CMD) gst-launch-1.0 v4l2src device="/dev/video0" ! “video/x-raw, format=BGRA, width=1920, height=720, framerate=30/1” ! videoconvert ! xvimagesink

Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Pipeline is PREROLLED …
Setting pipeline to PLAYING …
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
…/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.001330112
Setting pipeline to NULL …
Freeing pipeline …

Can I get next steps?

Could you try below command.

gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, format=BGRA, width=1920, height=720, framerate=30/1' ! xvimagesink

gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, format=BGRA, width=1920, height=720, framerate=30/1' ! nvvidconv ! xvimagesink

1st result is…

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Execution ended after 0:00:00.000163552
Setting pipeline to NULL ...
Freeing pipeline ...

2nd result


0:00:00.085972192  8624   0x5580ae32f0 ERROR           GST_PIPELINE gst/parse/grammar.y:760:gst_parse_perform_link: could not link v4l2src0 to nvvconv0, nvvconv0 can't handle caps video/x-raw, format=(string)BGRA, width=(int)1920, height=(int)720, framerate=(fraction)30/1
WARNING: erroneous pipeline: could not link v4l2src0 to nvvconv0, nvvconv0 can't handle caps video/x-raw, format=(string)BGRA, width=(int)1920, height=(int)720, framerate=(fraction)30/1

not works all

May need to trace the v4l2src to get more information.

Have modify or remove the format in command line for try and error.

format=BGRA

YEP problem was unstable signals


GST_DEBUG=3 gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw, format=BGRA, width=1920, height=720, framerate=30/1" ! queue ! videoconvert ! clockoverlay !  nveglglessink -v

is works

HI ShaneCCC

I still have problem with RGB24 settings.
I cheched streaming sender’s signals.

sender’s image is

but TX2 rgb24 is this.

#gst-launch-1.0 v4l2src device=/dev/video0 ! “video/x-raw, format=BGRA, width=1920, height=720” ! videoconvert ! xvimagesink -v

Other v4l2src format likes ARGB or BGRx is not working and i added RGB24 too

RGB888 should be report to AR24 by v4l2-ctl --list-formats-ext