This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

composite ntsc loopback on dm3730 evm appears "jumpy"

Other Parts Discussed in Thread: OMAP3530, DM3730

I'm attempting to use the dm3730 evm in a composite video loopback test and about half the time I run the test application the video is "jumpy" with old frames being displayed mixed in with current frames. The other half the time the video appears smooth as expected, but does display "noise" that I assume is the same as identified here: SDOCM00073286. The test involves attaching an ntsc camera to the composite video input and an ntsc display to the composite video output. I then run the following command on the console to put the output in ntsc mode:

echo "13500,720/16/58/64,482/6/31/6" > /sys/devices/platform/omapdss/display1/timings

The test application is very simple in terms of initializing the capture and display interfaces using dmai and starting an infinite loop swapping buffers between capture and display interfaces. Code attached below for reference:

int main(int argc, char *argv[])
{
  Buffer_Handle hCapBuf, hDisBuf;
  Display_Handle hDisplay;
  BufTab_Handle hDisplayBufTab;
  Capture_Handle hCapture;
  BufTab_Handle hCaptureBufTab;
  Capture_Attrs cAttrs;
  Display_Attrs dAttrs;
  BufferGfx_Attrs gfxAttrs;
  Int32 bufSize;

  Dmai_init();

  // create capture buffer table
  gfxAttrs = BufferGfx_Attrs_DEFAULT;
  gfxAttrs.colorSpace = ColorSpace_UYVY;
  BufferGfx_calcDimensions(VideoStd_D1_NTSC, ColorSpace_UYVY, &gfxAttrs.dim);
  bufSize = BufferGfx_calcSize(VideoStd_D1_NTSC, ColorSpace_UYVY);
  bufSize = (bufSize + 4096) & (~0xFFF);
  hCaptureBufTab = BufTab_create(Capture_Attrs_OMAP3530_DEFAULT.numBufs, bufSize, BufferGfx_getBufferAttrs(&gfxAttrs));
  if(hCaptureBufTab == 0)
  {
    printf("%s - BufTab_create failed\n", __FUNCTION__);
    return -1;
  }

  // create capture
  cAttrs = Capture_Attrs_OMAP3530_DEFAULT;
  cAttrs.videoInput = Capture_Input_COMPOSITE;
  cAttrs.videoStd = VideoStd_D1_NTSC;
  hCapture = Capture_create(hCaptureBufTab, &cAttrs);
  if(hCapture == 0)
  {
    printf("%s - Capture_create failed\n", __FUNCTION__);
    return -1;
  }

  // create display buffer table
  gfxAttrs = BufferGfx_Attrs_DEFAULT;
  gfxAttrs.colorSpace = ColorSpace_UYVY;
  BufferGfx_calcDimensions(VideoStd_D1_NTSC, ColorSpace_UYVY, &gfxAttrs.dim);
  bufSize = BufferGfx_calcSize(VideoStd_D1_NTSC, ColorSpace_UYVY);
  bufSize = (bufSize + 4096) & (~0xFFF);
  hDisplayBufTab = BufTab_create(Display_Attrs_O3530_VID_DEFAULT.numBufs, bufSize, BufferGfx_getBufferAttrs(&gfxAttrs));
  if(hDisplayBufTab == 0)
  {
    printf("%s - BufTab_create failed\n", __FUNCTION__);
    return -1;
  }

  // create display
  dAttrs = Display_Attrs_O3530_VID_DEFAULT;
  dAttrs.videoStd = VideoStd_D1_NTSC;
  dAttrs.videoOutput = Display_Output_COMPOSITE;
  hDisplay = Display_create(hDisplayBufTab, &dAttrs);
  if(hDisplay == 0)
  {
    printf("%s - failed to create display\n", __FUNCTION__);
    return -1;
  }

  while(true)
  {
    if(Capture_get(hCapture, &hCapBuf) < 0)
    {
      printf("%s - Capture_get failed\n", __FUNCTION__);
      continue;
    }
    if(Display_get(hDisplay, &hDisBuf) < 0)
    {
      printf("%s - Display_get failed\n", __FUNCTION__);
      continue;
    }
    Capture_put(hCapture, hDisBuf);
    Display_put(hDisplay, hCapBuf);
  }

  return 0;
}

Does it appear that I am I doing the setup and usage correctly in the code provided? If the setup and usage appears correct then is "jumpy" video expected behavior with composite ntsc loopback on dm3730 evm? Are there plans to address the "noise" identified in SDOCM00073286, and if not has the cause of the "noise" been identified so that we might address it in our own designs?

Thanks,
Greg

P.S. I had previously posted this question on the DM37x DaVinci Video Processor Forum, but I suspect it was the wrong forum for the question... Regardless, sorry for the cross-post.

  • Hi,

    Have you tried enabling TV out through bootargs, and not change any TV timings dynamically through SYSFS? I believe this should be working fine without any issues.

    If I remember correctly, the issue (SDOCM00073286) which you are referring to is not related to SW configuration; we have observed that if you dynamically switch the display output between LCD <=> TV (where it enables/disables VENC every time), the VENC goes out of sync leading to display output corruption. But your issue seems completely different to me, you are getting display but half and jumpy.

    Thanks,

    Vaibhav

  • I added these two arguments to the bootargs:

    omapfb.mode=tv:ntsc omapdss.def_disp=tv

    And it didn't appear to have any effect on the video. The test application still fails to show good loopback video about half the time when I start it.

    Are there any other bootargs that I should be setting? At this point I'm not sure if it is a capture or display issue, but I'll try to better isolate it next.

    Thanks,

    Greg

  • Yes, I think we should first identify whether problem is with display of capture driver. It should be pretty trivial to do this, just try to capture single frame to the standard file and view it through YUV player on host machine.

    I would suspect Capture driver here.

    Thanks,

    Vaibhav

  • Hi Vaibhav,

      I am trying to do the switching from lcd to TV out through "sysfs" entries on dm3730 evm, but fails with distorted display. With boorargs its working fine for TV.

    Please let me know if you have rectified the above VENC out of sync issue. Is it possible to do a dynamic switching between lcd and TV ?

    Thank you,

    Hareesh