InES-HPMM/linux-l4t-4.4

Interlaced capturing with Jetson TX2.

liv-kuka opened this issue · 1 comments

Hi all!
We have HDMI2CSI bridge (https://blog.zhaw.ch/high-performance/category/hdmi2csi/) working with Jetson TX2 (L4T 28.2.1). And we have trouble while trying to capture interlaced input stream. Capturing progressive works just great.

I have tried to wrote a letter directly to Tobias Kammacher but it was rejected. So decided to create an issue here.

While running gstreamer's pipeline with interlaced source in dmesg we get errors like:

tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
tegra-vi4 15700000.vi: ATOMP_FE syncpt timeout! err = -11

Currently we are investigating into changes made to L4T 24.2.1 to add support interlaced video signal for TX1. Sources from https://github.com/InES-HPMM/linux-l4t.
If we are on the right way, we should start from commit 3989691ee2ae75f7e3f2bf49be243493ecbed558.

As we understand, the core changes regarding interlacing are (tegra_vi2.c):

static int tegra_vi_fill_pix_format(struct v4l2_pix_format *pf,
        const struct v4l2_mbus_framefmt *framefmt)
{
...
  /* With interlaced try to return the requested field format */
  if (interlaced)
    field = tegra_vi_field_is_interlaced(pf->field) ?
      pf->field : V4L2_FIELD_INTERLACED_TB;
  else
    field = V4L2_FIELD_NONE;

  v4l2_fill_pix_format(pf, framefmt);
  pf->field = field;
...
}
static int tegra_vi_channel_set_format(
  struct tegra_vi_channel *chan, struct v4l2_pix_format *pf)
{
...
  /* Bus format */
  vi_writel(nv_mbus | (input->csi_channel << 8) | (interlaced << 12),
    &chan->vi_regs->image_dt);
  /* Resolution */
  vi_writel(((framefmt.height >> interlaced) << 16) | framefmt.width,
    &chan->vi_regs->image_size);
...
}

Also, support of interlaced input is already added to tc358840.c, so we should not edit anything there.

We will be grateful for any help in advising what we should to modify in the Linux kernel to capture interlaced signal on Tegra TX2. Thanks in advance, waiting for the response and have a good day!

According to Nvidia capturing interlaced is not supported, see https://devtalk.nvidia.com/default/topic/1047332/jetson-tx2/hdmi2csi-interlaced-video-for-jetson-tx2/post/5372631/#5372631.
If you try the suggested pipeline from the post, I am not sure if you need to adapt the EDID and the driver. See https://github.com/InES-HPMM/linux-l4t-4.4/wiki/hdmi2csi#changing-the-edid and tc358840_regs.h.