TI中文支持网
TI专业的中文技术问题搜集分享网站

M3Video 跳帧问题 ?

各位专家好,

      DM8148EVM板子,DVRRDK_04.00.00.03 的版本,通过mcfw_api_demos来进行采集

我们通过测试发现,在Usecase是Vcap+Vdisp很正常,

但是当usecase是vcap+Venc+vdip的时候,发现M3VPSS可以正常捕捉到帧,却在编码阶段,M3Video全部掉帧,

我们通过进一步跟踪发现是M3Video在调用Utils_bitbufGetEmptyBuf() 为h264编码申请bitsbuf的时候失败了,

请问这种情况一般是什么问题引起的,有什么思路解决?

M3video掉帧的log 如下:

 [m3vpss ]  
 [m3vpss ]  *** Capture Driver Advanced Statistics *** 
 [m3vpss ]  
 [m3vpss ]  VIP Parser Reset Count : 0
 [m3vpss ]  
 [m3vpss ]      |   Total    Even     Odd  Total  Even   Odd  Min /  Max  Min /  Max Dropped Fid Repeat Frame Error Y/C
 [m3vpss ]  CH  |  Fields  Fields  Fields    FPS   FPS   FPS       Width      Height  Fields      Count (Desc Error Y/C)
 [m3vpss ]  ————————————————————————————————————
 [m3vpss ]  200 |   26724   26724       0     60    60     0 1920 / 1920 1080 / 1080       1      26723 0/0 (0/0)
 [m3vpss ]  
 [m3vpss ]  VIP Capture Port 2 | DescMissMatch1 = 0, DescMissMatch2 = 0 , DescMissMatch3 = 0 
 [m3vpss ]  
 [m3vpss ]  *** Capture List Manager Advanced Statistics *** 
 [m3vpss ]  
 [m3vpss ]  List Post Count        : 55677 
 [m3vpss ]  List Stall Count       : 0 
 [m3vpss ]  List Post Time (ms)    : Max = 0, Min = 0, Avg = 0, Total = 0 
 [m3vpss ]  INTC Timeout Count     : (0, 0) (Min timeout value = 993, 1000) 
 [m3vpss ]  Descriptor miss found count : 0 
 [m3vpss ]  
 [m3vpss ]  
 [m3vpss ]  VIP and VPDMA registers, 
 [m3vpss ]  VIP0 : FIQ_STATUS  : 0x4810551c = 0x00000000
 [m3vpss ]  VIP1 : FIQ_STATUS  : 0x48105a1c = 0x00000000
 [m3vpss ]  VPDMA: LIST_BUSY   : 0x4810d00c = 0x00120000
 [m3vpss ]  
 [m3vpss ]  
 [m3vpss ]  450407: CAPTURE: Fields = 26723 (fps = 59, CPU Load = 0)
 [m3vpss ]  450407: CAPTURE: Num Resets = 0 (Avg 0 ms per reset)
 [m3vpss ]  450408: SYSTEM  : FREE SPACE : System Heap      = 244048 B, Mbx = 10239 msgs) 
 [m3vpss ]  450408: SYSTEM  : FREE SPACE : SR0 Heap         = 26539520 B (25 MB) 
 [m3vpss ]  450408: SYSTEM  : FREE SPACE : Frame Buffer     = 265044864 B (252 MB) 
 [m3vpss ]  450408: SYSTEM  : FREE SPACE : Bitstream Buffer = 198322048 B (189 MB) 
 [m3vpss ] TILER_STATS: CNT :8BIT
 [m3vpss ] TILER_STATS: CNT RESOLUTION:    16384 x 5440
 [m3vpss ] TILER_STATS: BUCKET RESOLUTION: 16384 x 5436
 [m3vpss ] TILER_STATS: NUM FREE BUCKETS:  1
 [m3vpss ] TILER_STATS: NUM USED BUCKETS:  0
 [m3vpss ] TILER_STATS: TOTAL FREE AREA:   89063424 (99 %)
 [m3vpss ] TILER_STATS: TOTAL USED AREA:   0 (0 %)
 [m3vpss ] TILER_STATS: CNT :16BIT
 [m3vpss ] TILER_STATS: CNT RESOLUTION:    32768 x 1344
 [m3vpss ] TILER_STATS: BUCKET RESOLUTION: 32768 x 1344
 [m3vpss ] TILER_STATS: NUM FREE BUCKETS:  1
 [m3vpss ] TILER_STATS: NUM USED BUCKETS:  0
 [m3vpss ] TILER_STATS: TOTAL FREE AREA:   44040192 (100 %)
 [m3vpss ] TILER_STATS: TOTAL USED AREA:   0 (0 %)
 [m3vpss ]  450410: SYSTEM  : FREE SPACE : Tiler 8-bit      = 89063424 B (84 MB)  – TILER ON 
 [m3vpss ]  450410: SYSTEM  : FREE SPACE : Tiler 16-bit     = 44040192 B (42 MB)  – TILER ON 
 [m3vpss ]  
 [m3vpss ]  *** [NSF0] NSF Statistics *** 
 [m3vpss ]  
 [m3vpss ]  Elasped Time           : 387 secs
 [m3vpss ]  Total Fields Processed : 26723 
 [m3vpss ]  Total Fields FPS       : 83 FPS
 [m3vpss ]  
 [m3vpss ]  
 [m3vpss ]  CH  | In Recv In Reject In Process Out User Out Out      
 [m3vpss ]  Num | FPS     FPS       FPS        FPS Skip FPS Skip FPS 
 [m3vpss ]  ————————————————
 [m3vpss ]    0 |      60         0         60  60        0        0
 [m3vpss ]  
 [m3vpss ]  450417: DISPLAY: HDDAC(BP0) : 59 fps, Latency (Min / Max) = ( 74 / 92 ), Callback Interval (Min / Max) = ( 16 / 17 ) DropCount:0 DispLatency (Min / Max) = 
 [m3vpss ]  450417: DISPLAY DRV: HDDAC(BP0) : Q:[26725] Display:[26754], Repeat:[32], DQ:[26721]
 [m3vpss ]  450417: DISPLAY: UNDERFLOW COUNT: HDMI(BP0) 23234, HDDAC(BP0) 0, DVO2(BP1) 23234, SDDAC(SEC1) 47276 
 [m3vpss ]  450418: SYSTEM  : FREE SPACE : System Heap      = 244048 B, Mbx = 10239 msgs) 
 [m3vpss ]  450418: SYSTEM  : FREE SPACE : SR0 Heap         = 26539520 B (25 MB) 
 [m3vpss ]  450418: SYSTEM  : FREE SPACE : Frame Buffer     = 265044864 B (252 MB) 
 [m3vpss ]  450418: SYSTEM  : FREE SPACE : Bitstream Buffer = 198322048 B (189 MB) 
 [m3vpss ] TILER_STATS: CNT :8BIT
 [m3vpss ] TILER_STATS: CNT RESOLUTION:    16384 x 5440
 [m3vpss ] TILER_STATS: BUCKET RESOLUTION: 16384 x 5436
 [m3vpss ] TILER_STATS: NUM FREE BUCKETS:  1
 [m3vpss ] TILER_STATS: NUM USED BUCKETS:  0
 [m3vpss ] TILER_STATS: TOTAL FREE AREA:   89063424 (99 %)
 [m3vpss ] TILER_STATS: TOTAL USED AREA:   0 (0 %)
 [m3vpss ] TILER_STATS: CNT :16BIT
 [m3vpss ] TILER_STATS: CNT RESOLUTION:    32768 x 1344
 [m3vpss ] TILER_STATS: BUCKET RESOLUTION: 32768 x 1344
 [m3vpss ] TILER_STATS: NUM FREE BUCKETS:  1
 [m3vpss ] TILER_STATS: NUM USED BUCKETS:  0
 [m3vpss ] TILER_STATS: TOTAL FREE AREA:   44040192 (100 %)
 [m3vpss ] TILER_STATS: TOTAL USED AREA:   0 (0 %)
 [m3vpss ]  450420: SYSTEM  : FREE SPACE : Tiler 8-bit      = 89063424 B (84 MB)  – TILER ON 
 [m3vpss ]  450420: SYSTEM  : FREE SPACE : Tiler 16-bit     = 44040192 B (42 MB)  – TILER ON 
 [m3video]  456421: HDVICP-ID:0
 [m3video] All percentage figures are based off totalElapsedTime
 [m3video]    totalAcquire2wait :1 %
 [m3video]    totalWait2Isr :96 %
 [m3video]    totalIsr2Done :0 %
 [m3video]    totalWait2Done :96 %
 [m3video]    totalDone2Release :0 %
 [m3video]    totalAcquire2Release :98 %
 [m3video]    totalAcq2acqDelay :1 %
 [m3video]    totalElapsedTime in msec :     203
 [m3video]    numAccessCnt:      12
 [m3video]   IVA-FPS :       0
 [m3video]   Average time spent per frame in microsec:   16239
 [m3video]  456422: 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]  456422: 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           : 387 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 |      60      60        0   0 255 /   0
 [m3video]    1 |      60      60        0   0 255 /   0
 [m3video]  
 [m3video] Multi Channel Encode 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]  
 [m3video] Multi Channel Encode 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 %
 [m3vpss ]  
 [m3vpss ]  459425: LOAD: CPU: 9.1% HWI: 1.7%, SWI:1.4% 
 [m3vpss ]  
 [m3vpss ]  459425: LOAD: TSK: IPC_OUT_M30         : 1.1% 
 [m3vpss ]  459426: LOAD: TSK: CAPTURE             : 0.5% 
 [m3vpss ]  459426: LOAD: TSK: NSF0                : 0.9% 
 [m3vpss ]  459426: LOAD: TSK: DISPLAY0            : 0.8% 
 [m3vpss ]  459426: LOAD: TSK: DUP0                : 0.3% 
 [m3vpss ]  459426: LOAD: TSK: DUP1                : 0.4% 
 [m3vpss ]  459426: LOAD: TSK: MERGE0              : 0.2% 
 [m3vpss ]  459427: LOAD: TSK: MISC                : 1.8% 
 [m3vpss ]  
 [m3video]  
 [m3video]  459927: LOAD: CPU: 4.3% HWI: 0.9%, SWI:0.9% 
 [m3video]  
 [m3video]  459928: LOAD: TSK: IPC_IN_M30          : 0.7% 
 [m3video]  459928: LOAD: TSK: IPC_BITS_OUT0       : 0.3% 
 [m3video]  459928: LOAD: TSK: ENC0                : 1.3% 
 [m3video]  459928: LOAD: TSK: MISC                : 0.2% 
 [m3video]  
 [c6xdsp ]  
 [c6xdsp ]  459647: LOAD: CPU: 0.2% HWI: 0.0%, SWI:0.0% 
 [c6xdsp ]  
 [c6xdsp ]  459647: LOAD: TSK: MISC                : 0.2% 
 [c6xdsp ] 

Ternence_Hsu:

你好;

       之前有调试过dm8148的evm 板子,也是在rdk4.0上面,编码是正常的;

       你可以贴出你的Usecase 的代码吗?或者是 email 发我邮箱 ternence.hsu@foxmail.com

shawnstone:

回复 Ternence_Hsu:

你好,

         usecase已经发送到 ternence.hsu@foxmail.com,麻烦查收,谢谢!

上午修改了一下:

ipcOutVpssPrm.notifyNextLink = TRUE;

改为ipcOutVpssPrm.notifyNextLink = FALSE;

发现HDVPSS掉帧了,推测可能是usecase的chain配置参数有问题,

请问有什么思路可以参考呢?

ps:为了方便解决问题,帖子后面也上传了usecase,谢谢!

shawnstone:

回复 Ternence_Hsu:

你好,

       usecase 代码已经发送到ternence.hsu@foxmail.com ,麻烦接收,非常感谢!

目前怀疑是usecase搭建过程中,配置参数有问题,请问有什么思路可以去解决?

谢谢!

Ternence_Hsu:

回复 shawnstone:

你好;

      

dupPrm[0].inQueParams.prevLinkId= gVcapModuleContext.captureId;dupPrm[0].inQueParams.prevLinkQueId= 0;dupPrm[0].numOutQue= 2;dupPrm[0].notifyNextLink= TRUE;dupPrm[0].outQueParams[0].nextLink= gVcapModuleContext.nsfId[0];dupPrm[0].outQueParams[1].nextLink= gVdisModuleContext.displayId[VDIS_DEV_HDMI];NsfLink_CreateParams_Init(&nsfPrm);nsfPrm.bypassNsf= TRUE;nsfPrm.tilerEnable= FALSE;nsfPrm.inQueParams.prevLinkId= dupId[0];nsfPrm.inQueParams.prevLinkQueId = 0;nsfPrm.numOutQue= 1;nsfPrm.outQueParams[0].nextLink= gVcapModuleContext.nsfId[0];ipcOutVpssPrm.inQueParams.prevLinkId= mergeId[ENC_MERGE_LINK_IDX];ipcOutVpssPrm.inQueParams.prevLinkQueId = 0;ipcOutVpssPrm.outQueParams[0].nextLink= ipcInVideoId;ipcOutVpssPrm.notifyNextLink= FALSE;ipcOutVpssPrm.notifyPrevLink= TRUE;ipcOutVpssPrm.noNotifyMode= TRUE;

代码

 nsfPrm.outQueParams[0].nextLink  = gVcapModuleContext.nsfId[0];   

    ipcOutVpssPrm.inQueParams.prevLinkId    = mergeId[ENC_MERGE_LINK_IDX];

nsf 的next link 应当是ipcoutvpss

merge link 在程序中没有使用到;

这个位置你查一下;

shawnstone:

回复 Ternence_Hsu:

你好,

     是的,上午我merge_link删除了,但是遗留下刚才的错误,现在已经根据你的建议修改过来,

调试了一下,发现M3video仍然是掉帧,

修改代码:

#include "mcfw/src_linux/mcfw_api/usecases/multich_common.h"#include "mcfw/src_linux/mcfw_api/usecases/multich_ipcbits.h"

#define TILER_ENABLE FALSE

#define NUM_CAPTURE_DEVICES (1)

#define ENC_MERGE_LINK_IDX (0)static SystemVideo_Ivahd2ChMap_Tbl systemVid_encDecIvaChMapTbl ={ .isPopulated = 1, .ivaMap[0] = { .EncNumCh = 1, .EncChList = {0, 1, 2}, .DecNumCh = 0, .DecChList = {0, 1, 2}, },};

Void MultiCh_createVcapVencVdis_HSV6(){ CaptureLink_CreateParams capturePrm; NsfLink_CreateParams nsfPrm; DupLink_CreateParams dupPrm[2]; DisplayLink_CreateParams displayPrm[1]; IpcLink_CreateParams ipcOutVpssPrm; IpcLink_CreateParams ipcInVideoPrm; EncLink_CreateParams encPrm; IpcBitsOutLinkRTOS_CreateParams ipcBitsOutVideoPrm; IpcBitsInLinkHLOS_CreateParams ipcBitsInHostPrm;

CaptureLink_VipInstParams *pCaptureInstPrm; CaptureLink_OutParams *pCaptureOutPrm; UInt32 ipcOutVpssId; UInt32 ipcInVideoId;

UInt32 i;//, chId; UInt32 dupId[2];

MULTICH_INIT_STRUCT(IpcLink_CreateParams,ipcOutVpssPrm); MULTICH_INIT_STRUCT(IpcLink_CreateParams,ipcInVideoPrm); MULTICH_INIT_STRUCT(IpcBitsOutLinkRTOS_CreateParams,ipcBitsOutVideoPrm); MULTICH_INIT_STRUCT(IpcBitsInLinkHLOS_CreateParams,ipcBitsInHostPrm); MULTICH_INIT_STRUCT(EncLink_CreateParams, encPrm);

MULTICH_INIT_STRUCT(DisplayLink_CreateParams ,displayPrm[0]);

printf("\nDB_DEBUG:%s %s() %d\n",__FILE__,__FUNCTION__,__LINE__); MultiCh_detectBoard(); System_linkControl( SYSTEM_LINK_ID_M3VPSS, SYSTEM_M3VPSS_CMD_RESET_VIDEO_DEVICES, NULL, 0, TRUE );

System_linkControl( SYSTEM_LINK_ID_M3VIDEO, SYSTEM_COMMON_CMD_SET_CH2IVAHD_MAP_TBL, &systemVid_encDecIvaChMapTbl, sizeof(SystemVideo_Ivahd2ChMap_Tbl), TRUE );

printf("\nDB_DEBUG:%s %s() %d\n",__FILE__,__FUNCTION__,__LINE__); gVcapModuleContext.captureId = SYSTEM_LINK_ID_CAPTURE; gVcapModuleContext.nsfId[0] = SYSTEM_LINK_ID_NSF_0; gVencModuleContext.encId = SYSTEM_LINK_ID_VENC_0; gVdisModuleContext.displayId[0] = SYSTEM_LINK_ID_DISPLAY_0; // ON CHIP HDMI

dupId[0] = SYSTEM_VPSS_LINK_ID_DUP_0;

ipcOutVpssId = SYSTEM_VPSS_LINK_ID_IPC_OUT_M3_0; ipcInVideoId = SYSTEM_VIDEO_LINK_ID_IPC_IN_M3_0;

gVencModuleContext.ipcBitsOutRTOSId = SYSTEM_VIDEO_LINK_ID_IPC_BITS_OUT_0; gVencModuleContext.ipcBitsInHLOSId = SYSTEM_HOST_LINK_ID_IPC_BITS_IN_0;

CaptureLink_CreateParams_Init(&capturePrm); capturePrm.numVipInst = 1; capturePrm.outQueParams[0].nextLink = dupId[0]; capturePrm.tilerEnable = TRUE; capturePrm.enableSdCrop = FALSE; // capturePrm.maxBlindAreasPerCh = 7; capturePrm.fakeHdMode = 1;

pCaptureInstPrm = &capturePrm.vipInst[0]; pCaptureInstPrm->vipInstId = SYSTEM_CAPTURE_INST_VIP1_PORTA; //pCaptureInstPrm->videoDecoderId = SYSTEM_DEVICE_VID_DEC_SII9135_DRV; pCaptureInstPrm->inDataFormat = SYSTEM_DF_YUV422P; pCaptureInstPrm->standard = SYSTEM_STD_1080P_60; pCaptureInstPrm->numOutput = 1; pCaptureInstPrm->embedMode = FALSE; pCaptureInstPrm->byteNum = 2; //16bit pCaptureInstPrm->debugFlag = FALSE; pCaptureInstPrm->discreteSignal = 0; //DISCRETE_SYNC_ACTVID_VSYNC;

pCaptureOutPrm = &pCaptureInstPrm->outParams[0]; pCaptureOutPrm->dataFormat = SYSTEM_DF_YUV422I_YUYV;//SYSTEM_DF_YUV422I_YUYV; pCaptureOutPrm->scEnable = FALSE; pCaptureOutPrm->scOutWidth = 0; pCaptureOutPrm->scOutHeight = 0; pCaptureOutPrm->outQueId = 0; dupPrm[0].inQueParams.prevLinkId = gVcapModuleContext.captureId; dupPrm[0].inQueParams.prevLinkQueId = 0; dupPrm[0].numOutQue = 2; dupPrm[0].notifyNextLink = TRUE; dupPrm[0].outQueParams[0].nextLink = gVcapModuleContext.nsfId[0]; dupPrm[0].outQueParams[1].nextLink = gVdisModuleContext.displayId[VDIS_DEV_HDMI];

NsfLink_CreateParams_Init(&nsfPrm); nsfPrm.bypassNsf = TRUE; nsfPrm.tilerEnable = FALSE; nsfPrm.inQueParams.prevLinkId = dupId[0]; nsfPrm.inQueParams.prevLinkQueId = 0; nsfPrm.numOutQue = 1; nsfPrm.outQueParams[0].nextLink = ipcOutVpssId;

ipcOutVpssPrm.inQueParams.prevLinkId = gVcapModuleContext.nsfId[0]; ipcOutVpssPrm.inQueParams.prevLinkQueId = 0; ipcOutVpssPrm.outQueParams[0].nextLink = ipcInVideoId; ipcOutVpssPrm.notifyNextLink = FALSE; ipcOutVpssPrm.notifyPrevLink = TRUE; ipcOutVpssPrm.noNotifyMode = TRUE;

ipcInVideoPrm.inQueParams.prevLinkId = ipcOutVpssId; ipcInVideoPrm.inQueParams.prevLinkQueId = 0; ipcInVideoPrm.outQueParams[0].nextLink = gVencModuleContext.encId; ipcInVideoPrm.notifyNextLink = TRUE; ipcInVideoPrm.notifyPrevLink = FALSE; ipcInVideoPrm.noNotifyMode = TRUE;

encPrm.numBufPerCh[0] = 4; //CIF { EncLink_ChCreateParams *pLinkChPrm; EncLink_ChDynamicParams *pLinkDynPrm; VENC_CHN_DYNAMIC_PARAM_S *pDynPrm; VENC_CHN_PARAMS_S *pChPrm;

/* Primary Stream Params – D1 */ for (i=0; i<gVencModuleContext.vencConfig.numPrimaryChn; i++) { pLinkChPrm = &encPrm.chCreateParams[i]; pLinkDynPrm = &pLinkChPrm->defaultDynamicParams;

pChPrm = &gVencModuleContext.vencConfig.encChannelParams[i]; pDynPrm = &pChPrm->dynamicParam;

pLinkChPrm->format = IVIDEO_H264HP; pLinkChPrm->profile = gVencModuleContext.vencConfig.h264Profile[i]; pLinkChPrm->dataLayout = IVIDEO_FIELD_SEPARATED; pLinkChPrm->fieldMergeEncodeEnable = FALSE; pLinkChPrm->enableAnalyticinfo = pChPrm->enableAnalyticinfo; pLinkChPrm->enableWaterMarking = pChPrm->enableWaterMarking; pLinkChPrm->maxBitRate = pChPrm->maxBitRate; pLinkChPrm->encodingPreset = pChPrm->encodingPreset; pLinkChPrm->rateControlPreset = pChPrm->rcType; pLinkChPrm->enableSVCExtensionFlag = pChPrm->enableSVCExtensionFlag; pLinkChPrm->numTemporalLayer = pChPrm->numTemporalLayer;

pLinkDynPrm->intraFrameInterval = pDynPrm->intraFrameInterval; pLinkDynPrm->targetBitRate = pDynPrm->targetBitRate; pLinkDynPrm->interFrameInterval = 1; pLinkDynPrm->mvAccuracy = IVIDENC2_MOTIONVECTOR_QUARTERPEL; pLinkDynPrm->inputFrameRate = pDynPrm->inputFrameRate; pLinkDynPrm->rcAlg = pDynPrm->rcAlg; pLinkDynPrm->qpMin = pDynPrm->qpMin; pLinkDynPrm->qpMax = pDynPrm->qpMax; pLinkDynPrm->qpInit = pDynPrm->qpInit; pLinkDynPrm->vbrDuration = pDynPrm->vbrDuration; pLinkDynPrm->vbrSensitivity = pDynPrm->vbrSensitivity;

}

encPrm.inQueParams.prevLinkId = ipcInVideoId; encPrm.inQueParams.prevLinkQueId = 0; encPrm.outQueParams.nextLink = gVencModuleContext.ipcBitsOutRTOSId; }

encPrm.inQueParams.prevLinkId = ipcInVideoId; encPrm.inQueParams.prevLinkQueId = 0; encPrm.outQueParams.nextLink = gVencModuleContext.ipcBitsOutRTOSId; ipcBitsOutVideoPrm.baseCreateParams.inQueParams.prevLinkId = gVencModuleContext.encId; ipcBitsOutVideoPrm.baseCreateParams.inQueParams.prevLinkQueId = 0; ipcBitsOutVideoPrm.baseCreateParams.numOutQue = 1; ipcBitsOutVideoPrm.baseCreateParams.outQueParams[0].nextLink = gVencModuleContext.ipcBitsInHLOSId; MultiCh_ipcBitsInitCreateParams_BitsOutRTOS(&ipcBitsOutVideoPrm,TRUE);

ipcBitsInHostPrm.baseCreateParams.inQueParams.prevLinkId = gVencModuleContext.ipcBitsOutRTOSId; ipcBitsInHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0; MultiCh_ipcBitsInitCreateParams_BitsInHLOS(&ipcBitsInHostPrm);

#ifndef SYSTEM_USE_VIDEO_DECODER capturePrm.isPalMode = Vcap_isPalMode();#endif System_linkCreate (gVcapModuleContext.captureId, &capturePrm, sizeof(capturePrm)); System_linkCreate(dupId[0], &dupPrm[0], sizeof(dupPrm[0]));

System_linkCreate(gVcapModuleContext.nsfId[0] , &nsfPrm, sizeof(nsfPrm)); //System_linkCreate(dupId[1], &dupPrm[1], sizeof(dupPrm[1]));

System_linkCreate(ipcOutVpssId , &ipcOutVpssPrm , sizeof(ipcOutVpssPrm) ); System_linkCreate(ipcInVideoId , &ipcInVideoPrm , sizeof(ipcInVideoPrm) );

System_linkCreate(gVencModuleContext.encId, &encPrm, sizeof(encPrm));

System_linkCreate(gVencModuleContext.ipcBitsOutRTOSId, &ipcBitsOutVideoPrm, sizeof(ipcBitsOutVideoPrm)); System_linkCreate(gVencModuleContext.ipcBitsInHLOSId, &ipcBitsInHostPrm, sizeof(ipcBitsInHostPrm));

displayPrm[0].inQueParams[0].prevLinkId = dupId[0]; displayPrm[0].inQueParams[0].prevLinkQueId = 1; displayPrm[0].displayRes = gVdisModuleContext.vdisConfig.deviceParams[0].resolution; System_linkCreate(gVdisModuleContext.displayId[0], &displayPrm[0], sizeof(displayPrm[0]));

//MultiCh_memPrintHeapStatus(); //Utils_encdecHdvicpPrfInit();}

Void MultiCh_deleteVcapVencVdis_HSV6(){ UInt32 dupId[2]; UInt32 ipcOutVpssId; UInt32 ipcInVideoId;

dupId[0] = SYSTEM_VPSS_LINK_ID_DUP_0;

ipcOutVpssId = SYSTEM_VPSS_LINK_ID_IPC_OUT_M3_0; ipcInVideoId = SYSTEM_VIDEO_LINK_ID_IPC_IN_M3_0;

System_linkDelete(gVcapModuleContext.captureId); System_linkDelete(dupId[0]); System_linkDelete(gVcapModuleContext.nsfId[0]); System_linkDelete(ipcOutVpssId ); System_linkDelete(ipcInVideoId ); System_linkDelete(gVencModuleContext.encId); System_linkDelete(gVencModuleContext.ipcBitsOutRTOSId); System_linkDelete(gVencModuleContext.ipcBitsInHLOSId); System_linkDelete(gVdisModuleContext.displayId[0]);

/* Print the HWI, SWI and all tasks load */ /* Reset the accumulated timer ticks */ //MultiCh_prfLoadCalcEnable(FALSE, TRUE, FALSE); //Utils_encdecHdvicpPrfPrint();

}

调试输出:

[m3vpss ] [m3vpss ] *** Capture Driver Advanced Statistics *** [m3vpss ] [m3vpss ] VIP Parser Reset Count : 0 [m3vpss ] [m3vpss ] | Total Even Odd Total Even Odd Min / Max Min / Max Dropped Fid Repeat Frame Error Y/C [m3vpss ] CH | Fields Fields Fields FPS FPS FPS Width Height Fields Count (Desc Error Y/C) [m3vpss ] ———————————————————————————————————— [m3vpss ] 200 | 9812 9812 0 60 60 0 1920 / 1920 1080 / 1080 1 9811 0/0 (0/0) [m3vpss ] [m3vpss ] VIP Capture Port 2 | DescMissMatch1 = 0, DescMissMatch2 = 0 , DescMissMatch3 = 0 [m3vpss ] [m3vpss ] *** Capture List Manager Advanced Statistics *** [m3vpss ] [m3vpss ] List Post Count : 20444 [m3vpss ] List Stall Count : 0 [m3vpss ] List Post Time (ms) : Max = 0, Min = 0, Avg = 0, Total = 0 [m3vpss ] INTC Timeout Count : (0, 0) (Min timeout value = 993, 1000) [m3vpss ] Descriptor miss found count : 0 [m3vpss ] [m3vpss ] [m3vpss ] VIP and VPDMA registers, [m3vpss ] VIP0 : FIQ_STATUS : 0x4810551c = 0x00000000 [m3vpss ] VIP1 : FIQ_STATUS : 0x48105a1c = 0x00000000 [m3vpss ] VPDMA: LIST_BUSY : 0x4810d00c = 0x00120000 [m3vpss ] [m3vpss ] [m3vpss ] 171757: CAPTURE: Fields = 9811 (fps = 59, CPU Load = 0) [m3vpss ] 171757: CAPTURE: Num Resets = 0 (Avg 0 ms per reset) [m3vpss ] 171758: SYSTEM : FREE SPACE : System Heap = 244112 B, Mbx = 10239 msgs) [m3vpss ] 171758: SYSTEM : FREE SPACE : SR0 Heap = 26539520 B (25 MB) [m3vpss ] 171758: SYSTEM : FREE SPACE : Frame Buffer = 272221056 B (259 MB) [m3vpss ] 171758: SYSTEM : FREE SPACE : Bitstream Buffer = 206616448 B (197 MB) [m3vpss ] TILER_STATS: CNT :8BIT [m3vpss ] TILER_STATS: CNT RESOLUTION: 16384 x 5440 [m3vpss ] TILER_STATS: BUCKET RESOLUTION: 16384 x 5436 [m3vpss ] TILER_STATS: NUM FREE BUCKETS: 1 [m3vpss ] TILER_STATS: NUM USED BUCKETS: 0 [m3vpss ] TILER_STATS: TOTAL FREE AREA: 89063424 (99 %) [m3vpss ] TILER_STATS: TOTAL USED AREA: 0 (0 %) [m3vpss ] TILER_STATS: CNT :16BIT [m3vpss ] TILER_STATS: CNT RESOLUTION: 32768 x 1344 [m3vpss ] TILER_STATS: BUCKET RESOLUTION: 32768 x 1344 [m3vpss ] TILER_STATS: NUM FREE BUCKETS: 1 [m3vpss ] TILER_STATS: NUM USED BUCKETS: 0 [m3vpss ] TILER_STATS: TOTAL FREE AREA: 44040192 (100 %) [m3vpss ] TILER_STATS: TOTAL USED AREA: 0 (0 %) [m3vpss ] 171759: SYSTEM : FREE SPACE : Tiler 8-bit = 89063424 B (84 MB) – TILER ON [m3vpss ] 171760: SYSTEM : FREE SPACE : Tiler 16-bit = 44040192 B (42 MB) – TILER ON [m3vpss ] [m3vpss ] *** [NSF0] NSF Statistics *** [m3vpss ] [m3vpss ] Elasped Time : 158 secs [m3vpss ] Total Fields Processed : 9811 [m3vpss ] Total Fields FPS : 83 FPS [m3vpss ] [m3vpss ] [m3vpss ] CH | In Recv In Reject In Process Out User Out Out [m3vpss ] Num | FPS FPS FPS FPS Skip FPS Skip FPS [m3vpss ] ———————————————— [m3vpss ] 0 | 60 0 60 60 0 0 [m3vpss ] [m3vpss ] 171762: DISPLAY: HDDAC(BP0) : 59 fps, Latency (Min / Max) = ( 76 / 81 ), Callback Interval (Min / Max) = ( 16 / 17 ) DropCount:0 DispLatency (Min / Max) = ( 49 / 66 ) !!! [m3vpss ] 171762: DISPLAY DRV: HDDAC(BP0) : Q:[9813] Display:[9848], Repeat:[37], DQ:[9810] [m3vpss ] 171762: DISPLAY: UNDERFLOW COUNT: HDMI(BP0) 9534, HDDAC(BP0) 0, DVO2(BP1) 9534, SDDAC(SEC1) 19395 [m3vpss ] 171762: SYSTEM : FREE SPACE : System Heap = 244112 B, Mbx = 10239 msgs) [m3vpss ] 171763: SYSTEM : FREE SPACE : SR0 Heap = 26539520 B (25 MB) [m3vpss ] 171763: SYSTEM : FREE SPACE : Frame Buffer = 272221056 B (259 MB) [m3vpss ] 171763: SYSTEM : FREE SPACE : Bitstream Buffer = 206616448 B (197 MB) [m3vpss ] TILER_STATS: CNT :8BIT [m3vpss ] TILER_STATS: CNT RESOLUTION: 16384 x 5440 [m3vpss ] TILER_STATS: BUCKET RESOLUTION: 16384 x 5436 [m3vpss ] TILER_STATS: NUM FREE BUCKETS: 1 [m3vpss ] TILER_STATS: NUM USED BUCKETS: 0 [m3vpss ] TILER_STATS: TOTAL FREE AREA: 89063424 (99 %) [m3vpss ] TILER_STATS: TOTAL USED AREA: 0 (0 %) [m3vpss ] TILER_STATS: CNT :16BIT [m3vpss ] TILER_STATS: CNT RESOLUTION: 32768 x 1344 [m3vpss ] TILER_STATS: BUCKET RESOLUTION: 32768 x 1344 [m3vpss ] TILER_STATS: NUM FREE BUCKETS: 1 [m3vpss ] TILER_STATS: NUM USED BUCKETS: 0 [m3vpss ] TILER_STATS: TOTAL FREE AREA: 44040192 (100 %) [m3vpss ] TILER_STATS: TOTAL USED AREA: 0 (0 %) [m3vpss ] 171765: SYSTEM : FREE SPACE : Tiler 8-bit = 89063424 B (84 MB) – TILER ON [m3vpss ] 171765: SYSTEM : FREE SPACE : Tiler 16-bit = 44040192 B (42 MB) – TILER ON [m3video] 177765: HDVICP-ID:0 [m3video] All percentage figures are based off totalElapsedTime [m3video] totalAcquire2wait :0 % [m3video] totalWait2Isr :98 % [m3video] totalIsr2Done :0 % [m3video] totalWait2Done :98 % [m3video] totalDone2Release :0 % [m3video] totalAcquire2Release :100 % [m3video] totalAcq2acqDelay :0 % [m3video] totalElapsedTime in msec : 67 [m3video] numAccessCnt: 4 [m3video] IVA-FPS : 0 [m3video] Average time spent per frame in microsec: 16415 [m3video] 177766: 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] 177767: 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 : 158 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 | 60 60 0 0 255 / 0 [m3video] [m3video] Multi Channel Encode 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] [m3video] Multi Channel Encode 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 % [m3vpss ] [m3vpss ] 180770: LOAD: CPU: 7.6% HWI: 1.5%, SWI:1.3% [m3vpss ] [m3vpss ] 180770: LOAD: TSK: IPC_OUT_M30 : 0.6% [m3vpss ] 180770: LOAD: TSK: CAPTURE : 0.5% [m3vpss ] 180770: LOAD: TSK: NSF0 : 0.9% [m3vpss ] 180770: LOAD: TSK: DISPLAY0 : 0.7% [m3vpss ] 180770: LOAD: TSK: DUP0 : 0.3% [m3vpss ] 180770: LOAD: TSK: MISC : 1.8% [m3vpss ] [m3video] [m3video] 181271: LOAD: CPU: 3.4% HWI: 0.5%, SWI:0.9% [m3video] [m3video] 181271: LOAD: TSK: IPC_IN_M30 : 0.4% [m3video] 181272: LOAD: TSK: IPC_BITS_OUT0 : 0.3% [m3video] 181272: LOAD: TSK: ENC0 : 1.1% [m3video] 181272: LOAD: TSK: MISC : 0.2% [m3video] [c6xdsp ] [c6xdsp ] 181447: LOAD: CPU: 0.2% HWI: 0.0%, SWI:0.0% [c6xdsp ] [c6xdsp ] 181447: LOAD: TSK: MISC : 0.2% [c6xdsp ]

仍然是将全部帧丢弃!

shawnstone:

回复 peng cheng2:

你好,

      检查了一下回调函数,发现此处的注册确实有点问题,已解决

谢谢!

赞(0)
未经允许不得转载:TI中文支持网 » M3Video 跳帧问题 ?
分享到: 更多 (0)