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.

DM8168 decoding 30fps fail

I tried to 8 channel display in networking multithread-environment(1 channel = 1 thread). The codec is H264.

I used Vdec_requestBitStreamBuffer(VDEC_BUF_REQUEST_S * bufReq, VCODEC_BITSBUF_LIST_S *pBitsBufList, UInt32 timeout) function to get buffer. Each thread called Vdec_requestBitStreamBuffer() function as 30fps. I used DVRRDK_V03.00.00.00.

I assigned struct 'bufReq' to this.
bufReq->numBufs = 1
bufReq->reqType = VDEC_BUFREQTYPE_CHID;
bufReq->u[0].chNum = channelNumber;

I tried to displaying 30fps per channel, but decoder buffer getting has failed frequently. Image resolution is 352x288. I thinked when pBitsBufList->numBufs's value has 0, buffer getting is failed.
When the value is 0, if decoder is tried to decoding P frame, decoded P frame is broken until next I frame has coming.

I want to know variable VDEC_BUF_REQUEST_S::numBufs's role. According to DVR RDK API Guide, it's role is 'Number of empty buffers needed from decode framework'. Does it means "How many have decoding channel at once? " or "How many have buffer per channel?"

And, I hope to know how to displaying 30fps per channel with no buffer getting fail.

Thank you.

  • pBitsBufList->numBufs = 0 indicates that decoder input buffer is not available (buffers are queued and not yet consumed by decoder). In that case, Vdec_putBitstreamBuffer() should not be invoked. App should call Vdec_requestBitStreamBuffer() again on timeout basis.

    VDEC_BUF_REQUEST_S::numBufs - indicates how many buffers application wants to get from decode input buffers queue. Requested numBufs will be returned if available. More than 1 buffer can be requested, but app should ensure to check that numBufs can be returned 0 if decoder has still not consumed the previously queued input frames.

  • Thank you for replying.

    In your reply, VDEC_BUF_REQUEST_S::numBufs indicates how many buffers request from decode input buffers queue. I want to know the queue is shared for all channel. For example, when I created 8 channels, one queue is created and 8 queue element are created in one queue, or eight queues are created and each channel has queue. 

    In additional, I know Vdec_init() functions uses VDEC_PARAMS_S *pContext parameter and struct VDEC_PARAMS_S, has struct variable VDEC_CHN_PARAMS_S. In VDEC_CHN_PARAMS_S, does variable numBufPerCh indicates how many queue element creates per channel?

    Thanks for reading. 

     

  • IPC Bits out buffers (Dec input buffers) can be created in 2 ways.

    IPC Bits Out Create params : bufPoolPerCh - if set to TRUE indicates that each channel has its own set of buffers.

    Vdec_create() sets this flag, so each channel has its own set of buffers (and not shared). Num of buffers of each channel can be specified (numBufPerCh). If numBufPerCh is set to 0, it uses a default value of IPC_BITS_OUT_LINK_MAX_OUT_FRAMES_PER_CH.

    So, you have fixed num. of buffers for each channel now.

    VDEC_CHN_PARAMS_S.numBufPerCh indicates the output buffers of decoder.

  • I found why decoding 30fps is failed frequently(interval in seconds). Before, I assigned VDEC_VDIS_FRAME_DURATION_MS value to 33 and put Vdis_setFistVidPTS() function so buffer getting has failed.  

    I newly assigned VDEC_VDIS_FRAME_DURATION_MS value to 3 (because frame is received from network about 33ms per 1 frame) and called Vdis_setFistVidPTS() function. The number of buffer getting failure is reduced, but has occured interval in minutes. 

    I'm setting numBufPerch 0. I know a default value of IPC_BITS_OUT_LINK_MAX_OUT_FRAMES_PER_CH is 6, so each channel has 6 buffers. I think if each channel has 6 buffers, decoding in 30fps is not difficult and CPU idle is 3-5%. 

    What do I need? How can I decoding with no buffer getting failure? 

  • Try disabling Avsync

    /dvr_rdk/mcfw/src_linux/mcfw_api/usecases/ti81xx/multich_vdec_vdis.c

    mulich_vdec_vdis_set_avsync_vidque_prm

    queCfg->avsyncEnable = FALSE;

    Migrate to DVR RDK 4.1 where the ipcBitsOutLink use RingBuffer which will enable larger buffering.

  • I tried avsync disabled.

    But, buffer get failure is occured still.

    I append results for Vsys_printDetailedStatistics() function.

    I'm appreciate if teaching me what I did wrong.

    Thanks for reading.

    5001.log.txt
     [m3vpss ]
     [m3vpss ]  *** [SWMS0] Mosaic Statistics ***
     [m3vpss ]
     [m3vpss ]  Elasped Time: 606 secs
     [m3vpss ]
     [m3vpss ]  Output Request FPS   : 33 fps (20586 frames)
     [m3vpss ]  Output Actual  FPS   : 33 fps (20586 frames)
     [m3vpss ]  Output Drop    FPS   : 0 fps (0 frames)
     [m3vpss ]  Output Reject  FPS   : 0 fps (0 frames)
     [m3vpss ]  Scaling Internal     : 29 ms
     [m3vpss ]  Scaling Internal min : 4 ms
     [m3vpss ]  Scaling Internal max : 200 ms
     [m3vpss ]
     [m3vpss ]  Win | Window Repeat Drop Recv Que  FID Invlid Acc Event          Invalid   Que Reject Reject Latency
     [m3vpss ]  Num | FPS    FPS    FPS  FPS  FPS  FPS        Count (Max/Min)    CH Frames Frames     Frames Min / Max
     [m3vpss ]  ------------------------------------------------------------------------------------------------------
     [m3vpss ]    0 |     33      5    0    0   28          0        0 (  0/255)         0          0      0 255 / 356514359
     [m3vpss ]    1 |     33      5    0    0   28          0        0 (  0/255)         0          0      0 255 / -2059404747
     [m3vpss ]    2 |     33      5    0    0   28          0        0 (  0/255)         0          0      0 255 / 89127566
     [m3vpss ]    3 |     33      5    0    0   28          0        0 (  0/255)         0          0      0 255 / -2059404776
     [m3vpss ]    4 |     33      0    0    0   33          0        0 (  0/255)         0          0      0 255 / 356514475
     [m3vpss ]    5 |     33      0    0    0   33          0        0 (  0/255)         0          0      0 255 / 1296038453
     [m3vpss ]    6 |     33      0    0    0   33          0        0 (  0/255)         0          0      0 255 / 88079118
     [m3vpss ]    7 |     33      0    0    0   33          0        0 (  0/255)         0          0      0 255 / 155187795
     [m3vpss ]
     [m3vpss ]
     [m3vpss ]  *** [SWMS0] Mosaic Parameters ***
     [m3vpss ]
     [m3vpss ]  Output FPS: 29
     [m3vpss ]
     [m3vpss ]  Win | Ch  | Input      | Input          | Input         | Input       | Output     |  Output         | Output        | Output      | Low Cost | SWMS | Data  | Blank |
     [m3vpss ]  Num | Num | Start X, Y | Width x Height | Pitch Y / C   | Memory Type | Start X, Y |  Width x Height | Pitch Y / C   | Memory Type | ON / OFF | Inst | Format| Frame |
     [m3vpss ]  ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
     [m3vpss ]    0 |   0 |    0,    0 |   160 x     96 |  2048 /  2048 | NON-TILED   |  576,   63 |   448 x    322 |  3840 /      0 | NON-TILED   |      OFF |    0 |  420SP |   OFF |
     [m3vpss ]    1 |   1 |    0,    0 |   160 x     96 |  2048 /  2048 | NON-TILED   | 1024,   63 |   448 x    322 |  3840 /      0 | NON-TILED   |      OFF |    0 |  420SP |   OFF |
     [m3vpss ]    2 |   2 |    0,    0 |   352 x    240 |  2048 /  2048 | NON-TILED   | 1472,   63 |   448 x    322 |  3840 /      0 | NON-TILED   |      OFF |    0 |  420SP |   OFF |
     [m3vpss ]    3 |   3 |    0,    0 |   352 x    240 |  2048 /  2048 | NON-TILED   |  576,  400 |   448 x    322 |  3840 /      0 | NON-TILED   |      OFF |    0 |  420SP |   OFF |
     [m3vpss ]    4 |   4 |    0,    0 |   352 x    240 |  2048 /  2048 | NON-TILED   | 1024,  400 |   448 x    322 |  3840 /      0 | NON-TILED   |      OFF |    0 |  420SP |   OFF |
     [m3vpss ]    5 |   5 |    0,    0 |   352 x    240 |  2048 /  2048 | NON-TILED   | 1472,  400 |   448 x    322 |  3840 /      0 | NON-TILED   |      OFF |    0 |  420SP |   OFF |
     [m3vpss ]    6 |   6 |    0,    0 |   320 x    176 |  2048 /  2048 | NON-TILED   |  576,  737 |   448 x    322 |  3840 /      0 | NON-TILED   |      OFF |    0 |  420SP |   OFF |
     [m3vpss ]    7 |   7 |    0,    0 |   320 x    176 |  2048 /  2048 | NON-TILED   | 1024,  737 |   448 x    322 |  3840 /      0 | NON-TILED   |      OFF |    0 |  420SP |   OFF |
     [m3vpss ]
     [m3vpss ]
     [m3vpss ]
     [m3vpss ]  *** [SWMS1] Mosaic Statistics ***
     [m3vpss ]
     [m3vpss ]  Elasped Time: 608 secs
     [m3vpss ]
     [m3vpss ]  Output Request FPS   : 33 fps (20664 frames)
     [m3vpss ]  Output Actual  FPS   : 33 fps (20664 frames)
     [m3vpss ]  Output Drop    FPS   : 0 fps (0 frames)
     [m3vpss ]  Output Reject  FPS   : 0 fps (0 frames)
     [m3vpss ]  Scaling Internal     : 29 ms
     [m3vpss ]  Scaling Internal min : 4 ms
     [m3vpss ]  Scaling Internal max : 190 ms
     [m3vpss ]
     [m3vpss ]  Win | Window Repeat Drop Recv Que  FID Invlid Acc Event          Invalid   Que Reject Reject Latency
     [m3vpss ]  Num | FPS    FPS    FPS  FPS  FPS  FPS        Count (Max/Min)    CH Frames Frames     Frames Min / Max
     [m3vpss ]  ------------------------------------------------------------------------------------------------------
     [m3vpss ]    0 |     33      5    0    0   28          0        0 (  0/255)         0          0      0 255 / 356514351
     [m3vpss ]
     [m3vpss ]
     [m3vpss ]  *** [SWMS1] Mosaic Parameters ***
     [m3vpss ]
     [m3vpss ]  Output FPS: 30
     [m3vpss ]
     [m3vpss ]  Win | Ch  | Input      | Input          | Input         | Input       | Output     |  Output         | Output        | Output      | Low Cost | SWMS | Data  | Blank |
     [m3vpss ]  Num | Num | Start X, Y | Width x Height | Pitch Y / C   | Memory Type | Start X, Y |  Width x Height | Pitch Y / C   | Memory Type | ON / OFF | Inst | Format| Frame |
     [m3vpss ]  ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
     [m3vpss ]    0 |   0 |    0,    0 |   160 x     96 |  2048 /  2048 | NON-TILED   |    0,    0 |  1920 x   1080 |  3840 /      0 | NON-TILED   |      OFF |    0 |  420SP |   OFF |
     [m3vpss ]
     [m3vpss ]
     [m3vpss ]  88079053: DISPLAY: HDDAC(BP0) : 68 fps, Latency (Min / Max) = ( 4 / 182 ), Callback Interval (Min / Max) = ( 14 / 15 ) !!!
     [m3vpss ]  88079053: DISPLAY: UNDERFLOW COUNT: HDMI(BP0) 41312, HDDAC(BP0) 41310, DVO2(BP1) 41310, SDDAC(SEC1) 41402
     [m3vpss ]  88079054: SYSTEM  : FREE SPACE : System Heap      = 5792 B, Mbx = 10237 msgs)
     [m3vpss ]  88079054: SYSTEM  : FREE SPACE : SR0 Heap         = 10993792 B (10 MB)
     [m3vpss ]  88079054: SYSTEM  : FREE SPACE : Frame Buffer     = 2944 B (0 MB)
     [m3vpss ]  88079054: SYSTEM  : FREE SPACE : Bitstream Buffer = 19038080 B (18 MB)
     [m3vpss ]  88079054: SYSTEM  : FREE SPACE : Tiler Buffer     = 18 B (0 MB)  - TILER OFF
     [m3vpss ]  88079055: DISPLAY: DVO2(BP1)  : 68 fps, Latency (Min / Max) = ( 1 / 179 ), Callback Interval (Min / Max) = ( 14 / 15 ) !!!
     [m3video]      88082582: HDVICP-ID:0
     [m3video] All percentage figures are based off totalElapsedTime
     [m3video]               totalAcquire2wait :0 %
     [m3video]               totalWait2Isr :4 %
     [m3video]               totalIsr2Done :0 %
     [m3video]               totalWait2Done :4 %
     [m3video]               totalDone2Release :0 %
     [m3video]               totalAcquire2Release :6 %
     [m3video]               totalAcq2acqDelay :93 %
     [m3video]               totalElapsedTime in msec :  611217
     [m3video]               numAccessCnt:  665820
     [m3video]              IVA-FPS :    1089
     [m3video]              Average time spent per frame in microsec:      36
     [m3video]      88082583: HDVICP-ID:1
     [m3video] All percentage figures are based off totalElapsedTime
     [m3video]               totalAcquire2wait :0 %
     [m3video]               totalWait2Isr :4 %
     [m3video]               totalIsr2Done :0 %
     [m3video]               totalWait2Done :4 %
     [m3video]               totalDone2Release :0 %
     [m3video]               totalAcquire2Release :7 %
     [m3video]               totalAcq2acqDelay :92 %
     [m3video]               totalElapsedTime in msec :  611249
     [m3video]               numAccessCnt:  707784
     [m3video]              IVA-FPS :    1158
     [m3video]              Average time spent per frame in microsec:      34
     [m3video]      88082584: HDVICP-ID:2
     [m3video] All percentage figures are based off totalElapsedTime
     [m3video]               totalAcquire2wait :0 %
     [m3video]               totalWait2Isr :6 %
     [m3video]               totalIsr2Done :0 %
     [m3video]               totalWait2Done :6 %
     [m3video]               totalDone2Release :0 %
     [m3video]               totalAcquire2Release :6 %
     [m3video]               totalAcq2acqDelay :93 %
     [m3video]               totalElapsedTime in msec :  611122
     [m3video]               numAccessCnt:  455160
     [m3video]              IVA-FPS :     744
     [m3video]              Average time spent per frame in microsec:      80
     [m3video]
     [m3video]  *** DECODE Statistics ***
     [m3video]
     [m3video]  Elasped Time           : 609 secs
     [m3video]
     [m3video]
     [m3video]  CH  | In Recv In User  Out
     [m3video]  Num | FPS     Skip FPS FPS
     [m3video]  -----------------------------------
     [m3video]    0 |      28        0  28
     [m3video]    1 |      28        0  28
     [m3video]    2 |      28        0  28
     [m3video]    3 |      28        0  28
     [m3video]    4 |      33        0  33
     [m3video]    5 |      33        0  33
     [m3video]    6 |      33        0  33
     [m3video]    7 |      33        0  33
     [m3video]    8 |       0        0   0
     [m3video]    9 |       0        0   0
     [m3video]   10 |       0        0   0
     [m3video]   11 |       0        0   0
     [m3video]   12 |       0        0   0
     [m3video]   13 |       0        0   0
     [m3video]   14 |       0        0   0
     [m3video]   15 |       0        0   0
     [m3video]
     [m3video] Multi Channel Decode Average Submit Batch Size
     [m3video] Max Submit Batch Size : 24
     [m3video] IVAHD_0 Average Batch Size : 1
     [m3video] IVAHD_0 Max achieved Batch Size : 1
     [m3video] IVAHD_1 Average Batch Size : 1
     [m3video] IVAHD_1 Max achieved Batch Size : 1
     [m3video] IVAHD_2 Average Batch Size : 1
     [m3video] IVAHD_2 Max achieved Batch Size : 1
     [m3video]
     [m3video] Multi Channel Decode Batch break Stats
     [m3video] Total Number of Batches created: 55421
     [m3video] All numbers are based off total number of Batches created
     [m3video]       Batch breaks due to batch sizeexceeding limit: 100 %
     [m3video]       Batch breaks due to ReqObj Que being empty: 0 %
     [m3video]       Batch breaks due to changed resolution class: 0 %
     [m3video]       Batch breaks due to interlace and progressivecontent mix: 0 %
     [m3video]       Batch breaks due to channel repeat: 0 %
     [m3video]       Batch breaks due to different codec: 0 %
     [m3video] Total Number of Batches created: 58909
     [m3video] All numbers are based off total number of Batches created
     [m3video]       Batch breaks due to batch sizeexceeding limit: 100 %
     [m3video]       Batch breaks due to ReqObj Que being empty: 0 %
     [m3video]       Batch breaks due to changed resolution class: 0 %
     [m3video]       Batch breaks due to interlace and progressivecontent mix: 0 %
     [m3video]       Batch breaks due to channel repeat: 0 %
     [m3video]       Batch breaks due to different codec: 0 %
     [m3video] Total Number of Batches created: 37900
     [m3video] All numbers are based off total number of Batches created
     [m3video]       Batch breaks due to batch sizeexceeding limit: 100 %
     [m3video]       Batch breaks due to ReqObj Que being empty: 0 %
     [m3video]       Batch breaks due to changed resolution class: 0 %
     [m3video]       Batch breaks due to interlace and progressivecontent mix: 0 %
     [m3video]       Batch breaks due to channel repeat: 0 %
     [m3video]       Batch breaks due to different codec: 0 %
     [m3video]
     [m3vpss ]
     [m3vpss ]  *** [MP_SCLR0 ] Statistics ***
     [m3vpss ]
     [m3vpss ]  Total Frames Received  : 152842
     [m3vpss ]  Total Frames Forwarded : 152842
     [m3vpss ]
     [m3vpss ]
     [m3vpss ]  CH  | In Recv In Reject Processed  Latency(DRV) Processed  Rejected
     [m3vpss ]  Num | FPS     FPS       FPS        Min / Max    Frames     Frames
     [m3vpss ]  -------------------------------------------------------------------
     [m3vpss ]
     [m3vpss ]  88084352: LOAD: CPU: 7.9% HWI: 1.9%, SWI:1.0%
     [m3vpss ]
     [m3vpss ]  88084352: LOAD: TSK: IPC_IN_M30          : 0.4%
     [m3vpss ]  88084352: LOAD: TSK: DISPLAY0            : 0.3%
     [m3vpss ]  88084352: LOAD: TSK: DISPLAY1            : 0.3%
     [m3vpss ]  88084352: LOAD: TSK: DUP0                : 0.3%
     [m3vpss ]  88084352: LOAD: TSK: SWMS0               : 1.6%
     [m3vpss ]  88084353: LOAD: TSK: SWMS1               : 0.9%
     [m3vpss ]  88084353: LOAD: TSK: MP_SCLR_FWD_Q0      : 0.2%
     [m3vpss ]  88084353: LOAD: TSK: MISC                : 1.0%
     [m3vpss ]
     [m3video]
     [m3video]  88084795: LOAD: CPU: 10.0% HWI: 0.7%, SWI:0.8%
     [m3video]
     [m3video]  88084795: LOAD: TSK: IPC_OUT_M30         : 0.9%
     [m3video]  88084795: LOAD: TSK: IPC_BITS_IN0        : 0.3%
     [m3video]  88084795: LOAD: TSK: DEC0                : 2.0%
     [m3video]  88084795: LOAD: TSK: DEC_PROCESS_TSK_0   : 1.8%
     [m3video]  88084795: LOAD: TSK: DEC_PROCESS_TSK_1   : 1.9%
     [m3video]  88084795: LOAD: TSK: DEC_PROCESS_TSK_2   : 1.2%
     [m3video]  88084795: LOAD: TSK: MISC                : 0.4%
     [m3video]
     [c6xdsp ]
     [c6xdsp ]  2318661: LOAD: CPU: 0.1% HWI: 0.0%, SWI:0.0%
     [c6xdsp ]
     [c6xdsp ]  2318661: LOAD: TSK: MISC                : 0.1%
     [c6xdsp ]

     

  • The log doesn't show any issue. The QCIF channel is being fed at 28 fps and the CIF channel is being fed at 33 fps. Check as to why the QCIF channel is being fed at lower fps. If Vdec_requestBufs returns zero bufs you should sleep and retry in your application until you get free buffer.

  • in source code 

    #define VDEC_VDIS_FRAME_DURATION_MS (33)

    what's this  VDEC_VDIS_FRAME_DURATION_MS   meaning ? and   33 means  what?

  • Say in the case if 30 FPS(Frames Per 1 Second), the time taken to Display one frame is 1/30 = 33ms.  The mcro looks to be the setting of the decoder, which is given to a display(just a guess), since I don't have the source code.