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.

Compiler/TDA2SG: How to Set Capture Create Parameters for Bt601

Part Number: TDA2SG
Other Parts Discussed in Thread: DS90UB914A-CXEVM

Tool/software: TI C/C++ Compiler

Hi Ti Team:

We are using Vsdk 3.07

Now we need the image data in Bt601 format, but I don't know which parameters need to be modified to create a appropriate and correct parameters configuration.

Could you please tell us how to configure these parameters ?

Our old parameter configuration is described below:

===============================================================================================================================

vision_sdk\apps\src\hlos\common\chains_common.c

Void ChainsCommon_MultiCam_SetCapturePrms(
CaptureLink_CreateParams *pPrm,
UInt32 numLvdsCh)
{
UInt32 i, streamId;

CaptureLink_VipInstParams *pInstPrm;
CaptureLink_InParams *pInprms;
CaptureLink_OutParams *pOutprms;
CaptureLink_VipScParams *pScPrm;
CaptureLink_VipPortConfig *pPortCfg;
UInt32 portId[10];


memset(pPrm, 0, sizeof(*pPrm));

pPrm->numVipInst = numLvdsCh;
pPrm->numDssWbInst = 0;

portId[0] = SYSTEM_CAPTURE_INST_VIP1_SLICE1_PORTB;
portId[1] = SYSTEM_CAPTURE_INST_VIP3_SLICE1_PORTA;
portId[2] = SYSTEM_CAPTURE_INST_VIP2_SLICE2_PORTB;
portId[3] = SYSTEM_CAPTURE_INST_VIP1_SLICE2_PORTA;


for (i=0; i<SYSTEM_CAPTURE_VIP_INST_MAX; i++)
{
pInstPrm = &pPrm->vipInst[i];
pInstPrm->vipInstId = portId[i];
pInstPrm->videoIfMode = SYSTEM_VIFM_SCH_ES;
pInstPrm->videoIfWidth = SYSTEM_VIFW_8BIT;
pInstPrm->bufCaptMode = SYSTEM_CAPT_BCM_FRM_DROP;
pInstPrm->numStream = 1;

pInprms = &pInstPrm->inParams;

pInprms->width = CAPTURE_SENSOR_WIDTH;
pInprms->height = CAPTURE_SENSOR_HEIGHT;
pInprms->dataFormat = SYSTEM_DF_YUV422P;
pInprms->scanFormat = SYSTEM_SF_PROGRESSIVE;

for (streamId = 0; streamId < CAPTURE_LINK_MAX_OUTPUT_PER_INST;
streamId++)
{
pOutprms = &pInstPrm->outParams[streamId];
pOutprms->width = pInprms->width;
pOutprms->height = pInprms->height;
pOutprms->dataFormat = SYSTEM_DF_YUV420SP_UV;
pOutprms->maxWidth = pOutprms->width;
pOutprms->maxHeight = pOutprms->height;
pOutprms->scEnable = FALSE;

/* sub-frame not supported, set to FALSE */
pOutprms->subFrmPrms.subFrameEnable = FALSE;
pOutprms->subFrmPrms.numLinesPerSubFrame = 0;

}
pScPrm = &pInstPrm->scPrms;
pScPrm->inCropCfg.cropStartX = 0;
pScPrm->inCropCfg.cropStartY = 0;
pScPrm->inCropCfg.cropWidth = pInprms->width;
pScPrm->inCropCfg.cropHeight = pInprms->height;

pScPrm->scCfg.bypass = FALSE;
pScPrm->scCfg.nonLinear = FALSE;
pScPrm->scCfg.stripSize = 0;

pScPrm->userCoeff = FALSE;

pPortCfg = &pInstPrm->vipPortCfg;
pPortCfg->syncType = SYSTEM_VIP_SYNC_TYPE_EMB_SINGLE_422_YUV;
pPortCfg->ancCropEnable = FALSE;

pPortCfg->intfCfg.clipActive = FALSE;
pPortCfg->intfCfg.clipBlank = FALSE;
pPortCfg->intfCfg.intfWidth = SYSTEM_VIFW_16BIT;

pPortCfg->disCfg.fidSkewPostCnt = 0;
pPortCfg->disCfg.fidSkewPreCnt = 0;
pPortCfg->disCfg.lineCaptureStyle =
SYSTEM_VIP_LINE_CAPTURE_STYLE_ACTVID;
pPortCfg->disCfg.fidDetectMode = SYSTEM_VIP_FID_DETECT_MODE_PIN;
pPortCfg->disCfg.actvidPol = SYSTEM_POL_HIGH;
pPortCfg->disCfg.vsyncPol = SYSTEM_POL_HIGH;
pPortCfg->disCfg.hsyncPol = SYSTEM_POL_HIGH;
pPortCfg->disCfg.discreteBasicMode = TRUE;

pPortCfg->comCfg.ctrlChanSel = SYSTEM_VIP_CTRL_CHAN_SEL_7_0;
pPortCfg->comCfg.ancChSel8b =
SYSTEM_VIP_ANC_CH_SEL_8B_LUMA_SIDE;
pPortCfg->comCfg.pixClkEdgePol = SYSTEM_EDGE_POL_RISING;
pPortCfg->comCfg.invertFidPol = FALSE;
pPortCfg->comCfg.enablePort = FALSE;
pPortCfg->comCfg.expectedNumLines = pInprms->height;
pPortCfg->comCfg.expectedNumPix = pInprms->width;
pPortCfg->comCfg.repackerMode = SYSTEM_VIP_REPACK_CBA_TO_CBA;

pPortCfg->actCropEnable = TRUE;
pPortCfg->actCropCfg.srcNum = 0;
pPortCfg->actCropCfg.cropCfg.cropStartX = 0;
pPortCfg->actCropCfg.cropCfg.cropStartY = 0;
pPortCfg->actCropCfg.cropCfg.cropWidth = pInprms->width;
pPortCfg->actCropCfg.cropCfg.cropHeight = pInprms->height;

pPortCfg->ancCropCfg.srcNum = 0;
pPortCfg->ancCropCfg.cropCfg.cropStartX = 0;
pPortCfg->ancCropCfg.cropCfg.cropStartY = 0;
pPortCfg->ancCropCfg.cropCfg.cropWidth = 0;
pPortCfg->ancCropCfg.cropCfg.cropHeight = 0;

pInstPrm->numBufs = CAPTURE_LINK_NUM_BUFS_PER_CH_DEFAULT + 2;
}
}

===============================================================================================================================

Thanks.

  • Hi,

    I will check with an expert & let you know.

    Thanks

    Gaviraju

  • Hi,

    BT601 input mode can be configured by changing interface to 8bit and interface mode to discrete sync mode, ie by changing below two variables.

    pInstPrm->videoIfMode = SYSTEM_VIFM_SCH_DS_HSYNC_VSYNC;
    pInstPrm->videoIfWidth = SYSTEM_VIFW_8BIT;

    Regards,

    Brijesh

  • When I changed below two variables, errors occurred. 

     pInstPrm->videoIfMode   =   SYSTEM_VIFM_SCH_DS_HSYNC_VSYNC;

    pPortCfg->syncType          =   SYSTEM_VIP_SYNC_TYPE_DIS_SINGLE_YUV;

    The error log is as follows. How and why does it happen?  

    ==============================================================

    error log:

    [IPU2 ] 106.668517 s: UTILS: MBX: Utils_mbxSendCmd(): Msg Alloc Failed (0)!!!
    [IPU2 ] 106.668669 s: UTILS: MBX: Utils_mbxSendCmd(): Msg Alloc Failed (0)!!!
    [IPU2 ] 106.668822 s: UTILS: MBX: Utils_mbxSendCmd(): Msg Alloc Failed (0)!!!

    ====================================================================

    Our camera output timing diagrams is as follows.Could you please tell us any other parameters that need to be configured?

  • Hi,

    These errors are not related to VIP timings, it is something to do in the usecase. Somewhere your usecase is running slow, so framework is eventually running out of message boxes.

    For the bringup of this camera, can you try simple usecase like capture -> display?

    Yes, the timing looks fine. HS looks more like DE, so please check if it is connected as DE input to the VIP. If it is, then change interface mode to SYSTEM_VIFM_SCH_DS_ACTVID_VSYNC.

    Rgds,

    Brijesh

  • Hi Brijesh,

    1.The Usecase I'm currently testing has always been like capture -> select -> display.

    2.We just connet  Hsync、Vsync、PCLK0、Rout0~Rout7 of DS90UB914A-CXEVM board to our  own soc board. There is no DE input  connected to the VIP.

    3.Now our own application can actively controls the DS90UB914A power supply. When the DS90UB914A is not powered , vsdk application wouldn't not report an error. But   "Msg Alloc Failed" errors occurred as soon as DS90UB914A is powered up. It seems that the image acquisition process leads to this problem.

    What should I do next?

    Thanks!

  • Hi Chen,

    Is your input data format YUV422? Then can you try directly connecting capture output to display? 

    It seems your sensor outputs both, embedded sync signals with SAV/EAV codes and also HS/VS signals. So in this case, you could either configure VIP to receive data over embedded sync format or in discrete sync format. 

    In case of discrete sync format, please note that since input signal is HS and VS, it would capture entire horizontal blanking and also some portion of the vertical blanking. So you need to use VIP trimmer to remote these extra data.. 

    Please refer to the example configuration for AR0132 sensor. It also configures VIP in discrete sync format and uses trimmer to crop the blanking data.. 

    Regards,

    Brijesh

  • Hi Brijesh,

    1.Our input data format is YUV422.

    2.I have tried directly connecting capture output to display like capture -> display. "Msg Alloc Failed" errors occurred the same as before.

    3."Msg Alloc Failed" errors have also occurred, when I tried configuration for AR0132 sensor  in function of ChainsCommon_SingleCam_SetCapturePrms. 

    I wonder the parameter configuration for AR0132 sensor really fits,as the configuration code is described below:

    (Could you please offer us a more detailed configuration parameters in the form of code?)

    ==============================================================

    ......

    else if(captureSrc == CHAINS_CAPTURE_SRC_AR0132RCCC)
    {
    pInstPrm->vipInstId = SYSTEM_CAPTURE_INST_VIP3_SLICE1_PORTA;
    pInstPrm->videoIfMode = SYSTEM_VIFM_SCH_DS_HSYNC_VSYNC;
    //pInstPrm->videoIfWidth = SYSTEM_VIFW_16BIT;

    pInstPrm->videoIfWidth = SYSTEM_VIFW_8BIT;

    pInstPrm->bufCaptMode = SYSTEM_CAPT_BCM_FRM_DROP;
    pInstPrm->numStream = 1;

    pInprms->width = captureInWidth;
    pInprms->height = captureInHeight;
    //pInprms->dataFormat = SYSTEM_DF_YUV422I_YUYV;

    pInprms->dataFormat = SYSTEM_DF_YUV422P;
    pInprms->scanFormat = SYSTEM_SF_PROGRESSIVE;
    }

    ......

    if(captureSrc == CHAINS_CAPTURE_SRC_AR0132RCCC)
    {
    pPortCfg->disCfg.lineCaptureStyle = SYSTEM_VIP_LINE_CAPTURE_STYLE_HSYNC;
    pPortCfg->disCfg.fidDetectMode = SYSTEM_VIP_FID_DETECT_MODE_VSYNC;
    pPortCfg->disCfg.actvidPol = SYSTEM_POL_LOW;
    pPortCfg->disCfg.vsyncPol = SYSTEM_POL_LOW;
    pPortCfg->disCfg.hsyncPol = SYSTEM_POL_HIGH;
    pPortCfg->comCfg.ancChSel8b = SYSTEM_VIP_ANC_CH_SEL_DONT_CARE;
    pPortCfg->comCfg.pixClkEdgePol = SYSTEM_EDGE_POL_FALLING;
    }

    ......

    ==============================================================

    Thanks!

  • Hi Chen,

    Is your capture running at very high fps? Otherwise i dont see reason for it to run out of message box.. Can you please make sure that capture is running at 30fps? 

    Also how many buffers are you allocating for the capture link?

    Regards,

    Brijesh

  • Hi Brijesh,

    The problem is caused by an unstable hardware connection.

    Our Bt601 data can be captured and displayed on screen now,  but the display is fuzzy and not a full image.

    How can I configure it to display normally?

  • Hi Chen,

    It seems capture image is out of focus. Can you adjust the focus on the camera, by moving the lens on the camera? 

    I am not sure about the full frame, what is the capture and display resolution? are they exactly matching? I mean if the capture size is higher than display, then there could be cropping.. 

    Regards,

    Brijesh

  • Hi Brijesh,

    The problem is caused by a misconfiguration of the camera's physical focus.


    Thank you for your professional technical support!