Embedded Metadata (EBD) for MIPI CSI2 on TX1

Hi,

Currently, I’m trying to receive the PDAF data produced by a sensor that can be embedded on the CSI data stream. I was able to determine that is possible accessing that data using LibArgus, and that made me proceed to take a look on the CSI/video capture Nvidia drivers to determine how and that information was gathered. I realize that the usage of such data was just available on the TX2 drivers not the TX1 drivers on Jetpack 3.1.

After researching a bit more I came across the following post:

https://devtalk.nvidia.com/default/topic/1026113/jetson-tx1/obtain-information-from-raw-buffer-when-using-nvcamerasrc/post/5219504/

Which actually also confirmed my suspicions of that support currently only available on TX2. I have the following questions:

  • According to the TRM, this should also be able to supported on TX1. Is there any particular limitation for not having that support on TX1 driver?
  • Are there any patches to add support EBD on TX1?
  • In case that it is possible to add, and there are no patches; could you provide a rough estimate on how much effort it could take to backport that support on TX1?
  • Thanks in advance!
    JJ

    hello josejich,

    you don’t need patches to add EBD support.
    please check your sensor datasheet, and configure correct embedded_metadata_height.
    moreover, please look into the kernel driver about embedded metadata supporting.
    thanks
    r28.1_sources/kernel-4.4/drivers/media/platform/tegra/camera/sensor_common.c

    Hi JerryChang,

    Thanks for your reply, I performed a search for embedded_metadata_height on that directory

    $r28.1_sources/kernel-4.4/drivers/media/platform/tegra/camera$ rgrep "embedded_metadata_height" .
    
    ./sensor_common.c:	/* embedded_metadata_height is optional */
    ./sensor_common.c:	read_property_u32(node, "embedded_metadata_height",
    ./sensor_common.c:	&image->embedded_metadata_height);
    ./vi/vi4_fops.c:	sensor_mode->image_properties.embedded_metadata_height;
    

    So after reading it from the device tree; it seems like it’s only used on TX2 drivers (vi4_fops.c since it’s TEGRA_18x_SOC):

    $kernel-4.4/drivers/media/platform/tegra/camera/vi$ cat Makefile
    
    ifeq ($(CONFIG_ARCH_TEGRA_18x_SOC),y)
    ccflags-y += -I../t18x/drivers/video/tegra/host/
    ccflags-y += -I../nvhost/include
    obj-y += mc_common.o core.o channel.o graph.o vi2_fops.o vi4_fops.o
    endif
    
    ifeq ($(CONFIG_ARCH_TEGRA_210_SOC),y)
    ccflags-y += -I../nvhost/include
    ccflags-y += -I../t18x/drivers/video/tegra/host/
    obj-y += mc_common.o core.o channel.o graph.o vi2_fops.o
    endif
    

    Changes between vi2_fops.c and vi4_fops.c seem to be significant, could you confirm that support is currently only available for TX2? and if so, is there any particular reason for not suporting it TX1?

    Thanks in advance,
    JJ

    hello josejich,

    we’re going to have internal discussion,
    will update the status later. thanks

    hello josejich,

    one more question according to your comments,

    I was able to determine that is possible accessing that data using LibArgus, and…

    did you mean you’re able to acquire EBD with LibArgus on TX2 but NOT on TX1?
    thanks

    Hi JerryChang,

    Thanks for the help, regarding my comment “I was able to determine that is possible accessing that data using LibArgus”, basically I was able to determine that the EBD was accessible from LibArgus and then researched how this might be possible using the current stack of drivers on the kernel, I was able to determine that t seems like it’s currently only possible for TX2.
    Unless LibArgus uses a different stack of software than the current kernel drivers.

    Thanks again,
    JJ

    hello josejich,

    here are the update,
    thanks

    1. embedded data support for TX1 and TX2 was accessed through libargus, NOT for the direct V4L2 path.
    2. V4L2 does not have interface and that needs an extension for embedded data.
    3. for the kernel driver implementation, that should be a massive effort for TX1 since TX1’s VI HW cannot extract metadata with the same tegra channel.

    Hi JerryChang,

    Understood, thanks!

    Hi Jerry,

    Is it possible for the VI HW/Driver to just pass the embedded data as part of the frame data to the V4L2 if we increase the frame height to include the embedded data lines. We don’t want the VI to extract the metadata, we want it to pass it along with the frame data.

    -clint

    hello csuson,

    yes, you’re able to pass through the signals within embedded metadata lines.
    please refer to [Tegra TRM]-> [Video Input (VI)]-> [Embedded Data Formats] chapter for more details.
    thanks