PASDK-568:Revert merge from PASDK-514, add Gate & cache inv to CB stream FL read...
authorFrank Livingston <frank-livingston@ti.com>
Fri, 20 Apr 2018 00:16:04 +0000 (19:16 -0500)
committerFrank Livingston <frank-livingston@ti.com>
Fri, 20 Apr 2018 00:16:04 +0000 (19:16 -0500)
pasdk/test_dsp/framework/aspDecOpCircBuf_master.c
pasdk/test_dsp/framework/audioStreamInpProc.c
pasdk/test_dsp/framework/audioStreamOutProc.c

index ca3f92354170a5dd218501f5d3df0c32ee336956..0813dfb38e5af1856a4567916f28ade8eeb68039 100644 (file)
@@ -805,17 +805,28 @@ Int cbReadStrFrameLen(
     Int16 *pStrFrameLen                 // stream frame length
 )
 {
+    IArg key;
+    GateMP_Handle gateHandle;
     PAF_AST_DecOpCircBuf *pCb;
 
-    // CB stream frame length only updated on DSP, 
-    // so no need for GateMP protection 
+    // Get gate handle
+    gateHandle = pCbCtl->gateHandle;
+    // Enter gate
+    key = GateMP_enter(gateHandle);
 
     // Get circular buffer base pointer
     pCb = &((*pCbCtl->pXDecOpCb)[cbIdx]);
 
+    // Invalidate circular buffer configuration
+    Cache_inv(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
+    Cache_wait();
+        
     // Set output frame length
     *pStrFrameLen = pCb->strFrameLen;
 
+    // Leave the gate
+    GateMP_leave(gateHandle, key);
+    
     return ASP_DECOP_CB_SOK;
 }
 
index f03d8907e13ccfbe0f79c216463bf97584c2f3d5..6bad180a2819db6b1d66f734ff8e9cdc118cb9d0 100644 (file)
@@ -1636,7 +1636,7 @@ PAF_ASIT_initPhaseDecOpCircBuf(
     zMS = pAstCfg->masterStr;
 
     // Decode output circular buffer memory
-    if (!(pAstCfg->xDecOpCb = Memory_calloc((IHeap_Handle)HEAP_EXTERNAL_NONCACHED_SHM,
+    if (!(pAstCfg->xDecOpCb = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM,
         DECODEN * sizeof (*pAstCfg->xDecOpCb), 4, &eb)))
     {
         TRACE_TERSE1("PAF_ASIT_initPhaseDecOpCircBuf: AS%d: Memory_calloc failed", as+zMS);
index cfd43a2ed9b3809f17765472f74bed73e0c4888e..2302281b4fcdda81b2b75aca92fedb28477ea900 100644 (file)
@@ -1122,6 +1122,7 @@ static Int PAF_ASOT_initSyncDecInfo1(
     PAF_AST_OutInitSyncCtl *pOutIsCtl;  // Output Init-Sync control
     Int8 decFlag;                       // dec stage flag
     Int status;                         // status code
+    PAF_AST_DecOpCircBufCtl *pCbCtl;    // Decoder output circular buffer control
     
     pAstCfg = pAsotCfg->pAstCfg;
     zMD = pAstCfg->masterDec;
@@ -1142,17 +1143,25 @@ static Int PAF_ASOT_initSyncDecInfo1(
     }
     else
     {
-        zMS = pAstCfg->masterStr;
-        pStrAf = pAstCfg->xStr[zMS].pAudioFrame;
-        
-        // Set ASOT output frame length
-        pDecInfo1Af->sampleCount = gOutFrameLen;    // !!!! GJ: Revisit !!!!
-
 // FL: moved to PAF_ASOT_initSyncDecDecode1()
 // Decode parameters necessary for CB stream FL auto config are known at that time.
 // CB stream FL used to configure Stream AF sample count.
 // ASP chain reset can adjust Stream AF sample count, depending on whether SRC enabled & decimation factor.
 #if 0 
+        // Get pointer to circular buffer control
+        pCbCtl = &pAsotCfg->pAspmCfg->decOpCircBufCtl;
+
+        // Initialize decoder output circular buffer for stream reads
+        cbInitStreamRead(pCbCtl, zMD);
+
+        // Get pointer to stream audio frame
+        zMS = pAstCfg->masterStr;
+        pStrAf = pAstCfg->xStr[zMS].pAudioFrame;
+        
+        // Set ASOT output frame length
+        //pDecInfo1Af->sampleCount = gOutFrameLen;    // !!!! GJ: Revisit !!!!
+        cbReadStrFrameLen(pCbCtl, zMD, &pDecInfo1Af->sampleCount);
+
         // Update Stream Audio Frame.
         // Copy Dec Info1 AF to Stream AF.
         outIsCpyAf(pDecInfo1Af, pStrAf);
@@ -1217,6 +1226,7 @@ static Int PAF_ASOT_initSyncDecDecode1(
     }
     else
     {
+#if 1
         // Get pointer to circular buffer control
         pCbCtl = &pAsotCfg->pAspmCfg->decOpCircBufCtl;
         
@@ -1249,6 +1259,7 @@ static Int PAF_ASOT_initSyncDecDecode1(
         {
             return status;
         }
+#endif
         
         // Find first Output associated with Master Stream
         zO = OUTPUT1;