Part Number: DRA72XEVM
Tool/software: Linux
Hi TI,
We are using PVSDK_03_04 SDK in DRA72XEVM board. The usecase being executed is NullSrc + Decode + Display
By default, Vision SDK nullSrc link supports single channel and we have modified it to support multiple channels as for our application we need to display encoded video coming from 4 inputs using Mosaic.
Below is the usecase diagram:
NullSource (A15) -> Decode -> VPE -> Merge -> Sync -> Alg_DmaSwMs -> Merge_1
DispDistSrc_weston -> Merge_1
Merge_1 -> Display
With 2 channels the use case is working fine. We are able to view the video.
However, when we increase the numbers of inputs to 3 or 4:
In NullSrcLink_processData() for each frame, OSA_bufGetEmptyBuffer() will be called... Is getting failed and return pBuffer as NULL. status is not SYSTEM_LINK_STATUS_SOK
status = OSA_bufGetEmptyBuffer(&pObj->outBufQue, &pBuffer, OSA_TIMEOUT_NONE);
if(status != SYSTEM_LINK_STATUS_SOK)
{
/*
* If for this channel buffer is not available then update stats
* for dropped buffer and continue for other channels
*/
pObj->linkStats.chStats[chId].inBufDropCount++;
continue;
}
This could probably be that the next link in the chain i.e, decoder is not releasing the buffer. Firstly, we tried to increase the number of buffers per channel to 8 for the decoder but still had the same problem of decoder not releasing the buffer. We tried reducing target bitrate to 1MB but still the same problem.
static Void chains_nullSrc_Display_SetDecodePrms(
Chains_NullSrcDisplayAppObj *pObj,
DecLink_CreateParams *pPrm)(
{
decPrm->numBufPerCh = 8;
decPrm->defaultDynamicParams.targetBitRate = 10*1000*1000;
decPrm->defaultDynamicParams.targetFrameRate = 30;
}
In NullSrcLink_processData() once the system buffer is filled nullSrc sends SYSTEM_CMD_NEW_DATA to next link i.e, decoder.
We felt decoder is not releasing buffer because processing might not be completed of previous frames and hence introduced delay of around 25ms after sending SYSTEM_CMD_NEW_DATA so that decoder could compete decoding of previous frames. With this functionally 4 channels started working and video could be seen in Mosaic display. However, video is very slow. We feel this might be due to the delay we are introducing while sending each of SYSTEM_CMD_NEW_DATA.
System_sendLinkCmd(pObj->createArgs.outQueParams.nextLink,
SYSTEM_CMD_NEW_DATA, NULL);
usleep(25000); //25ms
If the delay is not introduced, decoder is not releasing the empty buffer and this keeps repeating. nullSrc would never be able to send SYSTEM_CMD_NEW_DATA to decoder.
Input to the decoder is H.264 encoded VGA resolution video. According to TI specifications TI H.264 supports decoding 6 channels VGA encoded bitstream giving the output at 30fps. But for our requirement of 4 channels it is unable to decode 4 channels at 30fps and hence probably not releasing the empty buffer.
Please help us resolve this issue. (Temporary delay of 25ms introduced has to be removed and decoder should be releasing the buffer). There is limitation that there is only one instance of decoder running.
Note:
nullSrc fills the pBuffer every 33ms and sends SYSTEM_CMD_NEW_DATA to decoder
Adding further information for the above issue, without introducing delay in the logs it is observed that after few iterations the call to System_sendLinkCmd(pObj->createArgs.outQueParams.nextLink, SYSTEM_CMD_NEW_DATA, NULL);
did not return.
Code Snippet:
if(numBuf)
{
/*
*Notify the next link of data on Full Queue
*/
Vps_printf("NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA \n");
System_sendLinkCmd(pObj->createArgs.outQueParams.nextLink,
SYSTEM_CMD_NEW_DATA, NULL);
Vps_printf("NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA \n");
}
Log snippet:
[HOST] [IPU1-0] 39.519490 s: DecLink_tskMain() recieved SYSTEM_CMD_NEW_DATA
[HOST] [IPU1-0] 39.542274 s: DecLink_tskMain() recieved DEC_LINK_CMD_GET_PROCESSED_DATA
[HOST] [IPU1-0] 39.552339 s: DecLink_tskMain() recieved SYSTEM_CMD_NEW_DATA
[HOST] [IPU1-0] 39.574025 s: DecLink_tskMain() recieved DEC_LINK_CMD_GET_PROCESSED_DATA
[HOST] [IPU1-0] 39.585310 s: DecLink_tskMain() recieved SYSTEM_CMD_NEW_DATA
[HOST] [IPU1-0] 39.606996 s: DecLink_tskMain() recieved DEC_LINK_CMD_GET_PROCESSED_DATA
[HOST] [HOST ] 39.518849 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.518849 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.518880 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.518880 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.518880 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.518880 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.518910 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.518910 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.551729 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.551729 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.551759 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.551759 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.551759 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.551759 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.551790 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.551790 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.584700 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.584700 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.584731 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.584731 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.584731 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.584731 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.584761 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.584761 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.617702 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.617733 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.617733 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.617733 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.617763 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.617763 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.617763 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.617763 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.650735 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.650735 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.650735 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.650765 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.650765 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.650765 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.650765 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.650796 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.683706 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.683736 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.683736 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.683736 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.683767 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.683767 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.683767 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.683797 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.716708 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.716708 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.716708 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.716738 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.716738 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.716738 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.716738 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.716738 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.749740 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.749740 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.749771 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.749771 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.749771 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.749771 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.749801 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.749801 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.782742 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.782742 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.782742 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.782773 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.782773 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.782773 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.782773 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.782803 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.815714 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.815714 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.815714 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.815744 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.815744 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.815744 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.815744 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.815775 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.848715 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.848715 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.848746 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.848746 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.848746 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.848746 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.848776 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.848776 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.881778 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.881778 s: NULLSRC System_sendLinkCmd Sent SYSTEM_CMD_NEW_DATA
[HOST] [HOST ] 39.881809 s: NULLSRC System_sendLinkCmd sending SYSTEM_CMD_NEW_DATA
Looked into decLink_tsk.c, "flushCmds[0] = SYSTEM_CMD_NEW_DATA" seems to be doing the flush, but we are not sure pla confirm.
switch (cmd)
{
case SYSTEM_CMD_NEW_DATA:
Vps_printf("DecLink_tskMain() recieved SYSTEM_CMD_NEW_DATA\n");
Utils_tskAckOrFreeMsg(pMsg, status);
flushCmds[0] = SYSTEM_CMD_NEW_DATA;
Utils_tskFlushMsg(pTsk, flushCmds, 1);
DecLink_codecProcessData(pObj);
break;
}
Regards,
Sudhi