]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/commitdiff
PASDK-53: Experimental code, remove Dec Op CB reset on CB underflow.
authorFrank Livingston <frank-livingston@ti.com>
Tue, 28 Feb 2017 00:50:11 +0000 (18:50 -0600)
committerFrank Livingston <frank-livingston@ti.com>
Tue, 28 Feb 2017 00:50:11 +0000 (18:50 -0600)
This appears to fix:
1) Glitching for DDP, channel_sampling_rate_48k.ec3
2) MAT-THD causing system failure after 7x streams of
channel_sampling_rate_48k.mlp

pasdk/test_dsp/framework/audioStreamOutProc.c

index b8154d2ee1deff0f6b5cee131a4ed07b0a357e98..2395334e7899a833b0aee625d52d69fbbb95392f 100644 (file)
@@ -130,7 +130,11 @@ UInt32 gAsopStreamCnt   =0;
 UInt32 gAsopEncodeCnt   =0;
 UInt32 gAsopFinalCnt    =0;
 UInt32 gAsopQuitCnt     =0;
 UInt32 gAsopEncodeCnt   =0;
 UInt32 gAsopFinalCnt    =0;
 UInt32 gAsopQuitCnt     =0;
+//debug
+UInt32 gCbReadAfErr     =0;
 
 
+// FL: (***) debug
+#include "evmc66x_gpio_dbg.h"
 
 /*
  *  ======== taskAsopFxn ========
 
 /*
  *  ======== taskAsopFxn ========
@@ -1308,6 +1312,7 @@ PAF_ASOT_selectDevices(
     return errno;
 } //PAF_ASOT_selectDevices
 
     return errno;
 } //PAF_ASOT_selectDevices
 
+
 // -----------------------------------------------------------------------------
 // ASOT Processing Function - Decode Processing
 //
 // -----------------------------------------------------------------------------
 // ASOT Processing Function - Decode Processing
 //
@@ -1333,6 +1338,7 @@ PAF_ASOT_decodeProcessing(
     Int block; // decoder output block count / input frame
     Int outSioUpdate;
     
     Int block; // decoder output block count / input frame
     Int outSioUpdate;
     
+    
     pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
 
     for (;;) 
     pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
 
     for (;;) 
@@ -1443,6 +1449,7 @@ PAF_ASOT_decodeProcessing(
                     break;
                 }
 
                     break;
                 }
 
+
                 // (***) FL: do we need this? 
                 //       AF pointers come from CB read, any resets occur in Decoder AF.
                 // Reset audio frame pointers to original values
                 // (***) FL: do we need this? 
                 //       AF pointers come from CB read, any resets occur in Decoder AF.
                 // Reset audio frame pointers to original values
@@ -1855,22 +1862,23 @@ PAF_ASOT_decodeStream(
         cbErrno = cbReadAf(pCbCtl, z, pAfRd);
         if (cbErrno != 0)
         {
         cbErrno = cbReadAf(pCbCtl, z, pAfRd);
         if (cbErrno != 0)
         {
+            gCbReadAfErr++;
             TRACE_TERSE1("PAF_ASOT_decodeStream:cbReadAf() error=%d", cbErrno);
             //SW_BREAKPOINT; // FL: debug
             
             if (cbErrno == ASP_DECOP_CB_READ_UNDERFLOW)
             {
                 // Reset circular buffer
             TRACE_TERSE1("PAF_ASOT_decodeStream:cbReadAf() error=%d", cbErrno);
             //SW_BREAKPOINT; // FL: debug
             
             if (cbErrno == ASP_DECOP_CB_READ_UNDERFLOW)
             {
                 // Reset circular buffer
-                cbReset(pCbCtl, z);
-                Log_info0("PAF_ASOT_decodeStream:cbReset");
+                //cbReset(pCbCtl, z);
+                //Log_info0("PAF_ASOT_decodeStream:cbReset");
 
                 // Update underflow count, return if above threshold
                 gDecOpCbRdAfUnd++;
 
                 // Update underflow count, return if above threshold
                 gDecOpCbRdAfUnd++;
-                if (gDecOpCbRdAfUnd == DEC_OP_CB_RDAF_UND_THR)
-                {
-                    gDecOpCbRdAfUnd = 0;
-                    return cbErrno;
-                }
+                //if (gDecOpCbRdAfUnd == DEC_OP_CB_RDAF_UND_THR)
+                //{
+                //    gDecOpCbRdAfUnd = 0;
+                //    return cbErrno;
+                //}
             }
         }
         //Log_info0("PAF_ASOT_decodeStream:cbReadAf() complete.");
             }
         }
         //Log_info0("PAF_ASOT_decodeStream:cbReadAf() complete.");
@@ -1958,6 +1966,18 @@ PAF_ASOT_decodeEncode(
             }
             // TODO: use pC->xOut[z].pOutBuf in following ->encode call
 
             }
             // TODO: use pC->xOut[z].pOutBuf in following ->encode call
 
+#if 1 // (***) FL: shows timing of Input Rx SIO reclaim after decoding has started (autodet complete)
+            // (***) debug // B8
+            {
+                static Uint8 toggleState = 0;
+                if (toggleState == 0)
+                    GPIOSetOutput(GPIO_PORT_0, GPIO_PIN_106);
+                else
+                    GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_106);
+                toggleState = ~(toggleState);
+            }
+#endif            
+
             //
             // Simulate Tx SIO_reclaim() pend
             //
             //
             // Simulate Tx SIO_reclaim() pend
             //
@@ -2454,7 +2474,7 @@ PAF_ASOT_setCheckRateX(
     zMI = pP->zone.master;
 
     inputRate = pAstCfg->xInp[zMI].inpBufStatus.sampleRateStatus;
     zMI = pP->zone.master;
 
     inputRate = pAstCfg->xInp[zMI].inpBufStatus.sampleRateStatus;
-    inputCount = pAstCfg->xDec[zMD].decodeStatus.frameLength;
+    inputCount = pAstCfg->xDec[zMD].decodeStatus.frameLength; // FL: This should be protected
     rateI = pAstCfg->xStr[zMS].pAudioFrame->fxns->sampleRateHz
         (pAstCfg->xStr[zMS].pAudioFrame, inputRate, PAF_SAMPLERATEHZ_INV);
 
     rateI = pAstCfg->xStr[zMS].pAudioFrame->fxns->sampleRateHz
         (pAstCfg->xStr[zMS].pAudioFrame, inputRate, PAF_SAMPLERATEHZ_INV);