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.

IpcFramesHLOSLINK Getempty buffers 30fps

Hi, Sir

    I'm using IpcFramesHLOSLINK to recieve YUV frames from PCIe.

    I encountered one problem.

    The speed that I get empty buffers from IpcFramesHLOSLINK is always 30fps, even if the process flow is

    "IpcFramesOutLink_getEmptyVideoFrames---->IpcFramesOutLink_putFullVideoFrames" without any processing between getEmpty and putFull;

    Now, I want the speed can be 60fps, what shoud I do?

    Appreciate it for your timely response!

    Yours sincere.

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

    Resume my codes.

static Void *Chains_ipcFramesGetPutFxn(Void *prm)
{
    Chains_IpcFramesCtrlThrObj *thrObj = (Chains_IpcFramesCtrlThrObj *) prm;
    VIDFrame_BufList  bufList;
    VIDFrame_Buf      *pFrame;
    Int32             i = 0;
    Int32             status;
    Int32             bufSize = 1280 * 720 * 2;

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

    if (FALSE == bHasAllocSRBuf)
    {
        bufList.numFrames = 0;
        for (i = 0; i < VIDFRAME_MAX_FRAME_BUFS;i++)
        {
            status = Vsys_allocBuf(FRAMEBUF_HEAP_SR_ID, bufSize, 128, &thrObj->bufInfo[i]);
            if (ERROR_NONE == status)
            {
                bufList.numFrames++;
                pFrame                 = &bufList.frames[i];
                pFrame->channelNum     = 0;
                pFrame->fid            = 0;
                pFrame->frameHeight    = 720;
                pFrame->frameWidth     = 1280;
                pFrame->framePitch[0]  = 2560;
                pFrame->phyAddr[0][0]  = thrObj->bufInfo[i].physAddr;
                pFrame->addr[0][0]     = thrObj->bufInfo[i].virtAddr;
            }
        }
        status = IpcFramesOutLink_putFullVideoFrames(SYSTEM_HOST_LINK_ID_IPC_FRAMES_OUT_0, &bufList);
        OSA_assert(0 == status);

        bHasAllocSRBuf = TRUE;
    }

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

    double t_pcie_start        =    ELAPSE_TIME;
    unsigned long c_frames    =    0;

    while (FALSE == thrObj->exitFramesInOutThread)
    {
        status = IpcFramesOutLink_getEmptyVideoFrames(SYSTEM_HOST_LINK_ID_IPC_FRAMES_OUT_0, &bufList);
        OSA_assert(0 == status);
        printf("[%13.6f]numFrames = %d\n", ELAPSE_TIME, bufList.numFrames);

        if (bufList.numFrames)
        {
            c_frames += bufList.numFrames;
            status = IpcFramesOutLink_putFullVideoFrames(SYSTEM_HOST_LINK_ID_IPC_FRAMES_OUT_0, &bufList);
            OSA_assert(0 == status);

            printf("======== %d frames, AVE %13.6f fps\n", c_frames, c_frames / (ELAPSE_TIME - t_pcie_start));
        }
        OSA_waitMsecs(4);
    }
}

  • As I mentioned to your colleague in another post share details of the link connection and logs of Vsys_printDetailedStatistics to determine why it is 30 fps. If you are using this data flow: http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/271025.aspx ipcFramesIn frames are consumed by SwMs .If SwMs outputFPS is 30 you will get frames at only 30 fps.Confirm this by checking Vsys_printDetailedStatistics logs.If you want 60 fps output configure the swms layout params for 60 fps.

  • Thank you very much!

    I have solve this problem according to your suggestion.

    My data flow is in the url you've mentioned, The further question: our swms will be set to 30 fps, while PCIe framerate will be 60fps, how can I solve this problem?

    Thanks for any response!

  • Configure SwMs framerate as :(This is supported only in DVR RDK 4.0 release)

     

                SwMsLink_ChFpsParams swmsPrms;

                swmsPrms.chId = chId;
                swmsPrms.inputFrameRate = 60;
                swmsPrms.outputFrameRate = 30;
                status = System_linkControl(gVdisModuleContext.swMsId[<SWMS_IDX>],SYSTEM_SW_MS_LINK_CMD_SET_FRAME_RATE,
                                                              &swmsPrms, sizeof(swmsPrms), TRUE);
                 OSA_assert(status == 0);

     

  • OK, I got it. Thaks for your suggestion! I will attempt to migrate to 4.0 later.