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

DM8168 enclink 运行一段时间,没有bitbuf

我在我们项目中,部分设备运行一段时间(二天或者一个多星期),MPEG数据没有输出到A8

{Video |[enclink]=>[ipcBitOutVidde]}=>{A8|[ipcBitInHost]}

/* =============================================================================
* Use case code
* =============================================================================
*/
static SystemVideo_Ivahd2ChMap_Tbl systemVid_encDecIvaChMapTbl =
{
.isPopulated = 1,
.ivaMap[0] =
{
.EncNumCh = 12,
.EncChList = {0, 1, 2, 3, 4, 5, 16, 17, 18, 19, 20, 21},
.DecNumCh = 0,
.DecChList = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
},
.ivaMap[1] =
{
.EncNumCh = 12,
.EncChList = {6, 7, 8, 9, 10, 11, 22, 23, 24, 25, 26, 27},
.DecNumCh = 0,
.DecChList = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
},
.ivaMap[2] =
{
.EncNumCh = 24,
.EncChList = {12, 13, 14, 15, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47},
.DecNumCh = 0,
.DecChList = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
},
};

extern Void Vdsp_bitsCbFxn(Ptr pPrm);
extern Void Vcap_framesCbFxn(Ptr pPrm);

Void MultiCh_createVcapVencVdis()
{
CaptureLink_CreateParams capturePrm;
DeiLink_CreateParams deiPrm[MAX_DEI_LINK];
MergeLink_CreateParams mergePrm[NUM_MERGE_LINK];

IpcFramesOutLinkRTOS_CreateParams ipcFramesOutVpssToHostPrm;
IpcFramesInLinkHLOS_CreateParams ipcFramesInHostPrm;
IpcLink_CreateParams ipcOutVpssPrm;
IpcLink_CreateParams ipcInVideoPrm; EncLink_CreateParams encPrm;
IpcBitsOutLinkRTOS_CreateParams ipcBitsOutVideoPrm;
IpcBitsInLinkHLOS_CreateParams ipcBitsInHostPrm;

IpcFramesOutLinkRTOS_CreateParams ipcFramesOutVpssToDSPPrm;
IpcFramesInLinkRTOS_CreateParams ipcFramesInDSPPrm;
AlgLink_CreateParams dspAlgPrm;
IpcBitsOutLinkRTOS_CreateParams ipcBitsOutDSPPrm;
IpcBitsInLinkHLOS_CreateParams ipcBitsInHostFromDSPPrm;

VCAP_VIDDEC_PARAMS_S vidDecVideoModeArgs[NUM_CAPTURE_DEVICES];

Bool osdFormat = 0; // 0 for 420SP and 1 for 422i

CaptureLink_VipInstParams *pCaptureInstPrm;
CaptureLink_OutParams *pCaptureOutPrm;

UInt32 vipInstId;
UInt32 i,j;
Bool enableTiler;

System_init(); // SYSTEM INIT

MULTICH_INIT_STRUCT(IpcFramesOutLinkRTOS_CreateParams ,ipcFramesOutVpssToHostPrm);
MULTICH_INIT_STRUCT(IpcFramesInLinkHLOS_CreateParams ,ipcFramesInHostPrm);

/*VIDEO ENC*/
MULTICH_INIT_STRUCT(IpcLink_CreateParams ,ipcOutVpssPrm);
MULTICH_INIT_STRUCT(IpcLink_CreateParams ,ipcInVideoPrm);
MULTICH_INIT_STRUCT(EncLink_CreateParams ,encPrm);
MULTICH_INIT_STRUCT(IpcBitsOutLinkRTOS_CreateParams ,ipcBitsOutVideoPrm);
MULTICH_INIT_STRUCT(IpcBitsInLinkHLOS_CreateParams ,ipcBitsInHostPrm);

/* DSP */
MULTICH_INIT_STRUCT(IpcFramesOutLinkRTOS_CreateParams,ipcFramesOutVpssToDSPPrm);
MULTICH_INIT_STRUCT(IpcFramesInLinkRTOS_CreateParams,ipcFramesInDSPPrm);
MULTICH_INIT_STRUCT(AlgLink_CreateParams , dspAlgPrm);
MULTICH_INIT_STRUCT(IpcBitsOutLinkRTOS_CreateParams, ipcBitsOutDSPPrm);
MULTICH_INIT_STRUCT(IpcBitsInLinkHLOS_CreateParams , ipcBitsInHostFromDSPPrm);
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);

/* Disable tiler allocator for this usecase
* for that tiler memory can be reused for
* non-tiled allocation
*/
SystemTiler_disableAllocator(); enableTiler = FALSE;

gVcapModuleContext.captureId = SYSTEM_LINK_ID_CAPTURE;
gVcapModuleContext.deiId[0] = SYSTEM_LINK_ID_DEI_HQ_0;
gVcapModuleContext.deiId[1] = SYSTEM_LINK_ID_DEI_0;

gMultiCh_VcapVencVdisObj.mergeId[0] = SYSTEM_VPSS_LINK_ID_MERGE_0;
gMultiCh_VcapVencVdisObj.mergeId[1] = SYSTEM_VPSS_LINK_ID_MERGE_1;

gVcapModuleContext.ipcFramesOutVpssToHostId = SYSTEM_VPSS_LINK_ID_IPC_FRAMES_OUT_1;
gVcapModuleContext.ipcFramesInHostId = SYSTEM_HOST_LINK_ID_IPC_FRAMES_IN_0;
gMultiCh_VcapVencVdisObj.ipcOutVpssId = SYSTEM_VPSS_LINK_ID_IPC_OUT_M3_0;
gMultiCh_VcapVencVdisObj.ipcInVideoId = SYSTEM_VIDEO_LINK_ID_IPC_IN_M3_0;
gVencModuleContext.encId = SYSTEM_LINK_ID_VENC_0;
gVencModuleContext.ipcBitsOutRTOSId = SYSTEM_VIDEO_LINK_ID_IPC_BITS_OUT_0;
gVencModuleContext.ipcBitsInHLOSId = SYSTEM_HOST_LINK_ID_IPC_BITS_IN_0;

gVcapModuleContext.ipcFramesOutVpssId[0] = SYSTEM_VPSS_LINK_ID_IPC_FRAMES_OUT_0;
gVcapModuleContext.ipcFramesInDspId[0] = SYSTEM_DSP_LINK_ID_IPC_FRAMES_IN_0;
gVcapModuleContext.dspAlgId[0] = SYSTEM_LINK_ID_ALG_0;
gMultiCh_VcapVencVdisObj.ipcOutDSPtoHostId = SYSTEM_DSP_LINK_ID_IPC_BITS_OUT_0;
gVcapModuleContext.ipcBitsInHLOSId = SYSTEM_HOST_LINK_ID_IPC_BITS_IN_1;
/* set capture link args */
CaptureLink_CreateParams_Init(&capturePrm);

capturePrm.numVipInst = 4;
capturePrm.tilerEnable = FALSE;
capturePrm.outQueParams[0].nextLink = gVcapModuleContext.deiId[0];
capturePrm.outQueParams[1].nextLink = gVcapModuleContext.deiId[1];

for(vipInstId=0; vipInstId<capturePrm.numVipInst; vipInstId++)
{
pCaptureInstPrm = &capturePrm.vipInst[vipInstId];
//pCaptureInstPrm->vipInstId = SYSTEM_CAPTURE_INST_VIP1_PORTB-vipInstId;
//SYSTEM_CAPTURE_INST_VIP0_PORTA+vipInstId;
pCaptureInstPrm->vipInstId = SYSTEM_CAPTURE_INST_VIP0_PORTA+vipInstId;

pCaptureInstPrm->videoDecoderId = SYSTEM_DEVICE_VID_DEC_TVP5158_DRV;
pCaptureInstPrm->inDataFormat = SYSTEM_DF_YUV422P;
pCaptureInstPrm->standard = SYSTEM_STD_MUX_4CH_D1;
pCaptureInstPrm->numOutput = 1;

pCaptureOutPrm = &pCaptureInstPrm->outParams[0];
pCaptureOutPrm->dataFormat = SYSTEM_DF_YUV422I_YUYV;
pCaptureOutPrm->scEnable = FALSE;
pCaptureOutPrm->scOutWidth = 0;
pCaptureOutPrm->scOutHeight = 0;
if ((vipInstId >= 2) && !(osdFormat))
pCaptureOutPrm->outQueId = 1;
else
pCaptureOutPrm->outQueId = 0;
}

for(i = 0; i < NUM_CAPTURE_DEVICES; i++)
{
vidDecVideoModeArgs[i].videoIfMode = DEVICE_CAPT_VIDEO_IF_MODE_8BIT;
vidDecVideoModeArgs[i].videoDataFormat = SYSTEM_DF_YUV422P;
vidDecVideoModeArgs[i].standard = SYSTEM_STD_MUX_4CH_D1;
vidDecVideoModeArgs[i].videoCaptureMode =
DEVICE_CAPT_VIDEO_CAPTURE_MODE_MULTI_CH_PIXEL_MUX_EMBEDDED_SYNC; vidDecVideoModeArgs[i].videoSystem =
DEVICE_VIDEO_DECODER_VIDEO_SYSTEM_PAL;

vidDecVideoModeArgs[i].videoCropEnable = FALSE;
vidDecVideoModeArgs[i].videoAutoDetectTimeout = -1;
}

Vcap_configVideoDecoder(vidDecVideoModeArgs, NUM_CAPTURE_DEVICES);

/* set dei link and merge link args */
for(i=0; i<MAX_DEI_LINK; i++)
{
DeiLink_CreateParams_Init(&deiPrm[i]);
deiPrm[i].inQueParams.prevLinkId = gVcapModuleContext.captureId;
deiPrm[i].inQueParams.prevLinkQueId = i;
deiPrm[i].outQueParams[DEI_LINK_OUT_QUE_VIP_SC].nextLink = gMultiCh_VcapVencVdisObj.mergeId[0];
deiPrm[i].enableOut[DEI_LINK_OUT_QUE_VIP_SC] = TRUE;

deiPrm[i].outQueParams[DEI_LINK_OUT_QUE_VIP_SC_SECONDARY_OUT].nextLink = gMultiCh_VcapVencVdisObj.mergeId[1];
deiPrm[i].enableOut[DEI_LINK_OUT_QUE_VIP_SC_SECONDARY_OUT] = TRUE;
deiPrm[i].tilerEnable = FALSE;//TRUE;
deiPrm[i].comprEnable = FALSE;
deiPrm[i].setVipScYuv422Format = FALSE;
/* Set Output Scaling at DEI based on ratio */
deiPrm[i].scaleMode = DEI_SCALE_MODE_RATIO;
//deiPrm[i].enableDeiForceBypass = FALSE;
//deiPrm[i].enableLineSkipSc = FALSE; //deiPrm[i].inputFrameRate[DEI_LINK_OUT_QUE_VIP_SC_SECONDARY_OUT] = 30;
//deiPrm[i].outputFrameRate[DEI_LINK_OUT_QUE_VIP_SC_SECONDARY_OUT] = 1;

deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC].ratio.heightRatio.numerator = 1;
deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC].ratio.heightRatio.denominator = 1;
deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC].ratio.widthRatio.numerator = 1;
deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC].ratio.widthRatio.denominator = 1;

deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC_SECONDARY_OUT].ratio.widthRatio.numerator = 1;
deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC_SECONDARY_OUT].ratio.widthRatio.denominator = 2;
deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC_SECONDARY_OUT].ratio.heightRatio.numerator = 1;
deiPrm[i].outScaleFactor[DEI_LINK_OUT_QUE_VIP_SC_SECONDARY_OUT].ratio.heightRatio.denominator = 2;

mergePrm[MERGE_LINK_TO_D1].numInQue = 2;
mergePrm[MERGE_LINK_TO_D1].inQueParams[i].prevLinkId = gVcapModuleContext.deiId[i];
mergePrm[MERGE_LINK_TO_D1].inQueParams[i].prevLinkQueId = DEI_LINK_OUT_QUE_VIP_SC;

mergePrm[MERGE_LINK_TO_CIF].numInQue = 2;
mergePrm[MERGE_LINK_TO_CIF].inQueParams[i].prevLinkId = gVcapModuleContext.deiId[i];
mergePrm[MERGE_LINK_TO_CIF].inQueParams[i].prevLinkQueId = DEI_LINK_OUT_QUE_VIP_SC_SECONDARY_OUT; }

mergePrm[MERGE_LINK_TO_CIF].outQueParams.nextLink = gVcapModuleContext.ipcFramesOutVpssId[0];//gMultiCh_VcapVencVdisObj.ipcOutVpssToDSPId; //gVcapModuleContext.ipcFramesOutVpssToHostId; ////for a8, !!!!!, for SetFps
mergePrm[MERGE_LINK_TO_CIF].notifyNextLink = TRUE;

mergePrm[MERGE_LINK_TO_D1].outQueParams.nextLink = gMultiCh_VcapVencVdisObj.ipcOutVpssId; //for video, !!!!!!, relate to SetMJpegFps
mergePrm[MERGE_LINK_TO_D1].notifyNextLink = TRUE;

ipcFramesOutVpssToDSPPrm.baseCreateParams.inQueParams.prevLinkId = gMultiCh_VcapVencVdisObj.mergeId[MERGE_LINK_TO_CIF];
ipcFramesOutVpssToDSPPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcFramesOutVpssToDSPPrm.baseCreateParams.notifyPrevLink = TRUE;

ipcFramesOutVpssToDSPPrm.baseCreateParams.numOutQue = 1;
ipcFramesOutVpssToDSPPrm.baseCreateParams.outQueParams[0].nextLink = gVcapModuleContext.ipcFramesOutVpssToHostId;//gVcapModuleContext.ipcFramesInHostId;
ipcFramesOutVpssToDSPPrm.baseCreateParams.notifyNextLink = TRUE;

ipcFramesOutVpssToDSPPrm.baseCreateParams.processLink = gVcapModuleContext.ipcFramesInDspId[0];
ipcFramesOutVpssToDSPPrm.baseCreateParams.notifyProcessLink = TRUE;
ipcFramesOutVpssToDSPPrm.baseCreateParams.noNotifyMode = FALSE;

ipcFramesOutVpssToHostPrm.baseCreateParams.noNotifyMode = TRUE;
ipcFramesOutVpssToHostPrm.baseCreateParams.notifyNextLink = FALSE;
ipcFramesOutVpssToHostPrm.baseCreateParams.notifyPrevLink = TRUE;
ipcFramesOutVpssToHostPrm.baseCreateParams.inQueParams.prevLinkId = gVcapModuleContext.ipcFramesOutVpssId[0];
ipcFramesOutVpssToHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcFramesOutVpssToHostPrm.baseCreateParams.outQueParams[0].nextLink = gVcapModuleContext.ipcFramesInHostId;

ipcFramesInHostPrm.baseCreateParams.noNotifyMode = TRUE;
ipcFramesInHostPrm.baseCreateParams.notifyNextLink = FALSE;
ipcFramesInHostPrm.baseCreateParams.notifyPrevLink = FALSE; ipcFramesInHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcFramesInHostPrm.baseCreateParams.inQueParams.prevLinkId = gVcapModuleContext.ipcFramesOutVpssToHostId;
ipcFramesInHostPrm.baseCreateParams.numOutQue = 1;
ipcFramesInHostPrm.baseCreateParams.outQueParams[0].nextLink = SYSTEM_LINK_ID_INVALID;
ipcFramesInHostPrm.exportOnlyPhyAddr = FALSE;
ipcFramesInHostPrm.cbCtx = NULL;
ipcFramesInHostPrm.cbFxn = Vcap_framesCbFxn;
ipcFramesInDSPPrm.baseCreateParams.noNotifyMode = FALSE;
ipcFramesInDSPPrm.baseCreateParams.notifyNextLink = TRUE;
ipcFramesInDSPPrm.baseCreateParams.notifyPrevLink = FALSE;
ipcFramesInDSPPrm.baseCreateParams.inQueParams.prevLinkId = gVcapModuleContext.ipcFramesOutVpssId[0];//gMultiCh_VcapVencVdisObj.ipcOutVpssToDSPId;
ipcFramesInDSPPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcFramesInDSPPrm.baseCreateParams.numOutQue = 1;
ipcFramesInDSPPrm.baseCreateParams.outQueParams[0].nextLink = gVcapModuleContext.dspAlgId[0];//gMultiCh_VcapVencVdisObj.dspId;

dspAlgPrm.enableOSDAlg = FALSE;
dspAlgPrm.enableSCDAlg = FALSE;
dspAlgPrm.enablePrkAlg = TRUE;
dspAlgPrm.inQueParams.prevLinkId = gVcapModuleContext.ipcFramesInDspId[0];//gMultiCh_VcapVencVdisObj.ipcInDSPId;
dspAlgPrm.inQueParams.prevLinkQueId = 0;
dspAlgPrm.outQueParams.nextLink = gMultiCh_VcapVencVdisObj.ipcOutDSPtoHostId;
static UInt8 PRKChannelMonitor[16] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
};
dspAlgPrm.prkCreateParams.numBufPerCh = 10;
dspAlgPrm.prkCreateParams.numValidChForPRK = 16;
for(i=0; i<dspAlgPrm.prkCreateParams.numValidChForPRK; i++)
dspAlgPrm.prkCreateParams.prkChannId[i] = PRKChannelMonitor[i];

ipcBitsOutDSPPrm.baseCreateParams.inQueParams.prevLinkQueId = 1;
ipcBitsOutDSPPrm.baseCreateParams.inQueParams.prevLinkId = gVcapModuleContext.dspAlgId[0];//gMultiCh_VcapVencVdisObj.dspId;
ipcBitsOutDSPPrm.baseCreateParams.numOutQue = 1;
ipcBitsOutDSPPrm.baseCreateParams.outQueParams[0].nextLink = gVcapModuleContext.ipcBitsInHLOSId;//gMultiCh_VcapVencVdisObj.ipcInHostId;
MultiCh_ipcBitsInitCreateParams_BitsOutRTOS(&ipcBitsOutDSPPrm, TRUE);// 有关设置的NotifyMode
ipcBitsInHostFromDSPPrm.baseCreateParams.noNotifyMode = TRUE;
ipcBitsInHostFromDSPPrm.baseCreateParams.notifyNextLink = FALSE;
ipcBitsInHostFromDSPPrm.baseCreateParams.notifyPrevLink = FALSE;
ipcBitsInHostFromDSPPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcBitsInHostFromDSPPrm.baseCreateParams.inQueParams.prevLinkId = gMultiCh_VcapVencVdisObj.ipcOutDSPtoHostId;
ipcBitsInHostFromDSPPrm.baseCreateParams.numOutQue = 1;
ipcBitsInHostFromDSPPrm.baseCreateParams.outQueParams[0].nextLink = SYSTEM_LINK_ID_INVALID;

ipcBitsInHostFromDSPPrm.cbFxn = Vdsp_bitsCbFxn;
ipcBitsInHostFromDSPPrm.cbCtx = (Ptr*)NULL;
/*LIANGWL*/ /*A8 to VID*/
ipcOutVpssPrm.inQueParams.prevLinkId = gMultiCh_VcapVencVdisObj.mergeId[MERGE_LINK_TO_D1];
ipcOutVpssPrm.inQueParams.prevLinkQueId = 0;
ipcOutVpssPrm.numOutQue = 1;
ipcOutVpssPrm.outQueParams[0].nextLink = gMultiCh_VcapVencVdisObj.ipcInVideoId;
ipcOutVpssPrm.notifyNextLink = FALSE;
ipcOutVpssPrm.notifyPrevLink = TRUE;
ipcOutVpssPrm.noNotifyMode = TRUE; //?

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

/*VID enc*/
for (i = 0; i < ENC_LINK_MAX_BUF_ALLOC_POOLS; i++)
encPrm.numBufPerCh[i] = 4;
VENC_CHN_DYNAMIC_PARAM_S *pDynPrm;
VENC_CHN_PARAMS_S *pChPrm;
EncLink_ChCreateParams *pLinkChPrm;
EncLink_ChDynamicParams *pLinkDynPrm;
for (i=0; i < gVencModuleContext.vencConfig.numPrimaryChn ; i++)
{ pLinkChPrm = &encPrm.chCreateParams[i];
pLinkDynPrm = &pLinkChPrm->defaultDynamicParams;

pLinkChPrm->format = IVIDEO_MJPEG;
pLinkChPrm->profile = VENC_CHN_HIGH_PROFILE;
pLinkChPrm->dataLayout = IVIDEO_FIELD_SEPARATED;
pLinkChPrm->fieldMergeEncodeEnable = FALSE;
pLinkChPrm->enableAnalyticinfo = 0;
pLinkChPrm->maxBitRate = 0;
pLinkChPrm->encodingPreset = 0;
pLinkChPrm->rateControlPreset = 0;

pLinkDynPrm->intraFrameInterval = 0;
pLinkDynPrm->targetBitRate = 100*1000;
pLinkDynPrm->interFrameInterval = 0;
pLinkDynPrm->mvAccuracy = 0;
pLinkDynPrm->inputFrameRate = 5;//1; //????
pLinkDynPrm->qpMin = 10;
pLinkDynPrm->qpMax = 36;
pLinkDynPrm->qpInit = 2;
pLinkDynPrm->vbrDuration = 0;
pLinkDynPrm->vbrSensitivity = 0; }

encPrm.inQueParams.prevLinkId =gMultiCh_VcapVencVdisObj.ipcInVideoId; // OK
encPrm.inQueParams.prevLinkQueId= 0;
encPrm.outQueParams.nextLink = gVencModuleContext.ipcBitsOutRTOSId;

/*IpcBitsOutVideo*/
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);

/*IpcBitsInHost*/ ipcBitsInHostPrm.baseCreateParams.inQueParams.prevLinkId = gVencModuleContext.ipcBitsOutRTOSId;
ipcBitsInHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcBitsInHostPrm.baseCreateParams.numOutQue = 1;
ipcBitsInHostPrm.baseCreateParams.outQueParams[0].nextLink = SYSTEM_LINK_ID_INVALID;
MultiCh_ipcBitsInitCreateParams_BitsInHLOS(&ipcBitsInHostPrm); /*设置回调函数*/
#ifndef SYSTEM_USE_VIDEO_DECODER
capturePrm.isPalMode = TRUE;
#endif

/* create link */
System_linkCreate (gVcapModuleContext.captureId, &capturePrm, sizeof(capturePrm));

for(i=0; i<MAX_DEI_LINK; i++)
System_linkCreate(gVcapModuleContext.deiId[i] , &deiPrm[i], sizeof(deiPrm[i]));

System_linkCreate( gMultiCh_VcapVencVdisObj.mergeId[MERGE_LINK_TO_D1],
&mergePrm [MERGE_LINK_TO_D1],
sizeof(mergePrm [MERGE_LINK_TO_D1]));

System_linkCreate( gMultiCh_VcapVencVdisObj.mergeId[MERGE_LINK_TO_CIF],
&mergePrm [MERGE_LINK_TO_CIF],
sizeof(mergePrm [MERGE_LINK_TO_CIF]));
System_linkCreate(gVcapModuleContext.ipcFramesOutVpssId[0], &ipcFramesOutVpssToDSPPrm , sizeof(ipcFramesOutVpssToDSPPrm) );
System_linkCreate(gVcapModuleContext.ipcFramesInDspId[0], &ipcFramesInDSPPrm , sizeof(ipcFramesInDSPPrm));
System_linkCreate(gVcapModuleContext.dspAlgId[0], &dspAlgPrm, sizeof(dspAlgPrm));
System_linkCreate(gMultiCh_VcapVencVdisObj.ipcOutDSPtoHostId, &ipcBitsOutDSPPrm, sizeof(ipcBitsOutDSPPrm));
System_linkCreate(gVcapModuleContext.ipcBitsInHLOSId, &ipcBitsInHostFromDSPPrm, sizeof(ipcBitsInHostFromDSPPrm));
System_linkCreate(gVcapModuleContext.ipcFramesOutVpssToHostId ,
&ipcFramesOutVpssToHostPrm, sizeof(ipcFramesOutVpssToHostPrm));

System_linkCreate(gVcapModuleContext.ipcFramesInHostId ,
&ipcFramesInHostPrm, sizeof(ipcFramesInHostPrm));

System_linkCreate(gMultiCh_VcapVencVdisObj.ipcOutVpssId , &ipcOutVpssPrm , sizeof(ipcOutVpssPrm) );
System_linkCreate(gMultiCh_VcapVencVdisObj.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));
MultiCh_memPrintHeapStatus();

}

Void MultiCh_deleteVcapVencVdis()
{
UInt32 i;
UInt32 ipcBitsOutDSPId;

/* delete can be done in any order */
/* create link */
printf("[0]\n");
System_linkDelete (gVcapModuleContext.captureId);
printf("[1]\n");
for(i=0; i<MAX_DEI_LINK; i++)
System_linkDelete(gVcapModuleContext.deiId[i]);
printf("[2]\n");
System_linkDelete( gMultiCh_VcapVencVdisObj.mergeId[MERGE_LINK_TO_D1]);
printf("[3]\n");
System_linkDelete( gMultiCh_VcapVencVdisObj.mergeId[MERGE_LINK_TO_CIF]);
printf("[4]\n");

/*DSP*/
System_linkDelete(gVcapModuleContext.ipcFramesOutVpssId[0]);
printf("[5]\n");
System_linkDelete(gVcapModuleContext.ipcFramesOutVpssToHostId);
printf("[5-1]\n");
System_linkDelete(gVcapModuleContext.ipcFramesInHostId);
printf("[6]\n");
System_linkDelete(gVcapModuleContext.ipcFramesInDspId[0]);
printf("[7]\n");
System_linkDelete(gVcapModuleContext.dspAlgId[0]);
printf("[8]\n");
System_linkDelete(gMultiCh_VcapVencVdisObj.ipcOutDSPtoHostId);
printf("[9]\n");
System_linkDelete(gVcapModuleContext.ipcBitsInHLOSId);
printf("[10]\n");
/*VIDEO*/
System_linkDelete(gMultiCh_VcapVencVdisObj.ipcOutVpssId);
printf("[11]\n");
System_linkDelete(gMultiCh_VcapVencVdisObj.ipcInVideoId);
printf("[12]\n");
System_linkDelete(gVencModuleContext.encId);
printf("[13]\n");
System_linkDelete(gVencModuleContext.ipcBitsOutRTOSId);
printf("[14]\n");
System_linkDelete(gVencModuleContext.ipcBitsInHLOSId);
printf("[15]\n");

for(i = 0; i < VCAP_DEV_MAX; i++)
{
if(gVcapModuleContext.tvp5158Handle[i])
{
Device_tvp5158Delete(gVcapModuleContext.tvp5158Handle[i], NULL);
}
}

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

/* Reenable tiler allocator taht was disabled by this usecase
* at delete time.
*/
SystemTiler_enableAllocator(); //LIANGWL

System_deInit();
}

—————————————————————————————————————

通过系统DEBUG输出信息,来看,enclink 以及可以输出的Bitbuf了,出现该情况时,设备也不能正常退出

[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 ] 000 | 26397050 13198526 13198524 50 25 25 720 / 720 288 / 288 1 1 0/0 (0/0)
[m3vpss ] 001 | 26396999 13198500 13198499 50 25 25 720 / 720 288 / 288 1 0 0/0 (0/0)
[m3vpss ] 002 | 26397087 13198544 13198543 50 25 25 720 / 720 288 / 288 1 0 0/0 (0/0)
[m3vpss ] 003 | 26397040 13198521 13198519 50 25 25 720 / 720 288 / 288 1 1 0/0 (0/0)
[m3vpss ] 100 | 26397116 13198559 13198557 50 25 25 720 / 720 288 / 288 1 1 0/0 (0/0)
[m3vpss ] 101 | 26397038 13198520 13198518 50 25 25 720 / 720 288 / 288 1 1 0/0 (0/0)
[m3vpss ] 102 | 26397138 13198570 13198568 50 25 25 720 / 720 288 / 288 1 1 0/0 (0/0)
[m3vpss ] 103 | 26397160 13198580 13198580 50 25 25 720 / 720 288 / 288 1 0 0/0 (0/0)
[m3vpss ] 200 | 26397152 13198577 13198575 50 25 25 720 / 720 288 / 288 1 1 0/0 (0/0)
[m3vpss ] 201 | 26396989 13198495 13198494 50 25 25 720 / 720 288 / 288 1 1 0/0 (0/0)
[m3vpss ] 202 | 26397240 13198621 13198619 50 25 25 720 / 720 288 / 288 1 1 0/0 (0/0)
[m3vpss ] 203 | 26397283 13198642 13198641 50 25 25 720 / 720 288 / 288 1 1 0/0 (0/0)
[m3vpss ] 300 | 26238349 13119175 13119174 49 24 24 720 / 720 288 / 288 1 1 0/0 (0/0)
[m3vpss ] 301 | 26238349 13119175 13119174 49 24 24 720 / 720 288 / 288 1 1 0/0 (0/0)
[m3vpss ] 302 | 26238349 13119175 13119174 49 24 24 720 / 720 288 / 288 1 1 0/0 (0/0)
[m3vpss ] 303 | 26238349 13119175 13119174 49 24 24 720 / 720 288 / 288 1 1 0/0 (0/0)
[m3vpss ] [m3vpss ] VIP Capture Port 0 | DescMissMatch1 = 0, DescMissMatch2 = 0 , DescMissMatch3 = 0 [m3vpss ] VIP Capture Port 1 | DescMissMatch1 = 0, DescMissMatch2 = 0 , DescMissMatch3 = 0 [m3vpss ] VIP Capture Port 2 | DescMissMatch1 = 0, DescMissMatch2 = 0 , DescMissMatch3 = 0 [m3vpss ] VIP Capture Port 3 | DescMissMatch1 = 0, DescMissMatch2 = 0 , DescMissMatch3 = 0 [m3vpss ] [m3vpss ] *** Capture List Manager Advanced Statistics *** [m3vpss ] [m3vpss ] List Post Count : 269885068 [m3vpss ] List Stall Count : 0 [m3vpss ] List Post Time (ms) : Max = 1, Min = 0, Avg = 0, Total = 72 [m3vpss ] INTC Timeout Count : (0, 0) (Min timeout value = 940, 969) [m3vpss ] Descriptor miss found count : 0 [m3vpss ] [m3vpss ] [m3vpss ] VIP and VPDMA registers, [m3vpss ] VIP0 : FIQ_STATUS : 0x4810551c = 0x0000d400
[m3vpss ] VIP1 : FIQ_STATUS : 0x48105a1c = 0x0000f400
[m3vpss ] VPDMA: LIST_BUSY : 0x4810d00c = 0x00000000
[m3vpss ] [m3vpss ] [m3vpss ] 539804361: CAPTURE: Fields = 421718656 (fps = 66, CPU Load = 22)
[m3vpss ] 539804361: CAPTURE: Num Resets = 0 (Avg 0 ms per reset)
[m3vpss ] 539804362: SYSTEM : Heap Free Space (System = 21160 bytes, SR0 = 14396032 bytes, FrmBuf = 155087744 bytes, [m3vpss ] BitBuf = 94544640 bytes, Mbx = 10238 msgs) [m3vpss ] [m3vpss ] *** [DEI0 ] DEI Statistics *** [m3vpss ] [m3vpss ] Elasped Time : 527839 secs
[m3vpss ] Total Fields Processed : 211177420 [m3vpss ] Total Fields FPS : 121 FPS
[m3vpss ] [m3vpss ] [m3vpss ] CH | In Recv In Reject In Process Out[0] Out[1] Out[2] Skip Out[0] Skip Out[1] Skip Out[2] User Out[0] User Out[1] User Out[2] Latency [m3vpss ] Num | FPS FPS FPS FPS FPS FPS FPS FPS FPS Skip FPS Skip FPS Skip FPS Min / Max [m3vpss ] ——————————————————————————————————————————————
[m3vpss ] 0 | 50 0 50 0 10 10 50 0 0 0 15 15 3 / 13
[m3vpss ] 1 | 50 0 50 0 10 10 50 0 0 0 15 15 3 / 13
[m3vpss ] 2 | 50 0 50 0 10 10 50 0 0 0 15 15 1 / 13
[m3vpss ] 3 | 50 0 50 0 10 10 50 0 0 0 15 15 3 / 13
[m3vpss ] 4 | 50 0 50 0 10 10 50 0 0 0 15 15 3 / 13
[m3vpss ] 5 | 50 0 50 0 10 10 50 0 0 0 15 15 3 / 13
[m3vpss ] 6 | 50 0 50 0 10 10 50 0 0 0 15 15 3 / 13
[m3vpss ] 7 | 50 0 50 0 10 10 50 0 0 0 15 15 3 / 13
[m3vpss ] [m3vpss ] [m3vpss ] *** [DEI2 ] DEI Statistics *** [m3vpss ] [m3vpss ] Elasped Time : 527839 secs
[m3vpss ] Total Fields Processed : 210542855 [m3vpss ] Total Fields FPS : 114 FPS
[m3vpss ] [m3vpss ] [m3vpss ] CH | In Recv In Reject In Process Out[0] Out[1] Out[2] Skip Out[0] Skip Out[1] Skip Out[2] User Out[0] User Out[1] User Out[2] Latency [m3vpss ] Num | FPS FPS FPS FPS FPS FPS FPS FPS FPS Skip FPS Skip FPS Skip FPS Min / Max [m3vpss ] ——————————————————————————————————————————————
[m3vpss ] 0 | 50 0 50 0 10 10 50 0 0 0 15 15 2 / 17
[m3vpss ] 1 | 50 0 50 0 10 10 50 0 0 0 15 15 2 / 17
[m3vpss ] 2 | 50 0 50 0 10 10 50 0 0 0 15 15 2 / 14
[m3vpss ] 3 | 50 0 50 0 10 10 50 0 0 0 15 15 2 / 17
[m3vpss ] 4 | 49 0 49 0 9 9 49 0 0 0 14 14 3 / 17
[m3vpss ] 5 | 49 0 49 0 9 9 49 0 0 0 14 14 5 / 17
[m3vpss ] 6 | 49 0 49 0 9 9 49 0 0 0 14 14 3 / 17
[m3vpss ] 7 | 49 0 49 0 9 9 49 0 0 0 14 14 3 / 17
[m3vpss ] [m3vpss ] [m3vpss ] *** IpcFramesOutRTOS Statistics *** [m3vpss ] [m3vpss ] Elasped Time : 527839 secs
[m3vpss ] Total Fields Processed : 84344061 [m3vpss ] Total Fields FPS : 159 FPS
[m3vpss ] [m3vpss ] [m3vpss ] CH | In Recv In Process In Skip
[m3vpss ] Num | FPS FPS FPS [m3vpss ] ——————————–
[m3vpss ] 0 | 10 10 0
[m3vpss ] 1 | 10 10 0
[m3vpss ] 2 | 10 10 0
[m3vpss ] 3 | 10 10 0
[m3vpss ] 4 | 10 10 0
[m3vpss ] 5 | 10 10 0
[m3vpss ] 6 | 10 10 0
[m3vpss ] 7 | 10 10 0
[m3vpss ] 8 | 10 10 0
[m3vpss ] 9 | 10 10 0
[m3vpss ] 10 | 10 10 0
[m3vpss ] 11 | 10 10 0
[m3vpss ] 12 | 9 9 0
[m3vpss ] 13 | 9 9 0
[m3vpss ] 14 | 9 9 0
[m3vpss ] 15 | 9 9 0
[m3vpss ] [c6xdsp ] [c6xdsp ] *** SCD Statistics *** [c6xdsp ] [c6xdsp ] Elasped Time : 666273 secs
[c6xdsp ] Total Fields Processed : 0 [c6xdsp ] Total Fields FPS : 0 FPS
[c6xdsp ] [c6xdsp ] [c6xdsp ] CH | In Recv In Process In Skip In Process Time [c6xdsp ] Num | FPS FPS FPS per frame (msec)
[c6xdsp ] ————————————————-
[c6xdsp ] 0 | 0 0 0 1
[c6xdsp ] [m3video] 539808598: HDVICP-ID:0
[m3video] totalAcquire2wait in msec: 2965240
[m3video] totalWait2Isr in msec:21475594
[m3video] totalIsr2Done in msec: 113283
[m3video] totalWait2Done in msec:21588877
[m3video] totalDone2Release in msec: 0
[m3video] totalAcquire2Release in msec:25029572
[m3video] totalAcq2acqDelay in msec:321500540
[m3video] totalElapsedTime in msec:346530112
[m3video] numAccessCnt:20786438
[m3video] IVA-FPS : 59
[m3video] 539808599: HDVICP-ID:1
[m3video] totalAcquire2wait in msec: 1539113
[m3video] totalWait2Isr in msec:21306209
[m3video] totalIsr2Done in msec: 104641
[m3video] totalWait2Done in msec:21410850
[m3video] totalDone2Release in msec: 0
[m3video] totalAcquire2Release in msec:23571208
[m3video] totalAcq2acqDelay in msec:322958424
[m3video] totalElapsedTime in msec:346529585
[m3video] numAccessCnt:20770899
[m3video] IVA-FPS : 59
[m3video] 539808600: HDVICP-ID:2
[m3video] totalAcquire2wait in msec: 2210426
[m3video] totalWait2Isr in msec:14595000
[m3video] totalIsr2Done in msec: 134191
[m3video] totalWait2Done in msec:14729191
[m3video] totalDone2Release in msec: 0
[m3video] totalAcquire2Release in msec:17521368
[m3video] totalAcq2acqDelay in msec:329008441
[m3video] totalElapsedTime in msec:346529809
[m3video] numAccessCnt:13715829
[m3video] IVA-FPS : 39
[m3video] [m3video] *** ENCODE Statistics *** [m3video] [m3video] Elasped Time : 527840 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 | 10 3 0 6 13 / 30
[m3video] 1 | 10 3 0 6 13 / 34
[m3video] 2 | 10 3 0 6 13 / 34
[m3video] 3 | 10 3 0 6 13 / 34
[m3video] 4 | 10 3 0 6 13 / 34
[m3video] 5 | 10 3 0 6 13 / 34
[m3video] 6 | 10 3 0 6 13 / 30
[m3video] 7 | 10 3 0 6 13 / 34
[m3video] 8 | 10 3 0 6 13 / 34
[m3video] 9 | 10 3 0 6 13 / 34
[m3video] 10 | 10 3 0 6 12 / 34
[m3video] 11 | 10 3 0 6 13 / 34
[m3video] 12 | 9 3 0 6 13 / 30
[m3video] 13 | 9 3 0 6 13 / 34
[m3video] 14 | 9 3 0 6 13 / 34
[m3video] 15 | 9 3 0 6 13 / 34
[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 : 4
[m3video] IVAHD_1 Average Batch Size : 1
[m3video] IVAHD_1 Max achieved Batch Size : 5
[m3video] IVAHD_2 Average Batch Size : 1
[m3video] IVAHD_2 Max achieved Batch Size : 3
[m3vpss ] [m3vpss ] 539810604: LOAD: CPU: 18% HWI: 1%, SWI:0% [m3vpss ] [m3vpss ] 539810604: LOAD: TSK: IPC_OUT_M30: 1% [m3vpss ] 539810605: LOAD: TSK: IPC_FRAMES_OUT0: 1% [m3vpss ] 539810605: LOAD: TSK: IPC_FRAMES_OUT1: 1% [m3vpss ] 539810605: LOAD: TSK: DEI0 : 3% [m3vpss ] 539810605: LOAD: TSK: DEI2 : 3% [m3vpss ] [m3video] [m3video] 539811106: LOAD: CPU: 7% HWI: 0%, SWI:0% [m3video] [m3video] 539811106: LOAD: TSK: ENC0 : 1% [m3video] 539811107: LOAD: TSK: ENC_PROCESS_TSK_0 : 1% [m3video] 539811107: LOAD: TSK: ENC_PROCESS_TSK_1 : 1% [m3video] [c6xdsp ] [c6xdsp ] 666277709: LOAD: CPU: 7% HWI: 0%, SWI:0% [c6xdsp ] [c6xdsp ] 666277709: LOAD: TSK: ALG0 : 5% [c6xdsp ] [m3vpss ] [m3vpss ] *** CAPTURE Statistics *** [m3vpss ] 539812109: CAPTURE: Queued to driver = 421725039, Dequeued from driver = 421724853
[m3vpss ] CAPTURE [0] Buf Q Status
[m3vpss ] Empty Q -> count 0, wrPtr 0, rdPtr 0
[m3vpss ] Full Q -> count 0, wrPtr 68, rdPtr 68
[m3vpss ] CAPTURE [1] Buf Q Status
[m3vpss ] Empty Q -> count 0, wrPtr 0, rdPtr 0
[m3vpss ] Full Q -> count 0, wrPtr 241, rdPtr 241
[m3vpss ] CAPTURE [2] Buf Q Status
[m3vpss ] Empty Q -> count 0, wrPtr 0, rdPtr 0
[m3vpss ] Full Q -> count 0, wrPtr 0, rdPtr 0
[m3vpss ] CAPTURE [3] Buf Q Status
[m3vpss ] Empty Q -> count 0, wrPtr 0, rdPtr 0
[m3vpss ] Full Q -> count 0, wrPtr 0, rdPtr 0
[m3vpss ] [m3vpss ] *** [DEI0 ] DEI Statistics *** [m3vpss ] 539812113: DEI: Rcvd from prev = 211179716, Returned to prev = 211179716
[m3vpss ] DEI Out [0] Buf Q Status
[m3vpss ] Empty Q -> count 0, wrPtr 0, rdPtr 0
[m3vpss ] Full Q -> count 0, wrPtr 0, rdPtr 0
[m3vpss ] DEI Out [1] Buf Q Status
[m3vpss ] Empty Q -> count 59, wrPtr 227, rdPtr 168
[m3vpss ] Full Q -> count 0, wrPtr 168, rdPtr 168
[m3vpss ] DEI Out [2] Buf Q Status
[m3vpss ] Empty Q -> count 63, wrPtr 231, rdPtr 168
[m3vpss ] Full Q -> count 0, wrPtr 168, rdPtr 168
[m3vpss ] [m3vpss ] *** [DEI2 ] DEI Statistics *** [m3vpss ] 539812114: DEI: Rcvd from prev = 210545137, Returned to prev = 210545137
[m3vpss ] DEI Out [0] Buf Q Status
[m3vpss ] Empty Q -> count 0, wrPtr 0, rdPtr 0
[m3vpss ] Full Q -> count 0, wrPtr 0, rdPtr 0
[m3vpss ] DEI Out [1] Buf Q Status
[m3vpss ] Empty Q -> count 53, wrPtr 27, rdPtr 358
[m3vpss ] Full Q -> count 0, wrPtr 358, rdPtr 358
[m3vpss ] DEI Out [2] Buf Q Status
[m3vpss ] Empty Q -> count 58, wrPtr 32, rdPtr 358
[m3vpss ] Full Q -> count 0, wrPtr 358, rdPtr 358
[m3video] [m3video] *** Encode Statistics *** [m3video] 539812615: ENC: Rcvd from prev = 84345048, Returned to prev = 84345032
[m3video] ENC Out BitBuf Q Status
[m3video] Empty Q 0 -> count 0, wrPtr 222, rdPtr 222
[m3video] Full Q -> count 0, wrPtr 206, rdPtr 206

———————————————————————————————————

请问这个可能的原因是什么?

weilong liang:

从目前的情况来,enclink没有Bitbuf,但是后面的ipc link 仅是数据数据的通道,从A8这段已经看不到buf, 有没有数据经过ipcBitOutVideo 时丢失了,丢失是不是在ListMP里面了

赞(0)
未经允许不得转载:TI中文支持网 » DM8168 enclink 运行一段时间,没有bitbuf
分享到: 更多 (0)