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.

DM816x Dvr DRK Playback application implement Problem

Other Parts Discussed in Thread: TVP5158

Hi, We make a playback program using mcfw api on DM816x RDK(TI TVP5158 multi-channel video decoder)

 

And now we make test code from a part of mcfw demo code [VDEC + VDIS]

Our test code flow is Follow

 

  1. Initialize Mcfw
    1. Set Vsys to systemUseCase = VSYS_USECASE_MULTICHN_VDEC_VDIS
    2. Set Vdec to maxWid = 1920, maxheight=1080, displayDelay=0, numBufPerCh=0, codec=H264
    3. Set Vdis and swMosaic properly
  2. Work Process
    1.  Get one frame (always first frame is iFrame) and request Buffer(vdec_requestBitStreamBuffer())
    2. Memcpy from frame Buffer to pEmptyBuf->bufVirtAddr(requested buffer from decoder)
    3. Send buffer to decoder(vdec_putBitstreamBuffer())
    4. Sleep(XX ms)
    5. Repeat a~d

 

When we test above code at first without sleep function, we get error message follow..

[m3video] 2629060:DECLINK::links_m3video/iva_dec/decLink_h264.c:[376]::INTERNAL ERROR:-1

 [m3video] ALGPROCESS FAILED:STATUS

 [m3video] outArgs->viddec3OutArgs.extendedError for channel 0 Error: 0x2000a00

 

*Error number is not only 0x2000a00 but also 0x1021, 0x1209.

 

And we add sleep(27 millisecond) function after c (above process entry), error message disappear.. But if we input to sleep function parameter that is 26ms and less, error msg appear again.

So we think that it happened putting frame data or requesting buffer was too fast to handle for decoder.

And we didn’t think frame data was corrupted. Because it work well when add sleep after put BitstreamBuffer process.

 

Question

  1. So we really want to know that what is the cause of error message?
  2. Is it that we call api (request buffer, put buffer) or copy memory to bufVirtAddr middle of internal processing decoding?
  3. If it is right, how we know whether it’s ok call vdec api or not?

 

Last Question

l  Vdec_requestBitStreamBuffer() , vdec_putBitstreamBuffer() work lick nonblocking function as I know. They always return 0. So return value is useless. How check this function is success?

 

Thanks

I’ll hope reply

  • The problem looks to be because application is not really checking if buffer is avalialble from decoder and just contiuously writing. On returning from Vdec_requestBitstreamBuffer you should check the bufList.numBufs is a non-zero value and only then use the buffer. I would recommend you mgrate to DVR RDK 4.0 where a ring buffer is used for bitstream allowing application to queue more frames to the decoder for decoding