No captured data from v4l2 driver (TC358743)

@phil1 @robert.j.h.chandler according to a friend of mind who is a hardware engineer , there should be a hardware modification to Jetson Nano carrier board in order to make tc358743 run at 1080p@50fps mode :-(
right now they are having their self designed board testing, I’m waiting for their result now

they also said 1080p@30fps is totally reachable without any physical changes

Did they say what the reason is for the hardware mod? I would like to get 1080i50 working as this is the main broadcast format in the UK, from the sound of it, this should be (technically) possible although it does look like de-interlacing adds an extra level of complexity.

I’m surprised to hear that, to me it look like the Nano carrier board comes with a 4-lane CSI port which I can imagine is all that’s needed for the 1080p@50/60fps. Did your friend elaborate as to why?

In other news I hackily got rid of the need to call v4l2-ctrl before enabling the stream by calling the query and set dv timings every time the status is called. I imagine this could introduce bugs elsewhere but it’s probably fine for my use case! I have updated the gist and you can see the diff here.

2 Likes

I’m not sure if they are just bluffing now = =!
you should continue to work on your own method ~ just ignore me :-)

I’m gonna talk to them soon , gonna find out what their hardware mod is

I’m confused after seeing their solution, all I can say is I don’t see the necessity of their design .
Just keep trying your own way @robert.j.h.chandler

Were either of you using the B01 devkit (the one with two CSI ports)? I’m struggling to get it working with sources compiled by me

On re-reading the old posts it looks like @electrixoul you are using the B01 kit!

Could you describe the process you used to get the sources, compile them and most importantly flash the board with the right device tree. I’m fining I can get the board to boot to the UI for the first boot but after that it refuses to boot to the GUI though I can access it via SSH.

Did you use tegra210-p3448-0000-p3449-0000-b00.dtb for the device tree?

Thank you all for this development. I am Using the B01 kit and had very little problems getting it working with the files provided. I did originally follow the instructions exactly and modified the A02 files, but quickly realized that DTSI was not the one for this devkit. I had to modify the b00 dtsi file to

As you are all reporting, I can only get it to work at 720p@60. Additionally, when I capture the video stream using gstreamer, It freezes after a short period of time. occasionally gstreamer returns error that /dev/video0 cannot support 1280x720@60hz, or whatever the requested resolution is. but subsequent calls will not return this error, but always the stream freezes after 1-10 seconds… Also, up in this thread there is a post about the interrupt signal needing to be connected. I did not make this connection, but the device is detected and configures.

Hi I’m new to here.

Referring posts here, I could successfully capture 1080p30 from my HDMI camera, with correct color space, zero frame dropped. Thank you, all!

I’m now trying to get sound embedded on HDMI via I2S connector, but the HDMI-CSI board (both B101 and other China-brand one) do not generate any signal. Even I2S SD out but also MCLCK, which should have 12.288MHz (256x fs) clock. I tried to observe all I2S signals using digital oscilloscope but all are ground level.

Does anyone succeed to get the I2S / audio signal from the board ? I wonder I need to put something on initialization of TC358743 device via I2C, other than tc358743_set_hdmi_audio().

Thanks,
Takumi

Hi Takumi,

Welcome :)

Congratulations on getting 1080p30 capture working! Would you be able to share your changes here such that others can benefit?

I’ve not looked into audio yet but there are a few things you can try:

  • Make sure the edid you’re using advertises audio capabilities
  • Add some logging to places where you’d expect the audio stream to start
  • Does the i2s protocol require any kind of handshake before it starts the audio stream?

I’d also recommend a good search of the nvidia and raspberry pi forums for this issue

1 Like

Dear All,
I am impressed with the work you have done!

My board is like this: Lusya Hdmi-compatible Adapter Board Standard Interface To Csi-2 Tc358743xbg For Raspberry Pi 4b 3b 3b+ Zero W - Home Theater Amplifiers - AliExpress
I am newbie in the scope of above topics and I am not sure how to proceed to get this board running with Nano.

Could you please describe shortly step-by-step procedure and point out final repo?

There was also some notice to connect some pins with an extra wire…is this obligatory ?

Some other hints?

@robert.j.h.chandler
Based on your comments, is that mistake or intention to overwrite 443 with 840
tc358**443**.cLinux_for_Tegra/source/public/kernel/kernel-4.9/drivers/media/i2c/tc358**840**.c?

Szymon

Hi All.
I’m trying to get to 1080p60hz as well.
It’s hard to solve just 2-lanes of CSI-B.
As a result of setting link-frequencies to 1000000000(2Gbps/lane), the screen was output at 1080p50.
(I edited the tc358743.c and raised frequencies limit.)
But I didn’t get 1080p60hz.
Does anyone know how to use the 4 lanes?

@strojak
I was able to get 1080p30 and possibly 1080p50 using the same thing.
The name of the file is different, but overwrite it as is.
I did build this while looking at this page.

How to build NVIDIA Jetson Nano kernel

my changes
tegra210-tc358743.dtsi

refclk_hz = <42000000>; // refclk_hz → regclk
link-frequencies = /bits/ 64 <1000000000>;

tc358743.c

if (bps_pr_lane < 62500000U || bps_pr_lane > 1000000000U)

2 Likes

Hi Szymon,

To get the TC358743 working you either need to:

  1. build the full kernel sources with the TC358743 module enabled and flash the device
  2. just build the module, copy it across onto the Nano (/lib/modules/4.9.140-tegra/kernel/drivers/media/i2c/tc358743.ko) and run sudo depmod -a followed by sudo modprobe tc358743

With both options you’ll need to build and flash the device tree

Have a look at this nvidia guide and this ridgerun guide for instructions to build the kernel/module. As you’ve seen there are some instructions in the readme in the gist for debugging the code. You were right about the typo too!

Also, I’ve not had to connect anything other than the ribbon cable to my B101 TC358743 breakout.

4 Likes

Thank you, Robert!

To realizing 1080p30 capturing, I’ve just done the normal things - integrate device tree, flash it, and rebuild kernel enabling tc358743 support, then depmod. First it did not recognize my camera’s signal, but after pulling HDMI splitter out between my camera and the B101 board, it recognizes the signal - 1080p30.

However, I found it requires very accurate HDMI signal - it just recognizes HDMI signals from professional cameras, such as Blackmagic Studio Camera and Pocket Cinema Camera. Other DSLR is not recognized.

Re audio, I’m pretty new at HDMI but I think I’m professional of I2S - it’s one-way no-handshake signal, consists with 4 signal lines, such as master clock, frame clock, bit clock and serial data. According to the spec of TC358743, all signal lines are “out” so we just need to connect all signals into I2S line on Jetson nano (except master clock - we may need special treatment). Anyway in the code there is initialization function already, named tc358743_set_hdmi_audio, so we can expect the signal comes out from TC358743, but we see nothing…

Thanks for mentioning about EDID, I would check. Currently EDID is coded as binary array so I need to understand the content of it at first. (No document so far?)

Thanks,

1 Like

I had a brief look at http://www.edidreader.com/ to decode the two edids that are in the driver. The one that’s activated when TC358743_VOUT_RGB is defined seems to have some audio information where as the one that is activated by default does not. I’m sure with some googling you’ll be able to find an edid that advertise the capabilities that you desire, I believe one alternative option is to read the edid from a monitor that has the capabilities that you desire.

It’s possible that the other dslr’s that you’re trying are outputting a different framerate to the desired one and hence aren’t able to be read.

It’s always worth sharing the actual code that you got working so others can make similar changes

1 Like

Hello @robert.j.h.chandler

Thank you for sharing your code.
I am trying to build the kernel with your driver but I get some errors. I am absolutely new to this, but I can debug /correct myself if I am given the right path but in this case, I am not sure where to start! :)

I used the codes in your gist and added to the directories and modified the device tress.

I enabled the driver as module in the following using menuconfig command before building the kernel ( not sure if this is the right way or I should do it in another way?)

Toshiba TC358743 decoder
Device Drivers > Multimedia support > I2C Encoders, decoders, sensors and other helper chips

However I get the following errors result in “recipe for target ‘drivers’ failed Makefile:171: recipe for target ‘sub-make’ failed “

  /home/user/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/public/kernel/kernel-4.9/drivers/media/i2c/tc358743.c: In function ‘tc358743_set_csi’:
/home/user/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/public/kernel/kernel-4.9/drivers/media/i2c/tc358743.c:944:36: error: ‘struct tc358743_platform_data’ has no member named ‘endpoint’
  i2c_wr32(sd, TXOPTIONCNTRL, (pdata->endpoint.bus.mipi_csi2.flags &
                                    ^~
/home/user/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/public/kernel/kernel-4.9/drivers/media/i2c/tc358743.c: In function ‘tc358743_parse_dt’:
/home/user/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/public/kernel/kernel-4.9/drivers/media/i2c/tc358743.c:2027:7: error: ‘struct tc358743_platform_data’ has no member named ‘reset_gpio’
  pdata->reset_gpio = of_get_named_gpio(node, "reset-gpios", 0);
       ^~
/home/user/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/public/kernel/kernel-4.9/drivers/media/i2c/tc358743.c:2028:11: error: ‘struct tc358743_platform_data’ has no member named ‘reset_gpio’
  if (pdata->reset_gpio == 0)
           ^~
In file included from /home/user/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/public/kernel/kernel-4.9/include/media/v4l2-subdev.h:24:0,
                 from /home/user/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/public/kernel/kernel-4.9/include/media/v4l2-device.h:25,
                 from /home/user/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/public/kernel/kernel-4.9/drivers/media/i2c/tc358743.c:20:
/home/user/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/public/kernel/kernel-4.9/drivers/media/i2c/tc358743.c:2030:54: error: ‘struct tc358743_platform_data’ has no member named ‘reset_gpio’
  v4l_dbg(1, debug, client, "reset_gpio = %d\n", pdata->reset_gpio);
                                                      ^
/home/user/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/public/kernel/kernel-4.9/include/media/v4l2-common.h:35:76: note: in definition of macro ‘v4l_printk’
  printk(level "%s %d-%04x: " fmt, name, i2c_adapter_id(adapter), addr , ## arg)
                                                                            ^~~
/home/user/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/public/kernel/kernel-4.9/include/media/v4l2-common.h:55:4: note: in expansion of macro ‘v4l_client_printk’
    v4l_client_printk(KERN_DEBUG, client, fmt , ## arg); \
    ^~~~~~~~~~~~~~~~~
/home/user/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/public/kernel/kernel-4.9/drivers/media/i2c/tc358743.c:2030:2: note: in expansion of macro ‘v4l_dbg’
  v4l_dbg(1, debug, client, "reset_gpio = %d\n", pdata->reset_gpio);
  ^~~~~~~
/home/user/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/public/kernel/kernel-4.9/drivers/media/i2c/tc358743.c: In function ‘tc358743_probe’:
/home/user/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/public/kernel/kernel-4.9/drivers/media/i2c/tc358743.c:2299:8: error: ‘struct tc358743_platform_data’ has no member named ‘endpoint’
   pdata->endpoint.bus.mipi_csi2.flags = V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
        ^~
make[4]: *** [drivers/media/i2c/tc358743.o] Error 1
  CC [M]  drivers/media/i2c/tc358743.o
/home/user/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/public/kernel/kernel-4.9/scripts/Makefile.build:341: recipe for target 'drivers/media/i2c/tc358743.o' failed
make[3]: *** [drivers/media/i2c] Error 2
make[3]: *** Waiting for unfinished jobs....
/home/user/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/public/kernel/kernel-4.9/scripts/Makefile.build:649: recipe for target 'drivers/media/i2c' failed

It looks like the problem @phil1 mentioned in post #28 ( and the solution in post 31) but when I check your header file, those lines are already there. So I am a bit confused.

This is the same when I try to make it in built-in mode.

I tried to compile the kernel without your drivers and everything went well and the module boot up normally so rest of the files and tools are correct.

I appreciate if you can help on this.

Hi Ali,

tc358743_platform_data is defined in tc358743.h L53 so it’s likely that the header file that is being used has not been updated to the one from the gist.

I did notice there was a slight typo in my readme where I had it as tc358443.h so there’s a chance that you copied the file to the wrong location (by following an incorrect readme).

I enabled the driver as module in the following using menuconfig command before building the kernel ( not sure if this is the right way or I should do it in another way?)

That is how I did it. I would also recommend just re-building the module when iterating e.g.

make -C kernel/kernel-4.9/ ARCH=arm64 O=$TEGRA_KERNEL_OUT LOCALVERSION=-tegra CROSS_COMPILE=${TOOLCHAIN_PREFIX} M=drivers/media/i2c
1 Like

Dear All,

I have made an adaptation of kernel and compilation is done.

Unfortunatly /dev/video0 is not visible
What could be the reason?