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.

Occasionally missing frame in VPFE video capture

We are having a strange behavior in video capture (VPFE).  All the registers (CCDC and VPFE) are setup correctly, and the video stream runs well in most of time.  However, it will occasionally miss one frame.  Though interrupt is received, the received image is empty.  The buffer address was set correctly when we read back and check the SDR_ADDR register.  In ISR, no other register has been changed.  

We checked VPSS PCR register (the error identification register), and it is clean, no buffer overflow or underflow.  We also checked the previously captured buffer, and the new image was not written there either.

If you have any idea about what could be the potential problem, it will be highly appreciated.

Alan

  • Alan,

    This issue sounds very interesting; from a hardware point of view, it seems like you are checking all the right places (e.g. memory buffer address, PCR rgister)... Thos leads me to think this may be an error in the software application logic; as far as video buffers are concerned, the capture and display drivers just use the buffers the application passes to them.  Therefore, there may be a race condition in where the app does not pass the capture driver the next buffer in a timely manner, thereby the capture driver simply re-uses current buffer; in a system with say tripple buffering, this could lead data to be written to same buffer twice while skipping write to one of the other buffers.  Meanwhile, the display driver will simply keep displaying all buffer sequentally leading to a buffer which is incorrect (e.g. blank).  This is just one idea.

  • Just to confirm; you could actaully print a debug info in the ISr in the format as : Buffer Address, State(Queued/Active/DQueud), and probably the data at the start of buffer, data at the miiddle and end of buffer. basically the printks would come later, so you would know excatly if your framer has been over-written. You could then derive if your QBUF/DQBUF timing scehdule is affecting the input or is this some really weird data from the HW itslef.

    Thanx!

  • if the printk are in the video capture ISR, that would prove that valid data is being written to buffers; however, I would also check to ensure ISR is being re-entered (a new interrupt occurs before the previous ISR call finishes processing).

  • Also, if your device supports a diagnostic test bit to output a specific pattern, instead of capturing run-time video, you can verify some specific buffer contents at evry frame to derive if there is something wrong with the SW that is messing it up!

  • Hi,

    Sorry late to reply.  My account was unable to login for sometime, and I was kept busy in projects. Here I am, and want to say "thank you very much".

    The problem remains.  I checked all your suggestions and did not find any issue: no buffer overwrite, no ISR re-entry, etc. 

    I check further and keep you updated.

    Thanks.

    Alan