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.

dvrrdk350 ti816x Vdec_deleteChn() problem?

hello:

     i dynamic change decoder code type, so need call mcfw api Vdec_deleteChn();but it will bolock at delete ipcbitsOut link 's buff, the following msg will repeat again and again:

 [host] IPC_BITSOUTLINK:!WARNING!.IPCBITSOUT_LINK_CMD_DELETE_CH_BUFFER pending for [514] ms DeleteChBufState:1

I have check the state: 1 is right, I have see the link src and debug,i found if success call delete ipcbits buff,it will call ipcbitsoutlink_handle_flush_frame_free(), but unluckly,my function not call this.

when i call Vdec_deleteChn() this function, i have do nothing fot ipcbitsOutA8 link except send start msg

my link chain is:  ipcbitsOutA8--->ipcbitsInM3video--->dec--->ipcOutVideo--->ipcInM3vpss--->swms-->display

this link can decoder video and display.

the following is my ipcbitsOutHost config:

IpcBitsOutLinkHLOS_CreateParams ipcBitsOutA8Prm,*pIpcBitsOutA8Prm = &ipcBitsOutA8Prm;
IpcBitsOutLinkHLOS_CreateParams_Init(pIpcBitsOutA8Prm);
pIpcBitsOutA8Prm->baseCreateParams.outQueParams[0].nextLink = osd_display_linkId_core.linkId_ipcbitsInVideo0;
pIpcBitsOutA8Prm->baseCreateParams.numOutQue = 1;
pIpcBitsOutA8Prm->bufPoolPerCh = TRUE;
pIpcBitsOutA8Prm->baseCreateParams.noNotifyMode = TRUE;
pIpcBitsOutA8Prm->baseCreateParams.notifyNextLink = FALSE;
pIpcBitsOutA8Prm->baseCreateParams.notifyPrevLink = FALSE;
pIpcBitsOutA8Prm->inQueInfo.numCh = 2;
for(num=0; num<pIpcBitsOutA8Prm->inQueInfo.numCh; num++)
{
pIpcBitsOutA8Prm->inQueInfo.chInfo[num].width = 1920;
pIpcBitsOutA8Prm->inQueInfo.chInfo[num].height = 1080;
pIpcBitsOutA8Prm->inQueInfo.chInfo[num].scanFormat = SYSTEM_SF_PROGRESSIVE;
}
ret = System_linkCreate(osd_display_linkId_core.linkId_ipcbitsOutA8_0,pIpcBitsOutA8Prm,sizeof(*pIpcBitsOutA8Prm));

what's wrong wiht my program?

wish you replay!

  • Pls check with below bug fix. It is from latest codebase. The modified line is in bold.

    if (IPCBITSOUTHLOS_BUFPOOL_STATE_CREATED == pObj->bitBufState[pBitBuf->channelNum]) { IpcBitsOutLink_logTs(pBitBuf); OSA_assert(pObj->appAllocBufCnt[pBitBuf->channelNum] > 0); pObj->appAllocBufCnt[pBitBuf->channelNum] -= 1; /* Atmost 1 buffer is allowed per channel. Assert if not */ OSA_assert(pObj->appAllocBufCnt[pBitBuf->channelNum] == 0); /* Application must not set flush frame to false. * Flush frame is only used internally to delete buffer pool */ pBitBuf->flushFrame = FALSE; pListElem = (SystemIpcBits_ListElem *)pBitBuf; OSA_assert(SharedRegion_getPtr(pListElem->srBufPtr) == pBitBuf->addr); if (0 == pBitBuf->fillLength) { /* filled length of 0 indicates application * did not fill any data in this buffer. * Free it immediately */ #if SYSTEM_DEBUG_IPC_RT OSA_printf(" IPC_OUT: Dropping bitbuf\n"); #endif Cache_inv(pBitBuf->addr, pBitBuf->bufSize,Cache_Type_ALL, TRUE); OSA_assert(freeBitBufList.numBufs < VIDBITSTREAM_MAX_BITSTREAM_BUFS); freeBitBufList.bufs[freeBitBufList.numBufs] = pBitBuf; freeBitBufList.numBufs++; pObj->stats.droppedCount++; continue; } else { Int32 len; pObj->stats.recvCount++; OSA_assert(SYSTEM_IPC_BITS_GET_BUFSTATE(pListElem->bufState) == IPC_BITBUF_STATE_FREE); OSA_assert(SYSTEM_IPC_BITS_GET_BUFOWNERPROCID(pListElem->bufState) == System_getSelfProcId()); SYSTEM_IPC_BITS_SET_BUFSTATE(pListElem->bufState, IPC_BITBUF_STATE_ALLOCED); IpcBitsOutLink_listMPPut(pObj, pListElem); len = OSA_align(pBitBuf->fillLength, RING_BUF_ALIGN_SIZE); RingBufferWriterRelease( &pObj->ringBufHdnl[pBitBuf->allocPoolID], len); RingBufferWriterCancel(&pObj->ringBufHdnl[pBitBuf->allocPoolID]); putDone = TRUE; } } else { if (IPCBITSOUTHLOS_BUFPOOL_STATE_DELETEINPROGRESS_WAIT_APP_BUF_FREE == pObj->bitBufState[pBitBuf->channelNum]) { OSA_assert(pObj->appAllocBufCnt[pBitBuf->channelNum] > 0); pObj->appAllocBufCnt[pBitBuf->channelNum] -= 1; if (0 == pObj->appAllocBufCnt[pBitBuf->channelNum]) { OSA_assert(FALSE == sendFlushFrame); sendFlushFrame = TRUE; flushFrameChId = pBitBuf->channelNum; putDone = TRUE; } } else { IPCBITSOUTLINK_INFO_LOG(pObj->tskId,"Warning!. Trying to putFullBuffer for chId[%d] in invalid state [%d]", pBitBuf->channelNum, pObj->bitBufState[pBitBuf->channelNum]); } /* filled length of 0 indicates application * did not fill any data in this buffer. * Free it immediately */ #if SYSTEM_DEBUG_IPC_RT OSA_printf(" IPC_OUT: Dropping bitbuf\n"); #endif OSA_assert(freeBitBufList.numBufs < VIDBITSTREAM_MAX_BITSTREAM_BUFS); freeBitBufList.bufs[freeBitBufList.numBufs] = pBitBuf; freeBitBufList.numBufs++; pObj->stats.droppedCount++; } }

    Patch is based on DVRRDK 4.01 is below

    diff --git a/mcfw/src_linux/links/ipcBitsOut/ipcBitsOutLink_tsk.c b/mcfw/src_linux/links/ipcBitsOut/ipcBitsOutLink_tsk.c
    index 4728fd5..d5d461c 100755
    --- a/mcfw/src_linux/links/ipcBitsOut/ipcBitsOutLink_tsk.c
    +++ b/mcfw/src_linux/links/ipcBitsOut/ipcBitsOutLink_tsk.c
    @@ -637,6 +637,7 @@
                         OSA_assert(FALSE == sendFlushFrame);
                         sendFlushFrame = TRUE;
                         flushFrameChId = pBitBuf->channelNum;
    +                    putDone = TRUE;
                     }
                 }
                 else

  • hi:

        i add the "putDone = TRUE;" ,but still have the issue.

        I noly create and start the ipcbitsOut link, but never require a buff and any  other operation, so this function modify no effect with the issue.

     the key point is this function:

    Int32 IpcBitsOutLink_releaseBitBufs(IpcBitsOutLink_Obj * pObj)
    {
        SystemIpcBits_ListElem *pListElem = NULL;
        Int32 status;
        UInt32 curTime, roundTripTime;
    
        curTime = OSA_getCurTimeInMsec();
    
        do
        {
            pListElem = ListMP_getHead(pObj->listMPInHndl);
    
            if (pListElem != NULL)
            {
    			OSA_printf("%s %d. pListElem is not NULL\n",__FILE__,__LINE__);
                IpcBitsOutLink_doPostGetCacheOp(pObj, pListElem);
                if(SYSTEM_IPC_BITS_GET_BUFSTATE(pListElem->bufState)
                   != IPC_BITBUF_STATE_INQUE)
                {
                    OSA_printf("!!!WARNING.Bad ListElem\n");
                    OSA_printf("ListElem:%p,State:%d,SharedRegionID:%d,SrPtr:%p",
                                pListElem,
                                SYSTEM_IPC_BITS_GET_BUFSTATE(pListElem->bufState),
                                SharedRegion_getId(pListElem),
                                (void *)pListElem->srBufPtr);
                    OSA_printf("Stats:Recv:%d,Free:%d,Dropped:%d",
                               pObj->stats.recvCount,
                               pObj->stats.freeCount,
                               pObj->stats.droppedCount);
                    OSA_assert(SYSTEM_IPC_BITS_GET_BUFSTATE(pListElem->bufState)
                               == IPC_BITBUF_STATE_INQUE);
                }
                if (curTime > ((UInt32) pListElem->ipcPrivData))
                {
                    roundTripTime = curTime - ((UInt32) pListElem->ipcPrivData);
                    pObj->stats.totalRoundTrip += roundTripTime;
                }
                pObj->stats.freeCount++;
                /* release ListElem back to queue */
                SYSTEM_IPC_BITS_SET_BUFOWNERPROCID(pListElem->bufState);
                SYSTEM_IPC_BITS_SET_BUFSTATE(pListElem->bufState,
                                             IPC_BITBUF_STATE_FREE);
    
    			OSA_printf("%s %d . ipcbitsOut come here. pListElem->bitBuf.flushFrame=%d\n",__FILE__,__LINE__,pListElem->bitBuf.flushFrame);
                if (pListElem->bitBuf.flushFrame)
                {
    				OSA_printf("%s %d . ipcbitsOut come here\n",__FILE__,__LINE__);
                    ipcbitsoutlink_handle_flush_frame_free(pObj,pListElem);
                }
                else
                {
    				OSA_printf("%s %d . ipcbitsOut come here\n",__FILE__,__LINE__);
    
                    OSA_assert(pListElem->bitBuf.allocPoolID <
                               pObj->outQueInfo.allocPoolInfo.numPools);
                    status =
                        OSA_quePut(&(pObj->listElemQue[pListElem->bitBuf.allocPoolID]),
                                   (Int32) pListElem, OSA_TIMEOUT_NONE);
                    OSA_assert(status == OSA_SOK);
                }
    
            }                                                  /* if (pListElem
                                                                * != NULL) */
        } while (pListElem != NULL);
    
        return IPC_BITSOUT_LINK_S_SUCCESS;
    }

    if delete success. at least  pListElem != NULL one time.  then will may  be enter 

    if (pListElem->bitBuf.flushFrame)
    {
    OSA_printf("%s %d . ipcbitsOut come here\n",__FILE__,__LINE__);
    ipcbitsoutlink_handle_flush_frame_free(pObj,pListElem);
    }

    so can flush the buff,

    but i never applay a buff, so I think it will null.

    it's bug? or some place i set or use wrong

     

  • Hi:

      I have solve the problme ,it's my mistake, when I set the next link  noNotifyMode is TRUE,and notifyPrevLink is FALSE, the issue is gone.

       I guess the problem is because the next never notice the prev link it'sempty.so getlist_head always is none