[ADV7282A-M] Getting field type / frame num to distinguish top / bottom fields

We have successfully set up an ADV7282A-M to feed video from a PAL source into a TX2 over CSI2.

After noticing problems with the deinterlacer included in ADV7282A-M (I2P) – as noted e.g. here and here – we have decided to disable the I2P deinterlacer and do deinterlacing ourselves in software.

After applying this patch from upstream I can get the individual fields to show up as 720x288 frames from the v4l2 device. And by guessing which of them is the top and bottom fields respectively, I can merge them and get pretty much perfect result.

The problem is that guessing which field is which is not a very stable solution. Normally, the v4l2 driver is supposed to set the field field to V4L2_FIELD_TOP / V4L2_FIELD_BOTTOM, however the tegra camera library only sets it to V4L2_FIELD_NONE.


  1. Is it possible to get it to recognize the field correctly? AFAIK, this information is included in the CSI2 bit stream so it should be perfectly doable. For instance, the raspberry pi unicam driver seems able to do it. In that case, it seems to be done by looking at the frame num.
  2. If it is not supported currently, is it a software or hardware limitation? I.e., can I somehow extend the tegra camera library code to do this?

Thanks for any help here!
Here is my dtsi and the patches I have applied to the R32.6 L4T version of adv7180.c:
tegra186-camera-adv7281am-a00.dtsi (1.9 KB)
adv7180-alternate.diff (3.7 KB)

A possible solution is to use software plugin for deinterlacing. You can try to link like:

v4l2src ! deinterlace ! ...

For more information about the plugins, please check

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.