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.

DRA72XEVM: Unable to get correct video displayed during channel switching

Part Number: DRA72XEVM

Hi TI Forum,

We are trying to run below usecase on our custom board having TDA2xx SoC. We are using Vision SDK 3.0.7

Capture -> Dup -> VPE -> Merge

Dup -> VPE_D2 -> Alg_DmaSwMs -> Merge

Merge -> Display

We have connected 4 cameras. In the above usecase we are trying to display Mosaic view(4 camera display - number of windows set to 4) in Channel 0 and Single channel display in Channel 1,2,3,4

We are using below API to switch between channels 0 to 4.

System_linkControl(displayID,
DISPLAY_LINK_CMD_SWITCH_CH,
&params,
sizeof(params),
TRUE);

For channel - 0 we are getting the correct video of all the 4 cameras in Mosaic splitted into 4 windows. We are using below API to set the Mosaic properties.

But when we switch to channel-1,2,3,4 video is not proper seems to be interleaved and distorted. It looks like the video output format is altered by Merge[0].

Expected output when switch to Channel 1 should display from Camera1, Channel 2 should display from Camera2, Channel 3 should display from Camera3, and Channel 4 should display from Camera4 all videos correctly but is displayed distorted and interleaved.

Void ChainsCommon_SetAlgDmaSwMsPrm(
AlgorithmLink_DmaSwMsCreateParams *pPrm,
UInt32 numLvdsCh,
UInt32 channelWidth,
UInt32 channelHeight,
UInt32 channelSpacingHor,
UInt32 channelSpacingVer)


{
UInt32 algId, winId;
UInt32 useLocalEdma;
AlgorithmLink_DmaSwMsLayoutWinInfo *pWinInfo;

useLocalEdma = FALSE;
algId = ALGORITHM_LINK_IPU_ALG_DMA_SWMS;

pPrm->baseClassCreate.algId = algId;
pPrm->numOutBuf = 4;
pPrm->useLocalEdma = useLocalEdma;
pPrm->initLayoutParams.numWin = numLvdsCh; //numCh;

pPrm->maxOutBufWidth = 640;
pPrm->maxOutBufHeight = 480;

for(winId=0; winId<pPrm->initLayoutParams.numWin; winId++)
{
pWinInfo = &pPrm->initLayoutParams.winInfo[winId];
pWinInfo->chId = winId;
//pWinInfo->chId = 0;
pWinInfo->inStartX = 0;
pWinInfo->inStartY = 0;
pWinInfo->width = channelWidth;
pWinInfo->height = channelHeight;
Vps_printf("Win-ID = %d\n", pWinInfo->chId);
/*
* For 4x4 layout
*/
switch(winId)
{
default:
case 0:
pWinInfo->outStartX = 0;
pWinInfo->outStartY = 0;
break;
case 1:
pWinInfo->outStartX = 320; //winWidth;
pWinInfo->outStartY = 0;
pWinInfo->width = 320/*960*/; //winWidth;
pWinInfo->height = 240/*540*/; //winHeight;
break;
case 2:
pWinInfo->outStartX = 0;
pWinInfo->outStartY = 240; //winHeight;
pWinInfo->width = 320/*960*/; //winWidth;
pWinInfo->height = 240/*540*/; //winHeight;
break;
case 3:
pWinInfo->outStartX = 320; //winWidth;
pWinInfo->outStartY = 240; //winHeight;
pWinInfo->width = 320/*960*/; //winWidth;
pWinInfo->height = 240/*540*/; //winHeight;
break;
}
}

pPrm->initLayoutParams.outBufWidth = pPrm->maxOutBufWidth;
pPrm->initLayoutParams.outBufHeight = pPrm->maxOutBufHeight;

}

Regards,

Sudhi

  • Hi Sudhi,

    what is the output size from VPE[0] and VPE[1]? I guess VPE[1] outputs smaller frame size, since you are doing SWMS.

    Please note that in this case, both the VPEs are required to configured for exact same output resolution and format. other wise it will not work.

    Rgds,

    Brijesh

  • Hi Brijesh,

    Thanks for the reply.

    The output resolution of VPE[1] is configured to 320x240 so that all the fours channels are displayed in each of the 4 windows.

    Initially the output of  VPE[0] was set to 640x480 and since the correct video was not displayed, changed to 320x240. But still the video is not correct.

    Apart from resolution do we need to change the format also. If so, what would be the output format of Alg_DmaSwMs ..??

    Thanks & Regards,

    Sudhi

  • Hi Sudhi,

    Yes, you need to keep the output format to same. 

    Please check the create args for the output format for both the VPEs.

    Rgds,

    Brijesh

  • HI Brijesh,

    Thanks for the inputs.

    However, we are using the same API to set the resolution and data format. Below is the API we use:

    Void ChainsCommon_SetVPEPrms(VpeLink_CreateParams *pPrm,
    UInt32 captureInWidth,
    UInt32 captureInHeight
    )
    {

    UInt32 outId, chId;
    VpeLink_ChannelParams *chPrms;

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

    pPrm->enableOut[0] = TRUE;
    pPrm->enableOut[1] = FALSE;

    for(outId=0; outId<VPE_LINK_OUT_QUE_ID_MAX; outId++)
    {
    for (chId = 0; chId < VPE_LINK_MAX_CH; chId++)
    {
    chPrms = &pPrm->chParams[chId];
    chPrms->outParams[outId].numBufsPerCh = 10;//VPE_LINK_NUM_BUFS_PER_CH_DEFAULT;
    chPrms->outParams[outId].inputFrameRate = 50;
    chPrms->outParams[outId].outputFrameRate = 50;

    chPrms->outParams[outId].width = captureInWidth;
    chPrms->outParams[outId].height = captureInHeight;
    //chPrms->outParams[outId].dataFormat = SYSTEM_DF_YUV422P;
    chPrms->outParams[outId].dataFormat = SYSTEM_DF_YUV420SP_UV;

    chPrms->deiCfg.bypass = FALSE;

    chPrms->deiCfg.inpMode = VPE_DEI_EDIMODE_LUMA_CHROMA;
    chPrms->deiCfg.tempInpEnable = TRUE;
    chPrms->deiCfg.tempInpChromaEnable = TRUE;
    chPrms->deiCfg.spatMaxBypass = TRUE;
    chPrms->deiCfg.tempMaxBypass = TRUE;

    chPrms->scCfg.bypass = TRUE;
    chPrms->scCfg.nonLinear = FALSE;
    chPrms->scCfg.stripSize = 0;

    chPrms->scCropCfg.cropStartX = 0;
    chPrms->scCropCfg.cropStartY = 0;
    chPrms->scCropCfg.cropWidth = 0;
    chPrms->scCropCfg.cropHeight = 0;
    }
    }
    }

    For VPE[0]:

    ChainsCommon_SetVPEPrms(&pUcObj->VPEPrm,
    320,
    240
    )

    For VPE[1]:

    ChainsCommon_SetVPEPrms(&pUcObj->VPE_D1Prm,
    320,
    240
    )

    So, for both of the VPE[0] and VPE[1], the above API is called and hence same resolution and data format. But still the problem exists. 

    Our observation is data whichever data goes into merge[0]->display is working fine and merge[1]->display video is not correct. 

    VPE_D2 -> Sync -> Alg_DmaSwMs -> Merge   //Merge Queue[0]

    VPE -> Merge   //Merge Queue[1]

    Merge -> Display

    Is the first input video properties into Merge[0] is overriding the video properties being sent into Merge[1] 

    or the display link is being adjusted to video properties of video coming out of Merge[0] and not being changed to the type of video coming out or Merge[1]

    Is there any approach we cold look for to meet our requirement of displaying Channel-0 as Mosaic(all 4 channels displayed in 4 windows simultaneously) and Channels-1,2,3,4 as Single camera display

    Thanks & Regards,

    Sudhi

  • Hi Sudhi,

    I think i know the reason for the corrupted display. 

    The SWMS output will be full screen resolution output, whereas the other VPE output is 320x240 resolution. Can you try full resolution for the second VPE instance also? 

    Rgds,

    Brijesh

  • Hi Brijesh,

    We tried full resolution for both VPE 640*480, still the issue is not fixed.

    Rgds

    Balaji

  • Hi Balaji,

    You need to set the full resolution output for the first instance of VPE and it should be same as the swms output resolution..

    Since VPE(0) and SWMS are connected to display, they both should be configured to output same resolution, format, pitch etc..

    Rgds,

    Brijesh