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.

dm642 video capture problem

hi,

i am using the VPort to capture HD-SDI signal  in real time, i know that 3 frame buffers are used to store the data moved from VPort FIFO by EDMA. The application use the FVID API to grab a buffer from driver to process, in my case, using qdma transmit the frame data to FPGA. The problem is sometime the transmitting operation is slower than the capture operation, and the last frame data in the buffer may be overwritten by a new frame data.

Is it possible to monitor the status of frame buffers and know when this situation happen ??

Thank you!

mchen

  • I don't know of any APIs that allow you to monitor the status of the frame buffers, but I think the fundamental issue is that your system is not keeping up with the amount of data coming in and out. One possibility is to measure the length of time each of the frame buffers is "checked out." If you notice that a frame takes longer to process than is allotted that may be your warning indicator that the overflow is about to occur.

    Shifting over to the fix it side of things does this problem go away if you add another frame buffer to your system? You say this only sometimes happens, but is it guaranteed to occur more frequently over time (for example, every buffer takes a small amount of time more than what is allowed meaning you will always eventually run out of frame buffers regardless of number)? Can you speed up your algorithm or reduce the complexity just enough so that every buffer is ready in time?

  • TimHarron said:

    I don't know of any APIs that allow you to monitor the status of the frame buffers, but I think the fundamental issue is that your system is not keeping up with the amount of data coming in and out. One possibility is to measure the length of time each of the frame buffers is "checked out." If you notice that a frame takes longer to process than is allotted that may be your warning indicator that the overflow is about to occur.

    Shifting over to the fix it side of things does this problem go away if you add another frame buffer to your system? You say this only sometimes happens, but is it guaranteed to occur more frequently over time (for example, every buffer takes a small amount of time more than what is allowed meaning you will always eventually run out of frame buffers regardless of number)? Can you speed up your algorithm or reduce the complexity just enough so that every buffer is ready in time?

    Tim, thank you for your suggestions.

    Maybe i should use a timer to measure the length of time taken by the transmitting operation and see if it is longer than 1/24 second (my incoming video stream is 24fps).

    Another question is that my captured frame is always shifting down continuously, do you know what is the reason of this problem? it seems that the data stored in the frame buffer is not a whole frame but a combination of two successive frames,  is there anything wrong with the EDMA transfering process??

    Thank you very much!

  • MiaoChen said:

    Another question is that my captured frame is always shifting down continuously, do you know what is the reason of this problem? it seems that the data stored in the frame buffer is not a whole frame but a combination of two successive frames,  is there anything wrong with the EDMA transfering process??

    It sounds like your video port parameters are incorrect if your image is shifting down.  I recommend trying to take things a step at a time to make sure your video port parameters are correct:

    • Focus on just display, i.e. don't do any capture or frame copies
    • Either download an image to memory or else generate some kind of recognizable pattern.
    • Setup an EDMA transfer to repeatedly transfer that test image out the video port.  Preferably this should be the only EDMA activity in the system.
    • Make sure that your video port parameters result in an image that is synced both horizontally and vertically.

    Once you've performed the above steps then you can be sure that the video port parameters themselves are correct.  That way when other issues arise you can concentrate on the system level issues such as EDMA event queeu prioritization.

    Brad

  • Hi MiaoChen,

    just as another input...: I read raw data from a videoPort using EDMA. The EDMA transfer is setup to transport one full frame. The 'VideoPortFifo full' triggers the copy of one more line (without any interaction of the DSP). I can get the status of the transfer (the 'percentage of the already copied frame') using EDMA_getConfig(). since the EDMA config structure is updated during such transfers it contains for example the current destination adress of the next line.

    best regards,

    Thomas