diff --git a/pasdk/test_dsp/framework/audioStreamOutProc.c b/pasdk/test_dsp/framework/audioStreamOutProc.c
index 6578b3a8d375f4426862e2df803081611685eb55..e45912efc8f25a79aaece85b444368d06d42775f 100644 (file)
UInt32 gMaxDecOpCbRdAfUnd =0; // max (consecutive) decoder output circular buffer underflow count
UInt32 gMasterCbResetCnt =0; // master circular buffer reset count
+// For writeDECCommandRestart
+extern volatile UInt32 gCommandOutputTask_SYNC;
+extern volatile UInt32 gCommandOutputTask_ACK;
+
// Global debug counters */
UInt32 gAsopTxSioReclaimCnt =0;
UInt32 gAsopInitOutProcCnt =0;
// Check forward (ASIT) error here, TBD
//
+ // Even if we are not in error state, we check if writeDECCommandRestar issued or not
+ if (gCommandOutputTask_SYNC) {
+ TRACE_TERSE0("TaskAsop: ack for writeDECCommandRestart ... Wait for the command deasserted");
+ gCommandOutputTask_ACK = 1;
+ while (gCommandOutputTask_SYNC) {
+ Task_sleep(1);
+ }
+ TRACE_TERSE0("TaskAsop: ack for writeDECCommandRestart ... Sync-ed! Startover the process");
+ procSleep = 1; // init sleep flag -- sleep
+ procOutDevSel = 1; // init device output selection flag -- perform output device selection
+ state = INIT_OUT_PROC_STATE; // init state -- starover
+ errno = ASOP_DP_FORWARD_ERR; // Override the error -- for flushing SIO output device
+ }
+
// any error forces idling of output
if (errno)
{
TRACE_TERSE1("TaskAsop: Trace stopped at loop %d.", loopCount);
ERRNO_RPRT(TaskAsop, errno);
- }
-
+ }
+
if (procSleep == 1)
{
TRACE_VERBOSE1("TaskAsop: AS%d: ... sleeping ...", as+zMS);
// Check forward (ASIT) error here, TBD
//
-
+ // If writeDECCommandRestart issued, force exit the statemachine
+ if (gCommandOutputTask_SYNC) {
+ TRACE_VERBOSE1("PAF_ASOT_decodeProcessing: writeDECCommandRestart issued in state=0x%x ... exiting core loop", state);
+ errno = ASOP_DP_FORWARD_ERR;
+ break;
+ }
+
// Check if any change in output SIO, e.g. from Output shortcut.
// Changes will break FSM and allow Output reconfiguration.
errno = checkOutSio(pP, pAsotCfg, &outSioUpdate);