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.

AVI Playback on DM385 using IPNC RDK V3.5

Other Parts Discussed in Thread: DM385

Hi TI experts,

I am trying to playback AVI file on DM385. I am using IPNC RDK V3.5

My usecase is like that:

ipcBitsOutHost(A8) --> ipcBitsInVideoM3 --> dec --> dei/sclr -->display.

After configuring the above use case stream is flowing but display is not proper.

I have attached the snap of video output, kindly suggest on possible issue.

Regards:

Rajesh Singh

  • Hello,

    I will notify our IPNC RDK team for help.

    Regards,
    Pavel

  • Hi Rajesh,

    In your flow diagram there should be ipcOutM3 link between dec and sclr. Can you check?

    Also is the display link getting correct pitch value from previous link? 

    Print the value of 'pObj->inQueInfo.chInfo[0].pitch[0]' after memcpy at line # 1155 in ..\ipnc_rdk\ipnc_mcfw\mcfw\src_bios6\links_m3vpss\display\displayLink_drv.c file.

    regards,

    Anand

    regards,

    Anand

  • Hi Anand,

    Thanks for replying.

    yes usecase is like that:

    ipcBitsOutHost(A8) --> ipcBitsInVideoM3 --> dec -->  ipcM3Out --> ipcInVpss--> dei/sclr -->display.

    I will print the pObj->inQueInfo.chInfo[0].pitch[0] and let you know the result.

    Regards :

    Rajesh Singh

  • Hi Anand,

    Please see the log below.

    In dei link, I am scaling video to 800X480. there for the pitch 1600 is ok i think. Please suggest.

    [m3video]  93291: DECODE: Create in progress ... !!!
     [m3vpss ] HDCOMPCLK
     [m3video]  93383: DECODE: Creating CH0 of 1920 x 1080 [PROGRESSIVE] [NON-TILED  ],target bitrate = 10000 Kbps ...
    KOLANCHI : MultiCh_playbackApp 302
     [m3vpss ]  93423: IPC_IN_M3   : Create in progress !!!
     [m3video] DECLINK_H264:HEAPID:0        USED:2368
     [m3vpss ]  93423: SYSTEM: Opening ListMP [VIDEO-M3_IPC_OUT_0] ...
     [m3video]  93420: DECODE: All CH Create ... DONE !!!
     [m3vpss ]  93424: SYSTEM: Opening ListMP [VIDEO-M3_IPC_IN_0] ...
     [m3vpss ] RAJESH: System_ipcMsgQOpen for ProcessId=1
     [m3vpss ]  93425: SYSTEM: Opening MsgQ [VIDEO-M3_MSGQ] ...
     [m3video] DECLINK:HEAPID:0     USED:2408
     [m3vpss ]  93428: IPC_IN_M3   : Create Done !!!
     [m3video]  93421: DECODE: Create ... DONE !!!
     [m3vpss ]  93428: DEI    : Create in progress !!!
     [m3video]  93421: IPC_OUT_M3   : Create in progress !!!
     [m3vpss ]  93429: Warning: This CPU Revision [ES1.0] does not support current set width 1920
     [m3video]  93423: IPC_OUT_M3   : Create Done !!!
     [m3vpss ]  93429: Warning: Limiting Input width to 960
     [m3vpss ]  93449: DEI: OUT1:  0: 0xa1727480, 800 x 480, 4 frames
     [m3vpss ]  93450: DEI     : Loading Down-scaling Co-effs
     [m3vpss ]  93451: DEI     : Co-effs Loading ... DONE !!!
     [host] USECASE SETUP DONE
     [m3vpss ] DEI:HEAPID:0 USED:64
     [m3vpss ] DEI:HEAPID:1 USED:4448
     [m3vpss ]  93451: DEI    : Create Done !!!
     [m3vpss ]  93452: DISPLAY: Create in progress !!!
     [m3vpss ] DISPLAY: pObj->inQueInfo.chInfo[0].pitch[0] = (1600)
     [m3vpss ] width is 800 and height is 480 : dataFormat 1
     [m3vpss ] pitch 0 is 1600 : pitch 1 is 1600 : pitch 2 is 0
     [m3vpss ] DisplayId = 1,DataFormat = 1
     [m3vpss ] DISPLAY_LINK_DISPLAY_BP0 : DisplayLink_drvDisplayCreate 948
     [m3vpss ] BP0 displayInstId = 0
     [m3vpss ] RAJESH: pObj->createArgs.displayRes == VSYS_STD_CUSTOM
     [m3vpss ]  93453: RAJESH: DISPLAY: 0: Window size 800x480, 1600B
     [m3vpss ] KOLANCHI : DisplayLink_drvDisplayCreate 1069, displayHndl is not null
     [m3vpss ] RAJESH: Fn (DisplayLink_drvIsDeiDisplayDrv) begins
     [m3vpss ] RAJESH: displayInstId = (0)
     [m3vpss ] RAJESH: Fn (DisplayLink_drvIsDeiDisplayDrv) Ends
     [m3vpss ] RAJESH: Fn (DisplayLink_drvSetFmt) begins
     [m3vpss ] RAJESH: Fn (DisplayLink_drvIsDeiDisplayDrv) begins
     [m3vpss ] RAJESH: displayInstId = (0)
     [m3vpss ] RAJESH: Fn (DisplayLink_drvIsDeiDisplayDrv) Ends
     [m3vpss ] RAJESH: Fn (DisplayLink_drvSetFmt) Ends
     [m3vpss ]  93454: DISPLAY: Create Done !!!
     [m3vpss ]  93456: DISPLAY: Start in progress !!!
    [m3vpss ]  93518: DISPLAY: HDDAC(BP0) : 32 fps, Latency (Min / Max) = ( 255 / 0 ), Callback Interval (Min / Max) = ( 255 / 0 ) !!!
     [m3vpss ] DisplayLink_drvPrintRtStatus 1282
     [m3vpss ]  93518: DISPLAY: UNDERFLOW COUNT: HDMI(BP0) 1, HDDAC(BP0) 1, DVO2(BP1) 1, SDDAC(SEC1) 0
     [m3vpss ]  93518: SYSTEM  : FREE SPACE : System Heap      = 865704 B, Mbx = 10238 msgs)
    KOLANCHI : InitAudioCaptureDevice 486
     [m3vpss ]  93518: SYSTEM  : FREE SPACE : SR0 Heap         = 14771328 B (14 MB)
     [m3vpss ]  93519: SYSTEM  : FREE SPACE : Frame Buffer     = 82750336 B (78 MB)
     [m3vpss ]  93519: SYSTEM  : FREE SPACE : Bitstream Buffer = 66201472 B (63 MB)
     [m3vpss ]  93519: SYSTEM  : FREE SPACE : Tiler Buffer     = 127 B (0 MB)  - TILER OFF


    Regards:

    Rajesh Singh                                                                                                      

  • Hi Rajesh,

    Can you pl. use the attached file (..\ipnc_rdk\ipnc_mcfw\mcfw\src_bios6\links_m3vpss\dei\deiLink_drv.c) for your testing?

    regards,

    Anand7120.deiLink_drv.c

  • Hi Anand,

    Thanks for replying.

    I will use this file and let you know the outcome.

    Regards:

    Rajesh Singh

  • Hi Anand,

    After changing this file, while compilation, I am getting error.

    Regards:

    Rajesh Singh

  • What is the error?

    regards,

    Anand

  • Hi Anand,

    Compilation error, I have resolved, once i will test, I will inform the outcome.

    Regards:

    Rajesh Singh

  • Hi Anand,

    After changing the file, it is showing only first frame on display although stream is flowing.

    Kindly suggest.

    Regards:

    Rajesh Singh

  • Hi,

    How do you say frames are flowing?

    Can you print the no of buffers display link is re

    /*******************************************************************************
     *                                                                             *
     * Copyright (c) 2009 Texas Instruments Incorporated - http://www.ti.com/      *
     *                        ALL RIGHTS RESERVED                                  *
     *                                                                             *
     ******************************************************************************/
    
    #include "displayLink_priv.h"
    #include <mcfw/src_bios6/links_m3vpss/avsync/avsync_m3vpss.h>
    #include "mcfw/interfaces/common_def/ti_vsys_common_def.h"
    
    static inline UInt32 DisplayLink_getSc1DispId()
    {
        UInt32 displayId;
    
    #if defined(TI_814X_BUILD) || defined(TI_8107_BUILD)
        displayId = VPS_DISP_INST_MAIN_DEI_SC1;
    #else
        displayId = VPS_DISP_INST_MAIN_DEIH_SC1;
    #endif
    
        return (displayId);
    }
    
    static inline UInt32 DisplayLink_getSc2DispId()
    {
        UInt32 displayId;
    
    #if defined(TI_814X_BUILD) || defined(TI_8107_BUILD)
        displayId = VPS_DISP_INST_AUX_SC2;
    #else
        displayId = VPS_DISP_INST_AUX_DEI_SC2;
    #endif
    
        return (displayId);
    }
    
    static inline Bool DisplayLink_drvIsDeiDisplayDrv(DisplayLink_Obj * pObj)
    {
        Bool isDeiDisplay = FALSE;
    
        if ((VPS_DISP_INST_MAIN_DEIH_SC1 == pObj->displayInstId) ||
            (VPS_DISP_INST_AUX_DEI_SC2 == pObj->displayInstId) ||
            (VPS_DISP_INST_MAIN_DEI_SC1 == pObj->displayInstId) ||
            (VPS_DISP_INST_AUX_SC2 == pObj->displayInstId))
        {
            isDeiDisplay = TRUE;
        }
    
        return (isDeiDisplay);
    }
    
    static
    Bool  DisplayLink_drvIsSDDef(DisplayLink_Obj * pObj)
    {
        Bool isSdDef = FALSE;
    
        if ((VSYS_STD_NTSC == pObj->createArgs.displayRes)
            ||
            (VSYS_STD_PAL == pObj->createArgs.displayRes))
        {
            isSdDef = TRUE;
        }
        return isSdDef;
    }
    
    static
    Bool DisplayLink_drvDoInputPitchDoubling(DisplayLink_Obj * pObj)
    {
    	Bool doPitchDouble = FALSE;
    
        if (DisplayLink_drvIsSDDef(pObj)
            &&
            pObj->displayFormat.fieldMerged[0] == FALSE
            &&
                (
                    (FALSE == pObj->fieldInput[pObj->curActiveQueue])
                    ||
                    pObj->createArgs.forceFieldSeparatedInputMode
                )
            )
        {
        	doPitchDouble = TRUE;
        }
        return doPitchDouble;
    }
    
    static
    Void  DisplayLink_drvCreateFrameInfo(DisplayLink_Obj * pObj)
    {
        Int32 status,i;
        struct DisplayLink_FrameInfoObj *frameInfo =
            &pObj->frameInfo;
    
        UTILS_COMPILETIME_ASSERT(UTILS_ARRAYSIZE(frameInfo->infoQMem) ==
                                 UTILS_ARRAYSIZE(frameInfo->infoMem));
        status =
        Utils_queCreate(&frameInfo->infoQ,
                        UTILS_ARRAYSIZE(frameInfo->infoQMem),
                        &frameInfo->infoQMem[0],
                        UTILS_QUE_FLAG_NO_BLOCK_QUE);
        UTILS_assert(status == 0);
        for (i = 0; i < UTILS_ARRAYSIZE(frameInfo->infoMem);i++)
        {
            DisplayLink_FrameInfo *frameInfoElem;
    
            frameInfoElem = &frameInfo->infoMem[i];
            status =
            Utils_quePut(&frameInfo->infoQ,frameInfoElem,
                         BIOS_NO_WAIT);
            UTILS_assert(status == 0);
        }
        return;
    }
    
    static
    Void  DisplayLink_drvDeleteFrameInfo(DisplayLink_Obj * pObj)
    {
        Int32 status;
    
        status =
        Utils_queDelete(&pObj->frameInfo.infoQ);
        UTILS_assert(status == 0);
    }
    
    
    
    
    static
    Void  DisplayLink_drvFreeFrameInfo(DisplayLink_Obj * pObj,
                                       FVID2_FrameList *frameList)
    {
        Int i;
        FVID2_Frame *frame;
        DisplayLink_FrameInfo *frameInfo;
        Int32 status;
    
        for (i = 0; i < frameList->numFrames; i++)
        {
            frame = frameList->frames[i];
            if (DISPLAY_LINK_BLANK_FRAME_CHANNEL_NUM != frame->channelNum)
            {
                frameInfo = frame->appData;
                UTILS_assert(UTILS_ARRAYISVALIDENTRY(frameInfo,
                                        pObj->frameInfo.infoMem));
                frame->appData = frameInfo->origFrameInfo;
                status =
                  Utils_quePut(&pObj->frameInfo.infoQ,
                               frameInfo,
                               BIOS_NO_WAIT);
                UTILS_assert(status == 0);
            }
        }
    }
    
    static
    Void DisplayLink_drvCreateRtParams(DisplayLink_Obj * pObj)
    {
        Int32 status;
        Int i;
    
        UTILS_COMPILETIME_ASSERT(UTILS_ARRAYSIZE(pObj->rtParams.freeQMem)
                                 ==
                                 UTILS_ARRAYSIZE(pObj->rtParams.paramsMem));
        status =
        Utils_queCreate(&pObj->rtParams.freeQ,
                        UTILS_ARRAYSIZE(pObj->rtParams.freeQMem),
                        pObj->rtParams.freeQMem,
                        UTILS_QUE_FLAG_NO_BLOCK_QUE);
        UTILS_assert(0 == status);
        for (i = 0; i < UTILS_ARRAYSIZE(pObj->rtParams.paramsMem); i++)
        {
            DisplayLink_drvRtParams *rtParams = &pObj->rtParams.paramsMem[i];
            rtParams->dispRtPrms.inFrmPrms = &rtParams->inFrmPrms;
            status = Utils_quePut(&pObj->rtParams.freeQ,
                                  rtParams,
                                  BIOS_NO_WAIT);
            UTILS_assert(0 == status);
        }
    }
    
    static
    Void DisplayLink_drvDeleteRtParams(DisplayLink_Obj * pObj)
    {
        Int32 status;
    
        status = Utils_queDelete(&pObj->rtParams.freeQ);
        UTILS_assert(0 == status);
    }
    
    
    static
    Vps_DispRtParams * DisplayLink_drvSetFramePitchRtParams(DisplayLink_Obj * pObj)
    {
        Int32 status;
        DisplayLink_drvRtParams *rtParams;
        Int i;
    
        status = Utils_queGet(&pObj->rtParams.freeQ,
                              (Ptr *)&rtParams,
                              1,
                              BIOS_NO_WAIT);
        UTILS_assert(status == 0);
        rtParams->dispRtPrms.inFrmPrms = &rtParams->inFrmPrms;
        rtParams->inFrmPrms.width      = pObj->displayFormat.width;
        rtParams->inFrmPrms.height     = pObj->displayFormat.height;
    	rtParams->inFrmPrms.memType    = pObj->displayCreateArgs.memType;
    	rtParams->inFrmPrms.dataFormat = pObj->displayFormat.dataFormat;	
        for (i = 0; i < pObj->numDisplayBufPlanes; i++)
        {
            rtParams->inFrmPrms.pitch[i] = pObj->displayFormat.pitch[i];
        }
        return (&rtParams->dispRtPrms);
    }
    
    static
    Void DisplayLink_drvFreeRtParams(DisplayLink_Obj * pObj,
                                     FVID2_FrameList *freeFrameList)
    {
        Int32 status;
        DisplayLink_drvRtParams *rtParams;
    
        rtParams = freeFrameList->perListCfg;
        if (rtParams)
        {
            UTILS_COMPILETIME_ASSERT(
              offsetof(DisplayLink_drvRtParams,dispRtPrms) == 0);
            UTILS_assert(UTILS_ARRAYISVALIDENTRY(rtParams,pObj->rtParams.paramsMem));
            status = Utils_quePut(&pObj->rtParams.freeQ,
                                  rtParams,
                                  BIOS_NO_WAIT);
            UTILS_assert(status == 0);
        }
    
    }
    
    static
    Void  DisplayLink_drvSetPitchInfo(DisplayLink_Obj * pObj)
    {
        Int i;
        UInt32 curInQueId;
        UInt32 prevLinkQueId;
        System_LinkChInfo *chInfo;
    
        curInQueId = pObj->curActiveQueue;
        UTILS_assert(curInQueId < pObj->createArgs.numInputQueues);
        prevLinkQueId =
            pObj->createArgs.inQueParams[curInQueId].prevLinkQueId;
        UTILS_assert(prevLinkQueId <
                     pObj->inTskInfo[curInQueId].numQue);
        pObj->numDisplayBufPlanes =
        Utils_getNumPlanes((FVID2_DataFormat)pObj->displayFormat.dataFormat);
        UTILS_assert(pObj->numDisplayBufPlanes  != 0);
        if (pObj->curDisplayChannelNum <
            pObj->inTskInfo[curInQueId].queInfo[prevLinkQueId].numCh)
        {
            chInfo =
              &pObj->inTskInfo[curInQueId].queInfo[prevLinkQueId].chInfo[pObj->curDisplayChannelNum];
            UTILS_assert(chInfo->dataFormat == pObj->displayFormat.dataFormat);
            for (i = 0; i < pObj->numDisplayBufPlanes; i++)
            {
                pObj->displayFormat.pitch[i] = chInfo->pitch[i];
                if (DisplayLink_drvDoInputPitchDoubling(pObj))
                {
                    pObj->displayFormat.pitch[i] *= 2;
                }
            }
        }
    }
    
    Vps_DeiDispRtParams * DisplayLink_drvSetDeiFramePitchRtParams(DisplayLink_Obj * pObj)
    {
        Int32 status;
        DisplayLink_drvRtParams *rtParams;
        Int i;
    
        status = Utils_queGet(&pObj->rtParams.freeQ,
                              (Ptr *)&rtParams,
                              1,
                              BIOS_NO_WAIT);
        UTILS_assert(status == 0);
    
        rtParams->deiDispRtPrms.inFrmPrms = &rtParams->inFrmPrms;
        rtParams->inFrmPrms.width      = pObj->displayFormat.width;
        rtParams->inFrmPrms.height     = pObj->displayFormat.height;
    	rtParams->inFrmPrms.memType    = pObj->displayCreateArgs.memType;
    	rtParams->inFrmPrms.dataFormat = pObj->displayFormat.dataFormat;
        for (i = 0; i < pObj->numDisplayBufPlanes; i++)
        {
            rtParams->inFrmPrms.pitch[i] = pObj->displayFormat.pitch[i];
        }
        return (&rtParams->deiDispRtPrms);
    }
    
    
    static
    Void  DisplayLink_drvHandleDynamicPitchChange(DisplayLink_Obj * pObj,
                                                  FVID2_FrameList *frameList)
    {
        Bool updateDrvPitch = FALSE;
        UInt32 curInQueId;
        UInt32 prevLinkQueId;
        FVID2_Frame *frame;
        System_LinkChInfo *chInfo;
        DisplayLink_FrameInfo *frameInfo;
    
        curInQueId = pObj->curActiveQueue;
        UTILS_assert(curInQueId < pObj->createArgs.numInputQueues);
        prevLinkQueId =
            pObj->createArgs.inQueParams[curInQueId].prevLinkQueId;
        UTILS_assert(prevLinkQueId <
                     pObj->inTskInfo[curInQueId].numQue);
    
        UTILS_assert(frameList->numFrames == 1);
        frame = frameList->frames[0];
        if (frame->channelNum == pObj->curDisplayChannelNum)
        {
            Int i;
    
            chInfo =
              &pObj->inTskInfo[curInQueId].queInfo[prevLinkQueId].chInfo[pObj->curDisplayChannelNum];
    
            for (i = 0; i < pObj->numDisplayBufPlanes; i++)
            {
                UInt32 pitch;
    
                frameInfo = frame->appData;
                UTILS_assert((frameInfo != NULL)
                             &&
                             UTILS_ARRAYISVALIDENTRY(frameInfo,
                             pObj->frameInfo.infoMem));
    
                if ((frameInfo->origFrameInfo)
                    &&
                    (frameInfo->origFrameInfo->rtChInfoUpdate))
                {
                    chInfo->pitch[i] = frameInfo->origFrameInfo->rtChInfo.pitch[i];
                }
    
                pitch = chInfo->pitch[i];
    
                if (DisplayLink_drvDoInputPitchDoubling(pObj))
                {
                    pitch *= 2;
                }
                if (pObj->displayFormat.pitch[i] != pitch)
                {
                    updateDrvPitch = TRUE;
                    Vps_printf("DISPLAY:Runtime Pitch change:[%d->%d]",
                               pObj->displayFormat.pitch[i],pitch);
                    break;
                }
            }
        }
    
        if (updateDrvPitch)
        {
    		DisplayLink_drvSetPitchInfo(pObj);
    		
    		pObj->displayFormat.pitch[0] = frameInfo->origFrameInfo->rtChInfo.pitch[0];
    		pObj->displayFormat.pitch[1] = frameInfo->origFrameInfo->rtChInfo.pitch[1];
    		pObj->displayFormat.width    = frameInfo->origFrameInfo->rtChInfo.width;
    		pObj->displayFormat.height   = frameInfo->origFrameInfo->rtChInfo.height;
    
            if (DisplayLink_drvIsDeiDisplayDrv(pObj))
            {
                frameList->perListCfg  =
                    DisplayLink_drvSetDeiFramePitchRtParams(pObj);
            }
            else
            {
                frameList->perListCfg  =
                    DisplayLink_drvSetFramePitchRtParams(pObj);
            }
        }
    }
    
    static
    Void  DisplayLink_validateFrameList(DisplayLink_Obj * pObj,
                                        FVID2_FrameList *frameList)
    {
        static Bool enableValidate = FALSE;
        FVID2_Frame *frame;
        DisplayLink_FrameInfo *frameInfo;
        Int i;
    
        if (enableValidate)
        {
            for (i = 0; i < frameList->numFrames; i++)
            {
                frame = frameList->frames[i];
                if (DISPLAY_LINK_BLANK_FRAME_CHANNEL_NUM !=
                    frame->channelNum)
                {
                    frameInfo = frame->appData;
                    UTILS_assert(UTILS_ARRAYISVALIDENTRY(frameInfo,
                                                         pObj->frameInfo.infoMem));
                }
            }
        }
    }
    
    static
    Void  DisplayLink_drvCreateFieldMergedFrame(DisplayLink_Obj * pObj, FVID2_Frame *top_field,
                                                FVID2_Frame *bot_field,
                                                DisplayLink_FrameInfo *frameInfo)
    {
        FVID2_Frame *fieldMergedFrame = &frameInfo->frame;
    
        fieldMergedFrame->addr[0][0] = top_field->addr[0][0];
        fieldMergedFrame->addr[0][1] = top_field->addr[0][1];
        fieldMergedFrame->addr[0][2] = top_field->addr[0][2];
        fieldMergedFrame->addr[1][0] = bot_field->addr[0][0];
        fieldMergedFrame->addr[1][1] = bot_field->addr[0][1];
        fieldMergedFrame->addr[1][2] = bot_field->addr[0][2];
    
        if(pObj->createArgs.forceFieldSeparatedInputMode)
        {
            /* go to next line in frame for bottom field */
            fieldMergedFrame->addr[1][0] =
             (Ptr)((UInt32)fieldMergedFrame->addr[1][0] + pObj->displayFormat.pitch[0]/2);
    
            fieldMergedFrame->addr[1][1] =
             (Ptr)((UInt32)fieldMergedFrame->addr[1][1] + pObj->displayFormat.pitch[1]/2);
    
            fieldMergedFrame->addr[1][2] =
             (Ptr)((UInt32)fieldMergedFrame->addr[1][2] + pObj->displayFormat.pitch[2]/2);
    
        }
    
        fieldMergedFrame->blankData  = top_field->blankData;
        fieldMergedFrame->channelNum = top_field->channelNum;
        fieldMergedFrame->drvData    = top_field->drvData;
        fieldMergedFrame->fid        = FVID2_FID_TOP;
        fieldMergedFrame->perFrameCfg = top_field->perFrameCfg;
        fieldMergedFrame->reserved    = top_field->reserved;
        fieldMergedFrame->subFrameInfo = top_field->subFrameInfo;
        fieldMergedFrame->timeStamp    = top_field->timeStamp;
        fieldMergedFrame->appData      = frameInfo;
    
        frameInfo->isFieldPair         = TRUE;
        frameInfo->origFrame[0]        = top_field;
        frameInfo->origFrame[1]        = bot_field;
        frameInfo->origFrameInfo       = NULL;
    }
    
    
    static
    Void  DisplayLink_drvSetFrameInfo(DisplayLink_Obj * pObj,
                                      FVID2_Frame **pFramePtr,
                                      Bool        *frameReject)
    {
        DisplayLink_FrameInfo *frameInfo;
        FVID2_Frame *frame;
        Int32 status;
        Bool fieldSeparatedInputMode;
    
        *frameReject = FALSE;
        frame = *pFramePtr;
    
    
        fieldSeparatedInputMode = FALSE;
    
        if (pObj->fieldInput[pObj->curActiveQueue]
                &&
            pObj->createArgs.forceFieldSeparatedInputMode == FALSE
           )
        {
            fieldSeparatedInputMode = TRUE;
        }
        if (pObj->fieldInput[pObj->curActiveQueue]
                &&
            pObj->createArgs.forceFieldSeparatedInputMode == TRUE
                &&
            pObj->enableFieldSeparatedInputMode
           )
        {
            fieldSeparatedInputMode = TRUE;
        }
    
        if (DISPLAY_LINK_BLANK_FRAME_CHANNEL_NUM !=
            frame->channelNum)
        {
            if(fieldSeparatedInputMode)
            {
                if(pObj->createArgs.forceFieldSeparatedInputMode)
                    frame->fid = pObj->nextFid;
    
                if (frame->fid == pObj->nextFid)
                {
                    pObj->nextFid = !(pObj->nextFid);
                    if (frame->fid == FVID2_FID_BOTTOM)
                    {
                        status = Utils_queGet(&pObj->frameInfo.infoQ,
                                              (Ptr *)&frameInfo,
                                              1,
                                              BIOS_NO_WAIT);
                        UTILS_assert(status == 0);
                        frameInfo->activeQueueId = pObj->curActiveQueue;
                        /* Received bot fields of frame.
                         * Create a field merged frame
                         */
                        UTILS_assert(pObj->topField != NULL);
                        UTILS_assert(pObj->topField->fid == FVID2_FID_TOP);
                        DisplayLink_drvCreateFieldMergedFrame(pObj, pObj->topField,
                                                             frame,
                                                             frameInfo);
                        pObj->topField = NULL;
                        *pFramePtr = &frameInfo->frame;
                    }
                    else
                    {
                        /* if top field. Store top field */
                        pObj->topField = frame;
                        frame->timeStamp = Utils_getCurTimeInMsec();
                        *pFramePtr = NULL;
                    }
                }
                else
                {
                    /* FID out of order. Reject */
                    *frameReject = TRUE;
                }
            }
            else
            {
                status = Utils_queGet(&pObj->frameInfo.infoQ,
                                      (Ptr *)&frameInfo,
                                      1,
                                      BIOS_NO_WAIT);
                UTILS_assert(status == 0);
                frameInfo->activeQueueId = pObj->curActiveQueue;
                frameInfo->isFieldPair = FALSE;
                frameInfo->origFrameInfo = frame->appData;
                frame->appData = frameInfo;
            }
        }
    }
    
    
    
    static
    Int32 DisplayLink_drvDeQueue(DisplayLink_Obj * pObj,
                                 FVID2_FrameList *freeFrameList,
                                 UInt32 *freeQueId)
    {
        Int32 status,i;
        FVID2_Frame *frame;
        FVID2_FrameList tmpFreeFrameList;
        DisplayLink_FrameInfo *frameInfo;
    
        freeFrameList->numFrames = 0;
        tmpFreeFrameList.numFrames = 0;
        *freeQueId = DISPLAY_LINK_INVALID_INQUEID;
        status =
            FVID2_dequeue(pObj->displayHndl,&tmpFreeFrameList,0,
                          BIOS_NO_WAIT);
        if (FVID2_SOK == status)
        {
            pObj->dequeCount += tmpFreeFrameList.numFrames;
    
            if (tmpFreeFrameList.numFrames)
            {
                pObj->maxQueueCount++;
    #ifdef SYSTEM_DEBUG_DISPLAY_RT
                Vps_printf(" %d: DISPLAY: Deque %d frames\n",
                           Utils_getCurTimeInMsec(),
                           tmpFreeFrameList.numFrames);
    #endif
                DisplayLink_drvFreeRtParams(pObj,&tmpFreeFrameList);
            }
            for (i = 0; i < tmpFreeFrameList.numFrames;i++)
            {
                frame = tmpFreeFrameList.frames[i];
                if (DISPLAY_LINK_BLANK_FRAME_CHANNEL_NUM !=
                    frame->channelNum)
                {
                    frameInfo = frame->appData;
                    UTILS_assert(UTILS_ARRAYISVALIDENTRY(frameInfo,pObj->frameInfo.infoMem));
                    *freeQueId = frameInfo->activeQueueId;
                    if (frameInfo->isFieldPair)
                    {
                        UInt32 curTime;
    
                        curTime = Utils_getCurTimeInMsec();
                        UTILS_assert(freeFrameList->numFrames <
                                     UTILS_ARRAYSIZE(freeFrameList->frames));
                        freeFrameList->frames[freeFrameList->numFrames] =
                                     frameInfo->origFrame[0];
                        pObj->drvTopFieldLatency +=
                        (curTime - frameInfo->origFrame[0]->timeStamp);
                        pObj->numTopFields++;
                        freeFrameList->numFrames++;
                        UTILS_assert(freeFrameList->numFrames <
                                     UTILS_ARRAYSIZE(freeFrameList->frames));
                        freeFrameList->frames[freeFrameList->numFrames] =
                                     frameInfo->origFrame[1];
                        freeFrameList->numFrames++;
                        pObj->numBufsInDriver--;
                    }
                    else
                    {
                        /* If not field pair, restore original appData */
                        frame->appData = frameInfo->origFrameInfo;
                        UTILS_assert(freeFrameList->numFrames <
                                     UTILS_ARRAYSIZE(freeFrameList->frames));
                        freeFrameList->frames[freeFrameList->numFrames] =
                                     frame;
                        freeFrameList->numFrames++;
                        pObj->numBufsInDriver--;
                    }
                    status =
                      Utils_quePut(&pObj->frameInfo.infoQ,
                                   frameInfo,
                                   BIOS_NO_WAIT);
                    UTILS_assert(status == 0);
                }
            }
        }
        return status;
    }
    
    Int32 DisplayLink_drvFvidCb(FVID2_Handle handle, Ptr appData, Ptr reserved)
    {
        DisplayLink_Obj *pObj = (DisplayLink_Obj *) appData;
        UInt32 elaspedTime, curTime;
    
        Utils_tskSendCmd(&pObj->tsk, DISPLAY_LINK_CMD_DO_DEQUE);
    
        pObj->cbCount++;
    
        curTime = Utils_getCurTimeInMsec();
    
        if (pObj->cbCount > 10)
        {
            elaspedTime = curTime - pObj->lastCbTime;
    
            if (elaspedTime > pObj->maxCbTime)
                pObj->maxCbTime = elaspedTime;
    
            if (elaspedTime < pObj->minCbTime)
                pObj->minCbTime = elaspedTime;
        }
    
        pObj->lastCbTime = curTime;
    
    #if AVSYNC_COMP_ENABLE
        if ( pAvSyncInfo_obj->avSyncCompEnable )
        {
            if(pAvSyncInfo_obj->timeInfo.activeRefClk.clkType == AVSYNC_TIME_ClkTypeVideo) {
                Video_ISR(); // media time update
            }
        }
    #endif
    
        return FVID2_SOK;
    }
    
    Int32 DisplayLink_drvSwitchCh(DisplayLink_Obj * pObj, DisplayLink_SwitchChannelParams *prm)
    {
        DisplayLink_drvLock(pObj);
    
        pObj->curDisplayChannelNum = prm->activeChId;
    
        DisplayLink_drvUnlock(pObj);
    
        return FVID2_SOK;
    }
    
    
    Int32 DisplayLink_drvSwitchActiveQueue(DisplayLink_Obj * pObj,
                                           DisplayLink_SwitchActiveQueueParams *prm)
    {
        Int32 status = FVID2_SOK;
    
        DisplayLink_drvLock(pObj);
    
        if (prm->activeQueueId < pObj->createArgs.numInputQueues)
        {
            if (NULL != pObj->topField)
            {
                System_LinkInQueParams *pInQueParams;
                UInt32 freeQueueId = pObj->curActiveQueue;
                FVID2_FrameList freeFrameList;
                Int32 status;
    
                UTILS_assert(freeQueueId <
                             pObj->createArgs.numInputQueues);
                pInQueParams = &pObj->createArgs.inQueParams[freeQueueId];
                freeFrameList.numFrames = 1;
                freeFrameList.frames[0] = pObj->topField;
                status =
                    System_putLinksEmptyFrames(pInQueParams->prevLinkId,
                                           pInQueParams->prevLinkQueId,
                                           &freeFrameList);
                UTILS_assert(status == 0);
                pObj->topField = NULL;
            }
            pObj->nextFid        = FVID2_FID_TOP;
            pObj->curActiveQueue = prm->activeQueueId;
        }
        else
        {
            status = -1;
        }
    
        DisplayLink_drvUnlock(pObj);
    
        return status;
    }
    
    Int32 DisplayLink_drvDisplayAllocAndQueBlankFrame(DisplayLink_Obj * pObj)
    {
        FVID2_FrameList frameList;
        UInt32 numQue;
        Int32 status;
    
        if(pObj->displayCreateArgs.memType != VPS_VPDMA_MT_TILEDMEM)
        {
            status = System_getBlankFrame(&pObj->blankFrame);
        }
        else
            status = FVID2_SOK;
        UTILS_assert(status == FVID2_SOK);
    
        pObj->blankFrame.channelNum = DISPLAY_LINK_BLANK_FRAME_CHANNEL_NUM;
        for (numQue = 0; numQue < DISPLAY_LINK_BLANK_FRAME_INIT_QUE; numQue++)
        {
            frameList.numFrames = 1;
            frameList.frames[0] = &pObj->blankFrame;
            frameList.perListCfg = NULL;
    
            if(pObj->displayCreateArgs.memType != VPS_VPDMA_MT_TILEDMEM)
            {
                pObj->blankFrame.addr[1][0] =
                (UInt8 *) pObj->blankFrame.addr[0][0] +
                pObj->displayFormat.pitch[0];
            }
            else
            {
                pObj->blankFrame.addr[1][0] = NULL;
                pObj->blankFrame.addr[0][0] = NULL;
            }
            pObj->numBufsInDriver++;
            status = FVID2_queue(pObj->displayHndl,&frameList,0);
            UTILS_assert(status == FVID2_SOK);
            pObj->maxQueueCount--;
        }
    
        return status;
    }
    
    static
    Int32 DisplayLink_drvSetDeiDispPrms(DisplayLink_Obj *pObj, FVID2_Format *pFormat)
    {
        Int32              status;
        Vps_DeiDispParams *deiDispPrms = &pObj->deiDispPrms;
    
        deiDispPrms->fmt = *pFormat;
    
        deiDispPrms->comprEnable = FALSE;
        deiDispPrms->drnEnable = FALSE;
        deiDispPrms->scCfg.bypass = FALSE;
        deiDispPrms->scCfg.nonLinear = FALSE;
        deiDispPrms->scCfg.stripSize = 0;
        deiDispPrms->scCfg.vsType = VPS_SC_VST_POLYPHASE;
        deiDispPrms->scCfg.enablePeaking = FALSE;
        deiDispPrms->scCfg.enableEdgeDetect = FALSE;
    
        deiDispPrms->deiHqCfg = NULL;
        deiDispPrms->deiCfg = NULL;
    
        deiDispPrms->scTarWidth = pFormat->width;
        deiDispPrms->scTarHeight = pFormat->height;
    
    
        status = FVID2_control(
                     pObj->displayHndl,
                     IOCTL_VPS_DEI_DISP_SET_PARAMS,
                     deiDispPrms,
                     NULL);
    
        return (status);
    }
    
    Int32 DisplayLink_drvSetFmt(DisplayLink_Obj * pObj, FVID2_Format *pFormat)
    {
    
        Int32 status;
    
        /* For the DEI Display instances, set the DEI params */
        if (DisplayLink_drvIsDeiDisplayDrv(pObj))
        {
            status = DisplayLink_drvSetDeiDispPrms(pObj, pFormat);
        }
        else
        {
            status = FVID2_setFormat(pObj->displayHndl, pFormat);
        }
    
        UTILS_assert(status == FVID2_SOK);
        return(status);
    }
    
    Int32 DisplayLink_drvSetCoeff(DisplayLink_Obj *pObj)
    {
        Int32                   status;
        Vps_ScCoeffParams       coeffPrms;
    
        /* Set the scaling coefficients,
           it is assumed here that the scalar is used for upscaling, so setting
           upscaling coefficients */
        coeffPrms.hScalingSet = VPS_SC_US_SET;
        coeffPrms.vScalingSet = VPS_SC_US_SET;
    
        coeffPrms.coeffPtr = NULL;
        coeffPrms.scalarId = VPS_M2M_DEI_SCALAR_ID_DEI_SC;
    
        status = FVID2_control(
                     pObj->displayHndl,
                     IOCTL_VPS_SET_COEFFS,
                     &coeffPrms,
                     NULL);
    
        return (status);
    }
    
    
    static Void DisplayLink_prdCalloutFcn(UArg arg)
    {
        DisplayLink_Obj *pObj = (DisplayLink_Obj *) arg;
    
        UTILS_assert(pObj->isDisplayRunning == FALSE);
    
        Utils_tskSendCmd(&pObj->tsk, DISPLAY_LINK_CMD_DO_DEQUE);
    }
    
    static Int32 DisplayLink_drvCreatePrdObj(DisplayLink_Obj * pObj)
    {
        Clock_Params clockParams;
    
        Clock_Params_init(&clockParams);
        clockParams.arg = (UArg) pObj;
        UTILS_assert(pObj->prd.clkHandle == NULL);
    
        Clock_construct(&(pObj->prd.clkStruct),
                        DisplayLink_prdCalloutFcn, 1, &clockParams);
    
        pObj->prd.clkHandle = Clock_handle(&pObj->prd.clkStruct);
        pObj->prd.clkStarted = FALSE;
    
        Clock_setPeriod(pObj->prd.clkHandle, DISPLAY_LINK_DONE_PERIOD_MS);
        Clock_setTimeout(pObj->prd.clkHandle, DISPLAY_LINK_DONE_PERIOD_MS);
    
        return FVID2_SOK;
    }
    
    static Int32 DisplayLink_drvDeletePrdObj(DisplayLink_Obj * pObj)
    {
    
        if(pObj->prd.clkStarted)
        {
            Clock_stop(pObj->prd.clkHandle);
        }
    
        Clock_destruct(&(pObj->prd.clkStruct));
        pObj->prd.clkHandle = NULL;
        pObj->prd.clkStarted = FALSE;
    
        return FVID2_SOK;
    }
    
    
    Int32 DisplayLink_drvDisplayCreate(DisplayLink_Obj * pObj)
    {
        Int32 status;
        UInt32 dispId[3] = {VPS_DISP_INST_BP0, VPS_DISP_INST_BP1, VPS_DISP_INST_SEC1};
        FVID2_CbParams cbParams;
        System_LinkChInfo *pInChInfo;
        FVID2_Format *pFormat;
    
        pInChInfo = &pObj->inQueInfo.chInfo[0];
    
        memset(&cbParams, 0, sizeof(cbParams));
        cbParams.cbFxn = DisplayLink_drvFvidCb;
        cbParams.appData = pObj;
    
        pObj->displayCreateArgs.memType = pInChInfo->memType;
        pObj->displayCreateArgs.periodicCallbackEnable = TRUE;
    
        pFormat = &pObj->displayFormat;
    
        pFormat->channelNum = 0;
        pFormat->width      = pInChInfo->width;
        pFormat->height     = pInChInfo->height;
        pFormat->pitch[0]   = pInChInfo->pitch[0];
        pFormat->pitch[1]   = pInChInfo->pitch[1];
        pFormat->pitch[2]   = pInChInfo->pitch[2];
        pFormat->dataFormat = pInChInfo->dataFormat;
    
    	Vps_rprintf("DisplayId = %d,DataFormat = %d\n",pObj->createArgs.displayId,pInChInfo->dataFormat);
    			
    	/*
    	 * DISPLAY_LINK_DISPLAY_BP0 supports FVID2_DF_YUV422I_UYVY and FVID2_DF_YUV422I_YUYV formats.
    	 * DISPLAY_LINK_DISPLAY_SC2 supports FVID2_DF_YUV422I_YUYV and FVID2_DF_YUV420SP_UV formats.
    	 * Over riding the displayId based on the data format for HD resolutions
    	 */
    	if(pObj->createArgs.displayId != DISPLAY_LINK_DISPLAY_SD)
    	{		
    		if((pFormat->dataFormat == FVID2_DF_YUV422I_UYVY) || 
    		   (pFormat->dataFormat == FVID2_DF_YUV422I_YUYV))
    		{
    			pObj->createArgs.displayId = DISPLAY_LINK_DISPLAY_BP0;    
    		}	
    		else if((pFormat->dataFormat == FVID2_DF_YUV422I_YUYV) || 
    		        (pFormat->dataFormat == FVID2_DF_YUV420SP_UV))
    		     {
    			     pObj->createArgs.displayId = DISPLAY_LINK_DISPLAY_SC2;    
    		     }
    	}	
    	
        switch (pObj->createArgs.displayId)
        {
            default:
            case DISPLAY_LINK_DISPLAY_AUTO_SELECT:
                pObj->displayInstId = dispId[pObj->tskId -
                                                SYSTEM_LINK_ID_DISPLAY_FIRST];
                pFormat->scanFormat = FVID2_SF_PROGRESSIVE;
    			Vps_rprintf("Auto displayInstId = %d\n",pObj->displayInstId);
                break;
            case DISPLAY_LINK_DISPLAY_BP0:
                pObj->displayInstId = VPS_DISP_INST_BP0;
                pFormat->scanFormat = FVID2_SF_PROGRESSIVE;
    			Vps_rprintf("BP0 displayInstId = %d\n",pObj->displayInstId);
                break;
            case DISPLAY_LINK_DISPLAY_BP1:
                pObj->displayInstId = VPS_DISP_INST_BP1;
                pFormat->scanFormat = FVID2_SF_PROGRESSIVE;
    			Vps_rprintf("BP1 displayInstId = %d\n",pObj->displayInstId);
                break;
            case DISPLAY_LINK_DISPLAY_SC1:
                pObj->displayInstId = DisplayLink_getSc1DispId();
                pFormat->scanFormat = FVID2_SF_PROGRESSIVE;
    			Vps_rprintf("SC1 displayInstId = %d\n",pObj->displayInstId);
                break;
            case DISPLAY_LINK_DISPLAY_SC2:
                pObj->displayInstId = DisplayLink_getSc2DispId();
                pFormat->scanFormat = FVID2_SF_PROGRESSIVE;
    			Vps_rprintf("SC2 displayInstId = %d\n",pObj->displayInstId);
                break;
            case DISPLAY_LINK_DISPLAY_SD:
                pObj->displayInstId = VPS_DISP_INST_SEC1;
                pFormat->scanFormat = FVID2_SF_INTERLACED;
    			Vps_rprintf("SD displayInstId = %d\n",pObj->displayInstId);
                break;
        }
    
        pFormat->fieldMerged[0] = FALSE;
    
        if (pObj->createArgs.displayRes == VSYS_STD_1080I_60
            ||
            pObj->createArgs.displayRes == VSYS_STD_NTSC
            ||
            pObj->createArgs.displayRes == VSYS_STD_PAL)
        {
            Int i;
    
            pFormat->scanFormat = FVID2_SF_INTERLACED;
            pFormat->fieldMerged[0] = TRUE;
            if (DisplayLink_drvIsSDDef(pObj))
            {
                for (i = 0; i < pObj->createArgs.numInputQueues; i++)
                {
                    /* if we are going to get field input we should
                     * not enable field merged mode in the driver
                     * since we need to seamlessly switch from
                     * one input queue to another and changing
                     * field merged mode is not supported at
                     * runtime.
                     */
                    if (pObj->fieldInput[i] == TRUE)
                    {
                        pFormat->fieldMerged[0] = FALSE;
                    }
                }
                if (DisplayLink_drvDoInputPitchDoubling(pObj))
                {
                    pFormat->pitch[0] *= 2;
                    pFormat->pitch[1] *= 2;
                    pFormat->pitch[2] *= 2;
                }
            }
        }
        if (pObj->createArgs.displayRes == VSYS_STD_NTSC)
        {
            pFormat->width = 720;
            pFormat->height = 480;
        }
        if (pObj->createArgs.displayRes == VSYS_STD_PAL)
        {
            pFormat->width = 720;
            pFormat->height = 576;
        }
    
        pFormat->fieldMerged[1] = pFormat->fieldMerged[0];
        pFormat->fieldMerged[2] = pFormat->fieldMerged[0];
        pFormat->bpp = FVID2_BPP_BITS16;
        pFormat->reserved = NULL;
    
    #ifdef SYSTEM_VERBOSE_PRINTS
        Vps_printf(" %d: DISPLAY: %d: Window size %dx%d, %dB",
                   Utils_getCurTimeInMsec(),
                   pObj->displayInstId, pFormat->width, pFormat->height,
                   pFormat->pitch[0]);
    #endif
    
        pObj->displayHndl = FVID2_create(FVID2_VPS_DISP_DRV,
                                         pObj->displayInstId,
                                         &pObj->displayCreateArgs,
                                         &pObj->displayCreateStatus, &cbParams);
        UTILS_assert(pObj->displayHndl != NULL);
        pObj->maxQueueCount = pObj->displayCreateStatus.maxReqInQueue;
    
        /* Set the Scalar Coefficients */
        /* For the DEI Display instances, set the DEI params */
        if (DisplayLink_drvIsDeiDisplayDrv(pObj))
        {
            status = DisplayLink_drvSetCoeff(pObj);
            UTILS_assert(status == FVID2_SOK);
        }
    
        status = DisplayLink_drvSetFmt(pObj, pFormat);
        UTILS_assert(status == FVID2_SOK);
    
        pObj->queueCount = 0;
    
        return FVID2_SOK;
    }
    
    
    static
    Bool DisplayLink_drvIsFieldSeparatedInput(DisplayLink_Obj * pObj,
                                              System_LinkQueInfo *queInfo)
    {
        Bool isFieldSeparatedInput = FALSE;
        UInt32 fieldMergedHeightNTSC;
        UInt32 fieldMergedHeightPAL;
    
        UTILS_assert(DisplayLink_drvIsSDDef(pObj) == TRUE);
        fieldMergedHeightNTSC = 240;
        fieldMergedHeightPAL  = 288;
    
        pObj->enableFieldSeparatedInputMode = FALSE;
    
        if (queInfo->numCh > 0)
        {
            if(SYSTEM_SF_INTERLACED == queInfo->chInfo[0].scanFormat
            )
            {
                if ((queInfo->chInfo[0].height ==  fieldMergedHeightNTSC)
                    ||
                    (queInfo->chInfo[0].height ==  fieldMergedHeightPAL))
                {
                    isFieldSeparatedInput = TRUE;
                }
            }
            if(pObj->createArgs.forceFieldSeparatedInputMode)
            {
                isFieldSeparatedInput = TRUE;
                pObj->enableFieldSeparatedInputMode = TRUE;
            }
    
        }
        return isFieldSeparatedInput;
    }
    
    static
    Void DisplayLink_drvSetFieldSeparatedInfo(DisplayLink_Obj * pObj)
    {
        Int i,status;
        DisplayLink_CreateParams * pPrm;
    
        pPrm = &pObj->createArgs;
        for (i = 0; i < pObj->createArgs.numInputQueues;i++)
        {
            status = System_linkGetInfo(pPrm->inQueParams[i].prevLinkId,
                                        &pObj->inTskInfo[i]);
            UTILS_assert(status == FVID2_SOK);
            if (DisplayLink_drvIsSDDef(pObj))
            {
                pObj->fieldInput[i] =
                DisplayLink_drvIsFieldSeparatedInput (pObj,
                  &pObj->inTskInfo[i].queInfo[pPrm->inQueParams[i].prevLinkQueId]);
    
                if(pObj->fieldInput[i])
                {
                    Vps_printf(" %d: DISPLAY: %d: Field Separate Mode ENABLED for Que %d !!!\n",
                        Utils_getCurTimeInMsec(),
                        SYSTEM_GET_LINK_ID(pObj->tskId),
                        i
                      );
                }
            }
            else
            {
                pObj->fieldInput[i] = FALSE;
            }
        }
    }
    
    Int32 DisplayLink_drvCreate(DisplayLink_Obj * pObj,
                                DisplayLink_CreateParams * pPrm)
    {
        Semaphore_Params semParams;
        Int32 status = FVID2_SOK;
        DisplayLink_SwitchChannelParams switchParams;
    
    #ifdef SYSTEM_DEBUG_DISPLAY
        Vps_printf(" %d: DISPLAY: Create in progress !!!\n", Utils_getCurTimeInMsec());
    #endif
    
        pObj->cbCount = 0;
        pObj->dequeCount = 0;
        pObj->totalTime = 0;
        pObj->minCbTime = 0xFF;
        pObj->maxCbTime = 0;
        pObj->lastCbTime = 0;
        pObj->maxLatency = 0;
        pObj->minLatency = 0xFF;
        pObj->drvTopFieldLatency = 0;
        pObj->numTopFields = 0;
    
        pObj->inFrameGetCount = 0;
        pObj->inFramePutCount = 0;
        pObj->isDisplayRunning = FALSE;
    
        memcpy(&pObj->createArgs, pPrm, sizeof(*pPrm));
    
        UTILS_assertError((pPrm->activeQueue < UTILS_ARRAYSIZE(pPrm->inQueParams)),
                          status,
                          -1,
                          pObj->tskId,
                          -1);
        if (status != FVID2_SOK)
        {
            pPrm->activeQueue = 0;
        }
        DisplayLink_drvSetFieldSeparatedInfo(pObj);
        status = System_linkGetInfo(pPrm->inQueParams[pPrm->activeQueue].prevLinkId,
                                    &pObj->inTskInfo[pPrm->activeQueue]);
        UTILS_assert(status == FVID2_SOK);
        UTILS_assert(pPrm->inQueParams[pPrm->activeQueue].prevLinkQueId <
                     pObj->inTskInfo[pPrm->activeQueue].numQue);
    
        memcpy(&pObj->inQueInfo,
               &pObj->inTskInfo[pPrm->activeQueue].queInfo[pPrm->inQueParams[pPrm->activeQueue].prevLinkQueId],
               sizeof(pObj->inQueInfo));
        pObj->curActiveQueue = pPrm->activeQueue;
        pObj->numBufsInDriver = 0;
        pObj->topField = NULL;
        pObj->nextFid  = FVID2_FID_TOP;
        Semaphore_Params_init(&semParams);
    
        semParams.mode = Semaphore_Mode_BINARY;
    
        pObj->lock = Semaphore_create(1u, &semParams, NULL);
        UTILS_assert(pObj->lock != NULL);
    
        Semaphore_Params_init(&semParams);
    
        semParams.mode = Semaphore_Mode_BINARY;
    
        pObj->complete = Semaphore_create(0u, &semParams, NULL);
        UTILS_assert(pObj->complete != NULL);
    
        DisplayLink_drvDisplayCreate(pObj);
        DisplayLink_drvCreateFrameInfo(pObj);
        DisplayLink_drvCreateRtParams(pObj);
        DisplayLink_drvDisplayAllocAndQueBlankFrame(pObj);
        switchParams.activeChId = 0;
        DisplayLink_drvSwitchCh(pObj, &switchParams);
        DisplayLink_drvSetPitchInfo(pObj);
    
        DisplayLink_drvCreatePrdObj(pObj);
    
    #ifdef SYSTEM_DEBUG_DISPLAY
        Vps_printf(" %d: DISPLAY: Create Done !!!\n", Utils_getCurTimeInMsec());
    #endif
    
        return FVID2_SOK;
    }
    
    Int32 DisplayLink_drvPrintRtStatus(DisplayLink_Obj * pObj, UInt32 elaspedTime)
    {
        UInt32 displayId;
        char *displayName[] = { "HDDAC(BP0) ", "DVO2(BP1)  ", "SDDAC(SEC1)", "PRIMARY PATH", "AUX PATH" };
    
        displayId = pObj->displayInstId;
        if ((displayId == VPS_DISP_INST_MAIN_DEIH_SC1) ||
            (displayId == VPS_DISP_INST_MAIN_DEI_SC1))
        {
            displayId = 3;
        }
        if ((displayId == VPS_DISP_INST_AUX_DEI_SC2) ||
            (displayId == VPS_DISP_INST_AUX_SC2))
        {
            displayId = 4;
        }
    
        Vps_rprintf(" %d: DISPLAY: %s: %d fps, Latency (Min / Max) = ( %d / %d ), Callback Interval (Min / Max) = ( %d / %d ) !!! \r\n",
             Utils_getCurTimeInMsec(),
             displayName[displayId],
            pObj->cbCount*1000/elaspedTime,
            pObj->minLatency,
            pObj->maxLatency,
            pObj->minCbTime,
            pObj->maxCbTime
            );
    
        /* reset max time */
        pObj->maxCbTime = 0;
        pObj->minCbTime = 0xFF;
        pObj->maxLatency = 0;
        pObj->minLatency = 0xFF;
    
        if(pObj->displayInstId==0)
        {
            System_displayUnderflowPrint(TRUE, TRUE);
            System_memPrintHeapStatus();
        }
    
        return 0;
    }
    
    Int32 DisplayLink_drvPrintStatistics(DisplayLink_Obj * pObj)
    {
        UInt32 elaspedTime;
    
        elaspedTime = Utils_getCurTimeInMsec() - pObj->startTime;
    
        DisplayLink_drvPrintRtStatus(pObj, elaspedTime);
    
        return 0;
    }
    
    Int32 DisplayLink_drvProcessData(DisplayLink_Obj * pObj)
    {
        FVID2_FrameList frameList;
        FVID2_FrameList freeFrameList;
        FVID2_FrameList displayFrameList;
        UInt32 freeFrameNum, elaspedTime;
        System_LinkInQueParams *pInQueParams;
        FVID2_Frame *pFrame;
        Int32 status;
        UInt32 latency;
        Int i;
        UInt32 frameIdx;
    
        if(pObj->isDisplayRunning)
        {
            elaspedTime = Utils_getCurTimeInMsec() - pObj->startTime;
    
            if ((elaspedTime - pObj->prevTime) > 24 * 60 * 60 * 1000)
            {
                DisplayLink_drvPrintRtStatus(pObj, elaspedTime);
    
                pObj->prevTime = elaspedTime;
            }
    
            if(pObj->displayInstId==0)
            {
                System_displayUnderflowCheck(FALSE);
            }
    
            do
            {
                UInt32 freeQueueId;
                /* dequeue all completed frames */
                status = DisplayLink_drvDeQueue(pObj,&freeFrameList,
                                                &freeQueueId);
    
                if (freeFrameList.numFrames)
                {
                    pObj->inFramePutCount += freeFrameList.numFrames;
    
                    UTILS_assert(freeQueueId <
                                 pObj->createArgs.numInputQueues);
                    pInQueParams = &pObj->createArgs.inQueParams[freeQueueId];
                    System_putLinksEmptyFrames(pInQueParams->prevLinkId,
                                               pInQueParams->prevLinkQueId, &freeFrameList);
                }
    
            } while (status == FVID2_SOK);
    
    
            /* Free frames queued in inactive queues immediately */
            for (i = 0; i < pObj->createArgs.numInputQueues;i++)
            {
                if (i != pObj->curActiveQueue)
                {
                    frameList.numFrames = 0;
                    pInQueParams =
                      &pObj->createArgs.inQueParams[i];
                    System_getLinksFullFrames(pInQueParams->prevLinkId,
                                              pInQueParams->prevLinkQueId,
                                              &frameList);
                    if (frameList.numFrames)
                    {
                        pObj->inFrameGetCount += frameList.numFrames;
                        pObj->inFramePutCount += frameList.numFrames;
                        System_putLinksEmptyFrames(pInQueParams->prevLinkId,
                                                   pInQueParams->prevLinkQueId,
                                                   &frameList);
                    }
                }
            }
            UTILS_assert(pObj->curActiveQueue < pObj->createArgs.numInputQueues);
            pInQueParams = &pObj->createArgs.inQueParams[pObj->curActiveQueue];
            /* que frames if any */
    
            System_getLinksFullFrames(pInQueParams->prevLinkId,
                                      pInQueParams->prevLinkQueId, &frameList);
    		Vps_printf("#### frameList.numFrames = %d\n",frameList.numFrames);						  
            pObj->inFrameGetCount += frameList.numFrames;
    
            #ifdef ENABLE_FXN_PROFILE
                DisplayLink_drvFxnProfileControl(pObj);
            #endif /* #ifdef ENABLE_FXN_PROFILE */
            freeFrameNum = 0;
    
            DisplayLink_drvLock(pObj);
            frameIdx = 0;
            while((pObj->maxQueueCount)
                  &&
                  (frameIdx < frameList.numFrames))
            {
                pFrame = frameList.frames[frameIdx];
                frameIdx++;
                UTILS_assert(pFrame != NULL);
                if (pFrame->channelNum == pObj->curDisplayChannelNum)
                {
                    Bool frameReject;
                    UInt32 pitch0,pitch1;
    
                    pitch0 = pObj->displayFormat.pitch[0];
                    pitch1 = pObj->displayFormat.pitch[1];
                    if (DisplayLink_drvDoInputPitchDoubling(pObj))
                    {
                        pitch0 /= 2;
                        pitch1 /= 2;
                    }
    
                    UTILS_assert(DISPLAY_LINK_BLANK_FRAME_CHANNEL_NUM !=
                                 pFrame->channelNum);
                    pFrame->addr[1][0] =
                        (UInt8 *) pFrame->addr[0][0] + pitch0;
                    pFrame->addr[1][1] =
                        (UInt8 *) pFrame->addr[0][1] + pitch1;
        #ifdef SYSTEM_DEBUG_DISPLAY_RT
                    Vps_printf(" %d: DISPLAY: Queue %d frames\n", Utils_getCurTimeInMsec(),
                               displayFrameList.numFrames);
        #endif
                    latency = Utils_getCurTimeInMsec() - pFrame->timeStamp;
    
                    if(latency>pObj->maxLatency)
                        pObj->maxLatency = latency;
                    if(latency<pObj->minLatency)
                        pObj->minLatency = latency;
                    /* queue frame for display */
                    displayFrameList.numFrames = 0;
                    DisplayLink_drvSetFrameInfo(pObj,
                                                &pFrame,
                                                &frameReject);
                    if (pFrame)
                    {
                        if (frameReject)
                        {
                            UTILS_assert(freeFrameNum <
                                         UTILS_ARRAYSIZE(freeFrameList.frames));
                            /* error in queing to display, instead of asserting
                                release the frame and continue
                            */
                            freeFrameList.frames[freeFrameNum] = pFrame;
                            freeFrameNum++;
                        }
                        else
                        {
                            displayFrameList.frames[displayFrameList.numFrames] = pFrame;
                            displayFrameList.numFrames++;
                            displayFrameList.perListCfg = NULL;
                            DisplayLink_drvHandleDynamicPitchChange(pObj,&displayFrameList);
                            DisplayLink_validateFrameList(pObj,
                                                          &displayFrameList);
                            pObj->queueCount += displayFrameList.numFrames;
                            pObj->numBufsInDriver++;
    
                            status = FVID2_queue(pObj->displayHndl,
                                                 &displayFrameList,
                                                 0);
                            pObj->maxQueueCount--;
    
                            if(status!=FVID2_SOK)
                            {
    
                                 Vps_rprintf(" %d: DISPLAY (%d): Queue to driver failed !!!\n", Utils_getCurTimeInMsec(),
                                       pObj->tskId);
    
                                UTILS_assert(freeFrameNum <
                                             UTILS_ARRAYSIZE(freeFrameList.frames));
                                /* error in queing to display, instead of asserting
                                    release the frame and continue
                                */
                                freeFrameList.frames[freeFrameNum] = pFrame;
                                freeFrameNum++;
                                DisplayLink_drvFreeFrameInfo(pObj,
                                                             &displayFrameList);
                            }
                        }
                   }
                }
                else
                {
                    UTILS_assert(freeFrameNum <
                                 UTILS_ARRAYSIZE(freeFrameList.frames));
                    freeFrameList.frames[freeFrameNum] = pFrame;
                    freeFrameNum++;
                }
            }
            DisplayLink_drvUnlock(pObj);
    
            for (i = frameIdx; i < frameList.numFrames;i++)
            {
                UTILS_assert(freeFrameNum < UTILS_ARRAYSIZE(freeFrameList.frames));
                freeFrameList.frames[freeFrameNum] = frameList.frames[i];
                freeFrameNum++;
            }
            if (freeFrameNum)
            {
                freeFrameList.numFrames = freeFrameNum;
                pObj->inFramePutCount += freeFrameList.numFrames;
    
                System_putLinksEmptyFrames(pInQueParams->prevLinkId,
                                           pInQueParams->prevLinkQueId, &freeFrameList);
            }
    
        }
        else {
    
            /* Free frames queued in inactive queues immediately */
            for (i = 0; i < pObj->createArgs.numInputQueues;i++)
            {
                frameList.numFrames = 0;
                pInQueParams =
                  &pObj->createArgs.inQueParams[i];
                System_getLinksFullFrames(pInQueParams->prevLinkId,
                                          pInQueParams->prevLinkQueId,
                                          &frameList);
                if (frameList.numFrames)
                {
                    pObj->inFrameGetCount += frameList.numFrames;
                    pObj->inFramePutCount += frameList.numFrames;
                    System_putLinksEmptyFrames(pInQueParams->prevLinkId,
                                               pInQueParams->prevLinkQueId,
                                               &frameList);
                }
            }
        }
    
    
        return FVID2_SOK;
    }
    
    Int32 DisplayLink_drvDelete(DisplayLink_Obj * pObj)
    {
        FVID2_FrameList frameList;
        Int32 status;
    
    #ifdef SYSTEM_DEBUG_DEI
        Vps_printf(" %d: DISPLAY: Frames = %d (fps = %d) !!!\n",
                   Utils_getCurTimeInMsec(),
                   pObj->dequeCount,
                   pObj->dequeCount * 100 / (pObj->totalTime / 10));
    #endif
    
    #ifdef SYSTEM_DEBUG_DISPLAY
        Vps_printf(" %d: DISPLAY: Delete in progress !!!\n", Utils_getCurTimeInMsec());
    #endif
    
        do
        {
            // dequeue queued buffer's
            status = FVID2_dequeue(pObj->displayHndl, &frameList, 0, BIOS_NO_WAIT);
        } while (status == FVID2_SOK);
    
        status = FVID2_delete(pObj->displayHndl, NULL);
        if (FVID2_SOK != status)
        {
            Vps_printf("%s: Error %d @ line %d\n", __FUNCTION__, status, __LINE__);
            return (status);
        }
    
        Semaphore_delete(&pObj->lock);
        Semaphore_delete(&pObj->complete);
        DisplayLink_drvDeleteFrameInfo(pObj);
        DisplayLink_drvDeleteRtParams(pObj);
    
        DisplayLink_drvDeletePrdObj(pObj);
    
    #ifdef SYSTEM_DEBUG_DISPLAY
        Vps_printf(" %d: DISPLAY: Delete Done !!!\n", Utils_getCurTimeInMsec());
    #endif
    
        return FVID2_SOK;
    }
    
    Int32 DisplayLink_drvStart(DisplayLink_Obj * pObj)
    {
        Int32 status = FVID2_SOK;
    
    #ifdef SYSTEM_DEBUG_DISPLAY
        Vps_printf(" %d: DISPLAY: Start in progress !!!\n", Utils_getCurTimeInMsec());
    #endif
    
        pObj->lastCbTime = Utils_getCurTimeInMsec();
        pObj->startTime = Utils_getCurTimeInMsec();
        pObj->prevTime = pObj->startTime;
    
        if(pObj->prd.clkStarted)
        {
            Clock_stop(pObj->prd.clkHandle);
            pObj->prd.clkStarted = FALSE;
        }
    
        status = FVID2_start(pObj->displayHndl, NULL);
        UTILS_assert(status == FVID2_SOK);
    
        pObj->isDisplayRunning = TRUE;
    
        pObj->totalTime = Utils_getCurTimeInMsec();
    
    #ifdef SYSTEM_DEBUG_DISPLAY
        Vps_printf(" %d: DISPLAY: Start Done !!!\n", Utils_getCurTimeInMsec());
    #endif
    
        return status;
    }
    
    Int32 DisplayLink_drvStop(DisplayLink_Obj * pObj)
    {
        Int32 status = FVID2_SOK;
    
    #ifdef SYSTEM_DEBUG_DISPLAY
        Vps_printf(" %d: DISPLAY: Stop in progress !!!\n", Utils_getCurTimeInMsec());
    #endif
    
        pObj->totalTime = Utils_getCurTimeInMsec() - pObj->totalTime;
    
        pObj->isDisplayRunning = FALSE;
    
        status = FVID2_stop(pObj->displayHndl, NULL);
        UTILS_assert(status == FVID2_SOK);
    
        if(pObj->prd.clkStarted == FALSE)
        {
            Clock_start(pObj->prd.clkHandle);
            pObj->prd.clkStarted = TRUE;
        }
    
    #ifdef SYSTEM_DEBUG_DISPLAY
        Vps_printf(" %d: DISPLAY: Stop Done !!!\n", Utils_getCurTimeInMsec());
    #endif
    
        return status;
    }
    
    Int32 DisplayLink_drvLock(DisplayLink_Obj * pObj)
    {
        return Semaphore_pend(pObj->lock, BIOS_WAIT_FOREVER);
    }
    
    Int32 DisplayLink_drvUnlock(DisplayLink_Obj * pObj)
    {
        Semaphore_post(pObj->lock);
    
        return FVID2_SOK;
    }
    
    Int32 DisplayLink_drvSwitchInputMode(DisplayLink_Obj * pObj, DisplayLink_SwitchInputMode *pPrm)
    {
        if(pObj->createArgs.forceFieldSeparatedInputMode)
            pObj->enableFieldSeparatedInputMode = pPrm->enableFieldSeparatedInputMode;
        else
            pObj->enableFieldSeparatedInputMode = FALSE;
    
        return FVID2_SOK;
    }
    
    Int32 DisplayLink_printBufferStatus(DisplayLink_Obj * pObj)
    {
        Vps_rprintf
            (
            " \n"
            " *** Display Statistics *** \n"
            "%d: DISPLAY: Rcvd from prev = %d, Returned to prev = %d, BufsInDriver = %d\r\n",
            Utils_getCurTimeInMsec(), pObj->inFrameGetCount, pObj->inFramePutCount, pObj->numBufsInDriver);
    
        return 0;
    }
    
    
    ceiving from the previous link as shown at line # 1323 in the attached ..\ipnc_rdk\ipnc_mcfw\mcfw\src_bios6\links_m3vpss\display\displayLink_drv.c file?

    regards,

    Anand

  •  Hi Anand,

    I have enable the print  "Vps_printf("#### frameList.numFrames = %d\n",frameList.numFrames);" in the file,mcfw/src_bios6/links_m3vpss/display/displayLink_drv.c

    After that I got following log:

    [host] IPC_BITSOUT:BitBuffer Alloc.PoolID:0,Size:0xBDD800
     [host] IPCBITSOUTLINK:Translated Addr Virt:0x41341080 To Phy:0x90000080
     [host]  512: IPC_BITS_OUT   : Create Done !!!
     [m3video]  85127: IPC_BITS_IN   : Create in progress !!!
     [m3vpss ] VPS_DCTRL_INST_0
     [m3video]  85128: SYSTEM: Opening ListMP [HOST_IPC_OUT_28] ...
     [m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_DVO2
     [m3video]  85128: SYSTEM: Opening ListMP [HOST_IPC_IN_28] ...
     [m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_HDMI
     [m3video] RAJESH: System_ipcMsgQOpen for ProcessId=3
     [m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_SD
     [m3video]  85129: SYSTEM: Opening MsgQ [HOST_MSGQ] ...
     [m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_HDCOMP
     [m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_CLK_SRC VPS_DC_VENC_HDMI | VPS_DC_VENC_HDCOMP
     [m3vpss ] HDCOMPCLK
    KOLANCHI : MultiCh_playbackApp 301
     [m3video]  85132: IPC_BITS_IN   : Create Done !!!
     [m3video]  85133: DECODE: Create in progress ... !!!
     [m3video]  85225: DECODE: Creating CH0 of 1920 x 1080 [PROGRESSIVE] [NON-TILED  ],target bitrate = 10000 Kbps ...
    KOLANCHI : MultiCh_playbackApp 303
     [m3vpss ]  85265: IPC_IN_M3   : Create in progress !!!
     [m3vpss ]  85266: SYSTEM: Opening ListMP [VIDEO-M3_IPC_OUT_0] ...
     [m3video] DECLINK_H264:HEAPID:0        USED:2368
     [m3vpss ]  85266: SYSTEM: Opening ListMP [VIDEO-M3_IPC_IN_0] ...
     [m3video]  85262: DECODE: All CH Create ... DONE !!!
     [m3vpss ] RAJESH: System_ipcMsgQOpen for ProcessId=1
     [m3vpss ]  85267: SYSTEM: Opening MsgQ [VIDEO-M3_MSGQ] ...
     [m3vpss ]  85270: IPC_IN_M3   : Create Done !!!
     [m3video] DECLINK:HEAPID:0     USED:2408
     [m3vpss ]  85270: DEI    : Create in progress !!!
     [m3video]  85263: DECODE: Create ... DONE !!!
     [m3video]  85263: IPC_OUT_M3   : Create in progress !!!
     [m3video]  85265: IPC_OUT_M3   : Create Done !!!
     [m3vpss ]  85291: DEI: OUT1:  0: 0xa1727480, 800 x 480, 4 frames
                 [m3vpss ]  85293: DEI     : Loading Down-scaling Co-effs
     [m3vpss ]  85293: DEI     : Co-effs Loading ... DONE !!!
     [m3vpss ] DEI:HEAPID:0 USED:64
     [m3vpss ] DEI:HEAPID:1 USED:4672
     [m3vpss ]  85293: DEI    : Create Done !!!
     [m3vpss ]  85294: DISPLAY: Create in progress !!!
     [m3vpss ] DISPLAY: pObj->inQueInfo.chInfo[0].pitch[0] = (1600)
     [m3vpss ] width is 800 and height is 480 : dataFormat 1
     [m3vpss ] pitch 0 is 1600 : pitch 1 is 1600 : pitch 2 is 0
     [m3vpss ] DisplayId = 1,DataFormat = 1
     [m3vpss ] DISPLAY_LINK_DISPLAY_BP0 : DisplayLink_drvDisplayCreate 945
     [m3vpss ]
     [m3vpss ] BP0 displayInstId = 0 [m3vpss ]  85356: DISPLAY: HDDAC(BP0) : 34 fps, Latency (Min / Max) = ( 255 / 0 ), Callback Interval (Min / Max) = ( 255 / 0 ) !!!
     [m3vpss ] KOLANCHI : DisplayLink_drvPrintRtStatus 1279
     [m3vpss ]  85356: DISPLAY: UNDERFLOW COUNT: HDMI(BP0) 1, HDDAC(BP0) 1, DVO2(BP1) 1, SDDAC(SEC1) 1
     [m3vpss ]  85357: SYSTEM  : FREE SPACE : System Heap      = 865704 B, Mbx = 10238 msgs)
     [m3vpss ]  85357: SYSTEM  : FREE SPACE : SR0 Heap         = 14771328 B (14 MB)
     [m3vpss ]  85357: SYSTEM  : FREE SPACE : Frame Buffer     = 82750336 B (78 MB)
     [m3vpss ]  85357: SYSTEM  : FREE SPACE : Bitstream Buffer = 66201472 B (63 MB)
     [m3vpss ]  85358: SYSTEM  : FREE SPACE : Tiler Buffer     = 127 B (0 MB)  - TILER OFF
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
    [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
    ERROR  (audio_playback.c|Audio_playbackPlay|232): audio short write:832 frames
     [m3vpss ] #### frameList.numFrames = 0
     ERROR  (audio_playback.c|Audio_playbackPlay|228): audio error from write : Resource temporarily unavailable
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     ERROR  (audio_playback.c|Audio_playbackPlay|232): audio short write:584 frames
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     ERROR  (audio_playback.c|Audio_playbackPlay|228): audio error from write : Resource temporarily unavailable
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     ERROR  (audio_playback.c|Audio_playbackPlay|232): audio short write:776 frames
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     ERROR  (audio_playback.c|Audio_playbackPlay|228): audio error from write : Resource temporarily unavailable
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     ERROR  (audio_playback.c|Audio_playbackPlay|232): audio short write:768 frames
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
     ERROR  (audio_playback.c|Audio_playbackPlay|228): audio error from write : Resource temporarily unavailable
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ] #### frameList.numFrames = 0
                                                                                                                                                         

    Regards:

    Rajesh Singh


                                                                                                                                            

  • Hi Rajesh,

    Since the no of frames received by Display link from previous link is 0 so it keeps displaying the first frame.

    Can you pl. check your data flow?

    Check if encoded bitstream is getting to decoder link and decoder is outputting the decoded frames.

    regards,

    Anand

  • Dear Anand,

    Can you please help me, where to put prints in decoder  link to monitor  the input and output buffers from the decoder link.

    Regards:

    Rajesh Singh

  • Dear Anand,

    In file   "dvr_rdk/dvr_mcfw/mcfw/src_bios6/links_m3video/iva_dec/decLink_tsk.c" inside function "DecLink_tskMain(struct Utils_TskHndl *pTsk, Utils_MsgHndl * pMsg)"

    I have added the following lines:

     while (!done)
        {
            status = Utils_tskRecvMsg(pTsk, &pMsg, BIOS_WAIT_FOREVER);
            if (status != FVID2_SOK)
                break;

            cmd = Utils_msgGetCmd(pMsg);

            switch (cmd)
            {
                case SYSTEM_CMD_NEW_DATA:
                    Vps_printf ("DEC_LINK: %d times Called\n", iCount); //TODO: Remove after testing
                    iCount++;
                    Utils_tskAckOrFreeMsg(pMsg, status);

                    flushCmds[0] = SYSTEM_CMD_NEW_DATA;
                    Utils_tskFlushMsg(pTsk, flushCmds, 1);

                    DecLink_codecProcessData(pObj);
                    break;

    Inorder to get the frames are coming to the decoder link.

    I am getting the following logs:

    [m3video] DEC_LINK: 0 times Called
     [m3video] DEC_LINK: 1 times Called
     [m3video] DEC_LINK: 2 times Called
     [m3video] DEC_LINK: 3 times Called
     [m3video] DEC_LINK: 4 times Called
     [m3video] DEC_LINK: 5 times Called
     [m3video] DEC_LINK: 6 times Called
     [m3video] DEC_LINK: 7 times Called
     [m3video] DEC_LINK: 8 times Called
     [m3video] DEC_LINK: 9 times Called
     [m3video] DEC_LINK: 10 times Called
     [m3video] DEC_LINK: 11 times Called
     [m3video] DEC_LINK: 12 times Called
     [m3video] DEC_LINK: 13 times Called
     [m3video] DEC_LINK: 14 times Called
     [m3video] DEC_LINK: 15 times Called
     [m3video] DEC_LINK: 16 times Called
     [m3video] DEC_LINK: 17 times Called
     [m3video] DEC_LINK: 18 times Called
     [m3video] DEC_LINK: 19 times Called
     [m3video] DEC_LINK: 20 times Called
     [m3video] DEC_LINK: 21 times Called
     [m3video] DEC_LINK: 22 times Called
     [m3video] DEC_LINK: 23 times Called
     [m3video] DEC_LINK: 24 times Called

    Kindly suggest for this.

    Regards:

    Rajesh Singh

  • Hi Rajesh,

    Can you share your use case code?

    Also provide details on how are you feeding the bitstream to the IPC Bits Out link on Host (A8).

    You should be calling IpcBitsOutLink_getEmptyVideoBitStreamBufs() API to get empty buffers from IPC Bits Out link and then once the empty buffer is filled with the bitstream you should call IpcBitsOutLink_putFullVideoBitStreamBufs() API to provide full buffers to the next link.

    regards,

    Anand

  • Dear Anand,

    Please find the attached usecase code.

    Also i enabled the frames Received, Skipped and submitted for  DEI link and found the following log:

    [m3vpss ] #### frameList.numFrames = 0
     [m3video] In Fn (DecLink_codecProcessTskFxn) iCount = 0
     [m3vpss ]  132480: DEI    : Received 1 IN frames !!!
     [m3vpss ]  132481: DEI    : Submitting 1 frames !!!
     [m3vpss ] #### frameList.numFrames = 0
     [m3video] DEC_LINK: 1 times Called
     [m3vpss ]  132490: DEI    : Completed 1 frames !!!
     [m3vpss ]  132490: DEI    : Released 1 IN frames !!!
     [m3vpss ]  132490: DEI    : Submitting 0 frames !!!
     [m3video] In Fn (DecLink_codecProcessTskFxn) iCount = 1
     [m3vpss ]  132504: DEI    : Received 1 IN frames !!!
     [m3vpss ]  132505: DEI    : Skipped 1 IN frames !!!
     [m3vpss ]  132505: DEI    : Submitting 0 frames !!!
     [m3vpss ] #### frameList.numFrames = 1
     [m3video] DEC_LINK: 2 times Called
     [m3video] In Fn (DecLink_codecProcessTskFxn) iCount = 2
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ]  132528: DEI    : Received 1 IN frames !!!
     [m3vpss ]  132529: DEI    : Skipped 1 IN frames !!!
     [m3vpss ]  132529: DEI    : Submitting 0 frames !!!
     [m3video] DEC_LINK: 3 times Called
     [m3vpss ] #### frameList.numFrames = 0
     [m3video] In Fn (DecLink_codecProcessTskFxn) iCount = 3
     [m3vpss ] #### frameList.numFrames = 0
     [m3vpss ]  132556: DEI    : Received 1 IN frames !!!
     [m3vpss ]  132556: DEI    : Skipped 1 IN frames !!!
     [m3vpss ]  132557: DEI    : Submitting 0 frames !!!
                                                                 

    It seems in DEI link it is skipping the all frames.

    Regards:

    Rajesh Singh

    /** ==================================================================
     *  @file   multich_playback.c
     *
     *  @path    ipnc_mcfw/mcfw/src_linux/mcfw_api/usecases/
     *
     *  @desc   This  File contains.
     * ===================================================================
     *  Copyright (c) Texas Instruments Inc 2011, 2012
     *
     *  Use of this software is controlled by the terms and conditions found
     *  in the license agreement under which this software has been supplied
     * ===================================================================*/
    
    /*------------------------------ PLAYBACK ON HDMI ----------------------------------
    									  SENSOR
                                    ________||_______
    				|----SALDRE ON--|	CAMERA LINK  |
    				|				|    ISP LINK    |
    				|				|________________|
    		GLBCE_LINK
    				|
    				|				__________________
    				|				|	CAMERA LINK  |
    				|---SALDRE ON---|    ISP LINK    |
    								|________________|
                                        Capture
    								 RSZA     RSZB
                                   1080P60    D130
                           (YUV420/YUV422I) (YUV420)	 |------------- SD DISPLAY
                                      |			|		 |
                                      |         |		(2)
    								 NSF	    ----- DUP_1(1) --------- SCALER
                                  (YUV420)              (0)                 |
                                      |                  |                  |
                                      |			         |               DUP_3(0)-------- FD 
                                      |			|---------                 (1)
    							   	  |			|                           |----------------
    								  |         |							|				| 					
    					--------------|         |					IPC FRAMES OUT(VPS) 	|
    					|                       |                           |				|(VA on VPS)
    					|                       |                			|				|
                     DUP_2(0)-------------|     |					 IPC FRAMES IN(DSP) 	|	
                       (1)        |---|   |     |             				|				|
    					|		  |   |---|-----|              				|---------------|				
    					|---------|       |                    			    |	
    									  |                             VA(VPS/DSP)
    									MERGE                  
    									  |                    
    									  |                    
    									SWOSD
                                          |
                                          |
    								   DUP_4(1)----------- HDMI DISPLAY
                                          |
    									  |	
    								IPCM3OUT(VPS)
    									  |
    									  |
    				        		 IPCM3IN(VID)
    									  |
    									  |
    								    H264ENC
    									  |
    									  |
    								  BITSOUT (VID)
    								  	  |
    								  	  |
    								  BITSIN (A8)
    ------------------------------------------------------------------------------------------*/
    
    #include "mcfw/src_linux/mcfw_api/usecases/multich_common.h"
    #include "mcfw/src_linux/mcfw_api/usecases/multich_ipcbits.h"
    #include "demos/mcfw_api_demos/multich_usecase/ti_mcfw_ipnc_main.h"
    
    
    #ifdef ENABLE_TILER
            #define TILER_ENABLE    TRUE
    #else
            #define TILER_ENABLE    FALSE
    #endif
    
    
    #define NUM_DECODE_BUFFERS              (4)
    #define NUM_IPC_OUT_BUFFERS     (4)
    
    #define DEI_OUT_MAIN_STRAMER    (DEI_LINK_OUT_QUE_DEI_SC)   // YUV422I WB0/1
    #define DEI_OUT_SUB_STRAMER             (DEI_LINK_OUT_QUE_VIP_SC) // (or) DEI_LINK_OUT_QUE_VIP_SC_SECONDARY_OUT  => YUV422I, YUV420SP on VIP0/1,
    
    
    
    /* =============================================================================
     * Use case code
     * ============================================================================= */
    #if 0
    static SystemVideo_Ivahd2ChMap_Tbl systemVid_encDecIvaChMapTbl = {
        .isPopulated = 1,
        .ivaMap[0] = {
                      .EncNumCh = 2,
                      .EncChList = {0, 1},
                      .DecNumCh = 2,
                      .DecChList = {0, 1},
                      },
    
    };
    #endif
    
    
    /* Merge Link for camera streams */
    #define NUM_MERGE_LINK              (1)
    #define CAM_STREAM_MERGE_IDX        (0)
    
    /* Dup Links */
    #define NUM_DUP_LINK				(4)
    #define DIS_DUP_IDX					(0)
    #define MJPEG_DUP_LINK_IDX			(1)
    #define SCALER_DUP_IDX				(2)
    #define VA_DUP_IDX					(3)   
    
    UInt32 gIpcOutVpssId_cbb;
    UInt32 gIpcInVideoId_cbb;
    UInt32 gIpcOutVideoId_cbb;
    UInt32 gIpcInVpssId_cbb;
    UInt32 gDisplayId;
    //UInt32 gSclrId;
    UInt32 gDeiId;
    /* ===================================================================
     *  @func     MultiCh_playbackApp
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Void MultiCh_playbackApp()
    {
    	UInt32 i;
    
    	IpcBitsOutLinkHLOS_CreateParams ipcBitsOutHostPrm;
    	IpcBitsInLinkRTOS_CreateParams ipcBitsInVideoPrm;
    
    	DecLink_CreateParams decPrm;
    
    	IpcLink_CreateParams ipcOutVideoPrm;
    	IpcLink_CreateParams ipcInVpssPrm;
            //SclrLink_CreateParams       sclrPrm_LCD; //LCD
            DeiLink_CreateParams              deiPrm ;
    	DisplayLink_CreateParams displayPrm ;
    
    
    	/* IPC struct init */
    
    	MULTICH_INIT_STRUCT(IpcBitsOutLinkHLOS_CreateParams,ipcBitsOutHostPrm);
    	MULTICH_INIT_STRUCT(IpcBitsInLinkRTOS_CreateParams,ipcBitsInVideoPrm);
    	MULTICH_INIT_STRUCT(IpcLink_CreateParams,ipcOutVideoPrm);				//	KOLANCHI PLAYBACK
    	MULTICH_INIT_STRUCT(IpcLink_CreateParams,ipcInVpssPrm);
            MULTICH_INIT_STRUCT(DeiLink_CreateParams, deiPrm);
    
    
    
    	OSA_printf("\n KOLANCHI :  ********** PLAYBACK FEATURE USECASE ********\n");
    	OSA_printf("********* Entered PLAYBACK usecase - H264 1080p @60fps + H264 D1 @30fps + MJPEG 1080p @5fps ********\n\n");
    
    
            MultiCh_detectBoard();
    
            System_linkControl(SYSTEM_LINK_ID_M3VPSS,
                                                      SYSTEM_M3VPSS_CMD_RESET_VIDEO_DEVICES, NULL, 0, TRUE);
    
    	#if 0
        System_linkControl(SYSTEM_LINK_ID_M3VIDEO,
                           SYSTEM_COMMON_CMD_SET_CH2IVAHD_MAP_TBL,
                           &systemVid_encDecIvaChMapTbl,
                           sizeof(SystemVideo_Ivahd2ChMap_Tbl), TRUE);
    	#endif
        /* Link IDs */
    
    
        gVdecModuleContext.ipcBitsOutHLOSId = SYSTEM_HOST_LINK_ID_IPC_BITS_OUT_0;
        gVdecModuleContext.ipcBitsInRTOSId = SYSTEM_VIDEO_LINK_ID_IPC_BITS_IN_0;
    
        gVdecModuleContext.decId = SYSTEM_LINK_ID_VDEC_0;
        gVdecModuleContext.ipcM3OutId = SYSTEM_VIDEO_LINK_ID_IPC_OUT_M3_0;
        gVdecModuleContext.ipcM3InId = SYSTEM_VPSS_LINK_ID_IPC_IN_M3_0;
        gDeiId = SYSTEM_LINK_ID_DEI_0;
        gVdisModuleContext.displayId[VDIS_DEV_DVO2] = SYSTEM_LINK_ID_DISPLAY_1 ;	
    
    
    
    	/********************************************************************************************************************/
            /************************************************ DECODE PATH *******************************************************/
            /********************************************************************************************************************/
    
    
    	ipcBitsOutHostPrm.baseCreateParams.inputFrameRate                 = 30 ;
    	ipcBitsOutHostPrm.baseCreateParams.outputFrameRate                = 30 ;
    	ipcBitsOutHostPrm.baseCreateParams.inQueParams.prevLinkQueId      = 0 ;
            ipcBitsOutHostPrm.baseCreateParams.numOutQue                      = 1 ;
            ipcBitsOutHostPrm.baseCreateParams.outQueParams[0].nextLink       = gVdecModuleContext.ipcBitsInRTOSId ;
            ipcBitsOutHostPrm.baseCreateParams.notifyNextLink                 = TRUE;
            ipcBitsOutHostPrm.baseCreateParams.notifyPrevLink                 = FALSE;
            ipcBitsOutHostPrm.baseCreateParams.noNotifyMode                   = FALSE;
    
            ipcBitsOutHostPrm.inQueInfo.numCh                                 = 1;
            ipcBitsOutHostPrm.inQueInfo.chInfo[0].startX                      = 0;
            ipcBitsOutHostPrm.inQueInfo.chInfo[0].startY                      = 0;
            ipcBitsOutHostPrm.inQueInfo.chInfo[0].pitch[0]                    = 0;
            ipcBitsOutHostPrm.inQueInfo.chInfo[0].pitch[1]                    = 0;
            ipcBitsOutHostPrm.inQueInfo.chInfo[0].pitch[2]                    = 0;
    	ipcBitsOutHostPrm.inQueInfo.chInfo[0].height                      = 1080; //gVdecModuleContext.vdecConfig.decChannelParams[0].maxVideoHeight;
    	ipcBitsOutHostPrm.inQueInfo.chInfo[0].width                       = 1920; //gVdecModuleContext.vdecConfig.decChannelParams[0].maxVideoWidth;;
            ipcBitsOutHostPrm.inQueInfo.chInfo[0].bufType                     = SYSTEM_BUF_TYPE_VIDBITSTREAM;
            ipcBitsOutHostPrm.inQueInfo.chInfo[0].codingformat                = -1; //9;
            ipcBitsOutHostPrm.inQueInfo.chInfo[0].memType                     = SYSTEM_MT_NONTILEDMEM;
            ipcBitsOutHostPrm.inQueInfo.chInfo[0].dataFormat                  = SYSTEM_DF_YUV422I_YUYV;
            ipcBitsOutHostPrm.inQueInfo.chInfo[0].scanFormat                  = SYSTEM_SF_PROGRESSIVE;//SYSTEM_SF_INTERLACED;//
    
            /* IPC BITS IN VIDEO Link */
            ipcBitsInVideoPrm.baseCreateParams.inQueParams.prevLinkId    = gVdecModuleContext.ipcBitsOutHLOSId;
            ipcBitsInVideoPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
            ipcBitsInVideoPrm.baseCreateParams.numOutQue                 = 1;
            ipcBitsInVideoPrm.baseCreateParams.outQueParams[0].nextLink  = gVdecModuleContext.decId;
            ipcBitsInVideoPrm.baseCreateParams.noNotifyMode              = FALSE;
            ipcBitsInVideoPrm.baseCreateParams.notifyNextLink            = TRUE;
            ipcBitsInVideoPrm.baseCreateParams.notifyPrevLink            = TRUE;
    	ipcBitsInVideoPrm.baseCreateParams.inputFrameRate            = 30;
    	ipcBitsInVideoPrm.baseCreateParams.outputFrameRate           = 30;
    
            /* DEC Link */
        DecLink_CreateParams_Init(&decPrm);
    
      for (i = 0; i < ipcBitsOutHostPrm.inQueInfo.numCh; i++)
        {
                decPrm.chCreateParams[i].format                               = IVIDEO_H264HP;
                decPrm.chCreateParams[i].profile                              = IH264VDEC_PROFILE_ANY;
                decPrm.chCreateParams[i].fieldMergeDecodeEnable               = FALSE;
                decPrm.chCreateParams[i].targetMaxWidth                       = ipcBitsOutHostPrm.inQueInfo.chInfo[i].width;
                decPrm.chCreateParams[i].targetMaxHeight                      = ipcBitsOutHostPrm.inQueInfo.chInfo[i].height;
                decPrm.chCreateParams[i].defaultDynamicParams.targetFrameRate = gVdecModuleContext.vdecConfig.decChannelParams[i].dynamicParam.frameRate;
                decPrm.chCreateParams[i].defaultDynamicParams.targetBitRate   = gVdecModuleContext.vdecConfig.decChannelParams[i].dynamicParam.targetBitRate;
    
                /* Max ref frames is only 2 as this is closed loop decoder */
                decPrm.chCreateParams[i].dpbBufSizeInFrames = 2;
        }
     	decPrm.inQueParams.prevLinkId    = gVdecModuleContext.ipcBitsInRTOSId;
            decPrm.inQueParams.prevLinkQueId = 0;
    
            decPrm.outQueParams.nextLink     = gVdecModuleContext.ipcM3OutId;
            decPrm.tilerEnable               = TILER_ENABLE;
            decPrm.numBufPerPool[0]          = NUM_DECODE_BUFFERS;
    
            /* FRAMES OUT VIDEO Link */
            ipcOutVideoPrm.inQueParams.prevLinkId    = gVdecModuleContext.decId;
            ipcOutVideoPrm.inQueParams.prevLinkQueId = 0;
            ipcOutVideoPrm.numOutQue                 = 1;
            ipcOutVideoPrm.outQueParams[0].nextLink  = gVdecModuleContext.ipcM3InId;
            ipcOutVideoPrm.notifyNextLink            = TRUE;
            ipcOutVideoPrm.notifyPrevLink            = TRUE;
            ipcOutVideoPrm.noNotifyMode              = FALSE;
    
            /* FRAMES IN VPSS Link */
            ipcInVpssPrm.inQueParams.prevLinkId    = gVdecModuleContext.ipcM3OutId;
            ipcInVpssPrm.inQueParams.prevLinkQueId = 0;
            ipcInVpssPrm.numOutQue                 = 1;
            //ipcInVpssPrm.outQueParams[0].nextLink  = gMergeId_cbb[DIS_MERGE_IDX];
            //ipcInVpssPrm.outQueParams[0].nextLink  = gVdisModuleContext.swMsId[0];
            //ipcInVpssPrm.outQueParams[0].nextLink  = gDisplayId;
            //ipcInVpssPrm.outQueParams[0].nextLink  = gVdisModuleContext.displayId[VDIS_DEV_DVO2];
            ipcInVpssPrm.outQueParams[0].nextLink  =  gDeiId;
            //ipcInVpssPrm.outQueParams[0].nextLink    = gVcamModuleContext.deiId[0] ;
            //ipcInVpssPrm.outQueParams[0].nextLink  = dupId[VA_DUP_IDX];
            ipcInVpssPrm.notifyNextLink            = TRUE;
            ipcInVpssPrm.notifyPrevLink            = TRUE;
            ipcInVpssPrm.noNotifyMode              = FALSE;
    
            /* Link Creation */
            System_linkCreate(gVdecModuleContext.ipcBitsOutHLOSId,&ipcBitsOutHostPrm,sizeof(ipcBitsOutHostPrm));
            System_linkCreate(gVdecModuleContext.ipcBitsInRTOSId,&ipcBitsInVideoPrm,sizeof(ipcBitsInVideoPrm));
    	printf("KOLANCHI : %s %d\n",__func__,__LINE__);
            System_linkCreate(gVdecModuleContext.decId,&decPrm,sizeof(decPrm));
    	printf("KOLANCHI : %s %d\n",__func__,__LINE__);
            System_linkCreate(gVdecModuleContext.ipcM3OutId,&ipcOutVideoPrm,sizeof(ipcOutVideoPrm));
            System_linkCreate(gVdecModuleContext.ipcM3InId,&ipcInVpssPrm,sizeof(ipcInVpssPrm));
    
    	/********************************************************************************************************************/
            /************************************************ DISPLAY PATH ******************************************************/
            /********************************************************************************************************************/
    
    #if 1
            deiPrm.inQueParams.prevLinkId = gVdecModuleContext.ipcM3InId;
            deiPrm.inQueParams.prevLinkQueId  = 0 ;
            deiPrm.enableLineSkipSc = FALSE;
            deiPrm.enableDeiForceBypass = FALSE;
            deiPrm.inputDeiFrameRate = 30;
            deiPrm.outputDeiFrameRate = 30;
            deiPrm.outQueParams[DEI_OUT_SUB_STRAMER].nextLink = gVdisModuleContext.displayId[VDIS_DEV_DVO2] ;      //RAJESH v4l2
            deiPrm.enableOut[DEI_OUT_MAIN_STRAMER] = FALSE ;
            deiPrm.enableOut[DEI_OUT_SUB_STRAMER] = TRUE;
            deiPrm.comprEnable = FALSE;
            deiPrm.setVipScYuv422Format = TRUE;    // FALSE->yuv420sp,  TRUE->yuv422i
            deiPrm.inputFrameRate[DEI_OUT_SUB_STRAMER] = 30 ;
            deiPrm.outputFrameRate[DEI_OUT_SUB_STRAMER] = 30 ;
            deiPrm.outScaleFactor[DEI_OUT_SUB_STRAMER][0].scaleMode = DEI_SCALE_MODE_ABSOLUTE;
            deiPrm.outScaleFactor[DEI_OUT_SUB_STRAMER][0].absoluteResolution.outWidth  = 800;
            deiPrm.outScaleFactor[DEI_OUT_SUB_STRAMER][0].absoluteResolution.outHeight = 480;
    #endif
    
    #if 0
            /*LCD Scaler Path */
             /*LCD Scaler Configration*/
                SclrLink_CreateParams_Init(&sclrPrm_LCD);
                sclrPrm_LCD.inQueParams.prevLinkId                                   = gVdecModuleContext.ipcM3InId;
                sclrPrm_LCD.inQueParams.prevLinkQueId                                = 0;
                sclrPrm_LCD.outQueParams.nextLink                                    = gVdisModuleContext.displayId[VDIS_DEV_DVO2];
                sclrPrm_LCD.tilerEnable                                              = TRUE;
                sclrPrm_LCD.enableLineSkipSc                                         = FALSE;
                sclrPrm_LCD.inputFrameRate                                           = 30;
                sclrPrm_LCD.outputFrameRate                                          = 30;
                sclrPrm_LCD.scaleMode                                                = DEI_SCALE_MODE_ABSOLUTE;
                sclrPrm_LCD.outScaleFactor.absoluteResolution.outWidth   = 800;
                sclrPrm_LCD.outScaleFactor.absoluteResolution.outHeight  = 480;
    #if 0
                if(gUI_mcfw_config.display_device == HDMI ){
                   sclrPrm_LCD.outScaleFactor.absoluteResolution.outWidth   = 1920;
                   sclrPrm_LCD.outScaleFactor.absoluteResolution.outHeight  = 1080;
                }
    #endif
                sclrPrm_LCD.outDataFormat                                = SYSTEM_DF_YUV420SP_UV;
                //sclrPrm_LCD.outDataFormat                                = SYSTEM_DF_YUV422I_YUYV ;
                sclrPrm_LCD.pathId                                       = SCLR_LINK_SEC0_SC3 ;
                //sclrPrm_LCD.pathId                                       = 0 ;
           
    #endif 
    
     
    
            /* HDMI Display */
            MULTICH_INIT_STRUCT(DisplayLink_CreateParams,displayPrm);
            //displayPrm.inQueParams[0].prevLinkId    = gVdisModuleContext.swMsId[0];
            //displayPrm.inQueParams[0].prevLinkId    = gVdecModuleContext.ipcM3InId;
            displayPrm.inQueParams[0].prevLinkId    = gDeiId;
            //displayPrm.inQueParams[0].prevLinkId    = gVcamModuleContext.deiId[0];
            displayPrm.inQueParams[0].prevLinkQueId = DEI_OUT_SUB_STRAMER;
            //displayPrm.inQueParams[0].prevLinkQueId = 0;
            //displayPrm.activeQueue                  = 0;
            //displayPrm.displayRes                   = gVdisModuleContext.vdisConfig.deviceParams[VDIS_DEV_HDMI].resolution;
            displayPrm.displayRes                   = gVdisModuleContext.vdisConfig.deviceParams[VDIS_DEV_DVO2].resolution;
            displayPrm.displayId                    = DISPLAY_LINK_DISPLAY_SC2;
    
            /* Select Link */
            System_linkCreate(gDeiId,&deiPrm,sizeof(DeiLink_CreateParams));
            System_linkCreate(gVdisModuleContext.displayId[VDIS_DEV_DVO2], &displayPrm,sizeof(displayPrm));
    
    
        OSA_printf("USECASE SETUP DONE\n");
    }
    
    /* ===================================================================
     *  @func     MultiCh_deleteplaybackApp
     *
     *  @desc     Function does the following
     *
     *  @modif    This function modifies the following structures
     *
     *  @inputs   This function takes the following inputs
     *            <argument name>
     *            Description of usage
     *            <argument name>
     *            Description of usage
     *
     *  @outputs  <argument name>
     *            Description of usage
     *
     *  @return   Return value of this function if any
     *  ==================================================================
     */
    Void MultiCh_deleteplaybackApp()
    {
    
        gVdecModuleContext.ipcBitsOutHLOSId = SYSTEM_HOST_LINK_ID_IPC_BITS_OUT_0;
        gVdecModuleContext.ipcBitsInRTOSId = SYSTEM_VIDEO_LINK_ID_IPC_BITS_IN_0;
    
        gVdecModuleContext.decId = SYSTEM_LINK_ID_VDEC_0;
        gVdecModuleContext.ipcM3OutId = SYSTEM_VIDEO_LINK_ID_IPC_OUT_M3_0;
        gVdecModuleContext.ipcM3InId = SYSTEM_VPSS_LINK_ID_IPC_IN_M3_0;
        //gDisplayId = SYSTEM_LINK_ID_DISPLAY_0;
        //gVdisModuleContext.displayId[VDIS_DEV_HDMI] = SYSTEM_LINK_ID_DISPLAY_0 ;	//	KOLANCHI playback display issue
        gVdisModuleContext.displayId[VDIS_DEV_DVO2] = SYSTEM_LINK_ID_DISPLAY_1 ;	//	KOLANCHI playback display issue
        //gVcamModuleContext.deiId[0] = SYSTEM_LINK_ID_DEI_HQ_0; 
    
        System_linkDelete(gVdecModuleContext.ipcBitsOutHLOSId);
        System_linkDelete(gVdecModuleContext.ipcBitsInRTOSId);
        System_linkDelete(gVdecModuleContext.decId);    
        System_linkDelete(gVdecModuleContext.ipcM3OutId);
        System_linkDelete(gVdecModuleContext.ipcM3InId);
        //System_linkDelete(gSclrId);
        System_linkDelete(gDeiId);
        //System_linkDelete(gVdisModuleContext.displayId[VDIS_DEV_HDMI]); 			// 	KOLANCHI playback issue
        System_linkDelete(gVdisModuleContext.displayId[VDIS_DEV_DVO2]); 			// 	KOLANCHI playback issue
      	
    
        OSA_printf("USECASE TEARDOWN DONE\n");
    }
    

  • Hi Rajesh,

    Can you tell me where did you put the debug messages in the DEI link?

    regards,

    Anand

  • Dear Anand,

    I have enabled macro "SYSTEM_DEBUG_DEI_RT"  in file "dvr_rdk/dvr_mcfw/mcfw/src_bios6/links_m3vpss/dei/deiLink_drv.c "

    Regards:

    Rajesh Singh

  • Hi Rajesh,

    Can you pl. check at what point the value of 'freeFrameNum' is incremented in the function DeiLink_drvQueueFramesToChQue()?

    You can put some print before freeFrameNum++; statement.

    regards,

    Anand

  • Hi Anand,


    freeFrameNum++ is incremented after failing to meet below the condition,

                if (pChObj->nextFid == pFrame->fid)
                {

                 ......

                 ......
     
                 }
                 else
                 {
                              //if(pObj->createArgs.enableDeiForceBypass)
                              {
                                  pChObj->inFrameRejectCount++;

                                   // frame is not of expected FID, so release frame
                                   frameList.frames[freeFrameNum] = pFrame;
    //#ifdef SYSTEM_DEBUG_DEI_RT
                                   Vps_printf(" Adding to skip Frames line:989  !!! pChObj->nextFid=%d  pFrame->fid=%d\n", pChObj->nextFid, pFrame->fid);
    //#endif
                                    freeFrameNum++;
                               }
                 }

    So we are getting below message while executing the playback usecase,

    ....

    ....
     [m3video]  SARA : DECODE: NEW DATA... !!!
     [m3vpss ]  1119348: DEI    : Received 1 IN frames !!!
     [m3vpss ]  Adding to skip Frames line:989  !!! pChObj->nextFid=1  pFrame->fid=0
     [m3vpss ]  1119348: DEI    : Skipped 1 IN frames !!!
     [m3vpss ]  1119348: DEI    : Submitting 0 frames !!!
    [m3video]  SARA : DECODE: progress done for one frame !!!

    ....

    ....

    Kindly give your feedback.

    Regards,

    Saravanan S

  • Hi Saravana,

    When you are using the DEI only for scaling then you should use either 'SYSTEM_LINK_ID_DEI_HQ_0' or 'SYSTEM_LINK_ID_DEI_HQ_1' as DEI link ID.

    Else you need to provide interlaced input with field id 0 and 1.

    regards,

    Anand