Merge remote-tracking branch 'origin/dev_pasdk_govind_pasdk53IpDataDebug' into dev_pa...
[processor-sdk/performance-audio-sr.git] / pasdk / test_dsp / framework / audioStreamInpProc.c
index d1ba09742f7185628c5812719936ddb63125278b..7b1dbf891eacd612781ff3f497cc19bd8c421803 100644 (file)
@@ -298,20 +298,22 @@ PAF_ASIT_Config gPAF_ASIT_config = {
 };
 
 // Global debug counters */
-UInt32 gTaskAsipCnt=0; // debug
-UInt32 gAsipInitCnt     =0;
-UInt32 gAsipInfo1Cnt    =0;
-UInt32 gAsipInfo2Cnt    =0;
-UInt32 gAsipDecodeCnt   =0;
-UInt32 gAsipDecodeErrCnt   =0;
-UInt32 gAsipFinalCnt    =0;
-UInt32 gAsipQuitCnt     =0;
-UInt32 gIbReset_cnt    =0;
-UInt32 gcapIb_cnt              =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 gIbReset_cnt             =0;
+UInt32 gcapIb_cnt               =0;
 UInt32 gAsipInfo2_PrimaryErrCnt =0;
-UInt32 gAsipInfo2_ErrCnt               =0;
+UInt32 gAsipInfo2_ErrCnt        =0;
+// debug
+UInt32 gCbErrnoCnt              =0; // decoder circular buffer error count (write on ARM returned to DSP)
 
-#include "dbgDib.h"
+#include "dbgDib.h" // debug
 
 extern struct {
     Int size;
@@ -2054,13 +2056,11 @@ PAF_ASIT_decodeProcessing(
 
     for (;;) 
     {
-         statusOp_read(&tempVar8,
-                         &(pAstCfg->xDec[zMD].decodeStatus.sourceSelect),
-                         sizeof(tempVar8),
-                         GATEMP_INDEX_DEC);
-           // TRACE_TERSE1("PAF_ASIT_decodeProcessing: sourceSelect is %d", tempVar8);
-
-       if (tempVar8 == PAF_SOURCE_NONE)
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[zMD].decodeStatus.sourceSelect),
+                    sizeof(tempVar8),
+                    GATEMP_INDEX_DEC);
+        if (tempVar8 == PAF_SOURCE_NONE)
         {
 #else
     TRACE_TERSE1("PAF_ASIT_decodeProcessing: sourceSelect is %d", pAstCfg->xDec[zMD].decodeStatus.sourceSelect);
@@ -2107,8 +2107,9 @@ PAF_ASIT_decodeProcessing(
                 gAsipInitCnt++;
                 Log_info0("TaskAsip: state=INIT");
 
-                // (***) FL: revisit
-#if 1 // status for shared beta units can change (e.g. at-boot or alpha)
+#if 0 // Not necessary since decoder status is in uncached memory
+                // status for shared beta units can change (e.g. at-boot or alpha)
+                
                 // write back Status structures for shared Beta Units
                 //size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]->size;
                 //Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]), size, Cache_Type_ALLD, 0);
@@ -2120,7 +2121,7 @@ PAF_ASIT_decodeProcessing(
                 Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_THD]), size, Cache_Type_ALLD, 0);
                 Cache_wait();
 #endif
-#if 0
+#if 0 // Not necessary since decoder status is in uncached memory
                 ////size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]->size;
                 ////Cache_wbInv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]), size, Cache_Type_ALLD, 0);
                 //size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]->size;
@@ -2136,8 +2137,11 @@ PAF_ASIT_decodeProcessing(
                     break;
                 }
                 
-#if 1
-                // (***) FL: revisit
+                //
+                // Not necessary since decoder status is in uncached memory
+                //
+               
+#if 0 // Not necessary since decoder status is in uncached memory
                 // invalidate Status structures for shared Beta Units
                 //size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]->size;
                 //Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]), size, Cache_Type_ALLD, 0);
@@ -2931,6 +2935,7 @@ PAF_ASIT_decodeInfo(
         // FL: debug, capture input buffer
         capIb(pAstCfg->xInp[zMI].pInpBuf);
         gcapIb_cnt++;
+        
 #if 0
         {
             static Uint8 toggleState = 0;
@@ -2941,6 +2946,7 @@ PAF_ASIT_decodeInfo(
             toggleState = ~(toggleState);
         }
 #endif
+
         //
         // Simulate Rx SIO_reclaim() pend
         //
@@ -3420,8 +3426,9 @@ PAF_ASIT_decodeDecode(
                 cbErrno = *(Int32 *)&pAspMsg->buf[argIdx];
                 if (cbErrno != 0)
                 {
+                    gCbErrnoCnt++;
                     TRACE_TERSE1("CB write error=%d", cbErrno);
-                    SW_BREAKPOINT; // temporary
+                    //SW_BREAKPOINT; // temporary
                 }
             }
             else