Update dec status & beta table sharing between ARM & DSP
authorFrank Livingston <frank-livingston@ti.com>
Thu, 1 Sep 2016 16:22:31 +0000 (11:22 -0500)
committerFrank Livingston <frank-livingston@ti.com>
Thu, 1 Sep 2016 16:22:31 +0000 (11:22 -0500)
processor_audio_sdk_1_00_00_00/pasdk/test_arm/framework/audioStreamDecodeProc.c
processor_audio_sdk_1_00_00_00/pasdk/test_arm/framework/itopo/params.c
processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamInpProc.c
processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/itopo/params.c

index ac7fa4b6d4b85ed022032498c5e690b98574a556..ceb9ea9d01277bd699f1b6d93a16e5d333b90747 100644 (file)
@@ -53,12 +53,11 @@ All rights reserved.
 #include "audioStreamProc_params.h"
 #include "audioStreamProc_patchs.h"
 #include "audioStreamProc_config.h"
-#include "paf_decOpCircBuf.h"
 
 #include "common.h"
 #include "aspMsg_common.h"
 #include "aspMsg_slave.h"
-
+#include "paf_decOpCircBuf.h"
 #include "audioStreamProc_common.h"
 #include "audioStreamDecodeProc.h"
 
@@ -249,14 +248,14 @@ Void taskAsdpFxn(
     {
         pP->fxns->memStatusPrint(HEAP_INTERNAL, HEAP_INTERNAL1, HEAP_EXTERNAL, HEAP_INTERNAL1_SHM);
     }
-
+    
     // (***) FL: revisit
     // write back Status structure addresses for Beta Units initialized on Slave
     Cache_wb((Ptr)(&IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]), sizeof(IALG_Status *), Cache_Type_ALLD, 0);
     Cache_wb((Ptr)(&IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]), sizeof(IALG_Status *), Cache_Type_ALLD, 0);
     Cache_wb((Ptr)(&IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM2]), sizeof(IALG_Status *), Cache_Type_ALLD, 0);
-    //Cache_wb((Ptr)(&IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), sizeof(IALG_Status *), Cache_Type_ALLD, 0);
-    //Cache_wb((Ptr)(&IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP2]), sizeof(IALG_Status *), Cache_Type_ALLD, 0);
+    Cache_wb((Ptr)(&IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), sizeof(IALG_Status *), Cache_Type_ALLD, 0);
+    Cache_wb((Ptr)(&IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP2]), sizeof(IALG_Status *), Cache_Type_ALLD, 0);
     Cache_wait();
     
     // (***) FL: revisit
@@ -267,10 +266,10 @@ Void taskAsdpFxn(
     Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]), size, Cache_Type_ALLD, 0);
     size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM2]->size;
     Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM2]), size, Cache_Type_ALLD, 0);
-    //size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]->size;
-    //Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), size, Cache_Type_ALLD, 0);
-    //size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP2]->size;
-    //Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP2]), size, Cache_Type_ALLD, 0);
+    size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]->size;
+    Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), size, Cache_Type_ALLD, 0);
+    size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP2]->size;
+    Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP2]), size, Cache_Type_ALLD, 0);
     Cache_wait();
 
     // (***) FL: revisit
@@ -416,16 +415,21 @@ Void taskAsdpFxn(
                     
                     // (***) FL: revisit
                     // 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);
+                    //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);
                     size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]->size;
                     Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]), size, Cache_Type_ALLD, 0);
+                    size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]->size;
+                    Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), size, Cache_Type_ALLD, 0);
                     Cache_wait();
                     
                     argIdx = 0; // get decIdx
                     z = *(Int32 *)&pAspMsg->buf[argIdx];
                     TRACE_MSG2("slaveCmd=%d, decIdx=%d", slaveCmd, z);
                     
+                    // invalidate Dec configuration
+                    Cache_inv(&gPAF_AST_config.xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+                    
                     if (alg[z]->fxns->algActivate)
                     {
                         alg[z]->fxns->algActivate(alg[z]);
@@ -433,7 +437,13 @@ Void taskAsdpFxn(
 
                     // Start writes to circular buffer
                     pCb = &pC->xDec[z].decOpCb;
-                    cbWriteStart(pCb);
+                    cbErrno = cbWriteStart(pCb);
+                    if (cbErrno < 0)
+                    {
+                        SW_BREAKPOINT;
+                    }
+                    // FL: debug, log circular buffer control variables
+                    cbLog(pCb, 1, "cbWriteStart");
                     // Reset audio frame
                     resetAf(pP, z, sourceSelect);
                     
@@ -467,12 +477,18 @@ Void taskAsdpFxn(
                         errno = dec->fxns->reset(dec, NULL, &pC->xDec[z].decodeControl, &pC->xDec[z].decodeStatus);
                     }
 
+                    // write back Dec configuration
+                    Cache_wb(&gPAF_AST_config.xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+                    Cache_wait();            
+
                     // (***) FL: revisit
                     // 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);
+                    //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);
                     size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]->size;
                     Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]), size, Cache_Type_ALLD, 0);
+                    size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]->size;
+                    Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), size, Cache_Type_ALLD, 0);
                     Cache_wait();
                     
                     // send dec reset complete message to master
@@ -610,7 +626,7 @@ Void taskAsdpFxn(
                         //TRACE_TERSE0("Dec:cbWriteAf() complete");
                         
                         // FL: debug, log circular buffer control variables
-                        cbLog(pCb, 0);
+                        cbLog(pCb, 1, "cbWriteAf");
                     }
                     
                     // write back Dec configuration
@@ -658,7 +674,13 @@ Void taskAsdpFxn(
                     
                     // Stop writes to circular buffer
                     pCb = &pC->xDec[z].decOpCb;
-                    cbWriteStop(pCb);
+                    cbErrno = cbWriteStop(pCb);
+                    if (cbErrno < 0)
+                    {
+                        SW_BREAKPOINT;
+                    }
+                    // FL: debug, log circular buffer control variables
+                    cbLog(pCb, 1, "cbWriteStop");
                     
                     // send dec deactivate complete message to master
                     queId = MessageQ_getReplyQueue(pAspMsg);
@@ -711,7 +733,7 @@ PAF_ASDT_initPhaseMalloc(
     Int zMS = pC->masterStr;
     Error_Block    eb;
 
-    TRACE_TERSE1("PAF_AST_initPhaseMallocSlave: AS%d: initialization phase - memory allocation", as+zMS);
+    TRACE_TERSE1("PAF_ASDT_initPhaseMalloc: AS%d: initialization phase - memory allocation", as+zMS);
 
     // Initialize error block
     Error_init(&eb); 
@@ -719,15 +741,16 @@ PAF_ASDT_initPhaseMalloc(
     if (!(gpDecAudioFrame = (PAF_AudioFrame *)Memory_calloc((IHeap_Handle)HEAP_INTERNAL1,
         DECODEN * sizeof (PAF_AudioFrame), 4, &eb)))
     {
-        TRACE_TERSE1("PAF_AST_initPhaseMallocSlave: AS%d: Memory_calloc failed", as+zMS);
+        TRACE_TERSE1("PAF_ASDT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
         SW_BREAKPOINT;
         return __LINE__;
     }
-    TRACE_TERSE3("PAF_AST_initPhaseMalloc. (gpAudioFrameSlave) %d bytes from space %d at 0x%x.",
+    TRACE_TERSE3("PAF_ASDT_initPhaseMalloc. (gpAudioFrameSlave) %d bytes from space %d at 0x%x.",
             DECODEN * sizeof (PAF_AudioFrame),
             HEAP_ID_INTERNAL1, (IArg)gpDecAudioFrame);
 
-    TRACE_TERSE1("PAF_AST_initPhaseMallocSlave: AS%d: initialization phase - memory allocation complete.", as+zMS);
+    TRACE_TERSE1("PAF_ASDT_initPhaseMalloc: AS%d: initialization phase - memory allocation complete.", as+zMS);
+    TRACE_TERSE1("PAF_ASDT_initPhaseMalloc: AS%d: initialization phase - memory allocation complete.", as+zMS);
     return 0;
 } //PAF_ASDT_initPhaseMalloc
 
@@ -758,11 +781,12 @@ PAF_ASDT_initPhaseConfig(
     // overwrite pointer to audio frame in framework decode control
     for (z=DECODE1; z < DECODEN; z++) 
     {
-        //Int zS = pP->streamsFromDecodes[z]; // FL: slave
-        //pC->xDec[z].decodeControl.pAudioFrame = pC->xStr[zS].pAudioFrame; // FL: slave
-        //pC->xDec[z].decodeInStruct.pAudioFrame = pC->xStr[zS].pAudioFrame; // FL: slave        
+        //Int zS = pP->streamsFromDecodes[z]; // FL: formerly on master
+        //pC->xDec[z].decodeControl.pAudioFrame = pC->xStr[zS].pAudioFrame; FL: formerly on master
+        //pC->xDec[z].decodeInStruct.pAudioFrame = pC->xStr[zS].pAudioFrame; FL: formerly on master
         pC->xDec[z].decodeControl.pAudioFrame = &gpDecAudioFrame[z];
         pC->xDec[z].decodeInStruct.pAudioFrame = &gpDecAudioFrame[z];
+        pC->xDec[z].decodeStatus = *pP->z_pDecodeStatus[z];
         pP->fxns->initFrame0(pP, pQ, pC, z);
     }
 
@@ -916,7 +940,7 @@ PAF_ASDT_initPhaseCommon(
     PAF_IALG_Config pafAlgConfig;
     IALG_MemRec common[3][PAF_IALG_COMMON_MEMN+1];
    
-    TRACE_TERSE0("PAF_AST_initPhaseCommonSlav: initialization phase - Common Algorithms");
+    TRACE_TERSE0("PAF_ASDT_initPhaseCommon: initialization phase - Common Algorithms");
 
     //
     // Determine memory needs and instantiate algorithms across audio streams
@@ -1127,7 +1151,7 @@ PAF_ASDT_initPhaseCommon(
                                    decLinkInit[zD-DECODE1], NULL, common[z], &pafAlgConfig);
             if (!chain) 
             {
-                TRACE_TERSE1("AS%d: Decode chain initialization failed", as+z);
+                TRACE_TERSE1("PAF_ASDT_initPhaseCommon: AS%d: Decode chain initialization failed", as+z);
                 return __LINE__;
             }
         }
@@ -1239,7 +1263,7 @@ PAF_ASDT_initPhaseAlgKey(
 
     (void)as;  // clear warning.
 
-    TRACE_VERBOSE1("PAF_ASDT_initPhaseCommon: AS%d: initialization phase - Algorithm Keys", as);
+    TRACE_VERBOSE1("PAF_ASDT_initPhaseAlgKey: AS%d: initialization phase - Algorithm Keys", as);
 
     for (z=DECODE1; z < DECODEN; z++) 
     {
@@ -1334,7 +1358,7 @@ PAF_ASDT_initFrame0(
     {
         if (!(aBuf = (PAF_AudioData *)Memory_calloc((IHeap_Handle)HEAP_FRMBUF, aLen*aSize, aAlign, &eb)))
         {
-            TRACE_TERSE2("AS%d: %s: MEM_calloc failed", as+z, (IArg)__FUNCTION__);
+            TRACE_TERSE1("PAF_ASDT_initFrame0: AS%d: Memory_calloc failed", as+z);
             TRACE_TERSE2("  maxFrameLength: %d.  aLen*aSize: %d", maxFrameLength, aLen*aSize);
             SW_BREAKPOINT;
             return __LINE__;
index c15516135fb1b534cf6772ea202a0d1c1ce442cc..ceb8118fbf7e8c03ff403da52c3d593bb576eeb3 100644 (file)
@@ -410,7 +410,7 @@ const PAF_DecodeStatus PAF_AST_params_decodeStatus_primary =
    
 };
 #else
-extern const PAF_DecodeStatus PAF_AST_params_decodeStatus_primary;
+//extern const PAF_DecodeStatus PAF_AST_params_decodeStatus_primary;
 #endif
 
 #if 1
@@ -422,7 +422,7 @@ const PAF_DecodeStatus *const PAF_AST_params_decodeStatus[] =
     &PAF_AST_params_decodeStatus_primary,
 };
 #else   
-extern const PAF_DecodeStatus *const PAF_AST_params_decodeStatus[];
+//extern const PAF_DecodeStatus *const PAF_AST_params_decodeStatus[];
 #endif // FL: #if 0
 
 #if 0
index 1d821c97d363f55af0f60ee6047598118e113479..e59942cf1909949c8943a324613b562b32040228 100644 (file)
@@ -60,6 +60,7 @@ All rights reserved.
 #include "paf_heapMgr.h"
 #include "aspMsg_common.h"
 #include "aspMsg_master.h"
+#include "paf_decOpCircBuf.h"
 #include "audioStreamProc_common.h"
 #include "audioStreamInpProc.h"
 
@@ -484,14 +485,14 @@ Void taskAsipFxn(
     Cache_inv((Ptr)(&IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]), sizeof(IALG_Status *), Cache_Type_ALLD, 0);
     Cache_inv((Ptr)(&IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]), sizeof(IALG_Status *), Cache_Type_ALLD, 0);
     Cache_inv((Ptr)(&IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM2]), sizeof(IALG_Status *), Cache_Type_ALLD, 0);
-    //Cache_inv((Ptr)(&IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), sizeof(IALG_Status *), Cache_Type_ALLD, 0);
-    //Cache_inv((Ptr)(&IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP2]), sizeof(IALG_Status *), Cache_Type_ALLD, 0);
+    Cache_inv((Ptr)(&IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), sizeof(IALG_Status *), Cache_Type_ALLD, 0);
+    Cache_inv((Ptr)(&IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP2]), sizeof(IALG_Status *), Cache_Type_ALLD, 0);
     Cache_wait();
     if (!IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]) Log_info0("ERROR: beta unit for Dec==NULL");
     if (!IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]) Log_info0("ERROR: beta unit for Dec==NULL");
     if (!IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM2]) Log_info0("ERROR: beta unit for Dec==NULL");
-    //if (!IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]) Log_info0("ERROR: beta unit for Dec==NULL");
-    //if (!IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP2]) Log_info0("ERROR: beta unit for Dec==NULL");
+    if (!IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]) Log_info0("ERROR: beta unit for Dec==NULL");
+    if (!IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP2]) Log_info0("ERROR: beta unit for Dec==NULL");
     
     // (***) FL: revisit
     // invalidate Status structures for Beta Units initialized on Slave
@@ -504,12 +505,12 @@ Void taskAsipFxn(
     Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM2]), sizeof(Int), Cache_Type_ALLD, 0);
     size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM2]->size;
     Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM2]), size, Cache_Type_ALLD, 0);
-    //Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), sizeof(Int), Cache_Type_ALLD, 0);
-    //size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]->size;
-    //Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), size, Cache_Type_ALLD, 0);
-    //Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP2]), sizeof(Int), Cache_Type_ALLD, 0);
-    //size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP2]->size;
-    //Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP2]), size, Cache_Type_ALLD, 0);
+    Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), sizeof(Int), Cache_Type_ALLD, 0);
+    size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]->size;
+    Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), size, Cache_Type_ALLD, 0);
+    Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP2]), sizeof(Int), Cache_Type_ALLD, 0);
+    size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP2]->size;
+    Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP2]), size, Cache_Type_ALLD, 0);
     Cache_wait();
     
     // (***) FL: revisit
@@ -872,22 +873,22 @@ PAF_ASIT_initPhaseMalloc(
     /* Input memory */
     if (!(pC->xInp = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, INPUTN * sizeof (*pC->xInp), 4, &eb)))
     {
-        TRACE_TERSE1("PAF_AST_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
+        TRACE_TERSE1("PAF_ASIT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
         SW_BREAKPOINT;
         return __LINE__;
     }
-    TRACE_TERSE3("PAF_AST_initPhaseMalloc. (pC->xInp) %d bytes from space %d at 0x%x.",
+    TRACE_TERSE3("PAF_ASIT_initPhaseMalloc. (pC->xInp) %d bytes from space %d at 0x%x.",
             INPUTN * sizeof (*pC->xInp),
             HEAP_ID_INTERNAL1_SHM, (IArg)pC->xInp);
 
     /* Decode memory */
     if (!(pC->xDec = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, DECODEN * sizeof (*pC->xDec), 4, &eb)))
     {
-        TRACE_TERSE1("PAF_AST_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
+        TRACE_TERSE1("PAF_ASIT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
         SW_BREAKPOINT;
         return __LINE__;
     }
-    TRACE_TERSE3("PAF_AST_initPhaseMalloc. (pC->xDec) %d bytes from space %d at 0x%x.",
+    TRACE_TERSE3("PAF_ASIT_initPhaseMalloc. (pC->xDec) %d bytes from space %d at 0x%x.",
             DECODEN * sizeof (*pC->xDec),
             HEAP_ID_INTERNAL1_SHM, (IArg)pC->xDec);
             
@@ -901,7 +902,7 @@ PAF_ASIT_initPhaseMalloc(
             // allocate audio frame circular buffer
             if (!(pC->xDec[z].decOpCb.afCb = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, PAF_DECOP_CB_MAX_NUM_AF * sizeof(PAF_AudioFrame), 4, &eb)))
             {
-                TRACE_TERSE1("PAF_AST_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
+                TRACE_TERSE1("PAF_ASIT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
                 SW_BREAKPOINT;
             }
             // allocate audio frame PCM sample pointer array
@@ -909,25 +910,25 @@ PAF_ASIT_initPhaseMalloc(
             {
                 if (!(pC->xDec[z].decOpCb.afCb[i].data.sample = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, PAF_DECOP_CB_MAX_NUM_PCM_CH * sizeof(PAF_AudioData *), 4, &eb)))
                 {
-                    TRACE_TERSE1("PAF_AST_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
+                    TRACE_TERSE1("PAF_ASIT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
                     SW_BREAKPOINT;
                 }
                 if (!(pC->xDec[z].decOpCb.afCb[i].data.samsiz = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, PAF_DECOP_CB_MAX_NUM_PCM_CH * sizeof(PAF_AudioSize), 4, &eb)))
                 {
-                    TRACE_TERSE1("PAF_AST_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
+                    TRACE_TERSE1("PAF_ASIT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
                     SW_BREAKPOINT;
                 }                
             }
             // allocate PCM sample buffer
             if (!(pC->xDec[z].decOpCb.pcmBuf = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, PAF_DECOP_CB_PCM_BUF_SZ * sizeof(PAF_AudioData), 4, &eb)))
             {
-                TRACE_TERSE1("PAF_AST_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
+                TRACE_TERSE1("PAF_ASIT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
                 SW_BREAKPOINT;
             }
             // allocate Metadata buffers //QIN
             if (!(pC->xDec[z].decOpCb.metaBuf = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, PAF_DECOP_CB_MAX_NUM_AF * PAF_MAX_PRIVATE_MD_SZ * PAF_MAX_NUM_PRIVATE_MD * sizeof(Int8), 4, &eb)))
             {
-                TRACE_TERSE1("PAF_AST_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
+                TRACE_TERSE1("PAF_ASIT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
                 SW_BREAKPOINT;
             }
         }
@@ -981,16 +982,19 @@ PAF_ASIT_initPhaseConfig(
         Int zI = pP->inputsFromDecodes[z];
         pC->xDec[z].decodeControl.size = sizeof(pC->xDec[z].decodeControl);
         pC->xDec[z].decodeControl.pInpBufConfig = (const PAF_InpBufConfig *)&pC->xInp[zI].inpBufConfig;
-        pC->xDec[z].decodeStatus = *pP->z_pDecodeStatus[z];
+        //pC->xDec[z].decodeStatus = *pP->z_pDecodeStatus[z]; // FL: slave
 
-        // Initialize decoder output circular buffer
+        // Initialize decoder output circular buffer for PCM
         // (***) FL: revisit, here PCM is hard-coded for 256 sample dec op frame length        
         pCb = &pC->xDec[z].decOpCb;
-        errno = cbInit(PAF_SOURCE_PCM, 256, FRAMELENGTH, pCb);
+        errno = cbInit(PAF_SOURCE_PCM, 256, FRAMELENGTH, pCb, 1);
         if (errno)
         {
+            SW_BREAKPOINT; // FL: debug
             return errno;
         }
+        // FL: debug
+        cbLog(pCb, 1, "PAF_ASIT_initPhaseConfig:cbInit");
     }
 
     TRACE_TERSE1("PAF_ASIT_initPhaseConfig: AS%d: initialization phase - configuration complete.", as+zMS);
@@ -1032,7 +1036,7 @@ PAF_ASIT_initPhaseAcpAlg(
 
     if (!(acp = (ACP_Handle )ACP_MDS_create(NULL))) 
     {
-        TRACE_TERSE1("PAF_AST_initPhaseAcpAlg: AS%d: ACP algorithm instance creation failed", as+zMS);
+        TRACE_TERSE1("PAF_ASIT_initPhaseAcpAlg: AS%d: ACP algorithm instance creation failed", as+zMS);
         return __LINE__;
     }
     pC->acp = acp;
@@ -1178,10 +1182,10 @@ PAF_ASIT_initPhaseCommon(
         // patch, and not needed for FS11, since there is only one input.
         if (INPUT1 <= z && z < INPUTN) 
         {
-            TRACE_TERSE2("AS%d: PAF_ASIT_initPhaseCommon: alloc inpLinkInit common[%d]", as+z, z);
+            TRACE_TERSE2("PAF_ASIT_initPhaseCommon: AS%d: alloc inpLinkInit common[%d]", as+z, z);
             if (PAF_ALG_ALLOC(inpLinkInit[z-INPUT1], common[z]))
             {
-                TRACE_TERSE1("PAF_AST_initPhaseMalloc: AS%d: PAF_ALG_alloc failed", as+z);
+                TRACE_TERSE1("PAF_ASIT_initPhaseCommon: AS%d: PAF_ALG_alloc failed", as+z);
                 TRACE_TERSE2("failed to alloc %d bytes from space %d", common[z]->size, (IArg)common[z]->space);
                 SW_BREAKPOINT;
                 return __LINE__;
@@ -1222,7 +1226,7 @@ PAF_ASIT_initPhaseCommon(
         TRACE_TERSE0("PAF_ASIT_initPhaseCommon: calling PAF_ALG_mallocMemory for common space.");
         if (PAF_ALG_mallocMemory(common[z], &pafAlgConfig)) 
         {
-            TRACE_TERSE1("AS%d: PAF_ALG_mallocMemory failed", as+z);
+            TRACE_TERSE1("PAF_ASIT_initPhaseCommon: AS%d: PAF_ALG_mallocMemory failed", as+z);
             TRACE_TERSE3("AS%d: z: %d.  Size 0x%x", as+z, z, common[z][0].size);
             SW_BREAKPOINT;
             return __LINE__;
@@ -1257,7 +1261,7 @@ PAF_ASIT_initPhaseCommon(
                 decLinkInit[zD-DECODE1], NULL, common[z], &pafAlgConfig);
             if (!chain) 
             {
-                TRACE_TERSE1("AS%d: Decode chain initialization failed", as+z);
+                TRACE_TERSE1("PAF_ASIT_initPhaseCommon: AS%d: Decode chain initialization failed", as+z);
                 return __LINE__;
             }
         }
@@ -1269,19 +1273,19 @@ PAF_ASIT_initPhaseCommon(
         if (INPUT1 <= z && z < INPUTN) 
         {
             PAF_ASP_Chain *chain;
-            TRACE_TERSE2("PAF_AST_initPhaseMalloc: AS%d: non-common input chain init for %d",
+            TRACE_TERSE2("PAF_ASIT_initPhaseCommon: AS%d: non-common input chain init for %d",
                            as+z, z);
             chain = PAF_ASP_chainInit(&pC->xInp[z].inpChainData, pP->pChainFxns,
                         HEAP_EXTERNAL, as+z, acp, &trace,
                         inpLinkInit[z-INPUT1], NULL, common[z], &pafAlgConfig);
             if (!chain) 
             {
-                TRACE_TERSE1("AS%d: Input chain initialization failed", as+z);
+                TRACE_TERSE1("PAF_ASIT_initPhaseCommon: AS%d: Input chain initialization failed", as+z);
                 return __LINE__;
             }
         }
     }
-    TRACE_TERSE1("AS%d: PAF_ASIT_initPhaseCommon: Returning complete.", as+z);
+    TRACE_TERSE1("PAF_ASIT_initPhaseCommon: AS%d: Returning complete.", as+z);
 
     return 0;
 } //PAF_ASIT_initPhaseCommon
@@ -1710,13 +1714,13 @@ PAF_ASIT_autoProcessing(
     Int zMI = pP->zone.master;
     Int zMS = pC->masterStr;
 
-    TRACE_VERBOSE1("PAF_AST_autoProcessing: AS%d: PAF_AST_autoProcessing", as+zMS);
+    TRACE_VERBOSE1("PAF_ASIT_autoProcessing: AS%d: PAF_AST_autoProcessing", as+zMS);
 
     if (errno = SIO_ctrl (pC->xInp[zMI].hRxSio,
                           PAF_SIO_CONTROL_SET_SOURCESELECT,
                           DECSIOMAP (pC->xDec[zMD].decodeStatus.sourceSelect)))
     {
-        TRACE_VERBOSE2("PAF_AST_autoProcessing: AS%d: source select returns 0x%x", as+zMS, errno);
+        TRACE_VERBOSE2("PAF_ASIT_autoProcessing: AS%d: source select returns 0x%x", as+zMS, errno);
         return errno;
     }
     //frameLength = pP->fxns->computeFrameLength (pcmAlgMaster, FRAMELENGTH,
@@ -1726,7 +1730,7 @@ PAF_ASIT_autoProcessing(
     if (errno = SIO_ctrl (pC->xInp[zMI].hRxSio,
                           PAF_SIO_CONTROL_SET_PCMFRAMELENGTH, frameLength))
     {
-        TRACE_VERBOSE2("PAF_AST_autoProcessing: SET_PCMFRAMELENGTH returns 0x%x, returning ASPERR_AUTO_LENGTH, 0x%x",
+        TRACE_VERBOSE2("PAF_ASIT_autoProcessing: SET_PCMFRAMELENGTH returns 0x%x, returning ASPERR_AUTO_LENGTH, 0x%x",
             errno, ASPERR_AUTO_LENGTH);
         return ASPERR_AUTO_LENGTH;
     }
@@ -1735,12 +1739,12 @@ PAF_ASIT_autoProcessing(
                            &pC->xInp[zMI].inpBufConfig, sizeof (pC->xInp[zMI].inpBufConfig),
                            PAF_SIO_REQUEST_SYNC))
     {
-        TRACE_VERBOSE2("PAF_AST_autoProcessing: REQUEST_SYNC returns 0x%x, returning ASPERR_ISSUE, 0x%x",
+        TRACE_VERBOSE2("PAF_ASIT_autoProcessing: REQUEST_SYNC returns 0x%x, returning ASPERR_ISSUE, 0x%x",
             errno, ASPERR_ISSUE);
         return ASPERR_ISSUE;
     }
 
-    TRACE_VERBOSE1("PAF_AST_autoProcessing: AS%d: awaiting sync", as+zMS);
+    TRACE_VERBOSE1("PAF_ASIT_autoProcessing: AS%d: awaiting sync", as+zMS);
 
     // all of the sync scan work is done in this call. If the error returned
     // is DIBERR_SYNC then that just means we didn't find a sync, not a real I/O
@@ -1748,7 +1752,7 @@ PAF_ASIT_autoProcessing(
     nbytes = SIO_reclaim (pC->xInp[zMI].hRxSio, (Ptr)&pC->xInp[zMI].pInpBuf, NULL);
     if (nbytes == -DIBERR_SYNC)
     {
-        TRACE_TERSE2("PAF_AST_autoProcessing: AS%d: SIO_reclaim returned 0x%x, ignoring", as+zMS, nbytes);
+        TRACE_TERSE2("PAF_ASIT_autoProcessing: AS%d: SIO_reclaim returned 0x%x, ignoring", as+zMS, nbytes);
         return 0;
     }
     if (nbytes != sizeof (PAF_InpBufConfig))
@@ -1759,7 +1763,7 @@ PAF_ASIT_autoProcessing(
     }
     if (errno)
     {
-        TRACE_TERSE2("PAF_AST_autoProcessing: AS%d: returning errno 0x%x", as+zMS, errno);
+        TRACE_TERSE2("PAF_ASIT_autoProcessing: AS%d: returning errno 0x%x", as+zMS, errno);
     }
     return errno;
 } //PAF_ASIT_autoProcessing
@@ -1866,13 +1870,13 @@ PAF_ASIT_decodeProcessing(
     state = INIT;
     errno = 0; /* error number */
 
-    TRACE_TERSE1("PAF_AST_decodeProcessing: sourceSelect is %d", pC->xDec[zMD].decodeStatus.sourceSelect);
+    TRACE_TERSE1("PAF_ASIT_decodeProcessing: sourceSelect is %d", pC->xDec[zMD].decodeStatus.sourceSelect);
 
     for (;;) 
     {
         if (pC->xDec[zMD].decodeStatus.sourceSelect == PAF_SOURCE_NONE)
         {
-            TRACE_VERBOSE0("PAF_AST_decodeProcessing: sourceSelect == PAF_SOURCE_NONE");
+            TRACE_VERBOSE0("PAF_ASIT_decodeProcessing: sourceSelect == PAF_SOURCE_NONE");
             state = QUIT;
         }
 
@@ -1884,11 +1888,11 @@ PAF_ASIT_decodeProcessing(
                 if (getVal == ASPERR_QUIT)
                 {
                     state = QUIT;
-                    TRACE_VERBOSE0("PAF_AST_decodeProcessing. %d: state = QUIT");
+                    TRACE_VERBOSE0("PAF_ASIT_decodeProcessing. %d: state = QUIT");
                 }
                 else if (getVal == ASPERR_ABORT)
                 {
-                    TRACE_VERBOSE0("PAF_AST_decodeProcessing. %d: return getVal");
+                    TRACE_VERBOSE0("PAF_ASIT_decodeProcessing. %d: return getVal");
                     return getVal;
                 }
                 else
@@ -1896,7 +1900,7 @@ PAF_ASIT_decodeProcessing(
                     /* ignore */;
                 }
             }
-            TRACE_VERBOSE0("PAF_AST_decodeProcessing: state == INIT");
+            TRACE_VERBOSE0("PAF_ASIT_decodeProcessing: state == INIT");
         }
 
         TRACE_TIME((&TIME_MOD,         "... + %d = %d ->", dtime(), TSK_time()));
@@ -1910,37 +1914,39 @@ PAF_ASIT_decodeProcessing(
                 Log_info0("TaskAsip: state=INIT");
 
                 // (***) FL: revisit
-#if 0 // status for shared beta units can change (e.g. at-boot or alpha)
+#if 1 // 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);
+                //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);
                 size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]->size;
                 Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]), size, Cache_Type_ALLD, 0);
                 size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]->size;
                 Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), size, Cache_Type_ALLD, 0);
                 Cache_wait();
-#endif                
-                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);
+#endif
+#if 0
+                //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;
                 Cache_wbInv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]), size, Cache_Type_ALLD, 0);
-                //size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]->size;
-                //Cache_wbInv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), size, Cache_Type_ALLD, 0);
+                size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]->size;
+                Cache_wbInv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), size, Cache_Type_ALLD, 0);
                 Cache_wait();                
+#endif                
                 
                 //if (errno = pP->fxns->decodeInit (pP, pQ, pC, alg))
                 //if (errno = pP->fxns->decodeInit(pP, pQ, pC, alg, sourceSelect))
                 if (errno = pP->fxns->decodeInit(pP, pQ, pC, sourceSelect))
                 {
-                    TRACE_VERBOSE1("AF_AST_decodeProcessing: INIT, errno 0x%x.  break after decodeInit", errno);
+                    TRACE_VERBOSE1("PAF_ASIT_decodeProcessing: INIT, errno 0x%x.  break after decodeInit", errno);
                     break;
                 }
                 
-#if 0
-                    // (***) FL: revisit
+#if 1
+                // (***) FL: revisit
                 // 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);
+                //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);
                 size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]->size;
                 Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]), size, Cache_Type_ALLD, 0);
                 size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]->size;
@@ -1951,7 +1957,7 @@ PAF_ASIT_decodeProcessing(
                 frame = 0;
                 block = 0;
 
-                TRACE_VERBOSE0("AF_AST_decodeProcessing: state: INIT->INFO1");
+                TRACE_VERBOSE0("PAF_ASIT_decodeProcessing: state: INIT->INFO1");
                 state = INFO1;
                 continue;
 
@@ -1998,30 +2004,30 @@ PAF_ASIT_decodeProcessing(
                         Int zI = pP->inputsFromDecodes[z];
                         if (pC->xInp[zI].hRxSio && pC->xDec[z].decodeStatus.mode)
                         {
-                            TRACE_VERBOSE0("TaskAsip: PAF_AST_decodeProcessing: INFO1, SIO_issue");
+                            TRACE_VERBOSE0("TaskAsip: PAF_ASIT_decodeProcessing: INFO1, SIO_issue");
                             if (SIO_issue (pC->xInp[zI].hRxSio, &pC->xInp[zI].inpBufConfig,
                                 sizeof (pC->xInp[zI].inpBufConfig), PAF_SIO_REQUEST_NEWFRAME))
                             {
-                                TRACE_TERSE0("PAF_AST_decodeProcessing. %d: INFO1, return (ASPERR_ISSUE)");
+                                TRACE_TERSE0("PAF_ASIT_decodeProcessing. %d: INFO1, return (ASPERR_ISSUE)");
                                 return (ASPERR_ISSUE);
                             }
                         }
                     }
-                    TRACE_VERBOSE1("PAF_AST_decodeProcessing: INFO1: frame %d, not major access unit", frame);
+                    TRACE_VERBOSE1("PAF_ASIT_decodeProcessing: INFO1: frame %d, not major access unit", frame);
                     frame++;
                     state = INFO1;
                     continue;
                 }
-                TRACE_VERBOSE1("PAF_AST_decodeProcessing: INFO1: frame %d, major access unit found", frame);
+                TRACE_VERBOSE1("PAF_ASIT_decodeProcessing: INFO1: frame %d, major access unit found", frame);
 
                 // Establish secondary timing
                 if (errno = pP->fxns->decodeInfo1(pP, pQ, pC, frame, block))
                 {
-                    TRACE_VERBOSE1("PAF_AST_decodeProcessing: INFO1, errno 0x%x.  break after decodeInfo1", errno);
+                    TRACE_VERBOSE1("PAF_ASIT_decodeProcessing: INFO1, errno 0x%x.  break after decodeInfo1", errno);
                     break;
                 }
 
-                TRACE_VERBOSE0("PAF_AST_decodeProcessing: state: INFO1->DECODE");
+                TRACE_VERBOSE0("PAF_ASIT_decodeProcessing: state: INFO1->DECODE");
                 state = DECODE;
                 continue;
 
@@ -2045,7 +2051,7 @@ PAF_ASIT_decodeProcessing(
                 // Establish primary timing
                 if (errno = pP->fxns->decodeInfo(pP, pQ, pC, frame, block))
                 {
-                    TRACE_TERSE1("PAF_AST_decodeProcessing: INFO2 break on decodeInfo. errno 0x%x", errno);
+                    TRACE_TERSE1("PAF_ASIT_decodeProcessing: INFO2 break on decodeInfo. errno 0x%x", errno);
                     break;
                 }
 
@@ -2058,11 +2064,11 @@ PAF_ASIT_decodeProcessing(
                 
                 if (errno = pP->fxns->decodeInfo2(pP, pQ, pC, frame, block))
                 {
-                    TRACE_TERSE1("PAF_AST_decodeProcessing. %d: INFO2 break on decodeInfo2. errno 0x%x", errno);
+                    TRACE_TERSE1("PAF_ASIT_decodeProcessing. %d: INFO2 break on decodeInfo2. errno 0x%x", errno);
                     break;
                 }
 
-                TRACE_VERBOSE0("PAF_AST_decodeProcessing: state: INFO2->DECODE");
+                TRACE_VERBOSE0("PAF_ASIT_decodeProcessing: state: INFO2->DECODE");
                 state = DECODE;
                 continue;
 
@@ -2079,7 +2085,7 @@ PAF_ASIT_decodeProcessing(
             
                 if (errno = pP->fxns->decodeDecode(pP, pQ, pC, sourceSelect, frame, block))
                 {
-                    TRACE_TERSE1("PAF_AST_decodeProcessing: state: DECODE.  decodeDecode err 0x%04x", errno);
+                    TRACE_TERSE1("PAF_ASIT_decodeProcessing: state: DECODE.  decodeDecode err 0x%04x", errno);
                     break;
                 }
       
@@ -2090,7 +2096,7 @@ PAF_ASIT_decodeProcessing(
                 Cache_wait();                                            
 #endif                
                 
-                TRACE_VERBOSE0("PAF_AST_decodeProcessing: state: DECODE->FINAL");
+                TRACE_VERBOSE0("PAF_ASIT_decodeProcessing: state: DECODE->FINAL");
                 state = FINAL;
                 continue;
 
@@ -2106,7 +2112,7 @@ PAF_ASIT_decodeProcessing(
                 }
 
                 frame++;
-                TRACE_VERBOSE0("PAF_AST_decodeProcessing: state: FINAL->AGAIN");
+                TRACE_VERBOSE0("PAF_ASIT_decodeProcessing: state: FINAL->AGAIN");
                 state = INFO2;
                 continue;
 
@@ -2117,7 +2123,7 @@ PAF_ASIT_decodeProcessing(
                 // Quit:
                 // - Set error number registers.
                 // - Exit state machine to "decode complete" processing.
-                TRACE_VERBOSE0("PAF_AST_decodeProcessing: state: QUIT");
+                TRACE_VERBOSE0("PAF_ASIT_decodeProcessing: state: QUIT");
                 errno = ASPERR_QUIT;
                 break;
 
@@ -2127,13 +2133,13 @@ PAF_ASIT_decodeProcessing(
                 // - Set error number registers.
                 // - Exit state machine to "decode complete" processing.
 
-                TRACE_TERSE1("PAF_AST_decodeProcessing: state: unknown, 0x%x", state);
+                TRACE_TERSE1("PAF_ASIT_decodeProcessing: state: unknown, 0x%x", state);
                 errno = ASPERR_UNKNOWNSTATE;
                 break;
 
         }  // End of switch (state).
 
-        TRACE_VERBOSE0("PAF_AST_decodeProcessing: Calling decode complete");
+        TRACE_VERBOSE0("PAF_ASIT_decodeProcessing: Calling decode complete");
         if (pP->fxns->decodeComplete(pP, pQ, pC, alg, frame, block))
         {
             /* ignored? */;
@@ -2181,11 +2187,11 @@ PAF_ASIT_decodeCommand(
                     pC->xDec[z].decodeStatus.command2 |= 0x80;
                     break;
                 case 1: // command abort - leave now
-                    TRACE_TERSE2("AS%d: PAF_AST_decodeCommand: decode command abort (0x%02x)", as+zS, 1);
+                    TRACE_TERSE2("AS%d: PAF_ASIT_decodeCommand: decode command abort (0x%02x)", as+zS, 1);
                     pC->xDec[z].decodeStatus.command2 |= 0x80;
                     return (ASPERR_ABORT);
                 case 2: // command restart - leave later
-                    TRACE_TERSE2("AS%d: PAF_AST_decodeCommand: decode command quit (0x%02x)", as+zS, 2);
+                    TRACE_TERSE2("AS%d: PAF_ASIT_decodeCommand: decode command quit (0x%02x)", as+zS, 2);
                     pC->xDec[z].decodeStatus.command2 |= 0x80;
                     return (ASPERR_QUIT);
                 default: // command unknown - ignore
@@ -2249,8 +2255,12 @@ PAF_ASIT_decodeInit(
         {
             Uns gear;
             Int frameLength;
-            TRACE_VERBOSE1("AS%d: PAF_AST_decodeInit: initializing decode", as+zS);
+            TRACE_VERBOSE1("AS%d: PAF_ASIT_decodeInit: initializing decode", as+zS);
 
+            // write back Dec configuration
+            Cache_wb(&gPAF_AST_config.xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+            Cache_wait();
+            
             // FL: send dec activate message to slave
             pAspMsg = (ASP_Msg *)MessageQ_alloc(hAspMsgMaster->heapId, hAspMsgMaster->msgSize);  /* allocate message */
             if (pAspMsg == NULL)
@@ -2303,11 +2313,6 @@ PAF_ASIT_decodeInit(
                 decAlg[z]->fxns->algActivate (decAlg[z]);
 #endif
 
-            // (***) FL: revisit
-            // write back Dec configuration
-            Cache_wb(&gPAF_AST_config.xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
-            Cache_wait();
-
             // FL: send dec reset message to slave
             pAspMsg = (ASP_Msg *)MessageQ_alloc(hAspMsgMaster->heapId, hAspMsgMaster->msgSize);  /* allocate message */
             if (pAspMsg == NULL)
@@ -2378,7 +2383,6 @@ PAF_ASIT_decodeInit(
                 return errno;
 #endif
             
-            pC->xDec[z].decodeStatus.aspGearControl = 0;//QIN,  aspGearControl seems un-initialized
             gear = pC->xDec[z].decodeStatus.aspGearControl;
             pC->xDec[z].decodeStatus.aspGearStatus = gear < GEARS ? gear : 0;
             
@@ -2415,20 +2419,16 @@ PAF_ASIT_decodeInit(
             //pC->xDec[z].decodeControl.pafFrameLength = FRAMELENGTH;
             //pC->xDec[z].decodeControl.rdSampleCount = 0;
 
-            // Start decoder output circular buffer writes
+            // Initialize decoder output circular buffer for selected source
             pCb = &pC->xDec[z].decOpCb;
-            errno = cbInit(sourceSelect, frameLength, FRAMELENGTH, pCb);
-            if (errno)
-            {
-                return errno;
-            }
-                       errno = cbReadWriteRestore(pCb); //QIN
+            errno = cbInit(sourceSelect, frameLength, FRAMELENGTH, pCb, 0);
             if (errno)
             {
+                SW_BREAKPOINT; // FL: debug
                 return errno;
             }
             // FL: debug
-            cbLog(pCb, 1);
+            cbLog(pCb, 1, "PAF_ASIT_decodeInit:cbInit");
             
             if (z != zMD) 
             {
@@ -2835,7 +2835,7 @@ PAF_AST_decodeCont (const PAF_AST_Params *pP, const PAF_AST_Patchs *pQ, PAF_AST_
             || ! pC->xInp[zI].hRxSio
             || ! pC->xDec[z].decodeStatus.mode)
             continue;
-        TRACE_VERBOSE2("as1-f2: PAF_AST_decodeCont: AS%d: awaiting frame %d -- data", as+zS, frame);
+        TRACE_VERBOSE2("PAF_AST_decodeCont: AS%d: awaiting frame %d -- data", as+zS, frame);
         if (SIO_reclaim (pC->xInp[zI].hRxSio, (Ptr)&pC->xInp[zI].pInpBuf, NULL)
             != sizeof (pC->xInp[zI].inpBufConfig))
             return (ASPERR_RECLAIM);
@@ -2898,9 +2898,9 @@ PAF_ASIT_decodeDecode(
         (void)zS; // clear compiler warning in case not used with tracing disabled
         if (pC->xInp[zI].hRxSio && pC->xDec[z].decodeStatus.mode)
         {
-            TRACE_GEN2("AS%d: decodeDecode: processing block %d -- decode", as+zS, block);
+            TRACE_GEN2("PAF_ASIT_decodeDecode: AS%d: decodeDecode: processing block %d -- decode", as+zS, block);
 
-            TRACE_VERBOSE3("as1-f2: AS%d: decodeDecode: decoding from 0x%x (base) 0x%x (ptr)",
+            TRACE_VERBOSE3("PAF_ASIT_decodeDecode: AS%d: decodeDecode: decoding from 0x%x (base) 0x%x (ptr)",
                     as+zS,
                     (IArg)pC->xInp[z].pInpBuf->base.pVoid,
                     (IArg)pC->xInp[z].pInpBuf->head.pVoid);
@@ -3179,7 +3179,7 @@ PAF_ASIT_decodeComplete(
         Int zI = pP->inputsFromDecodes[z];
         if (pC->xInp[zI].hRxSio && pC->xDec[z].decodeStatus.mode) 
         {
-            TRACE_VERBOSE1("PAF_AST_decodeComplete: AS%d: finalizing decode", as+z);
+            TRACE_VERBOSE1("PAF_ASIT_decodeComplete: AS%d: finalizing decode", as+z);
 #ifdef PAF_ASP_FINAL
             if (dec->fxns->final)
                 dec->fxns->final(dec, NULL, &pC->xDec[z].decodeControl,
@@ -3235,6 +3235,7 @@ PAF_ASIT_decodeComplete(
                 decAlg[z]->fxns->algDeactivate (decAlg[z]);
 #endif
 
+#if 0
             // Stop decoder output circular buffer writes
             pCb = &pC->xDec[z].decOpCb;
             errno = cbWriteStop(pCb);
@@ -3242,10 +3243,11 @@ PAF_ASIT_decodeComplete(
             {
                 return errno;
             }
+#endif            
         }
         else 
         {
-            TRACE_VERBOSE1("PAF_AST_decodeComplete: AS%d: processing decode <ignored>", as+z);
+            TRACE_VERBOSE1("PAF_ASIT_decodeComplete: AS%d: processing decode <ignored>", as+z);
         }
     }
     return 0;
index 1ae09ee422383a8c6dd5ce3e6beca78ea05f14f2..5ee78d99c0531118cad2f6d1ae1bde4628645a7f 100644 (file)
@@ -262,6 +262,7 @@ const PAF_InpBufStatus PAF_AST_params_inpBufStatus =
     0, 0                                                    // reserved
 };
 
+#if 0 // FL: slave
 const PAF_DecodeStatus PAF_AST_params_decodeStatus_primary =
 {
     sizeof (PAF_DecodeStatus),                              // size
@@ -378,6 +379,8 @@ const PAF_DecodeStatus *const PAF_AST_params_decodeStatus[] =
 {
     &PAF_AST_params_decodeStatus_primary,
 };
+#endif // #if 0
+
 const PAF_OutBufStatus PAF_AST_params_outBufStatus =
 {
     sizeof (PAF_OutBufStatus),                              // size
@@ -829,7 +832,7 @@ const PAF_AST_Params asip_params_PAi =
     &PAF_AST_params_audioFrameFunctions,                    // pAudioFrameFunctions
     &PAF_ASP_chainFxns,                                     // pChainFxns
     &PAF_AST_params_inpBufStatus,                           // pInpBufStatus
-    PAF_AST_params_decodeStatus,                            // z_pDecodeStatus
+    NULL, //PAF_AST_params_decodeStatus,                            // z_pDecodeStatus
     &PAF_AST_params_outBufStatus,                           // pOutBufStatus
     PAF_AST_params_encodeStatus,                            // z_pEncodeStatus
     &PAF_AST_params_volumeStatus,                           // pVolumeStatus
@@ -892,7 +895,7 @@ const PAF_AST_Params asop_params_PAi =
     &PAF_AST_params_audioFrameFunctions,                    // pAudioFrameFunctions
     &PAF_ASP_chainFxns,                                     // pChainFxns
     &PAF_AST_params_inpBufStatus,                           // pInpBufStatus
-    PAF_AST_params_decodeStatus,                            // z_pDecodeStatus
+    NULL, //PAF_AST_params_decodeStatus,                            // z_pDecodeStatus
     &PAF_AST_params_outBufStatus,                           // pOutBufStatus
     PAF_AST_params_encodeStatus,                            // z_pEncodeStatus
     &PAF_AST_params_volumeStatus,                           // pVolumeStatus