No captured data from v4l2 driver (TC358743)

Hi Strojak,

There could be a number of reasons…

  1. Run dmesg | grep tc35 to see if there are any errors. If nothing is being printed it’s probably because your device tree isn’t correct so it’s not being probed, if there are some errors then post them here and we can help try and debug

  2. Send us the output of media-ctl -p -d /dev/media0 (you may need to install v4l-utils and/or media-ctl first)

I ported it from imx185, and now it works on my tx2

[ 8355.294772] tc358743v1 2-000f: -----Chip status-----
[ 8355.300109] tc358743v1 2-000f: Chip ID: 0x00
[ 8355.304783] tc358743v1 2-000f: Chip revision: 0x00
[ 8355.309668] tc358743v1 2-000f: Reset: IR: 1, CEC: 1, CSI TX: 0, HDMI: 0
[ 8355.316337] tc358743v1 2-000f: Sleep mode: off
[ 8355.320827] tc358743v1 2-000f: Cable detected (+5V power): yes
[ 8355.326932] tc358743v1 2-000f: DDC lines enabled: yes
[ 8355.332236] tc358743v1 2-000f: Hotplug enabled: no
[ 8355.338912] tc358743v1 2-000f: CEC enabled: no
[ 8355.343388] tc358743v1 2-000f: -----Signal status-----
[ 8355.348553] tc358743v1 2-000f: TMDS signal detected: yes
[ 8355.353897] tc358743v1 2-000f: Stable sync signal: yes
[ 8355.359128] tc358743v1 2-000f: PHY PLL locked: yes
[ 8355.363934] tc358743v1 2-000f: PHY DE detected: yes
[ 8355.371009] tc358743v1 2-000f: Detected format: 1920x1080p30.0 (2200x1125)
[ 8355.371013] tc358743v1 2-000f: horizontal: fp = 0, -sync = 280, bp = 0
[ 8355.371016] tc358743v1 2-000f: vertical: fp = 0, -sync = 45, bp = 0
[ 8355.371018] tc358743v1 2-000f: pixelclock: 74250000
[ 8355.371020] tc358743v1 2-000f: flags (0x0):
[ 8355.371022] tc358743v1 2-000f: standards (0x0):
[ 8355.371025] tc358743v1 2-000f: Configured format: 640x480p59.94 (800x525)
[ 8355.371027] tc358743v1 2-000f: horizontal: fp = 16, -sync = 96, bp = 48
[ 8355.371029] tc358743v1 2-000f: vertical: fp = 10, -sync = 2, bp = 33
[ 8355.371031] tc358743v1 2-000f: pixelclock: 25175000
[ 8355.371032] tc358743v1 2-000f: flags (0x0):
[ 8355.371034] tc358743v1 2-000f: standards (0x3): CEA DMT
[ 8355.371036] tc358743v1 2-000f: -----CSI-TX status-----
[ 8355.376219] tc358743v1 2-000f: Lanes needed: 2
[ 8355.380966] tc358743v1 2-000f: Lanes in use: 2
[ 8355.385651] tc358743v1 2-000f: Waiting for particular sync signal: no
[ 8355.392352] tc358743v1 2-000f: Transmit mode: no
[ 8355.397255] tc358743v1 2-000f: Receive mode: no
[ 8355.402009] tc358743v1 2-000f: Stopped: no
[ 8355.406129] tc358743v1 2-000f: Color space: YCbCr 422 16-bit
[ 8355.411980] tc358743v1 2-000f: -----DVI-D status-----
[ 8355.417046] tc358743v1 2-000f: HDCP encrypted content: no
[ 8355.422460] tc358743v1 2-000f: Input color space: RGB full range
[ 8358.438499] tc358743v1 2-000f: imx185_power_off: power off

Hello Robert,

Thank you for the help. Yes, that was my bad. I added the header file to the wrong location.

I was able to build the .ko and after fixing a couple of other problems I am able to load the driver. ( bopied the module to the folder and ran depmod and modprobe commands and also updated the device tree)

now it looks the driver is loaded correctly, video0 can be detected in ls /dev/video0 but I am not able to capture any picture.

here are the results of media-ctl -p -d /dev/media0

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, 2 links)
    type V4L2 subdev subtype Unknown flags 0
    device node name /dev/v4l-subdev0
    pad0: Sink
    <- “tc358743 6-000f”:0 [ENABLED]
    pad1: Source
    -> “vi-output, tc358743 6-000f”:0 [ENABLED]

  • entity 4: tc358743 6-000f (1 pad, 1 link)
    type V4L2 subdev subtype Sensor flags 0
    device node name /dev/v4l-subdev1
    pad0: Source
    [fmt:UYVY8_1X16/1280x720 field:none colorspace:smpte170m]
    [dv.caps:BT.656/1120 min:1x1@0 max:10000x10000@165000000 stds:CEA-861,DMT,CVT,GTF caps:progressive,reduced-blanking,custom]
    [dv.detect:BT.656/1120 1280x720p60 (1650x750) stds: flags:]
    [dv.current:BT.656/1120 1280x720p60 (1650x750) stds: flags:]
    -> “nvcsi–1”:0 [ENABLED]

  • entity 6: vi-output, tc358743 6-000f (1 pad, 1 link)
    type Node subtype V4L flags 0
    device node name /dev/video0
    pad0: Sink
    <- “nvcsi–1”:1 [ENABLED]

and here is the dmesg | grep tc358743 output

[ 1812.222736] tc358743 6-000f: Calling tc358743_g_input_status

[ 1812.223334] tc358743 6-000f: tc358743_g_input_status: status =0x0
[ 1812.223337] tc358743 6-000f: Now getting and setting dv timings
[ 1812.223341] tc358743 6-000f: Calling tc358743_query_dv_timings
[ 1812.226754] tc358743 6-000f: 495:tc358743_get_detected_timings: width 1280 heigh 720 interlaced 0
[ 1812.226762] tc358743 6-000f: tc358743_query_dv_timings: 1280x720p60.0 (1650x750)
[ 1812.226765] tc358743 6-000f: tc358743_s_dv_timings
[ 1812.226768] tc358743 6-000f: tc358743_s_dv_timings: no change
[ 1812.228132] tc358743 6-000f: tc358743_enum_frame_size()
[ 1812.228139] tc358743 6-000f: fse->code 8207, index 0
[ 1812.228143] tc358743 6-000f: ----------------------------------------
[ 1812.228151] tc358743 6-000f: Trying to find frmfmt that matches fse->code, code: 8207 (UYVY: 1498831189, ARGB32: 875713089, MEDIA_BUS_FMT_UYVY8_1X16: 8207, MEDIA_BUS_FMT_RGB888_1X24: 4106)
[ 1812.228154] tc358743 6-000f: Code ok
[ 1812.228158] tc358743 6-000f: Index ok
[ 1812.228164] tc358743 6-000f: !!! tc358743_enum_frame_size() complete successfully, width: 1280, height: 720
[ 1812.228173] tc358743 6-000f: tc358743_enum_frame_interval()
[ 1812.228177] tc358743 6-000f: ----------------------------------------
[ 1812.228183] tc358743 6-000f: Trying to find frame interfval that matches fie->code, code: 8207 (UYVY: 1498831189, ARGB32: 875713089, MEDIA_BUS_FMT_UYVY8_1X16: 8207)
[ 1812.228186] tc358743 6-000f: Code ok
[ 1812.228191] tc358743 6-000f: Matched width 1280 and 1280, height 720 and 720
[ 1812.228195] tc358743 6-000f: w/h ok or end (i=0, num=2)
[ 1812.228199] tc358743 6-000f: i ok
[ 1812.228203] tc358743 6-000f: index ok
[ 1812.228207] tc358743 6-000f: !!! tc358743_enum_frame_interval() completed successfully, interval: 1/30
[ 1812.228221] tc358743 6-000f: tc358743_enum_frame_interval()
[ 1812.228225] tc358743 6-000f: ----------------------------------------
[ 1812.228230] tc358743 6-000f: Trying to find frame interfval that matches fie->code, code: 8207 (UYVY: 1498831189, ARGB32: 875713089, MEDIA_BUS_FMT_UYVY8_1X16: 8207)
[ 1812.228233] tc358743 6-000f: Code ok
[ 1812.228238] tc358743 6-000f: Matched width 1280 and 1280, height 720 and 720
[ 1812.228242] tc358743 6-000f: w/h ok or end (i=0, num=2)
[ 1812.228245] tc358743 6-000f: i ok
[ 1812.228248] tc358743 6-000f: index ok
[ 1812.228253] tc358743 6-000f: !!! tc358743_enum_frame_interval() completed successfully, interval: 1/50
[ 1812.228261] tc358743 6-000f: tc358743_enum_frame_interval()
[ 1812.228265] tc358743 6-000f: ----------------------------------------
[ 1812.228270] tc358743 6-000f: Trying to find frame interfval that matches fie->code, code: 8207 (UYVY: 1498831189, ARGB32: 875713089, MEDIA_BUS_FMT_UYVY8_1X16: 8207)
[ 1812.228273] tc358743 6-000f: Code ok
[ 1812.228277] tc358743 6-000f: Matched width 1280 and 1280, height 720 and 720
[ 1812.228281] tc358743 6-000f: w/h ok or end (i=0, num=2)
[ 1812.228284] tc358743 6-000f: i ok
[ 1812.228287] tc358743 6-000f: index ok
[ 1812.228291] tc358743 6-000f: !!! tc358743_enum_frame_interval() completed successfully, interval: 1/60
[ 1812.228300] tc358743 6-000f: tc358743_enum_frame_interval()
[ 1812.228303] tc358743 6-000f: ----------------------------------------
[ 1812.228308] tc358743 6-000f: Trying to find frame interfval that matches fie->code, code: 8207 (UYVY: 1498831189, ARGB32: 875713089, MEDIA_BUS_FMT_UYVY8_1X16: 8207)
[ 1812.228311] tc358743 6-000f: Code ok
[ 1812.228315] tc358743 6-000f: Matched width 1280 and 1280, height 720 and 720
[ 1812.228319] tc358743 6-000f: w/h ok or end (i=0, num=2)
[ 1812.228322] tc358743 6-000f: i ok
[ 1812.228327] tc358743 6-000f: Error in tc358743_enum_frame_interval num framerates (3 outside 3)
[ 1812.237520] tc358743 6-000f: tc358743_enum_frame_size()
[ 1812.237524] tc358743 6-000f: fse->code 8207, index 1
[ 1812.237525] tc358743 6-000f: ----------------------------------------
[ 1812.237529] tc358743 6-000f: Trying to find frmfmt that matches fse->code, code: 8207 (UYVY: 1498831189, ARGB32: 875713089, MEDIA_BUS_FMT_UYVY8_1X16: 8207, MEDIA_BUS_FMT_RGB888_1X24: 4106)
[ 1812.237531] tc358743 6-000f: Code ok
[ 1812.237532] tc358743 6-000f: Index ok
[ 1812.237535] tc358743 6-000f: !!! tc358743_enum_frame_size() complete successfully, width: 1920, height: 1080
[ 1812.237539] tc358743 6-000f: tc358743_enum_frame_interval()
[ 1812.237541] tc358743 6-000f: ----------------------------------------
[ 1812.237543] tc358743 6-000f: Trying to find frame interfval that matches fie->code, code: 8207 (UYVY: 1498831189, ARGB32: 875713089, MEDIA_BUS_FMT_UYVY8_1X16: 8207)
[ 1812.237545] tc358743 6-000f: Code ok
[ 1812.237547] tc358743 6-000f: Matched width 1920 and 1920, height 1080 and 1080
[ 1812.237549] tc358743 6-000f: w/h ok or end (i=1, num=2)
[ 1812.237550] tc358743 6-000f: i ok
[ 1812.237552] tc358743 6-000f: index ok
[ 1812.237554] tc358743 6-000f: !!! tc358743_enum_frame_interval() completed successfully, interval: 1/30
[ 1812.237561] tc358743 6-000f: tc358743_enum_frame_interval()
[ 1812.237563] tc358743 6-000f: ----------------------------------------
[ 1812.237566] tc358743 6-000f: Trying to find frame interfval that matches fie->code, code: 8207 (UYVY: 1498831189, ARGB32: 875713089, MEDIA_BUS_FMT_UYVY8_1X16: 8207)
[ 1812.237567] tc358743 6-000f: Code ok
[ 1812.237569] tc358743 6-000f: Matched width 1920 and 1920, height 1080 and 1080
[ 1812.237571] tc358743 6-000f: w/h ok or end (i=1, num=2)
[ 1812.237573] tc358743 6-000f: i ok
[ 1812.237574] tc358743 6-000f: index ok
[ 1812.237576] tc358743 6-000f: !!! tc358743_enum_frame_interval() completed successfully, interval: 1/50
[ 1812.237581] tc358743 6-000f: tc358743_enum_frame_interval()
[ 1812.237582] tc358743 6-000f: ----------------------------------------
[ 1812.237585] tc358743 6-000f: Trying to find frame interfval that matches fie->code, code: 8207 (UYVY: 1498831189, ARGB32: 875713089, MEDIA_BUS_FMT_UYVY8_1X16: 8207)
[ 1812.237586] tc358743 6-000f: Code ok
[ 1812.237588] tc358743 6-000f: Matched width 1920 and 1920, height 1080 and 1080
[ 1812.237590] tc358743 6-000f: w/h ok or end (i=1, num=2)
[ 1812.237591] tc358743 6-000f: i ok
[ 1812.237593] tc358743 6-000f: index ok
[ 1812.237595] tc358743 6-000f: !!! tc358743_enum_frame_interval() completed successfully, interval: 1/60
[ 1812.237599] tc358743 6-000f: tc358743_enum_frame_interval()
[ 1812.237600] tc358743 6-000f: ----------------------------------------
[ 1812.237603] tc358743 6-000f: Trying to find frame interfval that matches fie->code, code: 8207 (UYVY: 1498831189, ARGB32: 875713089, MEDIA_BUS_FMT_UYVY8_1X16: 8207)
[ 1812.237604] tc358743 6-000f: Code ok
[ 1812.237606] tc358743 6-000f: Matched width 1920 and 1920, height 1080 and 1080
[ 1812.237608] tc358743 6-000f: w/h ok or end (i=1, num=2)
[ 1812.237610] tc358743 6-000f: i ok
[ 1812.237612] tc358743 6-000f: Error in tc358743_enum_frame_interval num framerates (3 outside 3)
[ 1812.246396] tc358743 6-000f: tc358743_enum_frame_size()
[ 1812.246400] tc358743 6-000f: fse->code 8207, index 2
[ 1812.246406] tc358743 6-000f: ----------------------------------------
[ 1812.246411] tc358743 6-000f: Trying to find frmfmt that matches fse->code, code: 8207 (UYVY: 1498831189, ARGB32: 875713089, MEDIA_BUS_FMT_UYVY8_1X16: 8207, MEDIA_BUS_FMT_RGB888_1X24: 4106)
[ 1812.246416] tc358743 6-000f: Code ok
[ 1812.246422] tc358743 6-000f: Error in tc358743_enum_frame_size, 2 outside of num_frmfmt (2)
[ 1812.254868] tc358743 6-000f: tc358743_enum_frame_size()
[ 1812.254873] tc358743 6-000f: fse->code 4106, index 0
[ 1812.254876] tc358743 6-000f: ----------------------------------------
[ 1812.254879] tc358743 6-000f: Trying to find frmfmt that matches fse->code, code: 4106 (UYVY: 1498831189, ARGB32: 875713089, MEDIA_BUS_FMT_UYVY8_1X16: 8207, MEDIA_BUS_FMT_RGB888_1X24: 4106)
[ 1812.254883] tc358743 6-000f: Error in tc358743_enum_frame_size fse->code, code: 4106, UYVY: 1498831189, ARGB32: 875713089
[ 1812.266758] tc358743 6-000f: Calling tc358743_get_fmt
[ 1812.266763] tc358743 6-000f: Here 6b, colorspace: 1
[ 1812.266765] tc358743 6-000f: get fmt complete

Any suggestions?

Thank you!

@robert.j.h.chandler

Never mind! It was a loose cable! now it works… Thank you again! :)

Can you help me for use TC358743 in jetson nano (step by step)?

Hi Robert,
can you provide a comprehensive, step-by-step solution for kernel compile, adding correct driver, update device tree , etc for use tc358743(B101) in jetson nano (with developer kit A02)?

You will be of great help to me if you can provide a comprehensive solution.
I wish you all the best:)

I am also looking at this project and am interested if there is a latest driver or what further development is needed and how I could contribute.

when i build dtb rise
ERROR (duplicate_label): Duplicate label ‘vi_port1’ on /host1x/vi/ports/port@1 and /host1x/vi/ports/port@0
how can fix it?

i fix it in dtb,set
vi_port1:vi_port0 the 1 to 0
i test the driver and dtb few days with not modify any thing on my jetson nano 2g ,and latest jetson kit 4.4. the driver is wark but no frame capture on start, i’m not good at C lang and linux kernel.
now it warks
the the hdmi source have to set 720P?
##########
I think some thing wrong with edid handshake or other like hotplug status when the sources cable plugin the board, hdmi sources was detected DVI, the driver can’t deal with DVI.
###########
i have read the sources of tc358743 driver code from official release
if (tx_5v_power_present(sd)) tc358743_enable_edid(sd);

but the fixs codes is

// if (tx_5v_power_present(sd))//common out tc358743_enable_edid(sd);

i search google.the video source mast present 5v power && the display hotplug status was on then read the display edid.and the logical is the 5v present then hotplug on in the code.so if the chip can’t detected the 5v may be the cable problem or source problem or other things, should set hotplug aways on or for a while when the driver initial.otherwise the edid is not used.
########
for my research the clock may not useful for the hdmi2csi board.the chip needs the clock was on the board. The refclk was not useful.

1 Like

i asked the board seller the borad was only 2 ways routed to the chip ,and the all for rasbarrypi boards could also only 2 ways ,so it can,t use 4 way csi trans.dos not the driver problem. thank you for all. so 1080x1920 50p may be the top on 2 ways.
so i think may be higher frequencies even up to 594000000 may be work.
case 972000000U:
state->pdata.lineinitcnt = 0xFA0;
state->pdata.lptxtimecnt = 0x007;
/* tclk-preparecnt: 6, tclk-zerocnt: 40 /
state->pdata.tclk_headercnt = 0x2806;
state->pdata.tclk_trailcnt = 0x00;
/
ths-preparecnt: 3, ths-zerocnt: 1 */
state->pdata.ths_headercnt = 0x0806;
state->pdata.twakeup = 0x4268;
state->pdata.tclk_postcnt = 0x008;
state->pdata.ths_trailcnt = 0x5;
state->pdata.hstxvregcnt = 0;
this data from raspberry pi set link freqencies 486000000.1080x1920P50 was worked.
tip>you should use vlc to see the frame inmeditately
#############
state->pdata.pll_fbd = 176;//144

// timing setting

//case 972000000U:
state->pdata.lineinitcnt = 0x1d01;//
state->pdata.lptxtimecnt = 0x008;//
/* tclk-preparecnt: 6, tclk-zerocnt: 45 /
state->pdata.tclk_headercnt = 0x2D06;//0x0218
state->pdata.tclk_trailcnt = 0x09;//
/
ths-preparecnt: 7, ths-zerocnt: 17 */
state->pdata.ths_headercnt = 0xd06;//0x0220
state->pdata.twakeup = 0x4883;//
state->pdata.tclk_postcnt = 0x010;//
state->pdata.ths_trailcnt = 0xA;//
state->pdata.hstxvregcnt = 5;//5

the data for 594000000 link frequencies .i have got P60 and modify the codes
(bps_pr_lane < 62500000U || bps_pr_lane > 1000000000U)
to
(bps_pr_lane < 62500000U || bps_pr_lane > 1188000000U)

??

It would be great for someone to post a working image you could write to the SD for the nano!

if you need can test my code at gitbub.

Hey everyone! First, thank you for this fantastic work! We were successful getting all this to work on our Nano.

One question, has anyone worked on getting other resolutions less than 720p working? I’d love to get 640x480, 720x480 and a few others as well.

I added 640x480 to the begging of the tc358743.c file and when I list the modes it shows up. When I hook up a 480p device it shows it properly, the buffers requested look the proper size as far as I can tell, but trying to capture just locks up, the test.ts file is 0 in size and I get those 4000 errors in dmesg.

I cannot find a user guide for this chip, and so far, no response from Toshiba sending them a message.

I know on other chips they have to send double pixels for 480p but the driver is only detecting 1, so I don’t know if this is the case.

Anyone have some pointers on where to go from there? Is this something that has to be supported in the v4l2 driver? or the csi driver?

I know that the Raspberry Pi folks support other resolutions including 480p with this chip, but not sure where that support resides to be able to figure out how to port.

I guess the first question, has anyone captured anything that used 1 data lane instead of 2? It seems to me that anything I try that wants 1 data lane isn’t working.

I started going down this path when I saw someone else that was getting 4000 errors as well, but their driver was for a TX2 custom board and driver set. Still, seemed like it could be related to this.