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 DECODE problem

Hi

I'am using DM8168 and RDK3.5. I am having a trouble with DM8168 decoder

I am using Live555 to recive H264 streams and decode by VDEC and display by VDIS. I found that the decode speed is low.

At begining The delay on the screen is increase with the time. After  ten second i receive a lot of 0 buffer when I request buffer fom VCEC.

the framerate is 30 and GOP is 30 too.

The code is as fellow

   emptyBufList.numBufs = 0;
   reqInfo.numBufs = 1;
   reqInfo.reqType = VDEC_BUFREQTYPE_BUFSIZE;
   for (j = 0; j < VCODEC_BITSBUF_MAX; j++)    
   {
    reqInfo.u[j].minBufSize = bitBufSize;
   }
   while(Vdec_requestBitstreamBuffer(&reqInfo, &emptyBufList, 0) == OSA_EFAIL || emptyBufList.numBufs == 0)
   {
    usleep(5*1000);
   }

 

Do any one know where is my problem . Thank you

  • Hi,


    After Vdec_requestBitstreamBuffer(), did you call function Vdec_putBitstreamBuffer(&emptyBufList) to return the used buffer back into Vdec block?

  • YES i called Vdec_putBitstreamBuffer and there are picture on the screen. but too much of delay and the quality is not good.

    I think decode took too much of time so that i can not request empty buffer. Am i right?

    The fellow are the print ofVsys_printDetailedStatistics


     [m3vpss ] 
     [m3vpss ]  *** [SWMS0] Mosaic Statistics ***
     [m3vpss ] 
     [m3vpss ]  Elasped Time: 11 secs
     [m3vpss ] 
     [m3vpss ]  Output Request FPS   : 31 fps (346 frames)
     [m3vpss ]  Output Actual  FPS   : 31 fps (346 frames)
     [m3vpss ]  Output Drop    FPS   : 0 fps (0 frames)
     [m3vpss ]  Output Reject  FPS   : 0 fps (0 frames)
     [m3vpss ]  Scaling Internal     : 33 ms
     [m3vpss ]  Scaling Internal min : 33 ms
     [m3vpss ]  Scaling Internal max : 34 ms
     [m3vpss ] 
     [m3vpss ]  Win | Window Repeat Drop Recv Que  FID Invlid Acc Event          Invalid   Que Reject Reject Latency   OutBufCopy InBufCopy
     [m3vpss ]  Num | FPS    FPS    FPS  FPS  FPS  FPS        Count (Max/Min)    CH Frames Frames     Frames Min / Max FPS        FPS     
     [m3vpss ]  ---------------------------------------------------------------------------------------------------------------------------
     [m3vpss ]    0 |     31      0    0    0   30          0        0 (  0/255)         0          0      0 65535 / -52846145          0         0
     [m3vpss ]    1 |      0     31    0    0    0          0        0 (  0/255)         0          0      0 65535 /   0         31         0
     [m3vpss ]    2 |      0     31    0    0    0          0        0 (  0/255)         0          0      0 65535 /   0         31         0
     [m3vpss ]    3 |      0     31    0    0    0          0        0 (  0/255)         0          0      0 65535 /   0         31         0
     [m3vpss ]    4 |      0     31    0    0    0          0        0 (  0/255)         0          0      0 65535 /   0         31         0
     [m3vpss ]    5 |      0     31    0    0    0          0        0 (  0/255)         0          0      0 65535 /   0         31         0
     [m3vpss ]    6 |      0     31    0    0    0          0        0 (  0/255)         0          0      0 65535 /   0         31         0
     [m3vpss ]    7 |      0     31    0    0    0          0        0 (  0/255)         0          0      0 65535 /   0         31         0
     [m3vpss ]    8 |      0     31    0    0    0          0        0 (  0/255)         0          0      0 65535 /   0         31         0
     [m3vpss ]    9 |      0     31    0    0    0          0        0 (  0/255)         0          0      0 65535 /   0         31         0
     [m3vpss ]   10 |      0     31    0    0    0          0        0 (  0/255)         0          0      0 65535 /   0         31         0
     [m3vpss ]   11 |      0     31    0    0    0          0        0 (  0/255)         0          0      0 65535 /   0         31         0
     [m3vpss ]   12 |      0     31    0    0    0          0        0 (  0/255)         0          0      0 65535 /   0         31         0
     [m3vpss ]   13 |      0     31    0    0    0          0        0 (  0/255)         0          0      0 65535 /   0         31         0
     [m3vpss ]   14 |      0     31    0    0    0          0        0 (  0/255)         0          0      0 65535 /   0         31         0
     [m3vpss ]   15 |      0     31    0    0    0          0        0 (  0/255)         0          0      0 65535 /   0         31         0
     [m3vpss ] 
     [m3vpss ] 
     [m3vpss ]  *** [SWMS0] 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 |  1280 x    360 |  4096 /  4096 | NON-TILED   |  136,   37 |   280 x    246 |  3840 /      0 | NON-TILED   |       ON |    0 |  420SP |   OFF |
     [m3vpss ]    1 |   1 |    0,    0 |  1920 x    540 |  4096 /  4096 | NON-TILED   |  416,   37 |   280 x    246 |  3840 /      0 | NON-TILED   |       ON |    0 |  420SP |    ON |
     [m3vpss ]    2 |   2 |    0,    0 |  1920 x    540 |  4096 /  4096 | NON-TILED   |  696,   37 |   280 x    246 |  3840 /      0 | NON-TILED   |       ON |    0 |  420SP |    ON |
     [m3vpss ]    3 |   3 |    0,    0 |  1920 x    540 |  4096 /  4096 | NON-TILED   |  976,   37 |   280 x    246 |  3840 /      0 | NON-TILED   |       ON |    0 |  420SP |    ON |
     [m3vpss ]    4 |   4 |    0,    0 |  1920 x    540 |  4096 /  4096 | NON-TILED   |  136,  283 |   280 x    246 |  3840 /      0 | NON-TILED   |       ON |    1 |  420SP |    ON |
     [m3vpss ]    5 |   5 |    0,    0 |  1920 x    540 |  4096 /  4096 | NON-TILED   |  416,  283 |   280 x    246 |  3840 /      0 | NON-TILED   |       ON |    1 |  420SP |    ON |
     [m3vpss ]    6 |   6 |    0,    0 |  1920 x    540 |  4096 /  4096 | NON-TILED   |  696,  283 |   280 x    246 |  3840 /      0 | NON-TILED   |       ON |    1 |  420SP |    ON |
     [m3vpss ]    7 |   7 |    0,    0 |  1920 x    540 |  4096 /  4096 | NON-TILED   |  976,  283 |   280 x    246 |  3840 /      0 | NON-TILED   |       ON |    1 |  420SP |    ON |
     [m3vpss ]    8 |   8 |    0,    0 |  1920 x    540 |  4096 /  4096 | NON-TILED   |  136,  529 |   280 x    246 |  3840 /      0 | NON-TILED   |       ON |    1 |  420SP |    ON |
     [m3vpss ]    9 |   9 |    0,    0 |  1920 x    540 |  4096 /  4096 | NON-TILED   |  416,  529 |   280 x    246 |  3840 /      0 | NON-TILED   |       ON |    1 |  420SP |    ON |
     [m3vpss ]   10 |  10 |    0,    0 |  1920 x    540 |  4096 /  4096 | NON-TILED   |  696,  529 |   280 x    246 |  3840 /      0 | NON-TILED   |       ON |    1 |  420SP |    ON |
     [m3vpss ]   11 |  11 |    0,    0 |  1920 x    540 |  4096 /  4096 | NON-TILED   |  976,  529 |   280 x    246 |  3840 /      0 | NON-TILED   |       ON |    1 |  420SP |    ON |
     [m3vpss ]   12 |  12 |    0,    0 |  1920 x    540 |  4096 /  4096 | NON-TILED   |  136,  775 |   280 x    246 |  3840 /      0 | NON-TILED   |       ON |    1 |  420SP |    ON |
     [m3vpss ]   13 |  13 |    0,    0 |  1920 x    540 |  4096 /  4096 | NON-TILED   |  416,  775 |   280 x    246 |  3840 /      0 | NON-TILED   |       ON |    1 |  420SP |    ON |
     [m3vpss ]   14 |  14 |    0,    0 |  1920 x    540 |  4096 /  4096 | NON-TILED   |  696,  775 |   280 x    246 |  3840 /      0 | NON-TILED   |       ON |    1 |  420SP |    ON |
     [m3vpss ]   15 |  15 |    0,    0 |  1920 x    540 |  4096 /  4096 | NON-TILED   |  976,  775 |   280 x    246 |  3840 /      0 | NON-TILED   |       ON |    1 |  420SP |    ON |
     [m3vpss ] 
     [m3vpss ] 
     [m3vpss ] 
     [m3vpss ]  *** [SWMS1] Mosaic Statistics ***
     [m3vpss ] 
     [m3vpss ]  Elasped Time: 11 secs
     [m3vpss ] 
     [m3vpss ]  Output Request FPS   : 31 fps (346 frames)
     [m3vpss ]  Output Actual  FPS   : 31 fps (346 frames)
     [m3vpss ]  Output Drop    FPS   : 0 fps (0 frames)
     [m3vpss ]  Output Reject  FPS   : 0 fps (0 frames)
     [m3vpss ]  Scaling Internal     : 33 ms
     [m3vpss ]  Scaling Internal min : 33 ms
     [m3vpss ]  Scaling Internal max : 42 ms
     [m3vpss ] 
     [m3vpss ]  Win | Window Repeat Drop Recv Que  FID Invlid Acc Event          Invalid   Que Reject Reject Latency   OutBufCopy InBufCopy
     [m3vpss ]  Num | FPS    FPS    FPS  FPS  FPS  FPS        Count (Max/Min)    CH Frames Frames     Frames Min / Max FPS        FPS     
     [m3vpss ]  ---------------------------------------------------------------------------------------------------------------------------
     [m3vpss ]    0 |     31      0    0    0   30          0        0 (  0/255)         0          0      0 65535 / -52846130          0         0
     [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 |  1280 x    720 |  2048 /  2048 | NON-TILED   |    0,    0 |  1920 x   1080 |  3840 /      0 | NON-TILED   |      OFF |    0 |  420SP |   OFF |
     [m3vpss ] 
     [m3vpss ] 
     [m3vpss ]  246771: DISPLAY: HDDAC(BP0) : 60 fps, Latency (Min / Max) = ( 83 / 92 ), Callback Interval (Min / Max) = ( 16 / 17 ) DropCount:0 DispLatency (Min / Max) = ( 60 / 66 ) !!!
     [m3vpss ]  246771: DISPLAY: UNDERFLOW COUNT: HDMI(BP0) 693, HDDAC(BP0) 693, DVO2(BP1) 692, SDDAC(SEC1) 694
     [m3vpss ]  246771: SYSTEM  : FREE SPACE : System Heap      = 67272 B, Mbx = 10239 msgs)
     [m3vpss ]  246771: SYSTEM  : FREE SPACE : SR0 Heap         = 9270528 B (8 MB)
     [m3vpss ]  246771: SYSTEM  : FREE SPACE : Frame Buffer     = 2944 B (0 MB)
     [m3vpss ]  246772: SYSTEM  : FREE SPACE : Bitstream Buffer = 12746624 B (12 MB)
     [m3vpss ]  246772: SYSTEM  : FREE SPACE : Tiler Buffer     = 18 B (0 MB)  - TILER OFF
     [m3vpss ]  246772: DISPLAY: DVO2(BP1)  : 60 fps, Latency (Min / Max) = ( 74 / 86 ), Callback Interval (Min / Max) = ( 16 / 17 ) DropCount:0 DispLatency (Min / Max) = ( 64 / 66 ) !!!
    root@dm816x:~#
    root@dm816x:~# root@dm816x:~#  [m3video]  250773: HDVICP-ID:0
     [m3video] All percentage figures are based off totalElapsedTime
     [m3video]    totalAcquire2wait :0 %
     [m3video]    totalWait2Isr :11 %
     [m3video]    totalIsr2Done :0 %
     [m3video]    totalWait2Done :11 %
     [m3video]    totalDone2Release :0 %
     [m3video]    totalAcquire2Release :12 %
     [m3video]    totalAcq2acqDelay :87 %
     [m3video]    totalElapsedTime in msec :  199962
     [m3video]    numAccessCnt:    5795
     [m3video]   IVA-FPS :      29
     [m3video]   Average time spent per frame in microsec:    3795
     [m3video]  250774: HDVICP-ID:1
     [m3video] All percentage figures are based off totalElapsedTime
     [m3video]    totalAcquire2wait :0 %
     [m3video]    totalWait2Isr :0 %
     [m3video]    totalIsr2Done :0 %
     [m3video]    totalWait2Done :0 %
     [m3video]    totalDone2Release :0 %
     [m3video]    totalAcquire2Release :0 %
     [m3video]    totalAcq2acqDelay :0 %
     [m3video]    totalElapsedTime in msec :       0
     [m3video]    numAccessCnt:       0
     [m3video]   IVA-FPS :       0
     [m3video]   Average time spent per frame in microsec:       0
     [m3video]  250774: HDVICP-ID:2
     [m3video] All percentage figures are based off totalElapsedTime
     [m3video]    totalAcquire2wait :0 %
     [m3video]    totalWait2Isr :0 %
     [m3video]    totalIsr2Done :0 %
     [m3video]    totalWait2Done :0 %
     [m3video]    totalDone2Release :0 %
     [m3video]    totalAcquire2Release :0 %
     [m3video]    totalAcq2acqDelay :0 %
     [m3video]    totalElapsedTime in msec :       0
     [m3video]    numAccessCnt:       0
     [m3video]   IVA-FPS :       0
     [m3video]   Average time spent per frame in microsec:       0
     [m3video] 
     [m3video]  *** DECODE Statistics ***
     [m3video] 
     [m3video]  Elasped Time           : 11 secs
     [m3video] 
     [m3video] 
     [m3video]  CH  | In Recv In User  Out
     [m3video]  Num | FPS     Skip FPS FPS
     [m3video]  -----------------------------------
     [m3video]    0 |      31        0  31
     [m3video]    1 |       0        0   0
     [m3video]    2 |       0        0   0
     [m3video]    3 |       0        0   0
     [m3video]    4 |       0        0   0
     [m3video]    5 |       0        0   0
     [m3video]    6 |       0        0   0
     [m3video]    7 |       0        0   0
     [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 : 0
     [m3video] IVAHD_1 Max achieved Batch Size : 0
     [m3video] IVAHD_2 Average Batch Size : 0
     [m3video] IVAHD_2 Max achieved Batch Size : 0
     [m3video] 
     [m3video] Multi Channel Decode Batch break Stats
     [m3video] Total Number of Batches created: 344
     [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: 0
     [m3video] All numbers are based off total number of Batches created
     [m3video]   Batch breaks due to batch sizeexceeding limit: 0 %
     [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: 0
     [m3video] All numbers are based off total number of Batches created
     [m3video]   Batch breaks due to batch sizeexceeding limit: 0 %
     [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  : 5855
     [m3vpss ]  Total Frames Forwarded : 5855
     [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 ]  252779: LOAD: CPU: 6.9% HWI: 2.2%, SWI:0.9%
     [m3vpss ] 
     [m3vpss ]  252779: LOAD: TSK: IPC_IN_M30          : 0.1%
     [m3vpss ]  252779: LOAD: TSK: DISPLAY0            : 0.3%
     [m3vpss ]  252780: LOAD: TSK: DISPLAY1            : 0.3%
     [m3vpss ]  252780: LOAD: TSK: DUP0                : 0.1%
     [m3vpss ]  252780: LOAD: TSK: SWMS0               : 1.5%
     [m3vpss ]  252780: LOAD: TSK: SWMS1               : 0.6%
     [m3vpss ]  252780: LOAD: TSK: MP_SCLR_FWD_Q0      : 0.1%
     [m3vpss ]  252780: LOAD: TSK: MISC                : 0.8%
     [m3vpss ] 
     [m3video] 
     [m3video]  253281: LOAD: CPU: 4.5% HWI: 0.4%, SWI:0.9%
     [m3video] 
     [m3video]  253281: LOAD: TSK: IPC_OUT_M30         : 0.3%
     [m3video]  253281: LOAD: TSK: IPC_BITS_IN0        : 0.1%
     [m3video]  253281: LOAD: TSK: DEC0                : 1.8%
     [m3video]  253281: LOAD: TSK: DEC_PROCESS_TSK_0   : 0.6%
     [m3video]  253281: LOAD: TSK: MISC                : 0.4%
     [m3video] 
     [c6xdsp ] 
     [c6xdsp ]  251153: LOAD: CPU: 0.2% HWI: 0.0%, SWI:0.0%
     [c6xdsp ] 
     [c6xdsp ]  251153: LOAD: TSK: MISC                : 0.2%
     [c6xdsp ] 
    20131029 15:44:17 Gone offline (0:00:00)
    20131029 15:46:01 Gone offline (0:00:00)
    20131029 15:46:05 Gone offline (0:00:00)
    20131029 15:46:51 Gone offline (0:00:00)
    20131029 15:49:06 Gone offline (0:00:00)
    20131029 15:49:21 Gone offline (0:00:00)
    20131029 15:50:09 Gone offline (0:00:00)
    20131029 15:50:27 Gone offline (0:00:00)
    20131029 15:54:09 Gone offline (0:00:00)
    20131029 15:56:47 Gone offline (0:00:00)

     

    we can see totalAcq2acqDelay is 87 %. I think  IVA_HD is idle most of the time. where is my problem? thank you

  • Statistics don't show any issue. You are decoding 1 channel 720P30 and statistics indicate decode and swms fps is 30. Vdec_requestBitstream buffer will return no buffers is bitstream buffer is fully used up.i.e you are queuing frames faster than consumption rate. Your code  of sleep and retry is correct. You can try disabling avsync to check if it changes behavior incase your application is setting timestamp wrongly.

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

    mulich_vdec_vdis_set_avsync_vidque_prm

    Set

    queCfg->avsyncEnable = TRUE;

    to

    queCfg->avsyncEnable = FALSE;

  • Thanks for  your reply

    I change from reqInfo.reqType from VDEC_BUFREQTYPE_BUFSIZE  to VDEC_BUFREQTYPE_CHID. and set queCfg->avsyncEnable to  FALSE. The delay is better than before. But  Lost frames is usually happened when I play 1080P(30fps).

    I add get_current_time_to_msec before and after  Vdec_requestBitstreamBuffe .I found that most of request takes time less than 1ms.but sometime it takes more than 30ms. Lost frames happened when requesttime is more than 30ms. The key code is as fellow

    reqInfo.numBufs = 1;
    reqInfo.reqType =  VDEC_BUFREQTYPE_CHID;
    for (j = 0; j < VCODEC_BITSBUF_MAX; j++)    
    {
     reqInfo.u[j].minBufSize = bitBufSize;
     reqInfo.u[j].chNum = chnId;
    }
    startTime = get_current_time_to_msec()
    while(emptyBufList.numBufs == 0)
    {
      Vdec_requestBitstreamBuffer(&reqInfo, &emptyBufList, 0);
    }
    stopTime = get_current_time_to_msec();
    printf("startTime=%lld stopTime=%lld time=%lld\n",startTime,stopTime,stopTime - startTime);

    Could you tell me where may my problem is . thank you

  • where is my problem? could you help me?

  • You should add a sleep before retry Vdec_requestBitstreamBuffer else A8 core will be in busy loop continuously polling for buffers. When you change the reqInfo bufType did you also change the usecase to set ipcBitsOutHots parameter correspondingly. It is not possible to dynamically change the reqInfo bufType.

  • Thanks for your reply

          I did add sleep before rtry Vdec_requestBitstreamBuffer but the drop frames still happned .

          I try to set vdecParams.decChannelParams[i].numBufPerCh to 24.the drop frames seem less than before

         But i don't think enlarge  numBufPerCh  is a solution. There must be something wrong with my code. So where is the really problem ?

          thank you

  • Are you using multich_vdec_vdis.c usecase as is or are you using your own usecase ? If using your own usecase attach it. Try enabling notify between ipcBitsOutHost link and ipcBitsInLink Video M3 and check if that helps. Also pls migrate to DVR RDK 4.1 where IpcBitsOut implements ringbuffer which enables handling temporary buffer unavailability without packet loss.