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.

DM365 DMAI buffer problem with V4L2 and LCD

Hello,

I connected an 800x600 LCD to the DM365 EVM.

It works fine if I draw things to the OSD frame buffer (after fixing a DMAI bug).

Now I want to use v4l to show a single image.
My test program works fine if I use the COMPOSITE output, but if I use my LCD, I get a problem...


...
...
dAttrs = Display_Attrs_DM365_VID_DEFAULT;
dAttrs.videoStd     = VideoStd_800x600;
dAttrs.videoOutput  = Display_Output_DKSLCD;
dAttrs.colorSpace   = ColorSpace_UYVY;
dAttrs.numBufs      = NUM_DISPLAY_BUFS;
...
...
hDisplay = Display_create(hDisBufTab, &dAttrs); /* If hDisBufTab is NULL, I have the same problem */
...
...
status = Display_get(hDisplay, &hDispBuf);
...
Idec1_process(hIdec, hInBuf, hDispBuf);

status = Display_put(hDisplay, hDispBuf);


If I set NUM_DISPLAY_BUFS to 3 (or higher) my screen stays black.

If NUM_DISPLAY_BUFS is 2, the image (created by Idec1_process) appears after Idec1_process
and the screen becomes black after
Display_put.

I found no bug in the DMAI, so there seems to be a problem in the V4L2 part.

 

Any idea where I can find the bug?

 

Regards,

Sandro

  • Hi Sandro,

    It sounds like the device driver buffer management is not working correctly. If NUM_DISPLAY_BUFS > 1 you are supposed to get a buffer which is not currently being displayed when calling Display_get() which is using the VIDIOC_DQBUF ioctl. If you see the image immediately after the Idec1_process() call this means you have rendered in to the current display buffer. This buffer should not have been returned to you by the driver.

    When you use NUM_DISPLAY_BUFS=3, if you add some Display_get() Display_put() sequences after, does the driver eventually cycle to the buffer you rendered?

    Regards, Niclas

  • Hello Niclas,

    if the number of buffers = 2, my program hangs in the 2nd call of Display_get()

    If I have 3 buffers, the 2nd and the following calls of Display_put() work as expected (I can see my image).

     

    Regards,

    Sandro

  • Hi Sandro,

    It sounds indeed like the issue you have is in the v4l2 device driver buffer management.

    Regards, Niclas

  • hi, Niclas

    I have the same problem as you.

    I can draw any thing on the lcd, and use ti gstreamer to decode video stream output to TV works well, but it can not decode video output to Lcd.

    any suggestion to me?

    Best Regards

    Robert