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.

IpcFramOutHLOS Commands not being processed

Hello Sir

I am using IpcFrame LINK to receive YUV video from PCIe, my chain is as shown below:

IpcFramesOutLinkHLOS ---IpcFramesInLinkRTOS(VPSS)---Capture---Swms---Display

OSA DMA (2 Dimention) being adopted to copy video frames from A8 to Shared Region in ipcFrame threads

I encounter one problem in a run, (but not always, just one time) after a few minutes, program down, printing following information :

 [host] IPC_FRAMESOUTLINK:!WARNING!.Commands not being processed by link.TimeSinceLastPutFull:266639,TimeSinceLastGetFree:266639
 [host] IPC_FRAMESOUTLINK:!WARNING!.Commands not being processed by link.TimeSinceLastPutFull:266651,TimeSinceLastGetFree:266651
 [host] IPC_FRAMESOUTLINK:!WARNING!.Commands not being processed by link.TimeSinceLastPutFull:267608,TimeSinceLastGetFree:267608
 [host] IPC_FRAMESOUTLINK:!WARNING!.Commands not being processed by link.TimeSinceLastPutFull:267608,TimeSinceLastGetFree:267608
 [host] IPC_FRAMESOUTLINK:!WARNING!.Commands not being processed by link.TimeSinceLastPutFull:267618,TimeSinceLastGetFree:267618

I wanna know what does these information mean, and how can I resolve it?

Appreciate for your timely response!

  • The warning indicates the main thread in ipcFramesOutLink is no longer getting scheduled.You can add some debug code to check which place the thread is stuck. Pls run strace with -f option and check the status of thread corresponding to ipcFramesOutLink.

  • Thanks!

    Is there any possibility that I set wrong parameters to IPCFrameOutLINK which can result this phenomenon?

    Following is my parameters:

    Part 1 : LINK parameters

        esipcFramesOutHostPrm0.baseCreateParams.inQueParams.prevLinkId         = SYSTEM_LINK_ID_INVALID;
        esipcFramesOutHostPrm0.baseCreateParams.inQueParams.prevLinkQueId      = 0;
        esipcFramesOutHostPrm0.baseCreateParams.numOutQue                      = 1;
        esipcFramesOutHostPrm0.baseCreateParams.numChPerOutQue[0]              = 1;
        esipcFramesOutHostPrm0.baseCreateParams.outQueParams[0].nextLink       = esipcFramesInVpssId0;
        esipcFramesOutHostPrm0.baseCreateParams.inputFrameRate                 = 60;    ////****~~~~
        esipcFramesOutHostPrm0.baseCreateParams.outputFrameRate                = 60;    ////****~~~~
        esipcFramesOutHostPrm0.baseCreateParams.notifyNextLink                 = TRUE;
        esipcFramesOutHostPrm0.baseCreateParams.notifyPrevLink                 = FALSE;
        esipcFramesOutHostPrm0.baseCreateParams.notifyProcessLink              = FALSE;
        esipcFramesOutHostPrm0.baseCreateParams.noNotifyMode                   = FALSE;

        esipcFramesOutHostPrm0.inQueInfo.numCh                                 = 1;
        esipcFramesOutHostPrm0.inQueInfo.chInfo[0].startX                      = 0;
        esipcFramesOutHostPrm0.inQueInfo.chInfo[0].startY                      = 0;
        esipcFramesOutHostPrm0.inQueInfo.chInfo[0].height                      = 720;
        esipcFramesOutHostPrm0.inQueInfo.chInfo[0].width                       = 1280;
        esipcFramesOutHostPrm0.inQueInfo.chInfo[0].pitch[0]                    = 2560;
        esipcFramesOutHostPrm0.inQueInfo.chInfo[0].bufType                     = SYSTEM_BUF_TYPE_VIDFRAME;
        esipcFramesOutHostPrm0.inQueInfo.chInfo[0].bufferFmt                   = 0;
        esipcFramesOutHostPrm0.inQueInfo.chInfo[0].codingformat                = 0;
        esipcFramesOutHostPrm0.inQueInfo.chInfo[0].memType                     = SYSTEM_MT_NONTILEDMEM;
        esipcFramesOutHostPrm0.inQueInfo.chInfo[0].dataFormat                  = SYSTEM_DF_YUV422I_YUYV;
        esipcFramesOutHostPrm0.inQueInfo.chInfo[0].scanFormat                  = SYSTEM_SF_PROGRESSIVE;//SYSTEM_SF_INTERLACED;//
        System_linkCreate(esipcFramesOutHostId0, &esipcFramesOutHostPrm0, sizeof(esipcFramesOutHostPrm0));

        esipcFramesInVpssPrm0.baseCreateParams.inQueParams.prevLinkId      = esipcFramesOutHostId0;
        esipcFramesInVpssPrm0.baseCreateParams.inQueParams.prevLinkQueId   = 0;
        esipcFramesInVpssPrm0.baseCreateParams.inputFrameRate              = 60;
        esipcFramesInVpssPrm0.baseCreateParams.noNotifyMode                = FALSE;
        esipcFramesInVpssPrm0.baseCreateParams.notifyNextLink              = TRUE;
        esipcFramesInVpssPrm0.baseCreateParams.notifyPrevLink              = TRUE;
        esipcFramesInVpssPrm0.baseCreateParams.numOutQue                   = 1;
        esipcFramesInVpssPrm0.baseCreateParams.numChPerOutQue[0]           = 1;
        esipcFramesInVpssPrm0.baseCreateParams.outQueParams[0].nextLink    = esmergeId0;
        esipcFramesInVpssPrm0.baseCreateParams.outputFrameRate             = 60;

    Part 2 : Allocate Shared Region

        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);

    Part 3 : Video Data exchanging :

        while (FALSE == thrObj->exitFramesInOutThread)
        {
            bufList.numFrames = 0;
            status = IpcFramesOutLink_getEmptyVideoFrames(SYSTEM_HOST_LINK_ID_IPC_FRAMES_OUT_0, &bufList);
            OSA_assert(0 == status);
            if (bufList.numFrames)
            {
                //printf("Number of get empty: %d\n", bufList.numFrames);
                for(i = 0;i < bufList.numFrames;i++)
                {
                    pFrame                 = &bufList.frames[i];
                    pFrame->channelNum     = 0;
                    pFrame->fid            = 0;
                    pFrame->frameHeight    = 720;
                    pFrame->frameWidth     = 1280;
                    pFrame->framePitch[0]  = 2560;
                    thrObj->bufSize        = (pFrame->frameHeight)*(pFrame->frameWidth)*2;

                    unsigned long ppIndex = ioctl(devfd, 4, 0);
    /*                printf("ipcFrames : [sn: %d] ppIndex = %d, virtual = %x, phyaddr = %x\n",
                            i, ppIndex, ppMemVirtAddr[ppIndex], ppMemPhyAddr[ppIndex]);//*/

                    //memcpy(pFrame->addr[0][0], ppMemVirtAddr[ppIndex], bufSize);

                    copy2D.srcPhysAddr = (unsigned long)ppMemPhyAddr[ppIndex];
                    copy2D.dstPhysAddr = (unsigned long)pFrame->phyAddr[0][0];
                    OSA_dmaCopy2D(&dmaHndl, &copy2D, 1);
                }
                status = IpcFramesOutLink_putFullVideoFrames(SYSTEM_HOST_LINK_ID_IPC_FRAMES_OUT_0, &bufList);
                OSA_assert(0 == status);
            }
            OSA_waitMsecs(4);
        }

  • Your code looks correct.

    -- Make sure the OSA_dmaCpy size is set correctly.

    -- Try setting noNotifyMode in ipcFramesOut and ipcFramesIn

        esipcFramesOutHostPrm0.baseCreateParams.notifyNextLink                 = FALSE;
        esipcFramesOutHostPrm0.baseCreateParams.notifyPrevLink                 = FALSE;
        esipcFramesOutHostPrm0.baseCreateParams.notifyProcessLink              = FALSE;
        esipcFramesOutHostPrm0.baseCreateParams.noNotifyMode                   = TRUE;


        esipcFramesInVpssPrm0.baseCreateParams.noNotifyMode                = TRUE;
        esipcFramesInVpssPrm0.baseCreateParams.notifyNextLink              = TRUE;
        esipcFramesInVpssPrm0.baseCreateParams.notifyPrevLink              = FALSE;


    -- Check if CPU loading is 100% when you see the issue using top/htop

  • I have set Notify pattern in ipcFramesIn and ipcFramesOut as your suggestion,

    video from PCIe dropped after 800 seconds, but this time, message "IPC_FRAMESOUTLINK:!WARNING!.Commands not being processed by link." not appear

    cpu loading is 95%

    How can I test next step?

    Thanks

  • The CPU loading is the cause of the problem. Check using top/htop on what is loading the CPU. Check using strace/ptrace to see if some process is stuck in infinite loop or something.

  • Hi Ri-Ping,

    I try to understand how to use OSA_dmaCopy2D ....
    Does OSA_dmaCopy2D complete the dma copy when this function (OSA_dmaCopy2D ) returns ?

    Regards,
    Ran