Jetson nano tc358743 r32.3.1 no /dev/video1 shows

after I modify the device tree and tc358743.c . the code end with tc358743_probe normally but no any /dev/video1 comes up .
Here is out output of media-ctl -p

sudo media-ctl -p
Media controller API version 0.1.0

Media device information

driver vi
model NVIDIA Tegra Video Input Device
serial
bus info
hw revision 0x3
driver version 0.0.0

Device topology

  • entity 1: nvcsi–1 (2 pads, 0 link)
    type V4L2 subdev subtype Unknown flags 0
    pad0: Sink
    pad1: Source

and here is my dmesg output

dmesg |grep 358743
[ 1.758208] tc358743 6-000f: tc358743 found @ 0x1e (Tegra I2C adapter)
[ 1.759004] tc358743 6-000f: -----Chip status-----
[ 1.759286] tc358743 6-000f: Chip ID: 0x00
[ 1.759568] tc358743 6-000f: Chip revision: 0x00
[ 1.759573] tc358743 6-000f: Reset: IR: 1, CEC: 1, CSI TX: 0, HDMI: 0
[ 1.759577] tc358743 6-000f: Sleep mode: off
[ 1.759581] tc358743 6-000f: Cable detected (+5V power): no
[ 1.759840] tc358743 6-000f: DDC lines enabled: yes
[ 1.760097] tc358743 6-000f: Hotplug enabled: no
[ 1.760378] tc358743 6-000f: CEC enabled: no
[ 1.760381] tc358743 6-000f: -----Signal status-----
[ 1.760385] tc358743 6-000f: TMDS signal detected: no
[ 1.760388] tc358743 6-000f: Stable sync signal: no
[ 1.760391] tc358743 6-000f: PHY PLL locked: no
[ 1.760394] tc358743 6-000f: PHY DE detected: no
[ 1.760652] tc358743 6-000f: No video detected
[ 1.760660] tc358743 6-000f: Configured format: 640x480p59.94 (800x525)
[ 1.760665] tc358743 6-000f: horizontal: fp = 16, -sync = 96, bp = 48
[ 1.760669] tc358743 6-000f: vertical: fp = 10, -sync = 2, bp = 33
[ 1.760673] tc358743 6-000f: pixelclock: 25175000
[ 1.760678] tc358743 6-000f: flags (0x0):
[ 1.760682] tc358743 6-000f: standards (0x3): CEA DMT
[ 1.760685] tc358743 6-000f: -----CSI-TX status-----
[ 1.760688] tc358743 6-000f: Lanes needed: 1
[ 1.761019] tc358743 6-000f: Lanes in use: 1
[ 1.761300] tc358743 6-000f: Waiting for particular sync signal: no
[ 1.761581] tc358743 6-000f: Transmit mode: no
[ 1.761861] tc358743 6-000f: Receive mode: no
[ 1.762143] tc358743 6-000f: Stopped: no
[ 1.762146] tc358743 6-000f: Color space: RGB 888 24-bit
[ 1.762405] tc358743 6-000f: -----DVI-D status-----
[ 1.762409] tc358743 6-000f: HDCP encrypted content: no
[ 1.762415] tc358743 6-000f: Input color space: RGB full range
[ 3.975745] tc358743: module is already loaded

and here is my device-tree

host1x {

  vi_base: vi {
  	num-channels = <2>;
  	ports {
  		#address-cells = <1>;
  		#size-cells = <0>;
  		vi_port0: port@0 {
  			reg = <0>;
  			rbpcv2_imx219_vi_in0: endpoint {
  				port-index = <0>;
  				bus-width = <2>;
  				remote-endpoint = <&rbpcv2_imx219_csi_out0>;
  			};
  		};
  		port@1 {
  			reg = <1>;
  			tc358743_vi_in0: endpoint {
  				port-index = <0>;
  				bus-width = <2>;
  				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 = <0>;
  					bus-width = <2>;
  					remote-endpoint = <&tc358743_out0>;
  				};
  			};
  			port@1 {
  				reg = <1>;
  				status = "okay";
  				tc358743_csi_out0: endpoint@3 {
  					status = "okay";
  					remote-endpoint = <&tc358743_vi_in0>;
  				};
  			};
  		};
  	};
  };
      tc358743@0f {
  		compatible = "tc358743";
  		status = "okay";
  		reg = <0x0f>;
  		/* Physical dimensions of sensor */
  		physical_w = "4.713";
  		physical_h = "3.494";

  		/* Sensor Model */
  		sensor_model ="tc358743";
  		devnode ="video1";
  		single-source-max-width = "1920";
  		mclk = "clk_out_3";
  		cam2_rst   = <&gpio 8 GPIO_ACTIVE_HIGH>;
  		vif-supply = <&gpio>;
  		vdig-supply = <&gpio>;
  		reset = <&gpio TEGRA_GPIO(S,4) GPIO_ACTIVE_HIGH>;
  		interrupt-parent = <&gpio>;
  		interrupts = <TEGRA_GPIO(X, 2) GPIO_ACTIVE_HIGH>;

  		refclk= <27000000>; /* 40 - 50 MHz */

  		ddc5v_delay = <1>;        /* 50 ms */

  		/* HDCP */
  		/* TODO: Not yet implemented */
  		enable_hdcp = <0>;

  		/* CSI Output */
  		csi_port = <3>;            /* Enable TX0 and TX1 */

  		lineinitcnt = <0x00000FA0>;
  		lptxtimecnt = <0x00000004>;
  		tclk_headercnt = <0x00180203>;
  		tclk_trailcnt = <0x00040005>;
  		ths_headercnt = <0x000D0004>;
  		twakeup = <0x00003E80>;
  		tclk_postcnt = <0x0000000A>;
  		ths_trailcnt = <0x00080006>;
  		hstxvregcnt = <0x00000020>;
  		btacnt = <0>;

  		/* PLL */
  		/* Bps per lane is (refclk_hz / pll_prd) * pll_fbd */
  		pll_prd = <10>;
  		pll_fbd = <230>;
  		pll_frs = <0>;
  		ports {
  			#address-cells = <1>;
  			#size-cells = <0>;

  			port@0 {
  				reg = <0>;
  				status = "okay";
  				tc358743_out0: endpoint {
  					status = "okay"
  					port-index = <0>;
  					bus-width = <2>;
  					remote-endpoint = <&tc358743_csi_in0>;
  				};
  			};
  		};
  	};
  };
};

Any helps would be appreciate!

Could you check the v4l2_async_register_subdev() been called in the probe()

@ShaneCCC Yes, I am sure it called and return 0

I have found out the problem is that I include the tegra210-porg-plugin-manager.dtsi which may have some conflict with imx219? I am not so clear . when I remove it , the /dev/video0 comes up.
@ShaneCCC

You need to remove it if your board don’t have EEPROM for auto detect.

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide%2Fcamera_sensor_prog.html%23wwpID0E01F0HA

but another problem comes up .
I use devm_request_threaded_irq with i2c_client -> irq . but this value always equal to 0 . my i2c driving works well except that . is it pass with device-tree or other way . how can I determine this value ?
@ShaneCCC

For current sensor driver didn’t need irq and didn’t have HW design for it.
Does your HW have GPIO or any interrupt HW connected to. If your HW have this design you can have below in your device tree to try.

interrupts = <TEGRA_AON_GPIO(AA, 2) GPIO_ACTIVE_HIGH>;

So you mean if I specify the interrupt property in i2c session it would attach to i2c_client->irq . Am I right?
So far out h2c board dont have INT connected . May be another solution is I query the INT register with a work_queue .

Yes, correct for the irq need INT signal.

Hi @ShaneCCC,
Now , I am able to get tc358743 capture stream with v4l2-ctl

v4l2-ctl --device /dev/video0 --stream-mmap --stream-to=frame.raw–stream-count=10
New timings found
<<<<<<<<<<

but how can I play frame.raw file ? my format output is

v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: ‘RG10’
Name : 10-bit Bayer RGRG/GBGB

and I can’t play with gst-launch-1.0 wich cmd is

gst-launch-1.0 --verbose v4l2src device="/dev/video0" ! videoconvert ! autovideosink
Setting pipeline to PAUSED …
nvbuf_utils: Could not get EGL display connection
nvbuf_utils: ERROR getting proc addr of eglCreateImageKHR
nvbuf_utils: ERROR getting proc addr of eglDestroyImageKHR
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.000607344
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

Here is the log-status output
v4l2-ctl --log-status
Status Log:

[ 2256.764820] vi 54080000.vi: ================= START STATUS =================
[ 2256.776797] tc358743 6-000f: -----Chip status-----
[ 2256.785275] tc358743 6-000f: Chip ID: 0x00
[ 2256.793789] tc358743 6-000f: Chip revision: 0x00
[ 2256.802190] tc358743 6-000f: Reset: IR: 1, CEC: 1, CSI TX: 0, HDMI: 0
[ 2256.814046] tc358743 6-000f: Sleep mode: off
[ 2256.824919] tc358743 6-000f: Cable detected (+5V power): yes
[ 2256.837643] tc358743 6-000f: DDC lines enabled: yes
[ 2256.852375] tc358743 6-000f: Hotplug enabled: yes
[ 2256.867765] tc358743 6-000f: CEC enabled: no
[ 2256.879807] tc358743 6-000f: -----Signal status-----
[ 2256.894304] tc358743 6-000f: TMDS signal detected: yes
[ 2256.920943] tc358743 6-000f: Stable sync signal: yes
[ 2256.948665] tc358743 6-000f: PHY PLL locked: yes
[ 2256.975790] tc358743 6-000f: PHY DE detected: yes
[ 2257.006623] tc358743 6-000f: Detected format: 1280x720p50.0 (1980x750)
[ 2257.031654] tc358743 6-000f: horizontal: fp = 0, -sync = 700, bp = 0
[ 2257.050076] tc358743 6-000f: vertical: fp = 0, -sync = 30, bp = 0
[ 2257.062327] tc358743 6-000f: pixelclock: 74250000
[ 2257.071382] tc358743 6-000f: flags (0x0):
[ 2257.077737] tc358743 6-000f: standards (0x0):
[ 2257.085308] tc358743 6-000f: Configured format: 0x0p0.0 (0x0)
[ 2257.094257] tc358743 6-000f: horizontal: fp = 0, -sync = 0, bp = 0
[ 2257.103188] tc358743 6-000f: vertical: fp = 0, -sync = 0, bp = 0
[ 2257.112355] tc358743 6-000f: pixelclock: 0
[ 2257.119685] tc358743 6-000f: flags (0x0):
[ 2257.126037] tc358743 6-000f: standards (0x0):
[ 2257.132801] tc358743 6-000f: -----CSI-TX status-----
[ 2257.140526] tc358743 6-000f: Lanes needed: 2
[ 2257.148237] tc358743 6-000f: Lanes in use: 2
[ 2257.155316] tc358743 6-000f: Waiting for particular sync signal: no
[ 2257.164064] tc358743 6-000f: Transmit mode: no
[ 2257.172210] tc358743 6-000f: Receive mode: no
[ 2257.179331] tc358743 6-000f: Stopped: no
[ 2257.185458] tc358743 6-000f: Color space: RGB 888 24-bit
[ 2257.193427] tc358743 6-000f: -----DVI-D status-----
[ 2257.200546] tc358743 6-000f: HDCP encrypted content: no
[ 2257.208195] tc358743 6-000f: Input color space: RGB full range
[ 2257.216615] vi 54080000.vi: ================== END STATUS ==================

Good to know it. Shouldn’t not be 10-bit Bayer RGRG/GBGB for this device? It’s could be YUV or RGB888 then can play with v4l2src.

It’s would be great if you could share your source code here for others user reference.

sure , I would share it if it complete .
but currently I still unable to play with gst-launch-1.0
here is my v4l2-ctl --list-formats output

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
and v4l2-ctl --all
Driver Info (not using libv4l2):
Driver name : tegra-video
Card type : vi-output, tc358743 6-000f
Bus info : platform:54080000.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 (HDMI 0: ok)
DV timings:
Active width: 0
Active height: 0
Total width: 0
Total height: 0
Frame format: progressive
Polarities: -vsync -hsync
Pixelclock: 0 Hz
Horizontal frontporch: 0
Horizontal sync: 0
Horizontal backporch: 0
Vertical frontporch: 0
Vertical sync: 0
Vertical backporch: 0
Standards:
Flags:
DV timings capabilities:
Minimum Width: 1
Maximum Width: 10000
Minimum Height: 1
Maximum Height: 10000
Minimum PClock: 0
Maximum PClock: 165000000
Standards: CTA-861, DMT, CVT, GTF
Capabilities: Progressive, Reduced Blanking, Custom Formats
Format Video Capture:
Width/Height : 0/32
Pixel Format : ‘NV16’
Field : None
Bytes per Line : 1280
Size Image : 81920
Colorspace : sRGB
Transfer Function : Rec. 709
YCbCr/HSV Encoding: Rec. 709
Quantization : Limited Range
Flags :

I have no idea why dv timing show nothing but when I run v4l2-ctl --query-dv-timings

Active width: 1280
Active height: 720
Total width: 1980
Total height: 750
Frame format: progressive
Polarities: -vsync -hsync
Pixelclock: 74250000 Hz (50.00 frames per second)
Horizontal frontporch: 0
Horizontal sync: 700
Horizontal backporch: 0
Vertical frontporch: 0
Vertical sync: 30
Vertical backporch: 0
Standards:
Flags:

still when I run

gst-launch-1.0 --verbose v4l2src ! “video/x-raw, width=1280, Height=720, framerate=(fraction)50/1,format=(string)UYVY” ! queue ! autovideosink -e

Setting pipeline to PAUSED …
nvbuf_utils: Could not get EGL display connection
nvbuf_utils: ERROR getting proc addr of eglCreateImageKHR
nvbuf_utils: ERROR getting proc addr of eglDestroyImageKHR
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
EOS on shutdown enabled – waiting for EOS after Error
Waiting for EOS…

Could you try the fakesink first.
gst-launch-1.0 --verbose v4l2src ! “video/x-raw, width=1280, Height=720, framerate=(fraction)50/1,format=(string)UYVY” ! fakesink

Hi askariz0503,

Did you manage to get video out?

Even if not I’d be super grateful if you could share your code any other changes to made to get the /dev/video1 showing up! I’ve been trying for a few days now and I’m still stuck with no /dev/video showing but I think there are problems in my tc358743.c (and maybe my device tree too).

Thanks,
Robert

@askariz0503 Can you please be so kind to share your device-tree file and any other changes required to make tc358743 work with the Nano?

I can’t get it to work and I’m just stabbing in the dark. :-(