diff --git a/pasdk/test_dsp/framework/audioStreamInpProc.c b/pasdk/test_dsp/framework/audioStreamInpProc.c
index a00036d99b443cbdcf335bb4a3fabb573c2ebb55..264e929bbb8ad0be7a2597f222e1bbc11678dc31 100644 (file)
};
// Global debug counters */
-UInt32 gTaskAsipCnt=0; // debug
-UInt32 gAsipInitCnt =0;
-UInt32 gAsipInfo1Cnt =0;
-UInt32 gAsipInfo2Cnt =0;
-UInt32 gAsipDecodeCnt =0;
-UInt32 gAsipFinalCnt =0;
-UInt32 gAsipQuitCnt =0;
+UInt32 gTaskAsipCnt =0;
+UInt32 gAsipInitCnt =0;
+UInt32 gAsipInfo1Cnt =0;
+UInt32 gAsipInfo2Cnt =0;
+UInt32 gAsipDecodeCnt =0;
+UInt32 gAsipDecodeErrCnt =0;
+UInt32 gAsipFinalCnt =0;
+UInt32 gAsipQuitCnt =0;
+UInt32 gAsipInfo1_PrimaryErrCnt =0;
+UInt32 gAsipInfo1_ErrCnt =0;
+UInt32 gAsipInfo2_PrimaryErrCnt =0;
+UInt32 gAsipInfo2_ErrCnt =0;
+UInt32 gCapIbReset_cnt =0;
+UInt32 gCapIb_cnt =0;
+UInt32 gCbWrtAfErrCnt =0; // decoder output circular buffer write error count (returned from ARM to DSP)
#include "dbgDib.h"
extern struct {
#ifdef NON_CACHE_STATUS
Int8 tempVar8;
#endif
+ Task_Handle taskHandle;
Log_info0("Enter taskAsipFxn()");
-
-#ifdef SIMULATE_SIO
- /* Start simulation */
- simStart();
-#endif // SIMULATE_SIO
//
// Audio Framework Parameters & Patch (*pP, *pQ)
pAstCfg->as = as;
TRACE_TERSE1("TaskAsip: Started with AS%d.", as);
+ taskHandle = Task_self();
+
//
// Initialize message log trace and line number reporting
//
// FL: debug, reset IB capture buffer
capIbReset();
+ gCapIbReset_cnt++;
Log_info0("capIbReset()");
-
+
// FL: send source select message to slave
pAspMsg = (ASP_Msg *)MessageQ_alloc(hAspMsgMaster->heapId, hAspMsgMaster->msgSize); /* allocate message */
MessageQ_setReplyQueue(hAspMsgMaster->masterQue, (MessageQ_Msg)pAspMsg); /* set the return address in the message header */
TRACE_VERBOSE1(procName[sourceProgram], as+zMS);
+ // Reduce priority level since autodetection complete
+ Task_setPri(taskHandle, Task_getPri(taskHandle)-1);
+
TRACE_VERBOSE0("TaskAsip: calling decodeProcessing.");
errno = pP->fxns->decodeProcessing(pP, pQ, pC, sourceSelect);
if (errno)
TRACE_VERBOSE0("TaskAsip: decodeProcessing complete with no error.");
}
+ // Increase priority level since decoding complete
+ Task_setPri(taskHandle, Task_getPri(taskHandle)+1);
+
// FL: send dec exit message to slave
pAspMsg = (ASP_Msg *)MessageQ_alloc(hAspMsgMaster->heapId, hAspMsgMaster->msgSize); /* allocate message */
MessageQ_setReplyQueue(hAspMsgMaster->masterQue, (MessageQ_Msg)pAspMsg); /* set the return address in the message header */
return errno;
} //PAF_ASIT_autoProcessing
+UInt32 gProbe1Err=0;
+UInt32 gProbe2Err=0;
+UInt32 gMajorAuMissed=0;
+
// -----------------------------------------------------------------------------
// ASIT Processing Function - Decode Processing
//
Int frame; // decoder input frame count
Int block; // (***) FL: formerly -- decoder output block count / input frame
#ifdef NON_CACHE_STATUS
- Int8 tempVar8, tempVar8_2;
+ Int8 tempVar8, temp2Var8;
#endif
pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
for (;;)
{
+ statusOp_read(&tempVar8,
+ &(pAstCfg->xDec[zMD].decodeStatus.sourceSelect),
+ sizeof(tempVar8),
+ GATEMP_INDEX_DEC);
if (tempVar8 == PAF_SOURCE_NONE)
{
#else
// Establish primary timing
if (errno = pP->fxns->decodeInfo(pP, pQ, pC, frame, block))
{
+ gAsipInfo1_PrimaryErrCnt++;
TRACE_TERSE1("INFO1: errno 0x%x after decodeInfo, primary timing", errno);
break;
}
&(pAstCfg->xDec[zMD].decodeStatus.sourceDecode),
sizeof(tempVar8),
GATEMP_INDEX_DEC);
-
- statusOp_read(&tempVar8_2,
+ statusOp_read(&temp2Var8,
&(pAstCfg->xDec[zMD].decodeStatus.sampleRate),
sizeof(tempVar8),
GATEMP_INDEX_DEC);
// Don't start decode until major access unit is found.
if (((tempVar8 == PAF_SOURCE_THD) ||
(tempVar8 == PAF_SOURCE_DXP) ||
- (tempVar8 == PAF_SOURCE_DTSHD))
- &&
- //(pAstCfg->xStr[zMS].pAudioFrame->sampleRate == PAF_SAMPLERATE_UNKNOWN)
- (tempVar8_2 == PAF_SAMPLERATE_UNKNOWN) // debug chitresh as per govind
- )
+ (tempVar8 == PAF_SOURCE_DTSHD)) &&
+ (temp2Var8 == PAF_SAMPLERATE_UNKNOWN))
#else
// Don't start decode until major access unit is found.
if (((pAstCfg->xDec[zMD].decodeStatus.sourceDecode == PAF_SOURCE_THD) ||
if (SIO_issue(pAstCfg->xInp[zI].hRxSio, &pAstCfg->xInp[zI].inpBufConfig,
sizeof(pAstCfg->xInp[zI].inpBufConfig), PAF_SIO_REQUEST_NEWFRAME))
{
+ gProbe2Err++;
TRACE_TERSE0("PAF_ASIT_decodeProcessing. %d: INFO1, return (ASPERR_ISSUE)");
return (ASPERR_ISSUE);
}
}
}
TRACE_VERBOSE1("PAF_ASIT_decodeProcessing: INFO1: frame %d, not major access unit", frame);
+ gMajorAuMissed++; // debug
frame++;
state = INFO1;
continue;
if (errno = pP->fxns->decodeInfo1(pP, pQ, pC, frame, block))
{
TRACE_VERBOSE1("PAF_ASIT_decodeProcessing: INFO1, errno 0x%x. break after decodeInfo1", errno);
+ gAsipInfo1_ErrCnt++;
break;
}
if (errno = pP->fxns->decodeInfo(pP, pQ, pC, frame, block))
{
TRACE_TERSE1("PAF_ASIT_decodeProcessing: INFO2 break on decodeInfo. errno 0x%x", errno);
+ gAsipInfo2_PrimaryErrCnt++;
break;
}
if (errno = pP->fxns->decodeInfo2(pP, pQ, pC, frame, block))
{
TRACE_TERSE1("PAF_ASIT_decodeProcessing. %d: INFO2 break on decodeInfo2. errno 0x%x", errno);
+ gAsipInfo2_ErrCnt++;
break;
}
if (errno = pP->fxns->decodeDecode(pP, pQ, pC, sourceSelect, frame, block))
{
+ gAsipDecodeErrCnt++;
TRACE_TERSE1("PAF_ASIT_decodeProcessing: state: DECODE. decodeDecode err 0x%04x", errno);
break;
}
Int zMI;
ASP_Msg* pAspMsg; /* Messaging */
Int argIdx;
- Int decErrno;
Int status;
#ifdef NON_CACHE_STATUS
Int8 tempVar8;
TRACE_MSG1("decErrno=%d", pAspMsg->buf[0]);
argIdx = 0; // get decErrno
- decErrno = *(Int32 *)&pAspMsg->buf[argIdx];
- if (decErrno != 0)
- {
- return decErrno;
- }
+ errno = *(Int32 *)&pAspMsg->buf[argIdx];
}
else
{
+ //
+ // Invalid message received
+ //
TRACE_TERSE3("ERROR: Rx ASP message: procId=%d, cmd=%d, messageId=0x%04x", pAspMsg->procId, pAspMsg->cmd, pAspMsg->messageId);
SW_BREAKPOINT; // temporary
return -1; // temporary
{
SW_BREAKPOINT;
}
-
+
// (***) FL: revisit
// invalidate Dec configuration
Cache_inv(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
- Cache_wait();
+ Cache_wait();
#if 0 // FL: decoder reset call, slave
if (dec->fxns->reset
&pC->xDec[z].decodeControl, &pC->xDec[z].decodeStatus)))
return errno;
#endif
+ if (errno != 0)
+ {
+ return errno;
+ }
#ifdef NON_CACHE_STATUS
gear = 0; // due to size difference
SW_BREAKPOINT;
return -1; // temporary
}
- if ((pAspMsg->procId != hAspMsgMaster->slaveProcId) ||
- (pAspMsg->cmd != ASP_MASTER_DEC_INFO_DONE) ||
- (pAspMsg->messageId != (hAspMsgMaster->messageId | ((UInt32)1<<31))))
+ if ((pAspMsg->procId == hAspMsgMaster->slaveProcId) &&
+ (pAspMsg->cmd == ASP_MASTER_DEC_INFO_DONE) &&
+ (pAspMsg->messageId == (hAspMsgMaster->messageId | ((UInt32)1<<31))))
+ {
+ hAspMsgMaster->messageId = (hAspMsgMaster->messageId + 1) & ~(1<<31);
+ TRACE_TERSE3("Rx ASP message: procId=%d, cmd=%d, messageId=0x%04x", pAspMsg->procId, pAspMsg->cmd, pAspMsg->messageId);
+ TRACE_MSG1("decErrno=%d", pAspMsg->buf[0]);
+
+ argIdx = 0; // get decErrno
+ errno = *(Int32 *)&pAspMsg->buf[argIdx];
+ }
+ else
{
+ //
+ // Invalid message received
+ //
TRACE_TERSE3("ERROR: Rx ASP message: procId=%d, cmd=%d, messageId=0x%04x", pAspMsg->procId, pAspMsg->cmd, pAspMsg->messageId);
SW_BREAKPOINT; // temporary
- }
- hAspMsgMaster->messageId = (hAspMsgMaster->messageId + 1) & ~(1<<31);
- TRACE_MSG3("Rx ASP message: procId=%d, cmd=%d, messageId=0x%04x", pAspMsg->procId, pAspMsg->cmd, pAspMsg->messageId);
+ return -1; // temporary
+ }
// free the message
status = MessageQ_free((MessageQ_Msg)pAspMsg); /* free the message */
if (status != MessageQ_S_SUCCESS)
TRACE_TERSE1("return error errno 0x%x.", errno);
return errno;
}
+
#ifdef NON_CACHE_STATUS
statusOp_read(&tempVar,
&(pAstCfg->xDec[z].decodeStatus.frameCount),
hAspMsgMaster->messageId = (hAspMsgMaster->messageId + 1) & ~(1<<31);
TRACE_MSG3("Rx ASP message: procId=%d, cmd=%d, messageId=0x%04x", pAspMsg->procId, pAspMsg->cmd, pAspMsg->messageId);
- argIdx = 0;
+ argIdx = 0; // get decErrno
errno = *(Int32 *)&pAspMsg->buf[argIdx];
- argIdx += sizeof(Int32);
+ argIdx += sizeof(Int32); // get cbErrno
cbErrno = *(Int32 *)&pAspMsg->buf[argIdx];
if (cbErrno != 0)
{
+ gCbWrtAfErrCnt++;
TRACE_TERSE1("CB write error=%d", cbErrno);
SW_BREAKPOINT; // temporary
}
}
else
{
+ //
+ // Invalid message received
+ //
TRACE_TERSE3("ERROR: Rx ASP message: procId=%d, cmd=%d, messageId=0x%04x", pAspMsg->procId, pAspMsg->cmd, pAspMsg->messageId);
SW_BREAKPOINT; // temporary
}