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.

DM385 : Video Flickering Issue

Other Parts Discussed in Thread: TVP5158, DM385

We are developing custom application using IPNC RDK 3.5 version. we have developed one custom chain to capture video from AR330 sensor along with 3 CVBS input video from TVP5158.   If we capture video(Full HD) from AR0330 sensor alone, the video capture, display, encode and streaming are working fine without any issue. But after integrating with 3 CVBS video, the full HD video is not smooth but analog video are fine. Only Full HD video is flickering and it seems the old frames are displayed in between the latest frames.

As we are not using TILER_MEMORY, We have changed the memory map to reduce the TIMER memory to 16MB and increased the SR2 region to 217MB.

Attached the log file for more information.

dvrload2.txt

  • Hi,

    It is possible that there are some DDR priority issues in your system.

    There is a newer DM385 RDK release (v 3.8.0)

    Do you have access to this release?

    thanks
    Cesar
  • Hi Cesar,

    Thanks for your reply.  

    Do you mean some of the application has high priority to access DDR ? As we are using IPNC 3.50 without much modification, can you help me to understand where the DDR priority are handled in the RDK ?

    Also we developed a simple usecase to capture and display the videos from camera(AR0330) and capture(TVP5158) links.   Interestingly, if we connect capture link with dei then the FullHD(AR0330) video flickers on the display. If we connect the output of capture link to "null" link,  then fullHD video is not flickering on the screen.  Is there anything to look into "dei" settings ? Attached our usecase file for your reference.

    Thanks,

    Saravanan S

    7802.multich_capturedisplay_mosaic.c
    /** ==================================================================
     *  @file   multich_Stream_CaptureDisplay.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
     * ===================================================================*/
    
    #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"
    
    /* =============================================================================
     * Externs
     * ============================================================================= */
    
    //#define NULLLINK  1
    
    
    UInt32 gDispSclrId ;
    UInt32 gDeiId;
    /* =============================================================================
     * Use case code
     * ============================================================================= */
    static SystemVideo_Ivahd2ChMap_Tbl systemVid_encDecIvaChMapTbl = {
        .isPopulated = 1,
        .ivaMap[0] = {
                      .EncNumCh = 2,
                      .EncChList = {0, 1},
                      .DecNumCh = 2,
                      .DecChList = {0, 1},
                      },
    
    };
    /* Merge Link for camera streams */
    #define NUM_MERGE_LINK              (1) 
    #define NUM_DUP_LINK           (3)
    #define HDMIDIS_DUP_IDX        (0)
    #define RAW_DUP_IDX            (2)
    #define CAM_STREAM_MERGE_IDX        (0)
    
    #define DEI_OUT_MAIN_STRAMER    (DEI_LINK_OUT_QUE_DEI_SC) // (DEI_LINK_OUT_QUE_VIP_SC // YUV422I WB0/1
    #define DEI_OUT_SUB_STRAMER     (DEI_LINK_OUT_QUE_DEI_SC) // (DEI_LINK_OUT_QUE_VIP_SC)
    
    /* ===================================================================
     *  @func     MultiCh_createStreamCaptureDisplay
     *
     *  @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_createStreamCaptureDisplay()
    Void MultiCh_tvp5158_CaptureDisplay11()
    {
        UInt32 chId;
     
        MergeLink_CreateParams mergePrm[NUM_MERGE_LINK];
        UInt32 mergeId[NUM_MERGE_LINK];
        SclrLink_CreateParams       disp_sclrPrm; 
     
        CameraLink_VipInstParams *pCameraInstPrm;
        CameraLink_OutParams *pCameraOutPrm;
        CameraLink_CreateParams cameraPrm;
    
        CaptureLink_CreateParams capturePrm;
        SwMsLink_CreateParams swMsPrm;
        DisplayLink_CreateParams displayPrm;
    
        //NullLink_CreateParams nulllink ;
        NullLink_CreateParams sdNullPrm;
    
        CaptureLink_VipInstParams *pCaptureInstPrm;
        CaptureLink_OutParams *pCaptureOutPrm;
        DeiLink_CreateParams              deiPrm ;
        OSA_printf("\n ** MultiCh_tvp5158_CaptureDisplay **\n\n");
    
        MultiCh_detectBoard();
    
        MULTICH_INIT_STRUCT(DeiLink_CreateParams, deiPrm);
    
        System_linkControl(SYSTEM_LINK_ID_M3VPSS,
                           SYSTEM_M3VPSS_CMD_RESET_VIDEO_DEVICES, NULL, 0, TRUE);
    
        System_linkControl(SYSTEM_LINK_ID_M3VIDEO,
                           SYSTEM_COMMON_CMD_SET_CH2IVAHD_MAP_TBL,
                           &systemVid_encDecIvaChMapTbl,
                           sizeof(SystemVideo_Ivahd2ChMap_Tbl), TRUE);
    
        gVcamModuleContext.cameraId = SYSTEM_LINK_ID_CAMERA;
    
            gVcamModuleContext.sclrId[0] = SYSTEM_LINK_ID_SCLR_INST_0;
            gVcamModuleContext.sclrId[1] = SYSTEM_LINK_ID_SCLR_INST_1;
            gVcamModuleContext.sclrId[2] = SYSTEM_LINK_ID_SCLR_INST_2;
            //gVcamModuleContext.sclrId[3] = SYSTEM_LINK_ID_SCLR_INST_3;
    
    
        gVcapModuleContext.captureId = SYSTEM_LINK_ID_CAPTURE;
        gVdisModuleContext.swMsId[1] = SYSTEM_LINK_ID_SW_MS_MULTI_INST_1;
        gVdisModuleContext.displayId[VDIS_DEV_SD] = SYSTEM_LINK_ID_DISPLAY_2;
        gDispSclrId = SYSTEM_LINK_ID_SCLR_INST_2 ;
        gDeiId =  SYSTEM_LINK_ID_DEI_HQ_0 ; //SYSTEM_LINK_ID_DEI_1; // SYSTEM_LINK_ID_DEI_HQ_0 
    
        {
    		gVcamModuleContext.glbceId = SYSTEM_LINK_ID_INVALID;
    		/* Camera Link params */
    		CameraLink_CreateParams_Init(&cameraPrm);
    
    		cameraPrm.captureMode = CAMERA_LINK_CAPMODE_ISIF;
    
    	        //cameraPrm.outQueParams[0].nextLink  =  SYSTEM_VPSS_LINK_ID_MERGE_1 ;
    	        cameraPrm.outQueParams[0].nextLink  =  SYSTEM_LINK_ID_SCLR_INST_0 ;
    	        //cameraPrm.outQueParams[0].nextLink  = scalerId[0] ; 
    
    		/* This is for TVP5158 Audio Channels - Change it to 16 if there are 16
    		 * audio channels connected in cascade */
    		cameraPrm.numAudioChannels = 0;
    		cameraPrm.numVipInst = 1;
                    cameraPrm.tilerEnable = FALSE;
    		cameraPrm.vsEnable = 0 ; //gUI_mcfw_config.vsEnable;
    
    		pCameraInstPrm = &cameraPrm.vipInst[0];
    		pCameraInstPrm->vipInstId = SYSTEM_CAMERA_INST_VP_CSI2;
    		pCameraInstPrm->videoDecoderId = MultiCh_getSensorId(gUI_mcfw_config.sensorId);
    		pCameraInstPrm->inDataFormat = SYSTEM_DF_YUV420SP_UV;
    		pCameraInstPrm->sensorOutWidth  = 1920;
    		pCameraInstPrm->sensorOutHeight = 1080;
    
    		if (gUI_mcfw_config.noisefilterMode == DSS_VNF_ON)
    		{
    			//pCameraInstPrm->standard = SYSTEM_STD_1080P_60;
    			pCameraInstPrm->standard = SYSTEM_STD_1080P_30;
    		}
    		else
    		{
    			pCameraInstPrm->standard = SYSTEM_STD_1080P_30;
    			cameraPrm.issVnfEnable = 1;
    		}
    
    		pCameraInstPrm->numOutput = 1;
    
    		/* First stream */
    		pCameraOutPrm = &pCameraInstPrm->outParams[0];
    		
    	        //pCameraOutPrm->dataFormat = SYSTEM_DF_YUV422I_YUYV ; 		
    	        pCameraOutPrm->dataFormat = SYSTEM_DF_YUV420SP_UV; 		
    
    		pCameraOutPrm->scEnable = FALSE;
    	        //pCameraOutPrm->scOutWidth = 720 ; // 1920;
    	        //pCameraOutPrm->scOutHeight = 480; // 1080;
    	        pCameraOutPrm->scOutWidth = 1920;
    	        pCameraOutPrm->scOutHeight = 1080;
    		pCameraOutPrm->outQueId = 0;
                    //pCameraOutPrm->standard    = SYSTEM_STD_480P;
    	        cameraPrm.vnfFullResolution = FALSE;
    
                    cameraPrm.vnfLinkId = SYSTEM_LINK_ID_INVALID;
                   
    		/* 2A config */
    		cameraPrm.t2aConfig.n2A_vendor = gUI_mcfw_config.n2A_vendor;
    		cameraPrm.t2aConfig.n2A_mode = gUI_mcfw_config.n2A_mode;
    #if 1               
                    /*Display Scaler Configration*/
                     SclrLink_CreateParams_Init(&disp_sclrPrm);
                     {
                         disp_sclrPrm.inQueParams.prevLinkId             = gVcamModuleContext.cameraId ; 
                         disp_sclrPrm.inQueParams.prevLinkQueId          = 0;
                     }
                     disp_sclrPrm.outQueParams.nextLink              =  SYSTEM_VPSS_LINK_ID_MERGE_1 ; //mergeId[CVBS_DUP_LINK_IDX]; 
                     //disp_sclrPrm.outQueParams.nextLink              =  SYSTEM_LINK_ID_SCLR_INST_0 ; //SYSTEM_VPSS_LINK_ID_MERGE_1 ; //mergeId[CVBS_DUP_LINK_IDX]; 
                     disp_sclrPrm.tilerEnable                        = FALSE;
                     disp_sclrPrm.enableLineSkipSc                   = FALSE;
                     disp_sclrPrm.inputFrameRate                     = 30;
                     disp_sclrPrm.outputFrameRate                    = 30;
                     disp_sclrPrm.scaleMode                          = DEI_SCALE_MODE_ABSOLUTE;
                     disp_sclrPrm.outScaleFactor.absoluteResolution.outWidth   = 720;
                     disp_sclrPrm.outScaleFactor.absoluteResolution.outHeight  = 480;
                     disp_sclrPrm.outDataFormat = VF_YUV422I_YUYV;
                     disp_sclrPrm.pathId = SCLR_LINK_SEC0_SC3;
                     //disp_sclrPrm.pathId = SCLR_LINK_SEC1_SC4;
    #endif
    
        }
    
    
        /* Capture Link params */
        CaptureLink_CreateParams_Init(&capturePrm);
        capturePrm.numVipInst		    = 1;
        capturePrm.tilerEnable		    = FALSE;
        capturePrm.numBufsPerCh		    = 10; //4;
    
        capturePrm.fakeHdMode                 = FALSE;
        capturePrm.enableSdCrop               = FALSE;
        capturePrm.doCropInCapture            = FALSE;
    
        pCaptureInstPrm                     = &capturePrm.vipInst[0];
        pCaptureInstPrm->vipInstId          = SYSTEM_CAPTURE_INST_VIP1_PORTA; //set capture port ID
        pCaptureInstPrm->videoDecoderId     = SYSTEM_DEVICE_VID_DEC_TVP5158_DRV; //set capture external device ID
        pCaptureInstPrm->standard           = SYSTEM_STD_MUX_4CH_D1; //set capture video standard as 4CH multiplxed D1 capture
        pCaptureInstPrm->numOutput          = 1; //number of output per channel for a port
        pCaptureInstPrm->inDataFormat       = SYSTEM_DF_YUV422P; //set input data format as 16-bit YUV422
        pCaptureOutPrm                      = &pCaptureInstPrm->outParams[0];
    	
        pCaptureOutPrm->dataFormat          = SYSTEM_DF_YUV422I_YUYV; //output data format is YUV422I
        pCaptureOutPrm->scEnable            = FALSE; //inline scaling disabled since this is multi-channel capture
        pCaptureOutPrm->scOutWidth          = 0;
        pCaptureOutPrm->scOutHeight         = 0;
        pCaptureOutPrm->outQueId            = 0;
    
        // next link after capture link is SW Mosaic DEI link
    #ifndef NULLLINK
        capturePrm.outQueParams[0].nextLink = gDeiId; 
    #else
        capturePrm.outQueParams[0].nextLink = SYSTEM_VPSS_LINK_ID_NULL_1 ; 
    #endif
    
    #ifndef NULLLINK
            /*DEI*/
            deiPrm.inQueParams.prevLinkId = gVcapModuleContext.captureId ; // CVBS_DISP
            deiPrm.inQueParams.prevLinkQueId  = 0 ;
            deiPrm.enableLineSkipSc = FALSE;
            deiPrm.enableDeiForceBypass = TRUE ; //Input is progressive TRUE
            deiPrm.inputDeiFrameRate = 30;
            deiPrm.outputDeiFrameRate = 30;
            //deiPrm.outQueParams[0].nextLink =  SYSTEM_VPSS_LINK_ID_NULL_1 ;
            deiPrm.outQueParams[DEI_OUT_SUB_STRAMER].nextLink =  SYSTEM_VPSS_LINK_ID_MERGE_1 ;
    
            deiPrm.enableOut[DEI_OUT_SUB_STRAMER] = TRUE;
            deiPrm.comprEnable = FALSE;
            deiPrm.setVipScYuv422Format = TRUE ;    // FALSE->yuv420sp,  TRUE->yuv422i //From DEI o/p to 422I
            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  = 720;
            deiPrm.outScaleFactor[DEI_OUT_SUB_STRAMER][0].absoluteResolution.outHeight = 480;
            for (chId=1; chId < DEI_LINK_MAX_CH; chId++)
                deiPrm.outScaleFactor[DEI_OUT_SUB_STRAMER][chId] = deiPrm.outScaleFactor[DEI_OUT_SUB_STRAMER][0];
    #else 
            sdNullPrm.numInQue = 1;
            sdNullPrm.inQueParams[0].prevLinkId =  gVcapModuleContext.captureId  ;
            sdNullPrm.inQueParams[0].prevLinkQueId = 0;
    #endif
    
            /* Merge Link params */
    #ifdef NULLLINK
            mergePrm[CAM_STREAM_MERGE_IDX].numInQue = 1;   
    #else 
            mergePrm[CAM_STREAM_MERGE_IDX].numInQue = 2;   
    #endif
            mergePrm[CAM_STREAM_MERGE_IDX].inQueParams[0].prevLinkId =  SYSTEM_LINK_ID_SCLR_INST_0  ; 
            //mergePrm[CAM_STREAM_MERGE_IDX].inQueParams[0].prevLinkId = gVcamModuleContext.cameraId ; // SYSTEM_LINK_ID_SCLR_INST_0  ; 
            mergePrm[CAM_STREAM_MERGE_IDX].inQueParams[0].prevLinkQueId = 0;
    #ifndef NULLLINK
            mergePrm[CAM_STREAM_MERGE_IDX].inQueParams[1].prevLinkId = gDeiId ;
            mergePrm[CAM_STREAM_MERGE_IDX].inQueParams[1].prevLinkQueId = 0;
    #endif
            mergePrm[CAM_STREAM_MERGE_IDX].outQueParams.nextLink = gVdisModuleContext.swMsId[1] ;
            mergePrm[CAM_STREAM_MERGE_IDX].notifyNextLink = TRUE;
    
            /* SW MS Link */
            SwMsLink_CreateParams_Init(&swMsPrm);
            swMsPrm.numSwMsInst               = 1;
            //swMsPrm.swMsInstId[0]             = SYSTEM_SW_MS_SC_INST_SC5;
            swMsPrm.swMsInstId[0]             = SYSTEM_SW_MS_SC_INST_VIP0_SC;
            //swMsPrm.swMsInstStartWin[0]       = 0;
            swMsPrm.inQueParams.prevLinkId    = SYSTEM_VPSS_LINK_ID_MERGE_1 ; //gDeiId; //gVcapModuleContext.captureId;
            swMsPrm.inQueParams.prevLinkQueId = 0;
            swMsPrm.outQueParams.nextLink     = gVdisModuleContext.displayId[VDIS_DEV_SD] ;//gDupId_cbb[DIS_DUP_IDX];
            swMsPrm.maxInputQueLen            =  4 ; // SYSTEM_SW_MS_DEFAULT_INPUT_QUE_LEN;
            swMsPrm.maxOutRes                 = gVdisModuleContext.vdisConfig.deviceParams[VDIS_DEV_SD].resolution;
            swMsPrm.lineSkipMode              = FALSE;
            swMsPrm.enableLayoutGridDraw      = FALSE; //gVdisModuleContext.vdisConfig.enableLayoutGridDraw;
            swMsPrm.enableProcessTieWithDisplay = TRUE ;
            //swMsPrm.layoutPrm.outputFPS = 30 ;
    
            printf("FOSSILSHALE DEBUG :  swMsPrm.maxOutRes=%d.............\n", swMsPrm.maxOutRes );
    
            MultiCh_swMsGetDefaultLayoutPrm(SYSTEM_DC_VENC_SD,&swMsPrm,FALSE);
    
            /* display link params */
            MULTICH_INIT_STRUCT(DisplayLink_CreateParams,displayPrm);
            displayPrm.inQueParams[0].prevLinkId =  gVdisModuleContext.swMsId[1]; //MergeId[NUM_MERGE_LINK] ; //gVcapModuleContext.captureId;
            displayPrm.inQueParams[0].prevLinkQueId = 0;
            displayPrm.displayRes = gVdisModuleContext.vdisConfig.deviceParams[VDIS_DEV_SD].resolution;
            displayPrm.displayId  = DISPLAY_LINK_DISPLAY_SD ;  // CVBS
    
    
        System_linkCreate(gVcamModuleContext.cameraId, &cameraPrm, sizeof(cameraPrm));
        System_linkControl(gVcamModuleContext.cameraId, CAMERA_LINK_CMD_DETECT_VIDEO, NULL, 0, TRUE);
        
        /* display scaler link */
        System_linkCreate( SYSTEM_LINK_ID_SCLR_INST_0 , &disp_sclrPrm, sizeof(disp_sclrPrm));  
        
        System_linkCreate( gVcapModuleContext.captureId, &capturePrm,  sizeof(capturePrm));
    
        /* null link*/
    #ifdef NULLLINK
        System_linkCreate(SYSTEM_VPSS_LINK_ID_NULL_1 ,&sdNullPrm, sizeof(sdNullPrm));
    #else 
        System_linkCreate(gDeiId,&deiPrm,sizeof(DeiLink_CreateParams));
    #endif
    
        /* Merge Link */
        System_linkCreate( SYSTEM_VPSS_LINK_ID_MERGE_1 , &mergePrm[CAM_STREAM_MERGE_IDX], sizeof(mergePrm[CAM_STREAM_MERGE_IDX]));
    
        System_linkCreate(gVdisModuleContext.swMsId[1],&swMsPrm,sizeof(swMsPrm));
    
        /* display link */
        System_linkCreate(gVdisModuleContext.displayId[VDIS_DEV_SD], &displayPrm,sizeof(displayPrm));
    
        OSA_printf("USECASE SETUP DONE\n");
    }
    
    /* ===================================================================
     *  @func     MultiCh_deleteStreamCaptureDisplay
     *
     *  @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_deleteStreamCaptureDisplay()
    Void MultiCh_delete_tvp5158_CaptureDisplay()
    {
        UInt32 MergeId[NUM_MERGE_LINK];
    
        MergeId[CAM_STREAM_MERGE_IDX] = SYSTEM_VPSS_LINK_ID_MERGE_0;
      /* display link */
        System_linkDelete(gVdisModuleContext.displayId[VDIS_DEV_SD]);
    
     /* Merge Link */
        System_linkDelete(MergeId[CAM_STREAM_MERGE_IDX]);
    
    //AV support start
    #if 0
        if( Av_scalerId != SYSTEM_LINK_ID_INVALID )
        {
            System_linkDelete(Av_scalerId);
            Av_scalerId = SYSTEM_LINK_ID_INVALID ;
        }
    #endif
    //AV support End
    
        /* Camera Link */
        System_linkDelete(gVcapModuleContext.captureId);
        /* Print the HWI, SWI and all tasks load */
        /* Reset the accumulated timer ticks */
        MultiCh_prfLoadCalcEnable(FALSE, TRUE, FALSE);
        
        OSA_printf("USECASE TEARDOWN DONE\n");
    }
    

  • Hi Cesar,

    We increased the priority & bandwidth to ISS, but still the video flickering continues. Kindly suggest a way forward.

    As per this link "e2e.ti.com/.../1659635 we have done the priority/BW changes in sys_pri.h & sys_pri.c. Also updated the below changes in init.sh.

    ./bin/sys_pri.out --L3-bw-reg-set HDVICP0 0 0 900 2500&
    ./bin/sys_pri.out --L3-bw-reg-set ISS 3 3 400 2500&
    ./bin/sys_pri.out --dmm-pri-set ISS 0&
    ./bin/sys_pri.out --dmm-pri-set HDVICP0 1&
  • Hi Cesar,


    Waiting for your feedback.

    Regards,

    Saravanan S

  • Hello Cesar,

    Do you need anymore information / log  for  your analysis & feedback?


    Regards,

    Saravanan S

  • Is there anybody from TI can help me to understand this video flickering issue ?

    Regards,
    Saravanan S
  • Hi Saravanan,

    I wanted to update you that DM385 is capable of encoding 1080p@60fps or 2 x 1080p@30fps or ~ 4 x 720p@30fps. If you try to overuse it then you may observe frame drops.

    Can you share the stream for which you observed Video Flickering issue ?? And also provide more information about the bitrate, resolutions, framerate used ??

    Regards

    Gajanan

  • Hi Gajanan,

    Thanks for your response.

    Yes, we are aware of the HDVICP's capability to encode upto 1080p@60.  As I indicated in the earlier communication, the issue is coming in just capture+display usecase. No encoding or decoding is done in the test usecase.

    camera(1080p30)------>scaler(720x480)-----|

                                                                                    |---  Merge-------->swMS-------->Display(SD)

    capture(TVP5158, 4D1Ch)------->Dei----------|

     

    Already i have shared the usecase file (multich_capturedisplay_mosaic.c),  Could you that usecase and help me to understand the issue ?

    Regards,

    Saravanan S

  • Hi Gajanan,

    Did you find any issue in my test(capture+display) chain ?


    Regards,

    Saravanan S

  • It looks like one of your component in the pipeline is repeating the buffer. So you add the timestamp at the capture and verify the timestamp at swMS if there is any repetition of timestamp based on the channel number.