]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/commitdiff
PASDK-277:Add debug variables
authorFrank Livingston <frank-livingston@ti.com>
Sat, 3 Jun 2017 14:36:18 +0000 (09:36 -0500)
committerFrank Livingston <frank-livingston@ti.com>
Sat, 3 Jun 2017 14:36:18 +0000 (09:36 -0500)
Captures show ASIT exits & re-enters decodeProcessing().
Because of this, cbInitSourceSel() is called twice during MAT-THD stream,
both "early" in stream. Because of this, ~5 decode frames are lost from CB.

Data accumulation in the CB associated with these 5 frames is lost.
(variable fill rate - fixed empty rate). As a result, CB can underflow
for MAT-THD streams.

Current approach(s) to circumvent CB underflow problem center around
artificially accumulating some amount of data at point in stream where
decodeProcessing() is re-entered.
- PP approach will accumulate first 5 frames of data (of whatever size in stream).
- Bogdan's approach will accumulate some number of samples:
(fixed nominal delay - size of frame where decodeProcessing is resumed).

Neither approach will gaurantee no underflow.

pasdk/test_arm/framework/aspDecOpCircBuf_slave.c
pasdk/test_dsp/framework/aspDecOpCircBuf_master.c

index 6a3bc915072fefdd40faec894d75d8887d2dd5d2..9a37e6eeaaad839456d0639e5d7c136ea3be5baf 100644 (file)
@@ -75,6 +75,8 @@ Int cbCtlInit(
     
 }
 
+//Int8 gCbWriteStartCnt=0; // debug
+
 // Start writes to circular buffer
 Int cbWriteStart(
     PAF_AST_DecOpCircBufCtl *pCbCtl,    // decoder output circular buffer control
@@ -88,6 +90,8 @@ Int cbWriteStart(
     Int8 n;
     //Int8 i;
 
+    //gCbWriteStartCnt++; // debug
+    
     // Get gate handle
     gateHandle = pCbCtl->gateHandle;
     // Enter gate
@@ -165,6 +169,11 @@ Int cbWriteStop(
     return ASP_DECOP_CB_SOK;
 }
 
+// debug
+//Int16 gSampleCountBuf[10];
+//Int16 gCalcDeltaSampsBuf[10];
+//Int8 gPrimedFlagCnt=0;
+
 // Write audio frame to circular buffer
 Int cbWriteAf(
     PAF_AST_DecOpCircBufCtl *pCbCtl,    // decoder output circular buffer control
@@ -401,6 +410,12 @@ Int cbWriteAf(
             // Calculate number of output frames to block reader.
             // This is sample count reader waits before allowed to actually read samples from the CB.
             pCb->deltaSamps = (pCb->targetNDSamps - pAfWrt->sampleCount + (pCb->strFrameLen-1)) / pCb->strFrameLen * pCb->strFrameLen;
+            
+            // debug
+            //gSampleCountBuf[gPrimedFlagCnt] = pAfWrt->sampleCount;
+            //gCalcDeltaSampsBuf[gPrimedFlagCnt] = pCb->deltaSamps;
+            //if (gPrimedFlagCnt < 10)
+            //    gPrimedFlagCnt++;
         }
 
         // (***) FL: revisit
index 851e003d86b77e11b43551bf5c1bf5d1cb5484a0..f79f85128dbdd25db0b9ec8491776a4374c830a0 100644 (file)
@@ -240,6 +240,10 @@ Int cbInit(
     return ASP_DECOP_CB_SOK;
 }
 
+// debug
+//Int8 gCbInitSourceSelCnt=0;
+//Int8 gCbInitSourceSelThdCnt=0;
+
 // Initialize circular buffer based on selected source
 Int cbInitSourceSel(
     PAF_AST_DecOpCircBufCtl *pCbCtl,    // decoder output circular buffer control
@@ -259,6 +263,8 @@ Int cbInitSourceSel(
     Int8 n;
     Int8 i;
 
+    //gCbInitSourceSelCnt++; // debug
+    
     // Get gate handle
     gateHandle = pCbCtl->gateHandle;
     // Enter gate
@@ -366,6 +372,8 @@ Int cbInitSourceSel(
     }
     else if (sourceSelect == PAF_SOURCE_THD)
     {
+        //gCbInitSourceSelThdCnt++; //debug
+        
         pCb->maxNumAfCb = ASP_DECOP_CB_MAX_NUM_AF_THD;
         
         //pCb->afInitialLag = ASP_DECOP_CB_INIT_LAG_THD;
@@ -550,6 +558,10 @@ Int cbReadStop(
     return ASP_DECOP_CB_SOK;
 }
 
+// debug
+//Int16 gDeltaSampsBuf[20];
+//Int8 gDeltaSampsBufIdx=0;
+
 // Read audio frame from circular buffer
 Int cbReadAf(
     PAF_AST_DecOpCircBufCtl *pCbCtl,    // decoder output circular buffer control
@@ -615,6 +627,11 @@ Int cbReadAf(
         if (pCb->primedFlag == 1)
         {
             pCb->deltaSamps = pCb->deltaSamps - pCb->strFrameLen;
+            
+            // debug
+            //gDeltaSampsBuf[gDeltaSampsBufIdx] = pCb->deltaSamps;
+            //if (gDeltaSampsBufIdx < 20)
+            //    gDeltaSampsBufIdx++;
         }
         
         cbReadMuteWithLastAfInfo(pCb, pAfRd);