No captured data from v4l2 driver (TC358743)

Hello,

I am attempting to get the Auvida B101 (a breakout for the Toshiba TC358743 HDMI to CSI converter) working with the Jetson Nano devkit. Using the forums I have managed to piece together a driver that can be registered as a v4l2 device (/dev/video0) and responds to various v4l2 commands but unfortunately I cannot capture any data from it.

The code I used to piece this driver together came from this TC358840 R32.2 driver and the TC358743 code for an old kernel version here.

I have uploaded my driver code and device tree are here. I was sensing some problems around tc358743_enum_frame_size so I’ve made some hacky changes there that might be worth reviewing by somebody that knows what they’re doing!

I am very new to this so I’m likely making some silly mistakes and I’m also not sure of all the tools available to help me debug things. Any help would be much appreciated and I’ll be sure to share the code once it’s working so others can benefit!

dmesg output

Probing

[   93.532440] tc358743: loading out-of-tree module taints kernel.
[   93.539674] tc358743 0-000f: chip found @0xf (7000c000.i2c)
[   93.539678] tc358743 0-000f: Device Tree Parameters:
[   93.539742] tc358743 0-000f: reset_gpio = 148
[   93.539745] tc358743 0-000f: refclk_hz = 27000000
[   93.539756] tc358743 endpoint->bus.mipi_csi2.flags 512
[   93.539758] tc358743 endpoint->bus.mipi_csi2.clock_lane 0
[   93.539760] tc358743 endpoint->bus.mipi_csi2.num_data_lanes 4
[   93.539762] tc358743 endpoint->bus.mipi_csi2.data_lanes [1-2-3-4]
[   93.539764] tc358743 endpoint->nr_of_link_frequencies 1
[   93.539766] tc358743 state->pdata.pll_prd=4
[   93.539767] tc358743 state->pdata.pll_fbd=88
[   93.539771] tc358743 0-000f: Subdev init done
[   93.539773] tc358743 0-000f: Reading i2c_rd16
[   93.540046] tegra-i2c 7000c000.i2c: no acknowledge from address 0xf
[   93.546463] tc358743 0-000f: i2c_rd: #### reading register0x0 from0xf failed
[   93.553755] tc358743 0-000f: RET -1
[   93.553757] tc358743 0-000f: Chip ID val: 99
[   93.553760] tc358743 0-000f: tc358743: ERROR: not a TC358743 on address0xf
[   93.553852] tc358743 1-000f: chip found @0xf (7000c400.i2c)
[   93.553855] tc358743 1-000f: Device Tree Parameters:
[   93.553908] tc358743 1-000f: reset_gpio = 152
[   93.553920] tc358743 1-000f: refclk_hz = 27000000
[   93.553929] tc358743 endpoint->bus.mipi_csi2.flags 512
[   93.553931] tc358743 endpoint->bus.mipi_csi2.clock_lane 0
[   93.553933] tc358743 endpoint->bus.mipi_csi2.num_data_lanes 2
[   93.553935] tc358743 endpoint->bus.mipi_csi2.data_lanes [1-2-0-0]
[   93.553937] tc358743 endpoint->nr_of_link_frequencies 1
[   93.553938] tc358743 state->pdata.pll_prd=4
[   93.553940] tc358743 state->pdata.pll_fbd=88
[   93.553943] tc358743 1-000f: Subdev init done
[   93.553944] tc358743 1-000f: Reading i2c_rd16
[   93.554224] tegra-i2c 7000c400.i2c: no acknowledge from address 0xf
[   93.562259] tc358743 1-000f: i2c_rd: #### reading register0x0 from0xf failed
[   93.569359] tc358743 1-000f: RET -1
[   93.569362] tc358743 1-000f: Chip ID val: 99
[   93.569368] tc358743 1-000f: tc358743: ERROR: not a TC358743 on address0xf
[   93.569462] tc358743 2-000f: chip found @0xf (7000c500.i2c)
[   93.569465] tc358743 2-000f: Device Tree Parameters:
[   93.569504] tc358743 2-000f: reset_gpio = 149
[   93.569506] tc358743 2-000f: refclk_hz = 27000000
[   93.569516] tc358743 endpoint->bus.mipi_csi2.flags 512
[   93.569517] tc358743 endpoint->bus.mipi_csi2.clock_lane 0
[   93.569519] tc358743 endpoint->bus.mipi_csi2.num_data_lanes 4
[   93.569521] tc358743 endpoint->bus.mipi_csi2.data_lanes [1-2-3-4]
[   93.569523] tc358743 endpoint->nr_of_link_frequencies 1
[   93.569525] tc358743 state->pdata.pll_prd=4
[   93.569526] tc358743 state->pdata.pll_fbd=88
[   93.569529] tc358743 2-000f: Subdev init done
[   93.569531] tc358743 2-000f: Reading i2c_rd16
[   93.569672] tegra-i2c 7000c500.i2c: no acknowledge from address 0xf
[   93.576007] tc358743 2-000f: i2c_rd: #### reading register0x0 from0xf failed
[   93.583089] tc358743 2-000f: RET -1
[   93.583093] tc358743 2-000f: Chip ID val: 99
[   93.583096] tc358743 2-000f: tc358743: ERROR: not a TC358743 on address0xf
[   93.583170] tc358743 6-000f: chip found @0xf (Tegra I2C adapter)
[   93.583173] tc358743 6-000f: Device Tree Parameters:
[   93.583204] tc358743 6-000f: reset_gpio = 151
[   93.583206] tc358743 6-000f: refclk_hz = 27000000
[   93.583215] tc358743 endpoint->bus.mipi_csi2.flags 512
[   93.583216] tc358743 endpoint->bus.mipi_csi2.clock_lane 0
[   93.583218] tc358743 endpoint->bus.mipi_csi2.num_data_lanes 4
[   93.583220] tc358743 endpoint->bus.mipi_csi2.data_lanes [1-2-3-4]
[   93.583222] tc358743 endpoint->nr_of_link_frequencies 1
[   93.583223] tc358743 state->pdata.pll_prd=4
[   93.583225] tc358743 state->pdata.pll_fbd=88
[   93.583228] tc358743 6-000f: Subdev init done
[   93.583229] tc358743 6-000f: Reading i2c_rd16
[   93.584108] tc358743 6-000f: RET 0
[   93.584111] tc358743 6-000f: Chip ID val: 0
[   93.584115] tc358743 6-000f: ctrl handler initied
[   93.584126] tc358743 6-000f: A bunch of new cutoms done
[   93.586682] tc358743 6-000f: Controls updated
[   93.586906] tc358743 6-000f: Work queue created
[   93.586908] tc358743 6-000f: About to call tegra_media_entity_init
[   93.586911] tc358743 6-000f: tegra_media_entity_init complete
[   93.586913] tc358743 6-000f: Set mbus_fmt_code in probe to: 8207
[   93.586915] tc358743 6-000f: About to register subdev
[   93.586921] vi 54080000.vi: subdev tc358743 6-000f bound
[   93.587248] tc358743 6-000f: tc358743_enum_mbus_code()
[   93.587251] tc358743 6-000f: tc358743_enum_mbus_code()
[   93.587253] tc358743 6-000f: tc358743_enum_mbus_code()
[   93.587255] tc358743 6-000f: Error in tc358743_enum_mbus_code
[   93.593992] tc358743 6-000f: Calling tc358743_get_fmt
[   93.593996] tc358743 6-000f: Here 6b, colorspace: 1
[   93.593998] tc358743 6-000f: get fmt complete
[   93.594000] tc358743 6-000f: format width 0
[   93.594002] tc358743 6-000f: format height 0
[   93.594004] tc358743 6-000f: fmt_code: 8207
[   93.594006] tc358743 6-000f: RGB888 code: 4106
[   93.594008] tc358743 6-000f: UYVY8 code: 8207
[   93.594443] tc358743 6-000f: Register subdev: 0
[   93.594447] tc358743 6-000f: before tc358743_initial_setup
[   93.594450] tc358743 6-000f: Reading i2c_rd16
[   93.596473] tc358743 6-000f: RET 0
[   93.596690] tc358743 6-000f: Reading i2c_rd16
[   93.597005] tc358743 6-000f: RET 0
[   93.597427] tc358743 6-000f: Reading i2c_rd16
[   93.597689] tc358743 6-000f: RET 0
[   93.604290] tc358743 6-000f: tc358743_set_hdmi_hdcp: disable
[   93.609076] tc358743 6-000f: Reading i2c_rd16
[   93.609332] tc358743 6-000f: RET 0
[   93.611597] tc358743 6-000f: after tc358743_initial_setup
[   93.611601] tc358743 6-000f: tc358743_set_csi_color_space: YCbCr 422 16-bit
[   93.612419] tc358743 6-000f: Reading i2c_rd16
[   93.612672] tc358743 6-000f: RET 0
[   93.612872] tc358743 6-000f: before tc358743_s_dv_timings
[   93.612875] tc358743 6-000f: tc358743_s_dv_timings
[   93.612879] tc358743 6-000f: enable_stream: disable
[   93.613059] tc358743 6-000f: Reading i2c_rd16
[   93.613312] tc358743 6-000f: RET 0
[   93.613517] tc358743 6-000f: 793:enable_stream: end
[   93.613520] tc358743 6-000f: Reading i2c_rd16
[   93.613774] tc358743 6-000f: RET 0
[   93.613777] tc358743 6-000f: Reading i2c_rd16
[   93.614030] tc358743 6-000f: RET 0
[   93.614033] tc358743 6-000f: tc358743_set_pll:
[   93.614036] tc358743 6-000f: tc358743_set_pll: updating PLL clock
[   93.614038] tc358743 6-000f: Reading i2c_rd16
[   93.614291] tc358743 6-000f: RET 0
[   93.614777] tc358743 6-000f: Reading i2c_rd16
[   93.615125] tc358743 6-000f: RET 0
[   93.615382] tc358743 6-000f: Reading i2c_rd16
[   93.615682] tc358743 6-000f: RET 0
[   93.615889] tc358743 6-000f: Reading i2c_rd16
[   93.616143] tc358743 6-000f: RET 0
[   93.616346] tc358743 6-000f: tc358743_set_csi:
[   93.616348] tc358743 6-000f: Reading i2c_rd16
[   93.616603] tc358743 6-000f: RET 0
[   93.621372] tc358743 6-000f: before tc358743_init_interrupts
[   93.624309] tc358743 6-000f: tc358743_enable_interrupts: cable connected = 1
[   93.625397] tc358743 6-000f: tc358743 found @0xf (Tegra I2C adapter)
[   93.625401] tc358743 6-000f: tc358743_s_edid, pad 0, start block 0, blocks 2
[   93.625404] tc358743 6-000f: tc358743_disable_edid:
[   93.632799] tc358743 6-000f: Calling tc358743_g_edid
[   93.639151] tc358743 6-000f: EDID_RAM has 256 byte from: 0x8c00 to 0x8d00
[   93.639396] tc358743 6-000f: Reading i2c_rd16
[   93.639665] tc358743 6-000f: RET 0
[   93.639908] tc358743 6-000f: -----Chip status-----
[   93.639911] tc358743 6-000f: Reading i2c_rd16
[   93.640170] tc358743 6-000f: RET 0
[   93.640173] tc358743 6-000f: Chip ID:0x00
[   93.640176] tc358743 6-000f: Reading i2c_rd16
[   93.640444] tc358743 6-000f: RET 0
[   93.640447] tc358743 6-000f: Chip revision:0x00
[   93.640452] tc358743 6-000f: Reset: IR: 1, CEC: 1, CSI TX: 0, HDMI: 0
[   93.640455] tc358743 6-000f: Sleep mode: off
[   93.640458] tc358743 6-000f: Cable detected (+5V power): no
[   93.640701] tc358743 6-000f: DDC lines enabled: yes
[   93.640936] tc358743 6-000f: Hotplug enabled: no
[   93.640938] tc358743 6-000f: Reading i2c_rd16
[   93.641205] tc358743 6-000f: RET 0
[   93.641209] tc358743 6-000f: CEC enabled: no
[   93.641211] tc358743 6-000f: -----Signal status-----
[   93.641215] tc358743 6-000f: TMDS signal detected: no
[   93.641217] tc358743 6-000f: Stable sync signal: no
[   93.641220] tc358743 6-000f: PHY PLL locked: no
[   93.641223] tc358743 6-000f: PHY DE detected: no
[   93.641464] tc358743 6-000f: tc358743_get_detected_timings: no valid signal
[   93.641467] tc358743 6-000f: No video detected
[   93.641474] tc358743 6-000f: Configured format: 1920x1080p60.0 (2200x1125)
[   93.641479] tc358743 6-000f: horizontal: fp = 88, +sync = 44, bp = 148
[   93.641483] tc358743 6-000f: vertical: fp = 4, +sync = 5, bp = 36
[   93.641487] tc358743 6-000f: pixelclock: 148500000
[   93.641492] tc358743 6-000f: flags (0x12): CAN_REDUCE_FPS CE_VIDEO
[   93.641495] tc358743 6-000f: standards (0x3): CEA DMT
[   93.641498] tc358743 6-000f: -----CSI-TX status-----
[   93.641501] tc358743 6-000f: Lanes needed: 4
[   93.641812] tc358743 6-000f: Lanes in use: 4
[   93.641815] tc358743 6-000f: Reading i2c_rd16
[   93.642082] tc358743 6-000f: RET 0
[   93.642086] tc358743 6-000f: Waiting for particular sync signal: no
[   93.642088] tc358743 6-000f: Reading i2c_rd16
[   93.642385] tc358743 6-000f: RET 0
[   93.642388] tc358743 6-000f: Transmit mode: no
[   93.642390] tc358743 6-000f: Reading i2c_rd16
[   93.642666] tc358743 6-000f: RET 0
[   93.642672] tc358743 6-000f: Receive mode: no
[   93.642675] tc358743 6-000f: Reading i2c_rd16
[   93.643024] tc358743 6-000f: RET 0
[   93.643029] tc358743 6-000f: Stopped: no
[   93.643032] tc358743 6-000f: Color space: YCbCr 422 16-bit
[   93.643351] tc358743 6-000f: -----DVI-D status-----
[   93.643355] tc358743 6-000f: HDCP encrypted content: no
[   93.643359] tc358743 6-000f: Input color space: RGB full range
[   93.643614] tc358743 6-000f: Probe complete

v4l2-ctl

v4l2-ctl --all

Driver Info (not using libv4l2):
        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
Priority: 2
Video input : 0 (HDMI 1: ok)
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: 88
        Horizontal sync: 44
        Horizontal backporch: 148
        Vertical frontporch: 4
        Vertical sync: 5
        Vertical backporch: 36
        Standards: CTA-861, DMT
        Flags: framerate can be reduced by 1/1.001, CE-video
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      : 1920/1080
        Pixel Format      : 'UYVY'
        Field             : None
        Bytes per Line    : 3840
        Size Image        : 4147200
        Colorspace        : SMPTE 170M
        Transfer Function : Default (maps to Rec. 709)
        YCbCr/HSV Encoding: Default (maps to ITU-R 601)
        Quantization      : Default (maps to Limited Range)
        Flags             :

User Controls

            audio_sampling_rate 0x00981980 (int)    : min=0 max=768000 step=1 default=0 value=0 flags=read-only
                  audio_present 0x00981981 (bool)   : default=0 value=0 flags=read-only

Camera Controls

                    bypass_mode 0x009a2064 (intmenu): min=0 max=1 default=0 value=0
                override_enable 0x009a2065 (intmenu): min=0 max=1 default=0 value=0
                   height_align 0x009a2066 (int)    : min=1 max=16 step=1 default=1 value=1
                     size_align 0x009a2067 (intmenu): min=0 max=2 default=0 value=0
               write_isp_format 0x009a2068 (bool)   : default=0 value=0
       sensor_signal_properties 0x009a2069 (u32)    : min=0 max=0 step=0 default=0 flags=read-only, has-payload
        sensor_image_properties 0x009a206a (u32)    : min=0 max=0 step=0 default=0 flags=read-only, has-payload
      sensor_control_properties 0x009a206b (u32)    : min=0 max=0 step=0 default=0 flags=read-only, has-payload
              sensor_dv_timings 0x009a206c (u32)    : min=0 max=0 step=0 default=0 flags=read-only, has-payload
               low_latency_mode 0x009a206d (bool)   : default=0 value=0
                   sensor_modes 0x009a2082 (int)    : min=0 max=30 step=1 default=30 value=30 flags=read-only

Digital Video Controls

                  power_present 0x00a00964 (bitmask): max=0x00000001 default=0x00000000 value=0x00000001 flags=read-only

v4l2-ctl --log-status

Status Log:

   [   15.519221] vi 54080000.vi: =================  START STATUS  =================
   [   15.519669] tc358743 6-000f: Reading i2c_rd16
   [   15.519988] tc358743 6-000f: RET 0
   [   15.520280] tc358743 6-000f: -----Chip status-----
   [   15.520284] tc358743 6-000f: Reading i2c_rd16
   [   15.520584] tc358743 6-000f: RET 0
   [   15.520590] tc358743 6-000f: Chip ID:0x00
   [   15.520594] tc358743 6-000f: Reading i2c_rd16
   [   15.520904] tc358743 6-000f: RET 0
   [   15.520909] tc358743 6-000f: Chip revision:0x00
   [   15.520914] tc358743 6-000f: Reset: IR: 1, CEC: 1, CSI TX: 0, HDMI: 0
   [   15.520919] tc358743 6-000f: Sleep mode: off
   [   15.520923] tc358743 6-000f: Cable detected (+5V power): yes
   [   15.521205] tc358743 6-000f: DDC lines enabled: yes
   [   15.521488] tc358743 6-000f: Hotplug enabled: yes
   [   15.521492] tc358743 6-000f: Reading i2c_rd16
   [   15.521877] tc358743 6-000f: RET 0
   [   15.521886] tc358743 6-000f: CEC enabled: no
   [   15.521893] tc358743 6-000f: -----Signal status-----
   [   15.521900] tc358743 6-000f: TMDS signal detected: yes
   [   15.521908] tc358743 6-000f: Stable sync signal: yes
   [   15.521915] tc358743 6-000f: PHY PLL locked: yes
   [   15.521923] tc358743 6-000f: PHY DE detected: yes
   [   15.526409] tc358743 6-000f: 496:tc358743_get_detected_timings: width 1280 heigh 720 interlaced 0
   [   15.526420] tc358743 6-000f: Detected format: 1280x720p50.0 (1980x750)
   [   15.526427] tc358743 6-000f: horizontal: fp = 0, -sync = 700, bp = 0
   [   15.526432] tc358743 6-000f: vertical: fp = 0, -sync = 30, bp = 0
   [   15.526437] tc358743 6-000f: pixelclock: 74250000
   [   15.526443] tc358743 6-000f: flags (0x0):
   [   15.526448] tc358743 6-000f: standards (0x0):
   [   15.526454] tc358743 6-000f: Configured format: 1920x1080p60.0 (2200x1125)
   [   15.526460] tc358743 6-000f: horizontal: fp = 88, +sync = 44, bp = 148
   [   15.526465] tc358743 6-000f: vertical: fp = 4, +sync = 5, bp = 36
   [   15.526470] tc358743 6-000f: pixelclock: 148500000
   [   15.526476] tc358743 6-000f: flags (0x12): CAN_REDUCE_FPS CE_VIDEO
   [   15.526481] tc358743 6-000f: standards (0x3): CEA DMT
   [   15.526485] tc358743 6-000f: -----CSI-TX status-----
   [   15.526490] tc358743 6-000f: Lanes needed: 4
   [   15.526853] tc358743 6-000f: Lanes in use: 4
   [   15.526858] tc358743 6-000f: Reading i2c_rd16
   [   15.527164] tc358743 6-000f: RET 0
   [   15.527169] tc358743 6-000f: Waiting for particular sync signal: no
   [   15.527173] tc358743 6-000f: Reading i2c_rd16
   [   15.527477] tc358743 6-000f: RET 0
   [   15.527482] tc358743 6-000f: Transmit mode: no
   [   15.527485] tc358743 6-000f: Reading i2c_rd16
   [   15.527790] tc358743 6-000f: RET 0
   [   15.527794] tc358743 6-000f: Receive mode: no
   [   15.527797] tc358743 6-000f: Reading i2c_rd16
   [   15.528100] tc358743 6-000f: RET 0
   [   15.528104] tc358743 6-000f: Stopped: no
   [   15.528108] tc358743 6-000f: Color space: YCbCr 422 16-bit
   [   15.528388] tc358743 6-000f: -----DVI-D status-----
   [   15.528393] tc358743 6-000f: HDCP encrypted content: no
   [   15.528398] tc358743 6-000f: Input color space: RGB full range
   [   15.528678] vi 54080000.vi: ==================  END STATUS  ==================

I noticed the configured format and deteted format differ but I haven’t been able to find out how to fix it.

yavta

Running

./yavta -f UYVY -s 1280x720 -n 4 --capture=5 -F /dev/video0

yeilds

Device /dev/video0 opened: vi-output, tc358743 6-000f (platform:54080000.vi:1).
Video format set: width: 1920 height: 1080 buffer size: 4147200
Video format: UYVY (59565955) 1920x1080
4 buffers requested.
length: 4147200 offset: 0
Buffer 0 mapped at address 0x7f79cb0000.
length: 4147200 offset: 4149248
Buffer 1 mapped at address 0x7f798bb000.
length: 4147200 offset: 8298496
Buffer 2 mapped at address 0x7f794c6000.
length: 4147200 offset: 12447744
Buffer 3 mapped at address 0x7f790d1000.

Then it hangs doing nothing…

and running

./yavta --enum-formats /dev/video0

yeilds

Device /dev/video0 opened: vi-output, tc358743 6-000f (platform:54080000.vi:1).
- Available formats:
        Format 0: AR24 (34325241)
        Type: Video capture (1)
        Name: 32-bit BGRA 8-8-8-8

        Format 1: UYVY (59565955)
        Type: Video capture (1)
        Name: UYVY 4:2:2
        Frame size: 1280x720 (1/30, 1/60)
        Frame size: 1920x1080 (1/30, 1/60)
        Frame size: 1280x720 (1/30, 1/60)
        Frame size: 1920x1080 (1/30, 1/60)

        Format 2: NV16 (3631564e)
        Type: Video capture (1)
        Name: Y/CbCr 4:2:2
        Frame size: 1280x720 (1/30, 1/60)
        Frame size: 1920x1080 (1/30, 1/60)
        Frame size: 1280x720 (1/30, 1/60)
        Frame size: 1920x1080 (1/30, 1/60)

Video format: UYVY (59565955) 0x32

gstreamer

gst-launch-1.0 -vvvvv v4l2src ! "video/x-raw, width=1280, height=720, framerate=60/1,format=UYVY"  ! nvvidconv ! omxh264enc ! mpegtsmux ! filesink location=test.ts

This creates an empty test.ts file and the following logs:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, width=(int)1280, height=(int)720, framerate=(fraction)60/1, format=(string)UYVY, colorimetry=(string)2:3:5:4, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, width=(int)1280, height=(int)720, framerate=(fraction)60/1, format=(string)UYVY, colorimetry=(string)2:3:5:4, interlace-mode=(string)progressive
/GstPipeline:pipeline0/Gstnvvconv:nvvconv0.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)I420, framerate=(fraction)60/1, interlace-mode=(string)progressive
Framerate set to : 60 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
H264: Profile = 66, Level = 40
/GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)I420, framerate=(fraction)60/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/Gstnvvconv:nvvconv0.GstPad:sink: caps = video/x-raw, width=(int)1280, height=(int)720, framerate=(fraction)60/1, format=(string)UYVY, colorimetry=(string)2:3:5:4, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, width=(int)1280, height=(int)720, framerate=(fraction)60/1, format=(string)UYVY, colorimetry=(string)2:3:5:4, interlace-mode=(string)progressive

if I set the framerate to 50/1 (like is detected) I get:

Setting pipeline to PAUSED ...
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.099286390
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

Many thanks in advance for your help!

2 Likes

Have enable the error report to check the status to check if can get more information.

sudo su
echo file vi2_fops.c +p > /sys/kernel/debug/dynamic_debug/control
echo file csi2_fops.c +p > /sys/kernel/debug/dynamic_debug/control

I have done this, but I’m unsure where to see any additional logs, there doesn’t seem to be anything more in dmesg?

does this help ?

please let me know if it helps, I’m working on the same thing :-)

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)