No captured data from v4l2 driver (TC358743)

this may also be useful :

I found out that “state->i2c_client->irq==0” is indeed happing, so the solutions above maybe useful

Excellent, I’ll take a look - do you want to try pair programming to get this driver working?

I also get irq == 0 but from the posts you shared it seems like it’s not used on the Jetson Nano?

I put these in tc358743.dtsi :

	interrupt-parent = <&gpio>;
	interrupts = <TEGRA_GPIO(E, 6) GPIO_ACTIVE_HIGH>;

and I attached INT pin from TC358743 to Jetson-Nano-pin-33
it solved irq == 0 issue , probe() finished successfully , but still no video stream when I ran g-streamer

this is dmesg output :

[   63.091019] =============================== hello init tc358743_probe================================

[ 63.091026] tc358743 6-000f: chip found @0xf (Tegra I2C adapter)
[ 63.091031] tc358743 6-000f: Device Tree Parameters:
[ 63.091057] tc358743 6-000f: reset_gpio = 151
[ 63.091061] tc358743 6-000f: refclk_hz = 27000000
[ 63.091075] tc358743 endpoint->bus.mipi_csi2.flags 512
[ 63.091078] tc358743 endpoint->bus.mipi_csi2.clock_lane 0
[ 63.091081] tc358743 endpoint->bus.mipi_csi2.num_data_lanes 4
[ 63.091085] tc358743 endpoint->bus.mipi_csi2.data_lanes [1-2-3-4]
[ 63.091088] tc358743 endpoint->nr_of_link_frequencies 1
[ 63.091091] tc358743 state->pdata.pll_prd=4
[ 63.091094] tc358743 state->pdata.pll_fbd=88
[ 63.091098] tc358743 6-000f: Subdev init done
[ 63.091101] tc358743 6-000f: Reading i2c_rd16
[ 63.094986] tc358743 6-000f: RET 0
[ 63.094992] tc358743 6-000f: Chip ID val: 0
[ 63.094997] tc358743 6-000f: ctrl handler initied
[ 63.095012] tc358743 6-000f: A bunch of new cutoms done
[ 63.097555] tc358743 6-000f: Controls updated
[ 63.097704] tc358743 6-000f: Work queue created
[ 63.097707] tc358743 6-000f: About to call tegra_media_entity_init
[ 63.097710] tc358743 6-000f: tegra_media_entity_init complete
[ 63.097713] tc358743 6-000f: Set mbus_fmt_code in probe to: 8207
[ 63.097716] tc358743 6-000f: About to register subdev
[ 63.097725] vi 54080000.vi: subdev tc358743 6-000f bound
[ 63.101309] tc358743 6-000f: tc358743_enum_mbus_code()
[ 63.101316] tc358743 6-000f: tc358743_enum_mbus_code()
[ 63.101320] tc358743 6-000f: tc358743_enum_mbus_code()
[ 63.101323] tc358743 6-000f: Error in tc358743_enum_mbus_code
[ 63.108877] tc358743 6-000f: Calling tc358743_get_fmt
[ 63.108882] tc358743 6-000f: Here 6b, colorspace: 1
[ 63.108886] tc358743 6-000f: get fmt complete
[ 63.108889] tc358743 6-000f: format width 0
[ 63.108892] tc358743 6-000f: format height 0
[ 63.108896] tc358743 6-000f: fmt_code: 8207
[ 63.108899] tc358743 6-000f: RGB888 code: 4106
[ 63.108902] tc358743 6-000f: UYVY8 code: 8207
[ 63.109366] tc358743 6-000f: Register subdev: 0
[ 63.109371] tc358743 6-000f: before tc358743_initial_setup
[ 63.109374] tc358743 6-000f: Reading i2c_rd16
[ 63.110284] tc358743 6-000f: RET 0
[ 63.116039] tc358743 6-000f: Reading i2c_rd16
[ 63.116336] tc358743 6-000f: RET 0
[ 63.116796] tc358743 6-000f: Reading i2c_rd16
[ 63.117103] tc358743 6-000f: RET 0
[ 63.125003] tc358743 6-000f: tc358743_set_hdmi_hdcp: disable
[ 63.131234] tc358743 6-000f: Reading i2c_rd16
[ 63.131508] tc358743 6-000f: RET 0
[ 63.133887] tc358743 6-000f: after tc358743_initial_setup
[ 63.133892] tc358743 6-000f: tc358743_set_csi_color_space: YCbCr 422 16-bit
[ 63.134797] tc358743 6-000f: Reading i2c_rd16
[ 63.135097] tc358743 6-000f: RET 0
[ 63.135329] tc358743 6-000f: before tc358743_s_dv_timings
[ 63.135336] tc358743 6-000f: tc358743_s_dv_timings
[ 63.135341] tc358743 6-000f: enable_stream: disable
[ 63.135541] tc358743 6-000f: Reading i2c_rd16
[ 63.135814] tc358743 6-000f: RET 0
[ 63.136031] tc358743 6-000f: 793:enable_stream: end
[ 63.136035] tc358743 6-000f: Reading i2c_rd16
[ 63.136306] tc358743 6-000f: RET 0
[ 63.136309] tc358743 6-000f: Reading i2c_rd16
[ 63.136578] tc358743 6-000f: RET 0
[ 63.136582] tc358743 6-000f: tc358743_set_pll:
[ 63.136586] tc358743 6-000f: tc358743_set_pll: updating PLL clock
[ 63.136588] tc358743 6-000f: Reading i2c_rd16
[ 63.136858] tc358743 6-000f: RET 0
[ 63.137285] tc358743 6-000f: Reading i2c_rd16
[ 63.137553] tc358743 6-000f: RET 0
[ 63.137779] tc358743 6-000f: Reading i2c_rd16
[ 63.138049] tc358743 6-000f: RET 0
[ 63.138264] tc358743 6-000f: Reading i2c_rd16
[ 63.138591] tc358743 6-000f: RET 0
[ 63.138944] tc358743 6-000f: tc358743_set_csi:
[ 63.138948] tc358743 6-000f: Reading i2c_rd16
[ 63.139336] tc358743 6-000f: RET 0
[ 63.144201] tc358743 6-000f: before tc358743_init_interrupts
[ 63.147153] tc358743 6-000f: tc358743_enable_interrupts: cable connected = 1
[ 63.148329] tc358743 6-000f: tc358743 found @0xf (Tegra I2C adapter)
[ 63.148334] tc358743 6-000f: tc358743_s_edid, pad 0, start block 0, blocks 2
[ 63.148338] tc358743 6-000f: tc358743_disable_edid:
[ 63.155718] tc358743 6-000f: Calling tc358743_g_edid
[ 63.162111] tc358743 6-000f: EDID_RAM has 256 byte from: 0x8c00 to 0x8d00
[ 63.162347] tc358743 6-000f: Reading i2c_rd16
[ 63.162733] tc358743 6-000f: RET 0
[ 63.162990] tc358743 6-000f: -----Chip status-----
[ 63.162993] tc358743 6-000f: Reading i2c_rd16
[ 63.163264] tc358743 6-000f: RET 0
[ 63.163268] tc358743 6-000f: Chip ID:0x00
[ 63.163271] tc358743 6-000f: Reading i2c_rd16
[ 63.163540] tc358743 6-000f: RET 0
[ 63.163544] tc358743 6-000f: Chip revision:0x00
[ 63.163548] tc358743 6-000f: Reset: IR: 1, CEC: 1, CSI TX: 0, HDMI: 0
[ 63.163554] tc358743 6-000f: Sleep mode: off
[ 63.163557] tc358743 6-000f: Cable detected (+5V power): no
[ 63.163804] tc358743 6-000f: DDC lines enabled: yes
[ 63.164049] tc358743 6-000f: Hotplug enabled: no
[ 63.164052] tc358743 6-000f: Reading i2c_rd16
[ 63.164322] tc358743 6-000f: RET 0
[ 63.164325] tc358743 6-000f: CEC enabled: no
[ 63.164328] tc358743 6-000f: -----Signal status-----
[ 63.164331] tc358743 6-000f: TMDS signal detected: no
[ 63.164334] tc358743 6-000f: Stable sync signal: no
[ 63.164338] tc358743 6-000f: PHY PLL locked: no
[ 63.164341] tc358743 6-000f: PHY DE detected: no
[ 63.164586] tc358743 6-000f: tc358743_get_detected_timings: no valid signal
[ 63.164590] tc358743 6-000f: No video detected
[ 63.164597] tc358743 6-000f: Configured format: 1920x1080p60.0 (2200x1125)
[ 63.164601] tc358743 6-000f: horizontal: fp = 88, +sync = 44, bp = 148
[ 63.164606] tc358743 6-000f: vertical: fp = 4, +sync = 5, bp = 36
[ 63.164609] tc358743 6-000f: pixelclock: 148500000
[ 63.164614] tc358743 6-000f: flags (0x12): CAN_REDUCE_FPS CE_VIDEO
[ 63.164618] tc358743 6-000f: standards (0x3): CEA DMT
[ 63.164621] tc358743 6-000f: -----CSI-TX status-----
[ 63.164625] tc358743 6-000f: Lanes needed: 4
[ 63.164942] tc358743 6-000f: Lanes in use: 4
[ 63.164945] tc358743 6-000f: Reading i2c_rd16
[ 63.165214] tc358743 6-000f: RET 0
[ 63.165218] tc358743 6-000f: Waiting for particular sync signal: no
[ 63.165220] tc358743 6-000f: Reading i2c_rd16
[ 63.165488] tc358743 6-000f: RET 0
[ 63.165491] tc358743 6-000f: Transmit mode: no
[ 63.165494] tc358743 6-000f: Reading i2c_rd16
[ 63.165762] tc358743 6-000f: RET 0
[ 63.165765] tc358743 6-000f: Receive mode: no
[ 63.165768] tc358743 6-000f: Reading i2c_rd16
[ 63.166037] tc358743 6-000f: RET 0
[ 63.166041] tc358743 6-000f: Stopped: no
[ 63.166044] tc358743 6-000f: Color space: YCbCr 422 16-bit
[ 63.166290] tc358743 6-000f: -----DVI-D status-----
[ 63.166293] tc358743 6-000f: HDCP encrypted content: no
[ 63.166297] tc358743 6-000f: Input color space: RGB full range
[ 63.167148] tc358743 6-000f: Probe complete

this is v4l2-compliance output :

root@t-desktop:~/i2c# v4l2-compliance -d /dev/video0
v4l2-compliance SHA: not available, 64 bits

Compliance test for tegra-video device /dev/video0:

Driver Info:
Driver name : tegra-video
Card type : vi-output, tc358743 6-000f
Bus info : platform:54080000.vi:1
Driver version : 4.9.140
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : vi
Model : NVIDIA Tegra Video Input Device
Serial :
Bus info :
Media version : 0.1.0
Hardware revision: 0x00000003 (3)
Driver version : 0.0.0
Interface Info:
ID : 0x03000005
Type : V4L Video
Entity Info:
ID : 0x00000003 (3)
Name : vi-output, tc358743 6-000f
Function : V4L2 I/O
Pad 0x01000004 : Sink
Link 0x02000007: from remote pad 0x1000002 of entity ‘tc358743 6-000f’: Data, Enabled

Required ioctls:
test MC information (see ‘Media Driver Info’ above): OK
test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
test second /dev/video0 open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OK

Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
test VIDIOC_LOG_STATUS: OK

Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 1 Audio Inputs: 0 Tuners: 0

Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_ENUMAUDOUT: OK (Not Supported)
test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK
test VIDIOC_DV_TIMINGS_CAP: OK
fail: v4l2-test-io-config.cpp(524): !ret && check_0(edid.reserved, sizeof(edid.reserved))
fail: v4l2-test-io-config.cpp(629): EDID check failed for input 0.
test VIDIOC_G/S_EDID: FAIL

Control ioctls (Input 0):
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
test VIDIOC_QUERYCTRL: OK
test VIDIOC_G/S_CTRL: OK
fail: v4l2-test-controls.cpp(647): did not check against size
test VIDIOC_G/S/TRY_EXT_CTRLS: FAIL
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
Standard Controls: 4 Private Controls: 13

Format ioctls (Input 0):
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
fail: v4l2-test-formats.cpp(1280): ret && node->has_frmintervals
test VIDIOC_G/S_PARM: FAIL
test VIDIOC_G_FBUF: OK (Not Supported)
test VIDIOC_G_FMT: OK
test VIDIOC_TRY_FMT: OK
test VIDIOC_S_FMT: OK
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
test Cropping: OK (Not Supported)
test Composing: OK (Not Supported)
test Scaling: OK (Not Supported)

Codec ioctls (Input 0):
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
test VIDIOC_G_ENC_INDEX: OK (Not Supported)
test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

Buffer ioctls (Input 0):
fail: v4l2-test-buffers.cpp(715): q.create_bufs(node, 1, &fmt) != EINVAL
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: FAIL
test VIDIOC_EXPBUF: OK
test Requests: OK (Not Supported)

Total for tegra-video device /dev/video0: 45, Succeeded: 41, Failed: 4, Warnings: 0

Your -----Signal status---- is showing no valid signal, I’m not sure why this is, have you got an HDMI input connected to your TC358743?

@ShaneCCC I’ve recently noticed is the tc358743_s_stream function and therefore enable_stream(sd, true) is never being called. I feel like this should be called by v4l2 to start the stream?

yep , with hdmi cable connected it’s still “no signal”

have signal now , but still no video stream ~

Cool, what did you change to get signal?

I’m currently investigating my device tree, I have no nvcsi currently so that might be the reason I’m getting no CSI data

I observed the output signal of the INT-pin on my tc358743 using a oscilloscope , and found out that there is a interrupt signal output (once) during driver initialization , so I connected INT pin to GPIO-pin-33 before driver starts , so I got the signal detected.

turned out that I should connect those two pins before system starts

just added nvcsi session in dtsi file , but still have the same problem

Could you share you device tree? I was trying to add nvcsi (and tidy my DT) but ended up breaking something and I’ve not had a chance to debug it yet)

Sure :

<tc358743.dtsi>

#include <dt-bindings/media/camera.h>
#include <dt-bindings/platform/t210/t210.h>
#include <dt-bindings/gpio/gpio.h>

/ {
host1x {

gpio@6000d000 {
	camera-control-output-low {
		gpio-hog;
		output-low;
		gpios = < CAM1_PWDN 0 >;
		label = "cam1-pwdn";
	};
};

    vi_base: vi {
        num-channels = <2>;  // Change 4->2
        ports {
            #address-cells = <1>;
            #size-cells = <0>;

            vi_port1: port@1 {
                status = "okay";
                reg = <1>;
                tc358743_vi_in1: endpoint {
                    status = "okay";
                    port-index = <1>;  /* CSI-B */
                    bus-width = <4>; /* Use CSI-B only */
                    remote-endpoint = <&tc358743_csi_out0>;
                };
            };
        };
    };


csi_base: nvcsi {
        num-channels = <2>;
        #address-cells = <1>;
        #size-cells = <0>;
        csi_chan0: channel@0 {
            reg = <0>;
            ports {
                #address-cells = <1>;
                #size-cells = <0>;
                csi_chan0_port0: port@0 {
                    reg = <0>;
                    rbpcv2_imx219_csi_in0: endpoint@0 {
                        port-index = <0>;
                        bus-width = <2>;
                        //remote-endpoint = <&rbpcv2_imx219_out0>;
                    };
                };
                csi_chan0_port1: port@1 {
                    reg = <1>;
                    rbpcv2_imx219_csi_out0: endpoint@1 {
                        //remote-endpoint = <&rbpcv2_imx219_vi_in0>;
                    };
                };
            };
        };
        channel@1 {
            reg = <1>;
            ports {
                #address-cells = <1>;
                #size-cells = <0>;
                port@0 {
                    status = "okay";
                    reg = <0>;
                    tc358743_csi_in0: endpoint@2 {
                        status = "okay";
                        port-index = <1>;
                        bus-width = <2>;
                        remote-endpoint = <&tc358743_out1>;
                    };
                };
                port@1 {
                    reg = <1>;
                    status = "okay";
                    tc358743_csi_out0: endpoint@3 {
                        status = "okay";
                        remote-endpoint = <&tc358743_vi_in1>;
                    };
                };
            };
        };
    };

    i2c@546c0000 {  /* I2C_PM, "adapter" 6 */
        status = "okay";
        #address-cells = <1>;
        #size-cells = <0>;
        tc358743@0f {
            status = "okay";
            compatible = "tc358743";
            reg = <0x0f>; /* shifted by 2 */
            mclk = "cam_mclk1";
            reset-gpios = <&gpio 149 0>;
            refclk_hz = <27000000>;  // refclk_hz -> regclk

	interrupt-parent = <&gpio>;
	interrupts = <TEGRA_GPIO(E, 6) GPIO_ACTIVE_HIGH>;

            /* Physical dimensions of sensor */
            physical_w = "4.713";
            physical_h = "3.494";
            /* Sensor Model */
            sensor_model ="tc358743";
            
   

            ddc5v_delay = <2>;
            enable_hdcp = "false";
            lineinitcnt = <0xe80>;
            lptxtimecnt = <0x003>;
            tclk_headercnt = <0x1403>;
            tclk_trailcnt = <0x00>;
            ths_headercnt = <0x0103>;
            twakeup = <0x4882>;
            tclk_postcnt = <0x008>;
            ths_trailcnt = <0x02>;
            hstxvregcnt = <0>;

            ports {
                #address-cells = <1>;
                #size-cells = <0>;

                port@0 {
                    reg = <0>;
                    tc358743_out1: endpoint {
                        port-index = <1>; /* CSI B */
                        bus-width = <4>; /* Use CSI-B only */
                        data-lanes = <1 2 3 4>;
                        clock-lanes = <0>;
                        clock-noncontinuous;
                        link-frequencies = /bits/ 64 <297000000>;
                        remote-endpoint = <&tc358743_csi_in0>;
                    };
                };
            };
        };
    };
};

tegra-camera-platform {
    status = "okay";
	compatible = "nvidia, tegra-camera-platform";
	num_csi_lanes = <4>;  // Changed 2 -> 4
	max_lane_speed = <1500000>;
	min_bits_per_pixel = <10>;  // Changed 16 -> 10
	vi_peak_byte_per_pixel = <2>;
	vi_bw_margin_pct = <25>;
	max_pixel_rate = <750000>;
	isp_peak_byte_per_pixel = <5>;
	isp_bw_margin_pct = <25>;

    	/**
	* The general guideline for naming badge_info contains 3 parts, and is as follows,
	* The first part is the camera_board_id for the module; if the module is in a FFD
	* platform, then use the platform name for this part.
	* The second part contains the position of the module, ex. “rear” or “front”.
	* The third part contains the last 6 characters of a part number which is found
	* in the module's specsheet from the vender.
	*/
	modules {

	    module1 {
	        status = "okay";
	        badge = "tc358743_top_i2c6_b";
	        position = "front";
	        orientation = "1";
	        drivernode0 {
	            status = "okay";
	            /* Declare PCL support driver (classically known as guid)  */
	            pcl_id = "v4l2_sensor";
	            /* Driver's v4l2 device name */
	            devname = "tc358743 6-000f";
	            /* Declare the device-tree hierarchy to driver instance */
	            proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/tc358743@0f";
	        };
	    };
        
	};
};

};

When I use your device tree my Nano doesn’t boot (at least not to ssh).

Did you disable the camera models plugin manager?

yes , I disabled these in <tegra210-porg-p3448-common.dtsi> :

#include “porg-platforms/tegra210-porg-camera-rbpcv2-imx219.dtsi”
#include “porg-platforms/tegra210-porg-camera-rbpcv2-dual-imx219.dtsi”
#include “porg-plugin-manager/tegra210-porg-plugin-manager.dtsi”

Hi, this discussion is very interesting to me as I tried to get the TC358743 working on Jetson Nano a few months ago but eventually gave up. You seem to have already got further than I did!

It has encouraged me to try again so I would appreciate if you could post your latest driver/dtsi file so I can try to get my kernel to build and run!

Thanks

Phil Taylor