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.

Memory consumption calculation for a link-chain

Hi all,

I am using DVR-RDK 3.5 on DM8168 platform.

For a transcoder usecase, i have setup the following syslink chain. I have programmatically set the buf_per_ch for some links. For the rest , it takes the default .

SYSTEM_HOST_LINK_ID_IPC_BITS_OUT_0 (buf_per_ch = 6)
                |
SYSTEM_VIDEO_LINK_ID_IPC_BITS_IN_0
               |
SYSTEM_LINK_ID_VDEC_0;  (buf_per_ch = 6)
               |
SYSTEM_VIDEO_LINK_ID_IPC_OUT_M3_0
               |
SYSTEM_VPSS_LINK_ID_IPC_IN_M3_0 
               |
SYSTEM_LINK_ID_SCLR_INST_0  (buf_per_ch = 3)
               |
SYSTEM_LINK_ID_NSF_0  (buf_per_ch = 4)
               |
SYSTEM_VPSS_LINK_ID_IPC_OUT_M3_0
               |
SYSTEM_VIDEO_LINK_ID_IPC_IN_M3_0
               |
SYSTEM_LINK_ID_VENC_0 (buf_per_ch = 4)
               |
SYSTEM_VIDEO_LINK_ID_IPC_BITS_OUT_0
               |
SYSTEM_HOST_LINK_ID_IPC_BITS_IN_0


1) For an input video of width(iw) and height(ih)  and output video (ow) and height (oh) How do i calculate the total (or maximum) memory consumption after setting up this usecase.

2) When are the buffers allocated (after the links are started?, created?) and when deallocated?

3) If I have programmed the IVA map table to 16 channels(Enc-dec), is the memory consumption 16 times more?


thanks,

mugunthan

  • srimugunthan dhandapani said:
    1) For an input video of width(iw) and height(ih)  and output video (ow) and height (oh) How do i calculate the total (or maximum) memory consumption after setting up this usecase

    Invoking Vsys_printDetailedStatistics will print the memory consumed in each SharedRegion .You should invoke this api after creating all the links

     

    srimugunthan dhandapani said:
    2) When are the buffers allocated (after the links are started?, created?) and when deallocated?

    Buffers are allocated at link create time

    srimugunthan dhandapani said:
    3) If I have programmed the IVA map table to 16 channels(Enc-dec), is the memory consumption 16 times more?

    No iva mapping only mentions which encoder decoder channels maps to which HDVICP id.It doesn't consume any memory.

  • Thanks for replying. I was hoping that For this link chain i can have some rough estimates for memory consumption  given the number of channels , input resolution and output resolution.

    I think accurate memory consumption of the link-chain cannot be obtained using the linux "free" command.  Are there anyother command line tools?

    Anyways, after the links are started, printing the buffer statistics and detailed statistics gives me the following output. how do i know the current memory consumption?

    BUFFER STATS:

    IPCBITSOUTLINK:Buffer Statistics
    Num Alloc Pools:1
    PoolId | TotalBufCnt | FreeBufCnt | BufSize | AppAllocCount
    0| 6| 3| 25344| 0

    VDEC:Buffer Statistics
    ChId | InBufCnt | OutBufCnt
    0| 0| 2
    [m3video] 
    [m3video] *** Encode Statistics *** 
    [m3video] 28110: ENC: Rcvd from prev = 441, Returned to prev = 439
    [m3video] ENC Out BitBuf Q Status
    [m3video] Empty Q 0 -> count 2, wrPtr 59, rdPtr 57
    [m3video] Full Q -> count 0, wrPtr 55, rdPtr 55

    ==============================================================================

    DETAILED STATS:

    [m3video] 52440: HDVICP-ID:0
    [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 : 27873
    [m3video] numAccessCnt: 3453
    [m3video] IVA-FPS : 127
    [m3video] Average time spent per frame in microsec: 484
    [m3video] 52440: HDVICP-ID:1
    [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 : 27889
    [m3video] numAccessCnt: 3455
    [m3video] IVA-FPS : 127
    [m3video] Average time spent per frame in microsec: 484
    [m3video] 52441: 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] *** ENCODE Statistics *** 
    [m3video] 
    [m3video] Elasped Time : 27 secs
    [m3video] 
    [m3video] 
    [m3video] CH | In Recv In Skip In User Out Latency 
    [m3video] Num | FPS FPS Skip FPS FPS Min / Max
    [m3video] --------------------------------------------
    [m3video] 0 | 127 0 0 127 255 / 268487887
    [m3video] 
    [m3video] Multi Channel Encode 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 Encode Batch break Stats 
    [m3video] Total Number of Batches created: 3449 
    [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: 100 %
    [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] 
    [m3video] *** DECODE Statistics *** 
    [m3video] 
    [m3video] Elasped Time : 27 secs
    [m3video] 
    [m3video] 
    [m3video] CH | In Recv In User Out 
    [m3video] Num | FPS Skip FPS FPS 
    [m3video] -----------------------------------
    [m3video] 0 | 127 0 127
    [m3video] 
    [m3video] Multi Channel Decode Average Submit Batch Size 
    [m3video] Max Submit Batch Size : 24
    [m3video] IVAHD_0 Average Batch Size : 0
    [m3video] IVAHD_0 Max achieved Batch Size : 0
    [m3video] IVAHD_1 Average Batch Size : 1
    [m3video] IVAHD_1 Max achieved Batch Size : 1
    [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: 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: 3452 
    [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: 100 %
    [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 ] 54448: LOAD: CPU: 7.3% HWI: 1.3%, SWI:1.1% 
    [m3vpss ] 
    [m3vpss ] 54448: LOAD: TSK: IPC_OUT_M30 : 1.1% 
    [m3vpss ] 54448: LOAD: TSK: IPC_IN_M30 : 0.3% 
    [m3vpss ] 54448: LOAD: TSK: NSF0 : 1.3% 
    [m3vpss ] 54449: LOAD: TSK: Scalar0 : 1.9% 
    [m3vpss ] 54449: LOAD: TSK: MISC : 0.3% 
    [m3vpss ] 
    [m3video] 
    [m3video] 54949: LOAD: CPU: 12.2% HWI: 1.2%, SWI:1.0% 
    [m3video] 
    [m3video] 54949: LOAD: TSK: IPC_OUT_M30 : 0.9% 
    [m3video] 54949: LOAD: TSK: IPC_IN_M30 : 0.5% 
    [m3video] 54949: LOAD: TSK: IPC_BITS_IN0 : 0.2% 
    [m3video] 54950: LOAD: TSK: IPC_BITS_OUT0 : 0.8% 
    [m3video] 54950: LOAD: TSK: ENC0 : 1.4% 
    [m3video] 54950: LOAD: TSK: DEC0 : 1.1% 
    [m3video] 54950: LOAD: TSK: DEC_PROCESS_TSK_1 : 2.1% 
    [m3video] 54950: LOAD: TSK: ENC_PROCESS_TSK_0 : 2.5% 
    [m3video] 54950: LOAD: TSK: MISC : 0.5% 
    [m3video] 
    [c6xdsp ] 
    [c6xdsp ] 52868: LOAD: CPU: 0.1% HWI: 0.0%, SWI:0.0% 
    [c6xdsp ] 
    [c6xdsp ] 52868: LOAD: TSK: MISC : 0.1% 
    [c6xdsp ] 
    =============================================

  • Pls modify

    /dvr_rdk/mcfw/src_bios6/links_m3video/iva_enc/encLink_common.c

    FUnction:

     Int32 EncLink_printStatistics (EncLink_Obj * pObj, Bool resetAfterPrint)

    Add call to

    System_memPrintHeapStatus();

    in this function. You should then see memory available and memory used  in different heaps.