Screen-flicker when capturing images from image sensor

Me and my team use a system including a Jetson TX2 and an external image sensor. For a long time we have been running L4T 28.1 with a custom image sensor driver based directly on the ov5693.c example driver. We interface to the image sensor using iotctl and the V4L2 API. This system works very well.

We want to upgrade to L4T 28.2 to enable TensorRT. We recently upgraded the kernel on a device which also entailed updating the driver to match the ov5693.c that comes with the 28.2 packages. When we now try to capture images and display them, the entire screen flickers in random patches (even outside of the window holding the displayed image). Underneath all the flickering we can see that the image sensor is still capturing images.

The output of the tracer is included below. The error we have focused on is

arm_smmu_context_fault: Unhandled context fault: iova=0x61d88000, fsynr=0x13, cb=19, sid=4(0x4 - VI), pgd=26affe003 pud=26affe003, pmd=ea965003, pte=0

On the embedded Linux wiki, it was suggested that this error arises when the driver’s embedded_metadata_height is set to 0 or does not match the sensor’s output. We matched what we found in the data sheet but just to be sure, we cycled through several different embedded_metadata_height values and the problem still occurs.

Any help would be greatly appreciated. This is a significant blocker for us right now. Trace output below (shortened a bit, there was a lot of the same thing repeated since we are live streaming):

<idle>-0     [000] dnH1    86.570190: tegra_mcerr_hard_irq: MCERR detected.
[...repeated a lot...]
          <idle>-0     [000] dnH1    86.570219: tegra_mcerr_hard_irq: MCERR detected.
     kworker/0:3-165   [000] ...1    86.731119: rtcpu_vinotify_handle_msg: tstamp:3029641019 tag:CHANSEL_PXL_SOF channel:0x00 frame:2 vi_tstamp:3029640442 data:0x00000001
     kworker/0:3-165   [000] ...1    86.731123: rtcpu_vinotify_handle_msg: tstamp:3029641243 tag:ATOMP_FS channel:0x00 frame:2 vi_tstamp:3029640447 data:0x00000000
     kworker/0:3-165   [000] ...1    86.731124: rtcpu_vinotify_handle_msg: tstamp:3029644040 tag:CHANSEL_LOAD_FRAMED channel:0x10 frame:2 vi_tstamp:3029643608 data:0x08000000
     kworker/0:3-165   [000] ...1    86.731125: rtcpu_vinotify_handle_msg: tstamp:3030672545 tag:CHANSEL_PXL_EOF channel:0x00 frame:2 vi_tstamp:3030671929 data:0x0c2f0002
     kworker/0:3-165   [000] ...1    86.731125: rtcpu_vinotify_handle_msg: tstamp:3030672697 tag:ATOMP_FE channel:0x00 frame:2 vi_tstamp:3030671946 data:0x00000000
     kworker/0:3-165   [000] ...1    86.731126: rtcpu_vinotify_handle_msg: tstamp:3030682434 tag:CHANSEL_PXL_SOF channel:0x00 frame:3 vi_tstamp:3030681881 data:0x00000001
     kworker/0:3-165   [000] ...1    86.731127: rtcpu_vinotify_handle_msg: tstamp:3030682619 tag:ATOMP_FS channel:0x00 frame:3 vi_tstamp:3030681886 data:0x00000000
     kworker/0:3-165   [000] ...1    86.731131: rtos_queue_peek_from_isr_failed: tstamp:3031517213 queue:0x0b4a3c58
     kworker/0:3-165   [000] ...1    86.731132: rtcpu_vinotify_handle_msg: tstamp:3031713968 tag:CHANSEL_PXL_EOF channel:0x00 frame:3 vi_tstamp:3031713368 data:0x0c2f0002
     kworker/0:3-165   [000] ...1    86.731133: rtcpu_vinotify_handle_msg: tstamp:3031714114 tag:ATOMP_FE channel:0x00 frame:3 vi_tstamp:3031713386 data:0x00000000
     kworker/0:3-165   [000] ...1    86.731135: rtos_queue_peek_from_isr_failed: tstamp:3036517660 queue:0x0b4a3c58
     kworker/0:3-165   [000] ...1    86.731136: rtcpu_vinotify_handle_msg: tstamp:3041096808 tag:CHANSEL_PXL_SOF channel:0x00 frame:13 vi_tstamp:3041096272 data:0x00000001
     kworker/0:3-165   [000] ...1    86.731137: rtcpu_vinotify_handle_msg: tstamp:3041096956 tag:ATOMP_FS channel:0x00 frame:13 vi_tstamp:3041096276 data:0x00000000
          <idle>-0     [000] d.h1    86.760191: arm_smmu_context_fault: Unhandled context fault: iova=0x646f0000, fsynr=0x13, cb=19, sid=4(0x4 - VI), pgd=26b528003 pud=26b528003, pmd=171b4e003, pte=0
      cbc_gui_qt-2243  [000] d.h1    86.784387: arm_smmu_context_fault: Unhandled context fault: iova=0x659f8000, fsynr=0x13, cb=19, sid=4(0x4 - VI), pgd=26b528003 pud=26b528003, pmd=168928003, pte=0
      cbc_gui_qt-2243  [000] d.H1    86.799208: arm_smmu_context_fault: Unhandled context fault: iova=0x66540ec0, fsynr=0x13, cb=19, sid=4(0x4 - VI), pgd=26b528003 pud=26b528003, pmd=16892e003, pte=0
     kworker/0:3-165   [000] ...1    86.799405: rtcpu_vinotify_handle_msg: tstamp:3041387294 tag:CHANSEL_LOAD_FRAMED channel:0x10 frame:13 vi_tstamp:3041386869 data:0x08000000
     kworker/0:3-165   [000] ...1    86.799408: rtos_queue_peek_from_isr_failed: tstamp:3041518166 queue:0x0b4a3c58
     kworker/0:3-165   [000] ...1    86.799409: rtcpu_vinotify_handle_msg: tstamp:3042128344 tag:CHANSEL_PXL_EOF channel:0x00 frame:13 vi_tstamp:3042127759 data:0x0c2f0002
     kworker/0:3-165   [000] ...1    86.799410: rtcpu_vinotify_handle_msg: tstamp:3042128455 tag:ATOMP_FE channel:0x00 frame:13 vi_tstamp:3042127776 data:0x00000000
     kworker/0:3-165   [000] ...1    86.799411: rtcpu_vinotify_handle_msg: tstamp:3042138261 tag:CHANSEL_PXL_SOF channel:0x00 frame:14 vi_tstamp:3042137711 data:0x00000001
     kworker/0:3-165   [000] ...1    86.799412: rtcpu_vinotify_handle_msg: tstamp:3042138405 tag:ATOMP_FS channel:0x00 frame:14 vi_tstamp:3042137715 data:0x00000000
     kworker/0:3-165   [000] ...1    86.799413: rtcpu_vinotify_handle_msg: tstamp:3042301165 tag:CHANSEL_LOAD_FRAMED channel:0x10 frame:14 vi_tstamp:3042300752 data:0x08000000
     kworker/0:3-165   [000] ...1    86.799414: rtcpu_vinotify_handle_msg: tstamp:3043169785 tag:CHANSEL_PXL_EOF channel:0x00 frame:14 vi_tstamp:3043169198 data:0x0c2f0002
     kworker/0:3-165   [000] ...1    86.799414: rtcpu_vinotify_handle_msg: tstamp:3043169896 tag:ATOMP_FE channel:0x00 frame:14 vi_tstamp:3043169215 data:0x00000000
     kworker/0:3-165   [000] ...1    86.799415: rtcpu_vinotify_handle_msg: tstamp:3043179682 tag:CHANSEL_PXL_SOF channel:0x00 frame:15 vi_tstamp:3043179150 data:0x00000001
     kworker/0:3-165   [000] ...1    86.799416: rtcpu_vinotify_handle_msg: tstamp:3043179826 tag:ATOMP_FS channel:0x00 frame:15 vi_tstamp:3043179155 data:0x00000000
          <idle>-0     [000] d.h1    86.835294: arm_smmu_context_fault: Unhandled context fault: iova=0x68160000, fsynr=0x13, cb=19, sid=4(0x4 - VI), pgd=26b528003 pud=26b528003, pmd=168949003, pte=0
          <idle>-0     [000] dnh1    86.857957: arm_smmu_context_fault: Unhandled context fault: iova=0x69340000, fsynr=0x13, cb=19, sid=4(0x4 - VI), pgd=26b528003 pud=26b528003, pmd=16895f003, pte=0

hello mwright1s7oh,

there are some VI known issues with l4t-r28.2,

  1. please refer to Topic 1038067 for the patch to fix FE syncpt wait issue.
  2. please also check Topic 1020202 for the kernel patch to fix missing timestamp for vi4 driver.

besides, we also had already release l4t-r28.3 driver package which include above fixes.
thanks

Thank you! Updating to 28.3 seems to have resolved the problem! I appreciate the quick response.