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.

Camera link and Sclr link problem

Hi, everyone!

I'm using DM8127 and IPNC RDK ver3.5. I modify the multich_encode_decode usecase as:

camera link(1080P)---->Sclr link(352*288)---->ipcframeVpssOut---->ipcframeHostIn

I have a callback function on arm to save the first YUV420sp frame as yuv file, and then turn this YUV420sp frame to BGR and save as jpg using OpenCV.

here is the jpg picture:

This picture has two problem:

problem 1.the picture is too dark compared with what I see on the web using multich_tristream_fullfeature usecase. Even all advanced features are turned off in multich_tristream_fullfeature usecase, it's still much brighter than this one.

problem 2. the last two line has some grey pixel points which is not correct. I read the yuv file using UltraEdit, and find the last few Y valve is always 128,and thus makes it grey.

More details:

Here is my link param:

/* Camera Link */
CameraLink_CreateParams_Init(&cameraPrm);

cameraPrm.captureMode = CAMERA_LINK_CAPMODE_ISIF;
cameraPrm.numAudioChannels = 1;
cameraPrm.numVipInst = 1;
cameraPrm.tilerEnable = FALSE;
cameraPrm.vsEnable = FALSE;
cameraPrm.outQueParams[0].nextLink = gVcamModuleContext.sclrId[0];
cameraPrm.t2aConfig.n2A_vendor = UI_AEWB_ID_TI;
cameraPrm.t2aConfig.n2A_mode = UI_AEWB_AEWB;

pCameraInstPrm = &cameraPrm.vipInst[0];
pCameraInstPrm->vipInstId = SYSTEM_CAMERA_INST_VP_CSI2;
pCameraInstPrm->videoDecoderId = MultiCh_getSensorId(MT_9J003);
pCameraInstPrm->inDataFormat = SYSTEM_DF_YUV420SP_UV;
pCameraInstPrm->sensorOutWidth = 1920;
pCameraInstPrm->sensorOutHeight = 1080;
pCameraInstPrm->standard = SYSTEM_STD_1080P_30;
pCameraInstPrm->numOutput = 1;

pCameraOutPrm = &pCameraInstPrm->outParams[0];
pCameraOutPrm->dataFormat = SYSTEM_DF_YUV420SP_UV;
pCameraOutPrm->scEnable = FALSE;
pCameraOutPrm->scOutWidth = 1920;
pCameraOutPrm->scOutHeight = 1080;
pCameraOutPrm->outQueId = 0;

/* Scaler Link Params */
SclrLink_CreateParams_Init(&sclrPrm);
sclrPrm.inQueParams.prevLinkId = gVcamModuleContext.cameraId;
sclrPrm.inQueParams.prevLinkQueId = 0;
sclrPrm.outQueParams.nextLink = ipcFramesOutVpssId;
sclrPrm.tilerEnable = FALSE;
sclrPrm.enableLineSkipSc = FALSE;
sclrPrm.inputFrameRate = 30;
sclrPrm.outputFrameRate = 30;
sclrPrm.scaleMode = DEI_SCALE_MODE_ABSOLUTE;
sclrPrm.outScaleFactor.absoluteResolution.outWidth = 352;
sclrPrm.outScaleFactor.absoluteResolution.outHeight = 288;
sclrPrm.outDataFormat = VF_YUV420SP_UV;
sclrPrm.pathId = SCLR_LINK_SEC0_SC3;

/* IPC Frames Out VPSS */
ipcFramesOutVpssPrm.baseCreateParams.inQueParams.prevLinkId = gVcamModuleContext.sclrId[0];
ipcFramesOutVpssPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcFramesOutVpssPrm.baseCreateParams.notifyPrevLink = FALSE;

ipcFramesOutVpssPrm.baseCreateParams.numOutQue = 1;
ipcFramesOutVpssPrm.baseCreateParams.outQueParams[0].nextLink = ipcFramesInHLOSId;
ipcFramesOutVpssPrm.baseCreateParams.notifyNextLink = FALSE;

ipcFramesOutVpssPrm.baseCreateParams.processLink = SYSTEM_LINK_ID_INVALID;
ipcFramesOutVpssPrm.baseCreateParams.notifyProcessLink = FALSE;
ipcFramesOutVpssPrm.baseCreateParams.noNotifyMode = TRUE;

/* IPC Frames in Host */
ipcFramesInHostPrm.baseCreateParams.inQueParams.prevLinkId = ipcFramesOutVpssId;
ipcFramesInHostPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;
ipcFramesInHostPrm.baseCreateParams.noNotifyMode = TRUE;
ipcFramesInHostPrm.baseCreateParams.notifyNextLink = FALSE;
ipcFramesInHostPrm.baseCreateParams.notifyPrevLink = FALSE;
ipcFramesInHostPrm.cbFxn = MultiCh_ipcFramesInHostCb;
ipcFramesInHostPrm.cbCtx = NULL;

when the frame is sent to ARM, I use mmap to read the file, the mmap function is provided in ti_mcfw_ipcframe.c as App_mmap() and App_unmmap().

I'm wondering if I miss something when I config the camera link that makes the picture so dark. 

And I also guess scaling 1920*1080 to 352*288 may be the reason why I lose some pixel points, am I right? If someone can explain to me how the sclr link works inside,I'll be grateful.

I have to admit these two problems are quite wield to me and I don't know how to solve it,hope someone can give me an advice.

best regards,

Zhao 

 

 

 

 

 

  • Hello,

    I will notify the IPNC team for help.

    Best Regards,

    Margarita

  • Hi, everyone

    I'm still stuck here,can someone help me out?

    best regards,

    Zhao

  • Hi ,

    Have you ever tried using DCC tool to get the RAW data and check if it is OK

    Have you checked that if AE is working?

  • Hi, Eason

    Glad someone finally answer my quesiton because I'm stuck here for another week. Actually I'm not familiar with DCC tool, so I don't know how to use it, if you can give me some guide or tell me which document is helpful I'll be grateful. And for AE, I think this doesn't matter because when I turn off AE in fullfeature usecase,it's still much brighter.

    These days I've done more tests on my code, and find my problems may still result from wrong virtual address I got on ARM. Now I use OSA_mapMem() to mmap my YUV420sp frame, I map phyAddr[0][0] and phyAddr[0][1] separately and the Y size should be (height*width) while UV should be (height*width*0.5).

    I used to think my picture is just too dark,but I'm wrong.

    When I save several pictures as YUV file, the 1st picture is too dark as I show before,but the 2nd picture's color is green with its Y right, and the 3rd picture is totally wrong.So I think it must be something wrong with how I got the virtual address.

    But I already use OSA_mapMem which is recommended by RDK, I don't know what to do next, hope you can point out my mistakes, Thank you very much.

    Best regards,

    Zhao