diff --git a/pasdk/test_dsp/framework/audioStreamInpProc.c b/pasdk/test_dsp/framework/audioStreamInpProc.c
index 7a2d35ca3180bc30199142e4e813968a69cfa0ae..990a758abf82a4eae85f414c1eb6874476a14650 100644 (file)
UInt32 gCapIb_cnt =0;
UInt32 gCbWrtAfErrCnt =0; // decoder output circular buffer write error count (returned from ARM to DSP)
+// For writeDECCommandRestart
+volatile UInt32 gCommandOutputTask_SYNC =0;
+volatile UInt32 gCommandOutputTask_ACK =0;
#include "dbgDib.h" // debug
// - AlgKey: Dec/Enc chain to Array Initialization
// - Device: I/O Device Initialization
// - DecOpCircBuf: Decoder Output Circular Buffer
- // - Unused: (available)
+ // - OutIS: Output Init-Sync
//
LINNO_RPRT(TaskAsip, -2);
for (i=0; i < lengthof(pP->fxns->initPhase); i++)
// any error forces idling of input
if (errno)
{
+ // If gCommandOutputTask_SYNC invoked by writeDECCommandRestart, wait for output task in sync ...
+ if (gCommandOutputTask_SYNC) {
+ TRACE_VERBOSE1("TaskAsip: writeDECCommandRestart issued ... Wait for ack from output task side (errno=%d)", errno);
+ // Wait for ack
+ while (gCommandOutputTask_ACK == 0) {
+ Task_sleep(1);
+ }
+ TRACE_VERBOSE0("TaskAsip: writeDECCommandRestart issued ... Sync-ed! Startover the process");
+ gCommandOutputTask_ACK = 0;
+ gCommandOutputTask_SYNC = 0;
+ }
+
for (z=INPUT1; z < INPUTN; z++)
{
if (pAstCfg->xInp[z].hRxSio)
tempVar8 |= 0x80;
sharedMemWriteInt8(&(pAstCfg->xDec[z].decodeStatus.command2),
tempVar8, GATEMP_INDEX_DEC);
+
+ // Invoke command to output task to break the loop
+ gCommandOutputTask_SYNC = 1;
+
return (ASPERR_QUIT);
default: // command unknown - ignore
break;