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.

Dm8148 OSD: ERROR during SWOSD_blendFrames()

Hi all,

I am working on Mistral Dm8148 EVM and DVR RDK4.1.

Our application is Capt->Dup->SWOSD->Encode(1080p), Encode(720p)->File write.

SWOSD is throwing some errors "OSD: ERROR during SWOSD_blendFrames()" but encoding  and file write is happening properly.

Please help me.

Please find the attached use case.

    CaptureLink_CreateParams        capturePrm;
    NsfLink_CreateParams        nsfPrm[2];
    IpcLink_CreateParams        ipcOutVpssPrm;
    IpcLink_CreateParams        ipcInVideoPrm;
    DupLink_CreateParams              dupPrm;
	DeiLink_CreateParams 		deiPrm;
	SclrLink_CreateParams             sclrPrm;
    MergeLink_CreateParams            mergePrm;
    EncLink_CreateParams        encPrm;
    IpcBitsOutLinkRTOS_CreateParams   ipcBitsOutVideoPrm;
    IpcBitsInLinkHLOS_CreateParams    ipcBitsInHostPrm;
    AlgLink_CreateParams              dspAlgPrm;
    CaptureLink_VipInstParams *pCaptureInstPrm;
    CaptureLink_OutParams     *pCaptureOutPrm;
    UInt32 i;

    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(SclrLink_CreateParams,sclrPrm);
    MULTICH_INIT_STRUCT(EncLink_CreateParams, encPrm);
    MULTICH_INIT_STRUCT(DeiLink_CreateParams, deiPrm);


    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
    );

    gVcapModuleContext.captureId             = SYSTEM_LINK_ID_CAPTURE;
    gVcapModuleContext.nsfId[0]              = SYSTEM_LINK_ID_NSF_0;
	gVcapModuleContext.nsfId[1]              = SYSTEM_LINK_ID_NSF_1;
    gVencModuleContext.encId                 = SYSTEM_LINK_ID_VENC_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;
	dupId    								 = SYSTEM_VPSS_LINK_ID_DUP_0;
	gVcapModuleContext.sclrId[0]			 = SYSTEM_LINK_ID_SCLR_INST_0;
	gVcapModuleContext.deiId[0]        		 = SYSTEM_LINK_ID_DEI_HQ_0;
    mergeId									 = SYSTEM_VPSS_LINK_ID_MERGE_0;
	gVcapModuleContext.dspAlgId[0] 			 = SYSTEM_LINK_ID_VIDEO_ALG_0  ;

    CaptureLink_CreateParams_Init(&capturePrm);
    capturePrm.outQueParams[0].nextLink = dupId;
    capturePrm.numVipInst    = 1;
    capturePrm.tilerEnable              = FALSE;
    capturePrm.enableSdCrop             = FALSE;

	pCaptureInstPrm                     = &capturePrm.vipInst[0];
	pCaptureInstPrm->inScanFormat       = SYSTEM_SF_PROGRESSIVE;
	pCaptureInstPrm->videoIfMode        = SYSTEM_CAPT_VIDEO_IF_MODE_16BIT;
	pCaptureInstPrm->videoCaptureMode 	= SYSTEM_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_EMBEDDED_SYNC;
	pCaptureInstPrm->vipInstId          = (SYSTEM_CAPTURE_INST_VIP0_PORTA+0)%SYSTEM_CAPTURE_INST_MAX;
	pCaptureInstPrm->videoDecoderId     = 0;//other than 
	pCaptureInstPrm->inDataFormat       = SYSTEM_DF_YUV422P;
	pCaptureInstPrm->standard           = SYSTEM_STD_720P_60;
	pCaptureInstPrm->numOutput          = 1;

	pCaptureOutPrm                      = &pCaptureInstPrm->outParams[0];
	pCaptureOutPrm->dataFormat          = SYSTEM_DF_YUV422I_YUYV;
	pCaptureOutPrm->scEnable            = FALSE;
	pCaptureOutPrm->scOutWidth          = 0;
	pCaptureOutPrm->scOutHeight         = 0;
	pCaptureOutPrm->outQueId            = 0;


    dupPrm.inQueParams.prevLinkId    = gVcapModuleContext.captureId;
    dupPrm.inQueParams.prevLinkQueId = 0;
    dupPrm.notifyNextLink            = TRUE;
    dupPrm.outQueParams[0].nextLink  = gVcapModuleContext.deiId[0];
    dupPrm.outQueParams[1].nextLink  = gVcapModuleContext.nsfId[1];
    dupPrm.numOutQue                 = 1;

    NsfLink_CreateParams_Init(&nsfPrm[0]);
    NsfLink_CreateParams_Init(&nsfPrm[1]);
    nsfPrm[1].bypassNsf                 = FALSE;
    nsfPrm[1].tilerEnable               = FALSE;
    nsfPrm[1].inQueParams.prevLinkId    = dupId;
    nsfPrm[1].inQueParams.prevLinkQueId = 1;
    nsfPrm[1].numOutQue                 = 1;
    nsfPrm[1].outQueParams[0].nextLink  = mergeId;
    nsfPrm[1].numBufsPerCh              = 6;
    nsfPrm[1].inputFrameRate            = 60;
    nsfPrm[1].outputFrameRate           = 30;

    deiPrm.inQueParams.prevLinkId    							= dupId;
    deiPrm.inQueParams.prevLinkQueId 							= 0;
    deiPrm.outQueParams[0].nextLink 							= gVcapModuleContext.nsfId[0];
	deiPrm.numBufsPerCh[0] 										= 4;
    deiPrm.outScaleFactor[0][0].scaleMode 						= SCLR_SCALE_MODE_ABSOLUTE;
    deiPrm.outScaleFactor[0][0].absoluteResolution.outWidth 	= 1920;
    deiPrm.outScaleFactor[0][0].absoluteResolution.outHeight 	= 1080;

    deiPrm.enableOut[0]                        					= TRUE;
    deiPrm.generateBlankOut[0]                       			= FALSE;
    deiPrm.tilerEnable[0]          								= FALSE;
    deiPrm.comprEnable                                   		= FALSE;
    deiPrm.setVipScYuv422Format                          		= TRUE;
    deiPrm.enableDeiForceBypass 								= FALSE;

    deiPrm.inputDeiFrameRate  									= 60;
    deiPrm.outputDeiFrameRate 									= 60;
    deiPrm.inputFrameRate[0] 									= 60;
    deiPrm.outputFrameRate[0] 									= 60; 
    deiPrm.enableLineSkipSc 									= FALSE;

    nsfPrm[0].bypassNsf                 = FALSE;
    nsfPrm[0].tilerEnable               = FALSE;
    nsfPrm[0].inQueParams.prevLinkId    = gVcapModuleContext.deiId[0];
    nsfPrm[0].inQueParams.prevLinkQueId = 0;
    nsfPrm[0].numOutQue                 = 1;
    nsfPrm[0].outQueParams[0].nextLink  = mergeId;
    nsfPrm[0].numBufsPerCh              = 6;
    nsfPrm[0].inputFrameRate            = 60;
    nsfPrm[0].outputFrameRate           = 30;

    mergePrm.inQueParams[0].prevLinkId    = gVcapModuleContext.nsfId[0];
    mergePrm.inQueParams[0].prevLinkQueId = 0;
    mergePrm.inQueParams[1].prevLinkId    = gVcapModuleContext.nsfId[1];
    mergePrm.inQueParams[1].prevLinkQueId =  0;
    mergePrm.notifyNextLink        		  = TRUE;
    mergePrm.numInQue              		  = 2;
    mergePrm.outQueParams.nextLink 		  = ipcOutVpssId;
	
    ipcOutVpssPrm.inQueParams.prevLinkId    = mergeId;
    ipcOutVpssPrm.inQueParams.prevLinkQueId = 0;
    ipcOutVpssPrm.numOutQue                 = 1;
    ipcOutVpssPrm.notifyNextLink            = TRUE;
    ipcOutVpssPrm.notifyPrevLink            = TRUE;
    ipcOutVpssPrm.noNotifyMode              = FALSE;
    ipcOutVpssPrm.outQueParams[0].nextLink  = ipcInVideoId ;


    ipcInVideoPrm.inQueParams.prevLinkId    = ipcOutVpssId;
    ipcInVideoPrm.inQueParams.prevLinkQueId = 0;
    ipcInVideoPrm.numOutQue                 = 1;
    ipcInVideoPrm.notifyNextLink            = TRUE;
    ipcInVideoPrm.notifyPrevLink            = TRUE;
    ipcInVideoPrm.noNotifyMode              = FALSE;

	ipcInVideoPrm.outQueParams[0].nextLink     = gVcapModuleContext.dspAlgId[0];
	
	dspAlgPrm.enableOSDAlg = TRUE;
	{
        int chId;

        for(chId = 0; chId < 2; chId++)
        {
            AlgLink_OsdChWinParams * chWinPrm = &dspAlgPrm.osdChCreateParams[chId].chDefaultParams;

            dspAlgPrm.osdChCreateParams[chId].maxWidth  = EXAMPLE_OSD_WIN_MAX_WIDTH;
            dspAlgPrm.osdChCreateParams[chId].maxHeight = EXAMPLE_OSD_WIN_MAX_HEIGHT;

            chWinPrm->chId = chId;
            chWinPrm->numWindows = 0;
        }
	}
	dspAlgPrm.inQueParams.prevLinkId           = ipcInVideoId;
	dspAlgPrm.inQueParams.prevLinkQueId        = 0;
	dspAlgPrm.outQueParams[ALG_LINK_FRAMES_OUT_QUE].nextLink = gVencModuleContext.encId;
    dspAlgPrm.enableSCDAlg              = FALSE;
    dspAlgPrm.outQueParams[ALG_LINK_SCD_OUT_QUE].nextLink     = SYSTEM_LINK_ID_INVALID;
     {
        EncLink_ChCreateParams *pLinkChPrm;
        EncLink_ChDynamicParams *pLinkDynPrm;
        VENC_CHN_DYNAMIC_PARAM_S *pDynPrm;
        VENC_CHN_PARAMS_S *pChPrm;

        EncLink_CreateParams_Init(&encPrm);

        encPrm.numBufPerCh[0] = 6;
		encPrm.numBufPerCh[1] = 6;

        for (i=0; i<2; 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      = FALSE;
            pLinkChPrm->enableWaterMarking      = pChPrm->enableWaterMarking;
            pLinkChPrm->maxBitRate              = pChPrm->maxBitRate;
            pLinkChPrm->encodingPreset          = pChPrm->encodingPreset;
            pLinkChPrm->rateControlPreset       = pChPrm->rcType;
	        //pLinkChPrm->enableHighSpeed         = TRUE;
            pLinkChPrm->enableSVCExtensionFlag  = pChPrm->enableSVCExtensionFlag;
            pLinkChPrm->numTemporalLayer        = VENC_TEMPORAL_LAYERS_4;

            pLinkDynPrm->intraFrameInterval     = pDynPrm->intraFrameInterval;
            pLinkDynPrm->targetBitRate          = 10*1000*1000;
            pLinkDynPrm->interFrameInterval     = 1;
            pLinkDynPrm->mvAccuracy             = IVIDENC2_MOTIONVECTOR_QUARTERPEL;
            pLinkDynPrm->inputFrameRate         = 30;
            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    = gVcapModuleContext.dspAlgId[0];
		encPrm.inQueParams.prevLinkQueId = ALG_LINK_FRAMES_OUT_QUE;
        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;
    ipcBitsInHostPrm.baseCreateParams.outQueParams[0].nextLink   = SYSTEM_LINK_ID_INVALID;
    MultiCh_ipcBitsInitCreateParams_BitsInHLOS(&ipcBitsInHostPrm);

    System_linkCreate(gVcapModuleContext.captureId, &capturePrm, sizeof(capturePrm));
    System_linkCreate(dupId, &dupPrm, sizeof(dupPrm));
    System_linkCreate(gVcapModuleContext.nsfId[1], &nsfPrm[1], sizeof(nsfPrm[1]));
    System_linkCreate(gVcapModuleContext.deiId[0], &deiPrm, sizeof(deiPrm));
	System_linkCreate(gVcapModuleContext.nsfId[0], &nsfPrm[0], sizeof(nsfPrm[0]));

    System_linkCreate(gVcapModuleContext.nsfId[1], &nsfPrm[1], sizeof(nsfPrm[1]));
    System_linkCreate(mergeId, &mergePrm, sizeof(mergePrm));

    System_linkCreate(ipcOutVpssId , &ipcOutVpssPrm , sizeof(ipcOutVpssPrm) );
    System_linkCreate(ipcInVideoId , &ipcInVideoPrm , sizeof(ipcInVideoPrm) );
	System_linkCreate(gVcapModuleContext.dspAlgId[0] , &dspAlgPrm, sizeof(dspAlgPrm));
    System_linkCreate(gVencModuleContext.encId, &encPrm, sizeof(encPrm));
    System_linkCreate(gVencModuleContext.ipcBitsOutRTOSId, &ipcBitsOutVideoPrm, sizeof(ipcBitsOutVideoPrm));
    System_linkCreate(gVencModuleContext.ipcBitsInHLOSId, &ipcBitsInHostPrm, sizeof(ipcBitsInHostPrm));

Regards,

Kiran S Patil