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.

problem with Configuring VPSS fo 16-bit mode in dvr-rdk

Other Parts Discussed in Thread: TVP7002

Hello,

I am trying to use TVP7002 with DVR RDK. My base board is DM8168EVM.

I found that if I configure video mode for 16-bit , FVID2_Create function gives error, and capture link creation fails while I run my code.

Could anyone please suggest me how to configure VPSS in 16-bit mode?

  • Hi Rakesh,

     

    Can you share the changes you made or complete create time parameters structure? I can look into it and could fine what is problem.

     

    Regards,

    Brijesh

  • Thanks Brijesh,

    Below are my create time parameters.

     [host] MCFW_IPCFRAMES:VcapVenc_ipcFramesSendRecvFxn:Entered... 41242: MCFW  : CPU Revision [ES1.1] !!!
     41242: MCFW  : Detected [UNKNOWN] Board !!!
     41242: MCFW  : Base Board Revision [REV A] !!!
     [m3vpss ]  68692: CAPTURE: Create in progress !!!
     [m3vpss ]  68724: CAPTURE: VIP0 PortA capture mode is [16-bit, Non-mux Embedded Sync] !!!
     [m3vpss ]  CAPTURE:
     [m3vpss ]  Instant Id = 0
     [m3vpss ]  Video Capture Mode =0
     [m3vpss ]  Video If Mode=1
     [m3vpss ]  video in data format =6
     [m3vpss ]  Periodic call enable=1
     [m3vpss ]  Number of channel=1
     [m3vpss ]  Number of Stream =1
     [m3vpss ]  Inscan Format=1
     [m3vpss ]  Instant Create Status = 0 Instant Cb param =4410901
     [m3vpss ]  68725: Assertion @ Line: 959 in links_m3vpss/capture/captureLink_drv.c: pInst->captureVipHandle != NULL : failed !!!

    Please let me know where it fails?

    I have given driver ID FVID2_VPS_VID_DEC_TVP7002_DRV.

  • Hi Rakehs,

     

    Could you dump parameters of outStreamInfo[0]?

     

    Regards,

    Brijesh Jadav

  • Hi Brijesh,

    Below are the outstreaminfo[0] Parameters.

    45495: CAPTURE: VIP0 PortA capture mode is [16-bit, Non-mux Embedded Sync] !!!
     [m3vpss ]  CAPTURE:Out Stream Parameters
     [m3vpss ]  In data Format=1
     [m3vpss ]  Mem Type=0
     [m3vpss ]  Mex DataOut Width=0
     [m3vpss ]  Max OUT Height=7
     [m3vpss ]  scEnable=0
     [m3vpss ]  subFrameModeEnable=0
     [m3vpss ]  numLinesInSubFrame=0


    Thanks.....

  • Are you setting createStatus to null? If it is null, it will return error?

     

    Regards,

    Brijesh Jadav

  • createStatus parameter does not effect on failur, whether I pass 1 or 0 it gives same result. Could you please let me know where this parameter fill up? because I could not found it  in captureLink_drv.c file

  • Hi Rakesh,

     

    CreateStatus is returned by the driver if the valid pointer is provided to the driver.From this, it looks like you are providing valid pointer, but still capture is returning null as handle. As such capture create time parameters are correct. If it could fail only if it cannot find the required resources. So what else are you running in the system? Do DEI and Scalar (SC3) link enabled in the system?

     

    Regards,

    Brijesh Jadav

  • Hi Brijesh,

    DEI link is enalble, while scalar link is not enable in it. I am trying to run Video Capture, encode and display demo(for HD) available in RDK, using TVP7002.I also found that if I pass 16-embedded sync in application then also capture link driver fails at same place. So I doubt that capture link does not support 16-bit data properly.

    Thanks....

  • ok let me try this out. i will check this and see what is the problem

     

    Regards,

    Brijesh Jadav

  • This may be helpful. I had a similiar problem. This is how I fixed it.

    I will be using a 'vipInstId' of 2.

    I use an external decoder so I set the following AFTER doing basic initialization Vxxx_params_init( &vxxxParams)

        // By Default enableConfigExtVideoDecoder is set to TRUE
        vcapParams.enableConfigExtVideoDecoder = false;

        // By Default enableConfigExtVideoDecoder is set to TRUE
        vdisParams.enableConfigExtThsFilter = false;
        vdisParams.enableConfigExtVideoEncoder = false;

    When Vcap_init(pContexxt) function is called with valid parameters:

    Make sure the numCh matches 'vipInstId'

    pContext->numCh = 2;

    This function also sets numChannels with 'numChn'

            gVcapModuleContext.numChannels = pContext->numChn;

    After setting up other McFw items (depends on your usecase)

    Eventually you call: vsys_create()

    This will call your usecase function located vsys_create()

    My decoder setup is:

    VIP0 Port A is  16bit embedded sync 

    VIP1 Port A is 8 bit embedded sync

    Here is part of my Capture Setup in my usecase (this is abbreviated)

    You must use PortA as the pCaptureInstPrm->vipInstId = SYSTEM_CAPTURE_INST_VIPx_PORTA

    Do not use SYSTEM_CAPTURE_INST_VIPx_PORTB

    Void M6820_setCapturePrm( )
    {
        M6820_UsecaseContext* pCtx = &g_M6820_UsecaseCtx;

        int i;
        UInt32 vipInstId;

        CaptureLink_VipInstParams*    pCaptureInstPrm;
        CaptureLink_OutParams*        pCaptureOutPrm;
        CaptureLink_CreateParams*     pCapturePrm = &pCtx->capturePrm;

        #if defined( _DEBUG )
        printf( "\n*** Entered %s()\n", __FUNCTION__ );
    #endif

        gVcapModuleContext.captureId = SYSTEM_LINK_ID_CAPTURE;
        pCtx->mergeId[ MERGE_0_LINK_ID ] = SYSTEM_VPSS_LINK_ID_MERGE_0;

        CaptureLink_CreateParams_Init( pCapturePrm );

         pCapturePrm->numVipInst               = 2;          // <<< THIS WAS THE gVcapModuleContext.numChannels value above
        pCapturePrm->tilerEnable              = FALSE;
        pCapturePrm->fakeHdMode               = FALSE;    // TRUE;
        pCapturePrm->enableSdCrop             = FALSE;
        pCapturePrm->doCropInCapture          = FALSE;
        pCapturePrm->maxBlindAreasPerCh       = 4;

    // THIS IS MY OUTPUT QUE SETUP (yours will be different)
        pCapturePrm->outQueParams[ VCAP_OUTQ_0_LINK_IDX ].nextLink = pCtx->mergeId[ MERGE_0_LINK_ID ];
        pCapturePrm->outQueParams[ VCAP_OUTQ_1_LINK_IDX ].nextLink = pCtx->mergeId[ MERGE_0_LINK_ID ];

        for( vipInstId = 0; vipInstId < pCapturePrm->numVipInst; vipInstId++)
        {
            if ( vipInstId == 0 )
            {
            pCaptureInstPrm                     = &pCapturePrm->vipInst[vipInstId];
            pCaptureInstPrm->vipInstId          = SYSTEM_CAPTURE_INST_VIP0_PORTA;
            pCaptureInstPrm->videoDecoderId     = 0;  // <<< MAKE SURE THIS IS ZERO
            pCaptureInstPrm->inDataFormat       = SYSTEM_DF_YUV422P;
            pCaptureInstPrm->standard           = SYSTEM_STD_720P_60;
            pCaptureInstPrm->numOutput          = 1;

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

            pCaptureOutPrm->outQueId          = 0;
            }
            else
            {
                pCaptureInstPrm                     = &pCapturePrm->vipInst[vipInstId];
                pCaptureInstPrm->vipInstId          = SYSTEM_CAPTURE_INST_VIP1_PORTA;
                pCaptureInstPrm->videoDecoderId     = 0; // <<< MAKE SURE THIS IS ZERO
                pCaptureInstPrm->inDataFormat       = SYSTEM_DF_YUV422P;
                pCaptureInstPrm->standard           = SYSTEM_STD_480I;
                pCaptureInstPrm->numOutput          = 1;

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

                pCaptureOutPrm->outQueId          = 1;
            }

        //#if defined (_DEBUG )
            printf( "\n pCapturePrm->vipInstId <%d>\n", vipInstId );
            printf( " CaptureInstPrm\n" );
            printf( "  vipInstId      <%d>\n", pCaptureInstPrm->vipInstId );
            printf( "  videoDecoderId <%d>\n", pCaptureInstPrm->videoDecoderId );
            printf( "  inDataFormat   <%d>\n", pCaptureInstPrm->inDataFormat );
            printf( "  standard       <%d>\n", pCaptureInstPrm->standard );
            printf( "  numOutput      <%d>\n", pCaptureInstPrm->numOutput );

            printf( " CaptureOutPrm\n" );
            printf( "  dataFormat     <%d>\n", pCaptureOutPrm->dataFormat );
            printf( "  scEnable       <%d>\n", pCaptureOutPrm->scEnable );
            printf( "  scOutWidth     <%d>\n", pCaptureOutPrm->scOutWidth );
            printf( "  scOutHeight    <%d>\n", pCaptureOutPrm->scOutHeight );
            printf( "  outQueId       <%d>\n", pCaptureOutPrm->outQueId );
        //#endif
        }

    Make other link setups

    You eventually call this:

        System_linkCreate (gVcapModuleContext.captureId, &pCtx->capturePrm, sizeof(pCtx->capturePrm));

    This will call a function in:

    captureLink_dvr.c

    Int32 CaptureLink_drvCreate(CaptureLink_Obj * pObj,
                                CaptureLink_CreateParams * pPrm)

    Then:

    Int32 CaptureLink_drvCreateInst(CaptureLink_Obj * pObj, UInt16 instId)

    You may have to review what is being done in captureLink_dvr.c
    Here is part of what I did

    /////////////////////////

                case FVID2_STD_720P_60:
    #ifndef CRUMB
                    Vps_printf(" \nLn:%d: CAPTURE: pInstPrm->standard 'FVID2_STD_720P_60'\n", __LINE__ );
    #endif
                    pVipCreateArgs->videoIfMode = VPS_CAPT_VIDEO_IF_MODE_16BIT;

                   inScanFormat = FVID2_SF_PROGRESSIVE;

                    pInst->maxWidth = 1280;
                    pInst->maxHeight = 748;

                    inWidth = 1280;
                    inHeight = 720;

                    break;
    //////////////////////

            if (pVipCreateArgs->inDataFormat == FVID2_DF_RGB24_888)
            {
                pVipCreateArgs->videoCaptureMode =
                    VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_DISCRETE_SYNC_ACTVID_VBLK;
                pVipCreateArgs->videoIfMode = VPS_CAPT_VIDEO_IF_MODE_24BIT;
            }
            else
            {
                pVipCreateArgs->videoCaptureMode =
                    VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_EMBEDDED_SYNC;

                // >>> CRUMB: changed from original
                // >>> CRUMB: done in switch above
                //pVipCreateArgs->videoIfMode = VPS_CAPT_VIDEO_IF_MODE_16BIT;
                //pVipCreateArgs->videoIfMode = VPS_CAPT_VIDEO_IF_MODE_8BIT;
            }
    ///////////////////////

    Good Luck!