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.

Linux/AM5728: How to flush VPE

Part Number: AM5728

Tool/software: Linux

Hi. i have developed that VPE use deinterace of Fast foward(8 times/rewind(-8 times)  for 1080i60 contents(H.264).

on the average, I frame(IDR) is used for trick speed.

but, I want to display smoothly Fast forward and Fast rewind. and then, IVA-HD decode IDR and non-iDR and we get yuv. this is displayed.

of course, s/w timer(STC) is running as 8(or -8) times,  fille synced s/w timer send to IVA-HD decoder. sometimes it run from IDR to next-IDR.

Fast forward is good. but, Fast rewind is not good. because suddenly broken picture is displayed.

i found VPE cause this problem.

i want VPE make flush previous picture when i feed next IDR frame to IVA-HD.

For VPE flush, when i use streamoff(v4l2), kernel(board-support\linux-4.9.28+gitAUTOINC+eed43d1050-geed43d1050\drivers\media\v4l2-core\videobuf2-core.c) have error.

at vb2_buffer_done, if (WARN_ON(vb->state != VB2_BUF_STATE_ACTIVE)) : this stack dump..

i want how to  flush VPE for deinterlace ?

Thanks a lot.

  • The software team have been notified. They will respond here.
  • Joohoo,

    the kernel message you are seeing is a warning that there are some buffer still in transit. Although it indicates a buffer management issue when dealing with interlaced frame it should not affect what you are trying to accomplish.

    So even when seeing this kernel warning the driver is still operational, is the follow on behavior what you expect?
    Or do you still see bad frame?

    Keep in mind that for VPE de-interlacer to work properly it requires at least 3 fields or frames for the Motion Vector to work properly. 

  • Hi.
    yes. this kernel message is warning. but, later vpe doesn't work properly.
    my action is following as below it.
    I send I Frame(IDR), B Frame(non-IDR), BFrame(non-IDR), P Frame(non-IDR), P Frame(non-IDR) decoded through IVA-HD send to VPE.
    when i get two or three deinterlace frame, i change streamoff(v4l2 api) for flushing VPE(don't reference previous field).
    I change streamon(v4l2 api) and send next Frame(IDR), B Frame(non-IDR), B Frame(non-IDR), P Frame(non-IDR), P Frame(non-IDR) decoded through IVA-HD send to VPE repeatly.
    this actions don't work because VPE is hanging.

    and, I want different solution.
    I send only I Frame(IDR) decoded(1080i60) through IVA-HD send to VPE. VPE need to deinterlace it. and then it need 3 fields.
    of course, VPE deinterlace not continuous I Frame(IDR). picture deinterlaced have a little afterimage.

    How do run fast forward/rewind throunh gstreamer for deinterlace ?
    I want to tell VPE this frame is not continuous I Frame(IDR/YUV) for deinterlace.
    Thanks a lot.
  • Hi JOONHO,

    For fast forward/rewind, just work with IDR fields, no need to decode P/B fields. VPE use spatial deinterlacing for first two fields and there is no dependency/need of multiple fields to deinterlace 1st field. You will need to streamoff the VPE after processing each IDR field. Let me know if you face any issue with this approach.

    Regards,

    Manisha

  • Hi. Manisha.


    Eahc IDR of 1080i60 contents have even field(1920x540) and odd field(1920x540).
    we want result of deinterlace(1920x1080) from VPE. and then we can't streamoff the VPE.

    i don't understand that "You will need to streamoff the VPE after processing each IDR field".

    In other words, It means that we send one IDR yuv field(even and odd) to VPE. but, we don't get deinterlace frame. For getting deinterlace frame, we must send next IDR yuv filld(even and odd). when does we streamoff VPE ?

    thanks a lot.
  • Can you send us a short sample of video with a list of which frame need to picked off for de-interlacing? We can try to deinterlace the video at our end and check the behavior.
  • Hi. manisha.

    I very thanks for you taking care about this problem.

    For fixing afterimage, I will try to send to VPE same IDR twice.

    1080i60 contents don't be published yet.

    If i have other problem for fast rewind, i will let you know.
    Thanks a lot.