Tc358840 not working on L4T 32.6.1

Hi :

I just upgrade my system from 32.5.2 to 32.6.1 and found that HDMI-MIPI bridge tc358840 not working.
The timing is 1920x1080p60. It worked very well on 32.5.2.

The command I use is as follow:

gst-launch-1.0 v4l2src device=/dev/video0 \
  ! 'video/x-raw, width=1920, height=1080, framerate=60/1, format=UYVY' \
  ! fpsdisplaysink text-overlay=false video-sink=fakevideosink -v

The following are the kernel messages:

Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.606307] t194-nvcsi 15a00000.nvcsi: csi5_power_on
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.607650] t194-nvcsi 15a00000.nvcsi: csi5_power_off
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.616825] t194-nvcsi 15a00000.nvcsi: csi5_power_on
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.616878] tc358840 0-001f: tc358840_g_input_status():
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.617309] tc358840 0-001f: tc358840_g_input_status: status = 0x0
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.621105] tc358840 0-001f: tc358840_enum_framesizes()
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.622170] tc358840 0-001f: tc358840_get_fmt():
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.622178] tc358840 0-001f: tc358840_get_fmt(): width=1920, height=1080, code=0x0000200F, field=1
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.622183] tc358840 0-001f: tc358840_set_fmt():
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.622984] tc358840 0-001f: tc358840_get_fmt():
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.622992] tc358840 0-001f: tc358840_get_fmt(): width=1920, height=1080, code=0x0000200F, field=1
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.622996] tc358840 0-001f: tc358840_set_fmt():
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.623045] tc358840 0-001f: tc358840_enum_framesizes()
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.623239] tc358840 0-001f: tc358840_get_fmt():
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.623246] tc358840 0-001f: tc358840_get_fmt(): width=1920, height=1080, code=0x0000200F, field=1
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.623250] tc358840 0-001f: tc358840_set_fmt():
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.623519] tc358840 0-001f: tc358840_get_fmt():
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.623525] tc358840 0-001f: tc358840_get_fmt(): width=1920, height=1080, code=0x0000200F, field=1
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.623529] tc358840 0-001f: tc358840_set_fmt():
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.623565] tc358840 0-001f: tc358840_enum_framesizes()
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.623756] tc358840 0-001f: tc358840_get_fmt():
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.623762] tc358840 0-001f: tc358840_get_fmt(): width=1920, height=1080, code=0x0000200F, field=1
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.623766] tc358840 0-001f: tc358840_set_fmt():
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.623998] tc358840 0-001f: tc358840_get_fmt():
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.624004] tc358840 0-001f: tc358840_get_fmt(): width=1920, height=1080, code=0x0000200F, field=1
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.624008] tc358840 0-001f: tc358840_set_fmt():
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.624406] tc358840 0-001f: tc358840_get_fmt():
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.624412] tc358840 0-001f: tc358840_get_fmt(): width=1920, height=1080, code=0x0000200F, field=1
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.624416] tc358840 0-001f: tc358840_set_fmt():
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.624605] tc358840 0-001f: tc358840_get_fmt():
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.624612] tc358840 0-001f: tc358840_get_fmt(): width=1920, height=1080, code=0x0000200F, field=1
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.624616] tc358840 0-001f: tc358840_set_fmt():
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.624619] tc358840 0-001f: tc358840_set_fmt(): format->which=1
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.624624] tc358840 0-001f: enable_stream: disable
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.624628] tc358840 0-001f: tc358840_set_csi:
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.625239] tc358840 0-001f: tc358840_set_csi: Enabling CSI TX0
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.625485] tc358840 0-001f: tc358840_set_pll:
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.625762] tc358840 0-001f: tc358840_set_pll: Updating PLL clock of CSI TX0
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.644181] tc358840 0-001f: tc358840_set_csi: Disabling CSI TX1
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.644659] tc358840 0-001f: tc358840_set_csi_mbus_config():
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.644664] tc358840 0-001f: tc358840_set_csi_mbus_config: YCbCr 422 16-bit
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.645795] video4linux video0: tegra_channel_update_format: Resolution= 1920x1080 bytesperline=3840
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.653608] tegra194-vi5 15c10000.vi: vi_capture_init++
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.653731] tegra194-vi5 15c10000.vi: vi_channel_power_on_vi_device
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.653812] tegra194-vi5 15c10000.vi: chan flags 4163
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.653818] tegra194-vi5 15c10000.vi: chan mask ffffffffffffffff
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.653823] tegra194-vi5 15c10000.vi: queue depth 4
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.653846] tegra194-vi5 15c10000.vi: request size 704
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.670253] tegra194-vi5 15c10000.vi: 6 GoS tables configured.
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.670265] tegra194-vi5 15c10000.vi: gos[0] = 0xc2100000
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.670270] tegra194-vi5 15c10000.vi: gos[1] = 0xc2101000
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.670276] tegra194-vi5 15c10000.vi: gos[2] = 0xc2102000
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.670283] tegra194-vi5 15c10000.vi: gos[3] = 0xc2103000
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.670314] tegra194-vi5 15c10000.vi: gos[4] = 0xc2104000
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.670318] tegra194-vi5 15c10000.vi: gos[5] = 0xc2105000
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.670325] tegra194-vi5 15c10000.vi: vi_capture_ivc_send_control: sending chan_id 66 msg_id 16
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.670434] tegra194-vi5 15c10000.vi: vi_capture_ivc_send_control: response chan_id 66 msg_id 17
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.670442] tegra194-vi5 15c10000.vi: vi_capture_setup: control failed, errno 2
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.707120] tegra194-vi5 15c10000.vi: vi capture setup failed
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.730592] tegra194-vi5 15c10000.vi: vi_channel_power_off_vi_device
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.731561] tegra194-vi5 15c10000.vi: vi_capture_shutdown--
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.783680] t194-nvcsi 15a00000.nvcsi: csi5_power_off

attached is the trace log from /sys/kernel/debug/tracing/trace
trace.txt (5.2 KB)

Please help.

hello butyshin,

could you please have a try to boost the clocks for testing,
for example,

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
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

Hi JerryChang:

I try your suggestion. It don’t work. The error messages are the same.
Some error messages are as follow:

Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.670325] tegra194-vi5 15c10000.vi: vi_capture_ivc_send_control: sending chan_id 66 msg_id 16
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.670434] tegra194-vi5 15c10000.vi: vi_capture_ivc_send_control: response chan_id 66 msg_id 17
Oct  6 11:51:33 nvidia-desktop kernel: [ 2320.670442] tegra194-vi5 15c10000.vi: vi_capture_setup: control failed, errno 2

According to camrtc-capture-messages.h,
msg_id 16 means CAPTURE_CHANNEL_SETUP_REQ.
msg_id 17 means CAPTURE_CHANNEL_SETUP_RESP.
errno 2 means CAPTURE_ERROR_NO_MEMORY.

Hope the above information is helpful.

hello butyshin,

do you have device node /dev/video0 generated on r32.6.1?
what’s the results if you check the formats by v4l utility, for example, $ v4l2-ctl -d /dev/video0 --list-formats-ext
thanks

Hi JerryChang:

The output from v4l2-ctl -d /dev/video0 --list-formats-ext:

ioctl: VIDIOC_ENUM_FMT
	Index       : 0
	Type        : Video Capture
	Pixel Format: 'AR24'
	Name        : 32-bit BGRA 8-8-8-8

	Index       : 1
	Type        : Video Capture
	Pixel Format: 'UYVY'
	Name        : UYVY 4:2:2

	Index       : 2
	Type        : Video Capture
	Pixel Format: 'NV16'
	Name        : Y/CbCr 4:2:2

The output from v4l2-ctl --query-dv-timings:

	Active width: 1920
	Active height: 1080
	Total width: 2200
	Total height: 1125
	Frame format: progressive
	Polarities: -vsync -hsync
	Pixelclock: 148500000 Hz (60.00 frames per second)
	Horizontal frontporch: 0
	Horizontal sync: 280
	Horizontal backporch: 0
	Vertical frontporch: 0
	Vertical sync: 45
	Vertical backporch: 0
	Standards: 
	Flags: 

The output from media-ctl -p -d /dev/media0:

Media controller API version 0.1.0

Media device information
------------------------
driver          tegra194-vi5
model           NVIDIA Tegra Video Input Device
serial          
bus info        
hw revision     0x3
driver version  0.0.0

Device topology
- entity 1: tc358840 0-001f (2 pads, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev0
	pad0: Source
		[fmt:UYVY8_1X16/1920x1080 field:none colorspace:smpte170m]
		[dv.caps:BT.656/1120 min:1x1@0 max:10000x10000@297000000 stds:CEA-861,DMT,CVT,GTF caps:progressive,reduced-blanking,custom]
		[dv.detect:BT.656/1120 1920x1080p60 (2200x1125) stds: flags:]
		[dv.current:BT.656/1120 1920x1080p60 (2200x1125) stds: flags:]
		-> "15a00000.nvcsi--1":0 [ENABLED]
	pad1: Source
		[dv.caps:BT.656/1120 min:1x1@0 max:10000x10000@297000000 stds:CEA-861,DMT,CVT,GTF caps:progressive,reduced-blanking,custom]
		[dv.detect:BT.656/1120 1920x1080p60 (2200x1125) stds: flags:]
		[dv.current:BT.656/1120 1920x1080p60 (2200x1125) stds: flags:]

- entity 4: 15a00000.nvcsi--1 (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev1
	pad0: Sink
		<- "tc358840 0-001f":0 [ENABLED]
	pad1: Source
		-> "vi-output, tc358840 0-001f":0 [ENABLED]

- entity 7: vi-output, tc358840 0-001f (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
	pad0: Sink
		<- "15a00000.nvcsi--1":1 [ENABLED]

hello butyshin ,

may I also know what’s the SKU of your Xavier NX, is it eMMC version or SD-card version?