]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blobdiff - processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamInpProc.c
Add 1 16-bit word for EDMA padding for Input Driver
[processor-sdk/performance-audio-sr.git] / processor_audio_sdk_1_00_00_00 / pasdk / test_dsp / framework / audioStreamInpProc.c
index e59942cf1909949c8943a324613b562b32040228..f8085b8e909543cf23d99bedfd12d2dc44ad4348 100644 (file)
@@ -60,8 +60,9 @@ All rights reserved.
 #include "paf_heapMgr.h"
 #include "aspMsg_common.h"
 #include "aspMsg_master.h"
-#include "paf_decOpCircBuf.h"
+#include "aspDecOpCircBuf_master.h"
 #include "audioStreamProc_common.h"
+#include "audioStreamProc_master.h"
 #include "audioStreamInpProc.h"
 
 // FL: porting
@@ -238,6 +239,7 @@ All rights reserved.
 #include "audioStreamProc_params.h"
 #include "audioStreamProc_patchs.h"
 #include "audioStreamProc_config.h"
+#include "audioStreamInpProc.h"
 
 //
 // Audio Stream Definitions
@@ -247,10 +249,6 @@ All rights reserved.
 #define MINFRAMELENGTH 24
 #define PA_MODULO       8   // also defined independently in ARC2 code, and may be hard coded other places.
 
-#if 0 // (***) FL: no longer used w/ removal of CONTINUOUS mode
-Int PAF_AST_decodeHandleErrorInput (const PAF_AST_Params *pP, const PAF_AST_Patchs *pQ, PAF_AST_Config *pC, ALG_Handle decAlg[], Int z, Int error);
-#endif
-
 
 //
 // Decoder Definitions
@@ -289,6 +287,14 @@ Int PAF_AST_decodeHandleErrorInput (const PAF_AST_Params *pP, const PAF_AST_Patc
 LINNO_DEFN(TaskAsip); /* Line number macros */
 ERRNO_DEFN(TaskAsip); /* Error number macros */
 
+// ASIT configuration
+#pragma DATA_SECTION(gPAF_ASIT_config, ".globalSectionPafAsitConfig")
+PAF_ASIT_Config gPAF_ASIT_config = {
+    NULL,               // acp
+    &gPAF_ASPM_config,  // pAspmCfg, shared ASIT/ASOT configuration
+    &gPAF_AST_config    // pAstCfg, shared ASIT/ASOT/ASDT configuration
+};
+
 // Global debug counters */
 UInt32 gTaskAsipCnt=0; // debug
 UInt32 gAsipInitCnt     =0;
@@ -311,14 +317,12 @@ extern struct {
  */
 Void taskAsipFxn(
 //    Int betaPrimeValue, // FL: revisit
-    const PAF_AST_Params *pP,
-    const PAF_AST_Patchs *pQ
+    const PAF_ASIT_Params *pP,
+    const PAF_ASIT_Patchs *pQ
 )
 {
-    // Task data
-    //PAF_AST_Config PAF_AST_config;  /* Local configuration */
-    //PAF_AST_Config *pC;             /* Local configuration pointer */
-    // Local data
+    PAF_ASIT_Config *pC;            /* Local configuration pointer */
+    PAF_AST_Config *pAstCfg;        /* Common (shared) configuration pointer */
     Int as;                         /* Audio Stream Number (1, 2, etc.) */
     Int z;                          /* input/encode/stream/decode/output counter */
     Int i;                          /* phase */
@@ -338,32 +342,34 @@ Void taskAsipFxn(
     simStart();
 #endif // SIMULATE_SIO
 
-    //
-    // Audio Framework Configuration (*pC):
-    //
-    pC = &gPAF_AST_config;
-
-    TRACE_TERSE1("TaskAsip: Started with betaPrimeValue=%d.", gBetaPrimeValue);
-    as = gBetaPrimeValue + 1;        /* Audio Stream Number (1, 2, etc.) */    
-    pC->as = as;    
-
     //
     // Audio Framework Parameters & Patch (*pP, *pQ)
     //
     if (!pP) 
     {
-        TRACE_TERSE1("TaskAsip: AS%d: No Parameters defined. Exiting.", as);
+        TRACE_TERSE0("TaskAsip: No Parameters defined. Exiting.");
         LINNO_RPRT(TaskAsip, -1);
         return;
     }
 
     if (!pQ)
     {
-        TRACE_TERSE1("TaskAsip: AS%d: No Patchs defined. Exiting.", as);
+        TRACE_TERSE0("TaskAsip: No Patchs defined. Exiting.");
         LINNO_RPRT(TaskAsip, -1);
         return;
     }    
     
+    //
+    // Audio Framework Configuration (*pC):
+    //
+    pC = &gPAF_ASIT_config;
+    pAstCfg = pC->pAstCfg;
+
+    /* Set Audio Stream Number (1, 2, etc.) */
+    as = gBetaPrimeValue + 1;
+    pAstCfg->as = as;    
+    TRACE_TERSE1("TaskAsip: Started with AS%d.", as);
+
     //
     // Initialize message log trace and line number reporting
     //
@@ -377,19 +383,19 @@ Void taskAsipFxn(
     // Determine decoder and stream indices associated with the master input
     //
     zMI = pP->zone.master;
-    pC->masterDec = zMI;
-    pC->masterStr = zMI;
+    pAstCfg->masterDec = zMI;
+    pAstCfg->masterStr = zMI;
     for (zX = DECODE1; zX < DECODEN; zX++)
     {
         if (pP->inputsFromDecodes[zX] == zMI)
         {
-            pC->masterDec = zX;
-            pC->masterStr = pP->streamsFromDecodes[zX];
+            pAstCfg->masterDec = zX;
+            pAstCfg->masterStr = pP->streamsFromDecodes[zX];
             break;
         }
     }
-    zMD = pC->masterDec;
-    zMS = pC->masterStr;
+    zMD = pAstCfg->masterDec;
+    zMS = pAstCfg->masterStr;
 
     // Initialize as per parametrized phases:
     //
@@ -400,7 +406,7 @@ Void taskAsipFxn(
     //      - Common: Common Memory Initialization
     //      - AlgKey: Dec/Enc chain to Array Initialization
     //      - Device: I/O Device Initialization
-    //      - Unused: (available)
+    //      - DecOpCircBuf: Decoder Output Circular Buffer
     //      - Unused: (available)
     //
     LINNO_RPRT(TaskAsip, -2);
@@ -432,14 +438,15 @@ Void taskAsipFxn(
     }
     
     // (***) FL: revisit
-    // write back configuration
-    Cache_wb(&gPAF_AST_config, sizeof(PAF_AST_Config), Cache_Type_ALLD, 0);
-    Cache_wb(&pC, sizeof(PAF_AST_Config *), Cache_Type_ALLD, 0);
+    // write back AST shared configuration
+    Cache_wb(pAstCfg, sizeof(PAF_AST_Config), Cache_Type_ALLD, 0);
+    // FL: no need to share this pointer, can be local
+    //Cache_wb(&pC, sizeof(PAF_AST_Config *), Cache_Type_ALLD, 0);
     Cache_wait();
 
     // (***) FL: revisit
-    // write Dec configuration
-    Cache_wb(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+    // write back Dec configuration
+    Cache_wb(&pAstCfg->xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
     Cache_wait();
 
     // (***) FL: revisit
@@ -561,9 +568,9 @@ Void taskAsipFxn(
         {
             for (z=INPUT1; z < INPUTN; z++)
             {
-                if (pC->xInp[z].hRxSio)
+                if (pAstCfg->xInp[z].hRxSio)
                 {
-                    SIO_idle(pC->xInp[z].hRxSio);
+                    SIO_idle(pAstCfg->xInp[z].hRxSio);
                 }
             }
         
@@ -588,40 +595,40 @@ Void taskAsipFxn(
 
         // if no master input selected then we don't know what may be at the input
         // so set to unknown and skip any remaining processing
-        if (!pC->xInp[zMI].hRxSio)
+        if (!pAstCfg->xInp[zMI].hRxSio)
         {
-            pC->xDec[zMD].decodeStatus.sourceProgram = PAF_SOURCE_UNKNOWN;
+            pAstCfg->xDec[zMD].decodeStatus.sourceProgram = PAF_SOURCE_UNKNOWN;
             TRACE_VERBOSE1("TaskAsip: AS%d: No input selected...", as+zMS);
             continue;
         }
         
         // if here then we have a valid input so query its status
-        if (errno = pP->fxns->updateInputStatus(pC->xInp[zMI].hRxSio, &pC->xInp[zMI].inpBufStatus, &pC->xInp[zMI].inpBufConfig))
+        if (errno = pP->fxns->updateInputStatus(pAstCfg->xInp[zMI].hRxSio, &pAstCfg->xInp[zMI].inpBufStatus, &pAstCfg->xInp[zMI].inpBufConfig))
         {
             TRACE_VERBOSE1("TaskAsip: continue as updateInputStatus returns 0x%x", errno);
             continue;
         }
         
         // If master decoder is not enabled, or the input is unlocked, then do nothing
-        if (!pC->xDec[zMD].decodeStatus.mode || !pC->xInp[zMI].inpBufStatus.lock)
+        if (!pAstCfg->xDec[zMD].decodeStatus.mode || !pAstCfg->xInp[zMI].inpBufStatus.lock)
         {
             TRACE_VERBOSE0("TaskAsip: Not locked, continue");
             continue;
         }
         
         // If no source selected then do nothing
-        if (pC->xDec[zMD].decodeStatus.sourceSelect == PAF_SOURCE_NONE) 
+        if (pAstCfg->xDec[zMD].decodeStatus.sourceSelect == PAF_SOURCE_NONE) 
         {
-            pC->xDec[zMD].decodeStatus.sourceProgram = PAF_SOURCE_NONE;
+            pAstCfg->xDec[zMD].decodeStatus.sourceProgram = PAF_SOURCE_NONE;
             TRACE_VERBOSE1("TaskAsip: AS%d: no source selected, continue", as+zMS);
             continue;
         }
 
         // If we want pass processing then proceed directly
-        if (pC->xDec[zMD].decodeStatus.sourceSelect == PAF_SOURCE_PASS) 
+        if (pAstCfg->xDec[zMD].decodeStatus.sourceSelect == PAF_SOURCE_PASS) 
         {
             TRACE_VERBOSE1("TaskAsip: AS%d: Pass processing ...", as+zMS);
-            pC->xDec[zMD].decodeStatus.sourceProgram = PAF_SOURCE_PASS;
+            pAstCfg->xDec[zMD].decodeStatus.sourceProgram = PAF_SOURCE_PASS;
             pP->fxns->sourceDecode(pP, pQ, pC, PAF_SOURCE_PASS);
             if (pP->fxns->passProcessing)
             {
@@ -641,20 +648,20 @@ Void taskAsipFxn(
         // If no decoder selected then do nothing. Need to reset the sourceProgram, since
         // when no decoder is selected there are no calls to IB
         //if (errno = pP->fxns->autoProcessing(pP, pQ, pC, pC->xDec[zMD].decodeStatus.sourceSelect, pC->xDec[zMD].decAlg[PAF_SOURCE_PCM]))
-        if (errno = pP->fxns->autoProcessing(pP, pQ, pC, pC->xDec[zMD].decodeStatus.sourceSelect, NULL)) // (***) FL: hard-coded to use PCM framelength inside function
+        if (errno = pP->fxns->autoProcessing(pP, pQ, pC, pAstCfg->xDec[zMD].decodeStatus.sourceSelect, NULL)) // (***) FL: re-visit this, hard-coded to use PCM framelength inside function
         {
             TRACE_VERBOSE1("TaskAsip: autoProcessing returns 0x%x, continue", errno);
             continue;
         }
         
         // query for input type
-        if (errno = SIO_ctrl(pC->xInp[zMI].hRxSio, PAF_SIO_CONTROL_GET_SOURCEPROGRAM, (Arg )&sourceProgram))
+        if (errno = SIO_ctrl(pAstCfg->xInp[zMI].hRxSio, PAF_SIO_CONTROL_GET_SOURCEPROGRAM, (Arg )&sourceProgram))
         {
             TRACE_TERSE2("TaskAsip: SIO_ctrl returns 0x%x, then 0x%x, continue", errno, ASPERR_AUTO_PROGRAM);
             errno = ASPERR_AUTO_PROGRAM;
             continue;
         }
-        pC->xDec[zMD].decodeStatus.sourceProgram = sourceProgram;
+        pAstCfg->xDec[zMD].decodeStatus.sourceProgram = sourceProgram;
 
         // if input is unclassifiable then do nothing
         if (sourceProgram == PAF_SOURCE_UNKNOWN)
@@ -667,7 +674,7 @@ Void taskAsipFxn(
         // input frame, we determine whether or not to call decodeProcessing and with
         // what decAlg.
         sourceSelect = PAF_SOURCE_NONE;
-        switch (pC->xDec[zMD].decodeStatus.sourceSelect) 
+        switch (pAstCfg->xDec[zMD].decodeStatus.sourceSelect) 
         {
             // If autodetecting, decoding everything, and input is something
             // (i.e. bitstream or PCM) then decode.
@@ -713,7 +720,7 @@ Void taskAsipFxn(
             // If user made specific selection then program must match select.
             // (NB: this compare relies on ordering of PAF_SOURCE)
             default:
-                sourceSelect = pC->xDec[zMD].decodeStatus.sourceSelect;
+                sourceSelect = pAstCfg->xDec[zMD].decodeStatus.sourceSelect;
                 if ((sourceSelect >= PAF_SOURCE_PCM) && (sourceSelect <= PAF_SOURCE_N))
                 {
                     if (sourceProgram != sourceSelect)
@@ -782,9 +789,6 @@ Void taskAsipFxn(
         TRACE_VERBOSE1(procName[sourceProgram], as+zMS);
 
         TRACE_VERBOSE0("TaskAsip: calling decodeProcessing.");
-        //errno = pP->fxns->decodeProcessing(pP, pQ, pC, pC->xDec[zMD].decAlg[sourceSelect]);
-        //errno = pP->fxns->decodeProcessing(pP, pQ, pC, NULL); // (***) FL: dec handle doesn't exist on Master (DSP)
-        //errno = pP->fxns->decodeProcessing(pP, pQ, pC, NULL, sourceSelect);
         errno = pP->fxns->decodeProcessing(pP, pQ, pC, sourceSelect);
         if (errno) 
         {
@@ -855,85 +859,49 @@ Void taskAsipFxn(
 //
 Int
 PAF_ASIT_initPhaseMalloc(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC
+    const PAF_ASIT_Params *pP, 
+    const PAF_ASIT_Patchs *pQ, 
+    PAF_ASIT_Config *pC
 )
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
-    Int zMS = pC->masterStr;
+    PAF_AST_Config *pAstCfg;
+    Int as;                    /* Audio Stream Number (1, 2, etc.) */
+    Int zMS;
     Error_Block    eb;
-    Int i;
 
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
+    zMS = pAstCfg->masterStr;
+    
     TRACE_TERSE1("PAF_ASIT_initPhaseMalloc: AS%d: initialization phase - memory allocation", as+zMS);
 
     // Initialize error block
     Error_init(&eb); 
 
     /* Input memory */
-    if (!(pC->xInp = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, INPUTN * sizeof (*pC->xInp), 4, &eb)))
+    if (!(pAstCfg->xInp = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, 
+        INPUTN * sizeof (*pAstCfg->xInp), 4, &eb)))
     {
         TRACE_TERSE1("PAF_ASIT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
         SW_BREAKPOINT;
         return __LINE__;
     }
     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);
+        INPUTN * sizeof (*pAstCfg->xInp),
+        HEAP_ID_INTERNAL1_SHM, (IArg)pAstCfg->xInp);
 
     /* Decode memory */
-    if (!(pC->xDec = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, DECODEN * sizeof (*pC->xDec), 4, &eb)))
+    if (!(pAstCfg->xDec = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, 
+        DECODEN * sizeof (*pAstCfg->xDec), 4, &eb)))
     {
         TRACE_TERSE1("PAF_ASIT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
         SW_BREAKPOINT;
         return __LINE__;
     }
     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);
-            
-    {   
-        // FL: added for decode output circular buffer
-        // FL: (***)revisit
-        Int z; /* decode counter */
-        
-        for (z=DECODE1; z < DECODEN; z++)
-        {
-            // 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_ASIT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
-                SW_BREAKPOINT;
-            }
-            // allocate audio frame PCM sample pointer array
-            for (i = 0; i<PAF_DECOP_CB_MAX_NUM_AF; i++)
-            {
-                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_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_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_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_ASIT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
-                SW_BREAKPOINT;
-            }
-        }
-    }
-    
+        DECODEN * sizeof (*pAstCfg->xDec),
+        HEAP_ID_INTERNAL1_SHM, (IArg)pAstCfg->xDec);
+                
     TRACE_TERSE1("PAF_ASIT_initPhaseMalloc: AS%d: initialization phase - memory allocation complete.", as+zMS);
     return 0;
 } //PAF_ASIT_initPhaseMalloc
@@ -954,17 +922,20 @@ PAF_ASIT_initPhaseMalloc(
 //
 Int
 PAF_ASIT_initPhaseConfig(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC
+    const PAF_ASIT_Params *pP, 
+    const PAF_ASIT_Patchs *pQ, 
+    PAF_ASIT_Config *pC
 )
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
-    Int z;                              /* input/encode/stream/decode/output counter */
-    Int zMS = pC->masterStr;
-    Int errno;                          /* error number */
-    PAF_DecodeOpCircBuf *pCb;           /* Decoder output circular buffer */
-
+    PAF_AST_Config *pAstCfg;
+    Int as;                    /* Audio Stream Number (1, 2, etc.) */
+    Int z;                     /* input/encode/stream/decode/output counter */
+    Int zMS;
+
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
+    zMS = pAstCfg->masterStr;
+    
     TRACE_TERSE1("PAF_ASIT_initPhaseConfig: AS%d: initialization phase - configuration", as+zMS);
 
     //
@@ -973,28 +944,16 @@ PAF_ASIT_initPhaseConfig(
     
     for (z=INPUT1; z < INPUTN; z++) 
     {
-        pC->xInp[z].inpBufStatus = *pP->pInpBufStatus;
-        pC->xInp[z].inpBufConfig.pBufStatus = &pC->xInp[z].inpBufStatus;
+        pAstCfg->xInp[z].inpBufStatus = *pP->pInpBufStatus;
+        pAstCfg->xInp[z].inpBufConfig.pBufStatus = &pAstCfg->xInp[z].inpBufStatus;
     }
 
     for (z=DECODE1; z < DECODEN; z++) 
     {
         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;
+        pAstCfg->xDec[z].decodeControl.size = sizeof(pAstCfg->xDec[z].decodeControl);
+        pAstCfg->xDec[z].decodeControl.pInpBufConfig = (const PAF_InpBufConfig *)&pAstCfg->xInp[zI].inpBufConfig;
         //pC->xDec[z].decodeStatus = *pP->z_pDecodeStatus[z]; // FL: slave
-
-        // 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, 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);
@@ -1018,23 +977,28 @@ PAF_ASIT_initPhaseConfig(
 //
 Int
 PAF_ASIT_initPhaseAcpAlg(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC
+    const PAF_ASIT_Params *pP, 
+    const PAF_ASIT_Patchs *pQ, 
+    PAF_ASIT_Config *pC
 )
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
-    Int z;                              /* input/encode/stream/decode/output counter */
+    PAF_AST_Config *pAstCfg;
+    Int as;                 /* Audio Stream Number (1, 2, etc.) */
+    Int z;                  /* input/encode/stream/decode/output counter */
     Int betaPrimeOffset;
     ACP_Handle acp;
-    Int zMS = pC->masterStr;
+    Int zMS;
     Int zS, zX;
 
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
+    zMS = pAstCfg->masterStr;
+    
     TRACE_TERSE1("PAF_ASIT_initPhaseAcpAlg: AS%d: initialization phase - ACP Algorithm", as+zMS);
 
     ACP_MDS_init();
 
-    if (!(acp = (ACP_Handle )ACP_MDS_create(NULL))) 
+    if (!(acp = (ACP_Handle)ACP_MDS_create(NULL))) 
     {
         TRACE_TERSE1("PAF_ASIT_initPhaseAcpAlg: AS%d: ACP algorithm instance creation failed", as+zMS);
         return __LINE__;
@@ -1057,21 +1021,10 @@ PAF_ASIT_initPhaseAcpAlg(
         }
         acp->fxns->attach(acp, ACP_SERIES_STD,
             STD_BETA_IB + betaPrimeOffset * (as-1+zS),
-            (IALG_Status *)&pC->xInp[z].inpBufStatus);
+            (IALG_Status *)&pAstCfg->xInp[z].inpBufStatus);
         /* Ignore errors, not reported. */
     }
 
-#if 0 // FL: slave
-    for (z=DECODE1; z < DECODEN; z++) 
-    {
-        zS = pP->streamsFromDecodes[z];
-        acp->fxns->attach(acp, ACP_SERIES_STD,
-            STD_BETA_DECODE + betaPrimeOffset * (as-1+zS),
-            (IALG_Status *)&pC->xDec[z].decodeStatus);
-        /* Ignore errors, not reported. */
-    }
-#endif
-
     TRACE_TERSE1("PAF_ASIT_initPhaseAcpAlg: AS%d: initialization phase - ACP Algorithm complete.", as+zMS);
 
     return 0;
@@ -1097,18 +1050,22 @@ PAF_ASIT_initPhaseAcpAlg(
 //
 Int
 PAF_ASIT_initPhaseCommon(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC
+    const PAF_ASIT_Params *pP, 
+    const PAF_ASIT_Patchs *pQ, 
+    PAF_ASIT_Config *pC
 )
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
-    Int z;                              /* stream counter */
-    //Int g;                              /* gear */
-    ACP_Handle acp = pC->acp;
+    PAF_AST_Config *pAstCfg;
+    Int as;                     /* Audio Stream Number (1, 2, etc.) */
+    Int z;                      /* stream counter */
+    ACP_Handle acp;
     PAF_IALG_Config pafAlgConfig;
     IALG_MemRec common[3][PAF_IALG_COMMON_MEMN+1];
    
+    acp = pC->acp;
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
+    
     TRACE_TERSE0("PAF_ASIT_initPhaseCommon: initialization phase - Common Memory");
 
     //
@@ -1129,8 +1086,6 @@ PAF_ASIT_initPhaseCommon(
 
     for (z = STREAM1; z < STREAMN; z++) 
     {
-        //Int zD, zE, zX;
-
         TRACE_TERSE1("PAF_ASIT_initPhaseCommon: AS%d: initialization phase - Common Memory", as+z);
 
         //
@@ -1141,38 +1096,6 @@ PAF_ASIT_initPhaseCommon(
         //
         PAF_ALG_init(common[z], lengthof(common[z]), COMMONSPACE);
 
-#if 0 // FL: slave
-        zD = -1;
-        for (zX = DECODE1; zX < DECODEN; zX++) 
-        {
-            if (pP->streamsFromDecodes[zX] == z) 
-            {
-                zD = zX;
-                break;
-            }
-        }
-#endif
-
-#if 0 // FL: slave
-        if (zD >= 0) 
-        {
-            TRACE_TERSE3("%s.%d: calling PAF_ALG_ALLOC for decoder common[%d].", (IArg)__FUNCTION__, __LINE__, z);
-            if (PAF_ALG_ALLOC(decLinkInit[zD-DECODE1], common[z])) 
-            {
-                TRACE_TERSE3("AS%d: %s.%d: PAF_ALG_alloc failed", as+z, (IArg)__FUNCTION__, __LINE__);
-                TRACE_TERSE2("Failed to alloc %d bytes from space %d", common[z]->size, common[z]->space);
-        
-                SW_BREAKPOINT;
-                return __LINE__;
-            }
-            TRACE_TERSE3("alloced %d bytes from space %d at 0x%x", common[z]->size, common[z]->space, (IArg)common[z]->base);
-            if (pP->fxns->allocPrint)
-            {
-                pP->fxns->allocPrint ((const PAF_ALG_AllocInit *)(decLinkInit[z-DECODE1]),sizeof (*(decLinkInit[z-DECODE1])), &pafAlgConfig);                
-            }
-        }
-#endif
-
         //
         // Determine common memory needs of Logical Input driver
         //
@@ -1221,8 +1144,6 @@ PAF_ASIT_initPhaseCommon(
     //
     for (z = STREAM1; z < STREAMN; z++) 
     {
-        //Int zD, zE, zX;
-
         TRACE_TERSE0("PAF_ASIT_initPhaseCommon: calling PAF_ALG_mallocMemory for common space.");
         if (PAF_ALG_mallocMemory(common[z], &pafAlgConfig)) 
         {
@@ -1239,34 +1160,6 @@ PAF_ASIT_initPhaseCommon(
             pP->fxns->commonPrint(common[z], &pafAlgConfig);
         }
 
-#if 0 // FL: slave
-        zD = -1;
-        for (zX = DECODE1; zX < DECODEN; zX++) 
-        {
-            if (pP->streamsFromDecodes[zX] == z) 
-            {
-                zD = zX;
-                break;
-            }
-        }
-#endif
-
-#if 0 // FL: slave
-        if (zD >= 0) 
-        {
-            PAF_ASP_Chain *chain;
-            TRACE_TERSE2("PAF_ASIT_initPhaseCommon: calling PAF_ASP_chainInit for decode.");
-            chain = PAF_ASP_chainInit(&pC->xDec[zD].decChainData, pP->pChainFxns,
-                HEAP_INTERNAL, as+z, acp, &trace,
-                decLinkInit[zD-DECODE1], NULL, common[z], &pafAlgConfig);
-            if (!chain) 
-            {
-                TRACE_TERSE1("PAF_ASIT_initPhaseCommon: AS%d: Decode chain initialization failed", as+z);
-                return __LINE__;
-            }
-        }
-#endif
-
         //
         // Allocate non-common memories for Logical IO drivers
         //    Since these structures are used at run-time we allocate from external memory
@@ -1275,7 +1168,7 @@ PAF_ASIT_initPhaseCommon(
             PAF_ASP_Chain *chain;
             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,
+            chain = PAF_ASP_chainInit(&pAstCfg->xInp[z].inpChainData, pP->pChainFxns,
                         HEAP_EXTERNAL, as+z, acp, &trace,
                         inpLinkInit[z-INPUT1], NULL, common[z], &pafAlgConfig);
             if (!chain) 
@@ -1290,6 +1183,7 @@ PAF_ASIT_initPhaseCommon(
     return 0;
 } //PAF_ASIT_initPhaseCommon
 
+// (***) FL: candidate for removal
 // -----------------------------------------------------------------------------
 // ASIT Initialization Function - Algorithm Keys
 //
@@ -1306,18 +1200,17 @@ PAF_ASIT_initPhaseCommon(
 // .............................................................................
 Int
 PAF_ASIT_initPhaseAlgKey(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC
+    const PAF_ASIT_Params *pP, 
+    const PAF_ASIT_Patchs *pQ, 
+    PAF_ASIT_Config *pC
 )
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
-#if 0
-    Int z;                              /* decode/encode counter */
-    Int s;                              /* key number */
-    PAF_ASP_Link *that;
-#endif
+    PAF_AST_Config *pAstCfg;
+    Int as;                    /* Audio Stream Number (1, 2, etc.) */
 
+    
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
     (void)as;  // clear compiler warning in case not used with tracing disabled
 
     TRACE_VERBOSE1("PAF_ASIT_initPhaseAlgKey: AS%d: initialization phase - Algorithm Keys", as);
@@ -1360,22 +1253,26 @@ PAF_ASIT_initPhaseAlgKey(
 //
 Int
 PAF_ASIT_initPhaseDevice(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC
+    const PAF_ASIT_Params *pP, 
+    const PAF_ASIT_Patchs *pQ, 
+    PAF_ASIT_Config *pC
 )
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
+    PAF_AST_Config *pAstCfg;
+    Int as;                             /* Audio Stream Number (1, 2, etc.) */
     Int z;                              /* input/output counter */
     PAF_SIO_IALG_Obj    *pObj;
     PAF_SIO_IALG_Config *pAlgConfig;
     PAF_IALG_Config pafAlgConfig;
 
+
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
     (void)as; // clear compiler warning in case not used with tracing disabled
 
     TRACE_TERSE1("PAF_ASIT_initPhaseDevice: AS%d: initialization phase - I/O Devices", as);
 
-    if(pP->fxns->bufMemPrint)
+    if (pP->fxns->bufMemPrint)
     {
         PAF_ALG_setup (&pafAlgConfig, 
             HEAP_ID_INTERNAL,       HEAP_INTERNAL, 
@@ -1388,12 +1285,12 @@ PAF_ASIT_initPhaseDevice(
 
     for (z=INPUT1; z < INPUTN; z++) 
     {
-        PAF_InpBufConfig *pConfig = &pC->xInp[z].inpBufConfig;
+        PAF_InpBufConfig *pConfig = &pAstCfg->xInp[z].inpBufConfig;
 
-        pObj = (PAF_SIO_IALG_Obj *)pC->xInp[z].inpChainData.head->alg;
+        pObj = (PAF_SIO_IALG_Obj *)pAstCfg->xInp[z].inpChainData.head->alg;
         pAlgConfig = &pObj->config;
 
-        pC->xInp[z].hRxSio = NULL;
+        pAstCfg->xInp[z].hRxSio = NULL;
 
         pConfig->base.pVoid       = pAlgConfig->pMemRec[0].base;
         pConfig->pntr.pVoid       = pAlgConfig->pMemRec[0].base;
@@ -1403,16 +1300,115 @@ PAF_ASIT_initPhaseDevice(
         pConfig->sizeofElement    = 2;
         pConfig->precision        = 16;
 
-        if(pP->fxns->bufMemPrint)
+        if (pP->fxns->bufMemPrint)
         {
-            pP->fxns->bufMemPrint(z,pAlgConfig->pMemRec[0].size,PAF_ALG_memSpaceToHeapId(&pafAlgConfig,pAlgConfig->pMemRec[0].space),0);            
+            pP->fxns->bufMemPrint(z, pAlgConfig->pMemRec[0].size, PAF_ALG_memSpaceToHeapId(&pafAlgConfig,pAlgConfig->pMemRec[0].space), 0);
         }
     }
+
     TRACE_TERSE1("PAF_ASIT_initPhaseDevice: AS%d: initialization phase - I/O Devices complete.", as);
 
     return 0;
 } //PAF_ASIT_initPhaseDevice
 
+// -----------------------------------------------------------------------------
+// ASIT Initialization Function - Decoder Output Circular Buffer
+//
+//   Name:      PAF_ASIT_initPhaseDecOpCircBuf
+//   Purpose:   Audio Stream Input Task Function for initialization of Decoder Output Circular Buffer.
+//   From:      audioStream1Task or equivalent
+//   Uses:      See code.
+//   States:    x
+//   Return:    0 on success.
+//              Source code line number on device allocation failure.
+//   Trace:     Message Log "trace" in Debug Project Configuration reports:
+//              * State information as per parent.
+//              * Memory allocation errors.
+//
+Int
+PAF_ASIT_initPhaseDecOpCircBuf(
+    const PAF_ASIT_Params *pP, 
+    const PAF_ASIT_Patchs *pQ, 
+    PAF_ASIT_Config *pC
+)
+{
+    PAF_AST_Config *pAstCfg;
+    PAF_AST_DecOpCircBuf *pCb;          /* Decoder output circular buffer */
+    Int as;                             /* Audio Stream Number (1, 2, etc.) */
+    Int zMS;
+    Int z;                              /* decode counter */
+    Int errno;                          /* error number */
+    Error_Block    eb;
+    Int i;
+
+    // FL: (***)revisit
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
+    zMS = pAstCfg->masterStr;
+
+    /* Decode output circular buffer memory */
+    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);
+        SW_BREAKPOINT;
+        return __LINE__;
+    }
+    TRACE_TERSE3("PAF_ASIT_initPhaseDecOpCircBuf. (pC->xDecOpCb) %d bytes from space %d at 0x%x.",
+        DECODEN * sizeof (*pAstCfg->xDecOpCb),
+        HEAP_ID_INTERNAL1_SHM, (IArg)pAstCfg->xDecOpCb);
+        
+    for (z=DECODE1; z < DECODEN; z++)
+    {
+        pCb = &pAstCfg->xDecOpCb[z];
+        
+        // allocate audio frame circular buffer
+        if (!(pCb->afCb = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, ASP_DECOP_CB_MAX_NUM_AF * sizeof(PAF_AudioFrame), 4, &eb)))
+        {
+            TRACE_TERSE1("PAF_ASIT_initPhaseDecOpCircBuf: AS%d: Memory_calloc failed", as+zMS);
+            SW_BREAKPOINT;
+        }
+        // allocate audio frame PCM sample pointer array
+        for (i = 0; i<ASP_DECOP_CB_MAX_NUM_AF; i++)
+        {
+            if (!(pCb->afCb[i].data.sample = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, ASP_DECOP_CB_MAX_NUM_PCM_CH * sizeof(PAF_AudioData *), 4, &eb)))
+            {
+                TRACE_TERSE1("PAF_ASIT_initPhaseDecOpCircBuf: AS%d: Memory_calloc failed", as+zMS);
+                SW_BREAKPOINT;
+            }
+            if (!(pCb->afCb[i].data.samsiz = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, ASP_DECOP_CB_MAX_NUM_PCM_CH * sizeof(PAF_AudioSize), 4, &eb)))
+            {
+                TRACE_TERSE1("PAF_ASIT_initPhaseDecOpCircBuf: AS%d: Memory_calloc failed", as+zMS);
+                SW_BREAKPOINT;
+            }                
+        }
+        // allocate PCM sample buffer
+        if (!(pCb->pcmBuf = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, ASP_DECOP_CB_PCM_BUF_SZ * sizeof(PAF_AudioData), 4, &eb)))
+        {
+            TRACE_TERSE1("PAF_ASIT_initPhaseDecOpCircBuf: AS%d: Memory_calloc failed", as+zMS);
+            SW_BREAKPOINT;
+        }
+        // allocate Metadata buffers //QIN
+        if (!(pCb->metaBuf = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, ASP_DECOP_CB_MAX_NUM_AF * PAF_MAX_PRIVATE_MD_SZ * PAF_MAX_NUM_PRIVATE_MD * sizeof(Int8), 4, &eb)))
+        {
+            TRACE_TERSE1("PAF_ASIT_initPhaseDecOpCircBuf: AS%d: Memory_calloc failed", as+zMS);
+            SW_BREAKPOINT;
+        }
+        
+        // (***) FL: revisit, here PCM is hard-coded for 256 sample dec op frame length        
+        // Initialize decoder output circular buffer for PCM
+        errno = cbInit(pCb);
+        if (errno)
+        {
+            SW_BREAKPOINT; // FL: debug
+            return errno;
+        }
+    }
+
+    return 0;
+} //PAF_ASIT_initPhaseDecOpCircBuf
+
+
 #if 0
 // -----------------------------------------------------------------------------
 // AST Processing Function - Pass-Through Processing
@@ -1435,7 +1431,7 @@ PAF_ASIT_initPhaseDevice(
 /* and CODE_SECTION/clink constructs facilitate this omission.  */
 
 Int
-PAF_AST_passProcessing (const PAF_AST_Params *pP, const PAF_AST_Patchs *pQ, PAF_AST_Config *pC, Int hack)
+PAF_AST_passProcessing(const PAF_AST_Params *pP, const PAF_AST_Patchs *pQ, PAF_AST_Config *pC, Int hack)
 {
     Int z;                              /* input/output counter */
     Int errno = 0;                      /* error number */
@@ -1603,7 +1599,7 @@ PAF_AST_passProcessing (const PAF_AST_Params *pP, const PAF_AST_Patchs *pQ, PAF_
     return errno;
 
 } //PAF_AST_passProcessing
-#endif
+#endif // #if 0
 
 #if 0
 // -----------------------------------------------------------------------------
@@ -1678,7 +1674,7 @@ PAF_AST_passProcessingCopy (const PAF_AST_Params *pP, const PAF_AST_Patchs *pQ,
 
     return 0;
 } //PAF_AST_passProcessingCopy
-#endif
+#endif // #if 0
 
 // -----------------------------------------------------------------------------
 // ASIT Processing Function - Auto Processing
@@ -1699,26 +1695,33 @@ PAF_AST_passProcessingCopy (const PAF_AST_Params *pP, const PAF_AST_Patchs *pQ,
 
 Int
 PAF_ASIT_autoProcessing(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC, 
+    const PAF_ASIT_Params *pP, 
+    const PAF_ASIT_Patchs *pQ, 
+    PAF_ASIT_Config *pC, 
     Int inputTypeSelect, 
     ALG_Handle pcmAlgMaster
 )
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
-    Int errno = 0;                      /* error number */
+    PAF_AST_Config *pAstCfg;
+    Int as;                 /* Audio Stream Number (1, 2, etc.) */
+    Int errno = 0;          /* error number */
     Int nbytes;
     Int frameLength;
-    Int zMD = pC->masterDec;
-    Int zMI = pP->zone.master;
-    Int zMS = pC->masterStr;
-
+    Int zMD;
+    Int zMI;
+    Int zMS;
+    
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
+    zMD = pAstCfg->masterDec;
+    zMS = pAstCfg->masterStr;    
+    zMI = pP->zone.master;    
+    
     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)))
+    if (errno = SIO_ctrl(pAstCfg->xInp[zMI].hRxSio,
+                         PAF_SIO_CONTROL_SET_SOURCESELECT,
+                         DECSIOMAP(pAstCfg->xDec[zMD].decodeStatus.sourceSelect)))
     {
         TRACE_VERBOSE2("PAF_ASIT_autoProcessing: AS%d: source select returns 0x%x", as+zMS, errno);
         return errno;
@@ -1727,17 +1730,17 @@ PAF_ASIT_autoProcessing(
     //                                            pC->xDec[zMD].decodeStatus.bufferRatio);
     frameLength = FRAMELENGTH; // FL: fix PCM frameLength for alpha release.
 
-    if (errno = SIO_ctrl (pC->xInp[zMI].hRxSio,
-                          PAF_SIO_CONTROL_SET_PCMFRAMELENGTH, frameLength))
+    if (errno = SIO_ctrl(pAstCfg->xInp[zMI].hRxSio,
+                         PAF_SIO_CONTROL_SET_PCMFRAMELENGTH, frameLength))
     {
         TRACE_VERBOSE2("PAF_ASIT_autoProcessing: SET_PCMFRAMELENGTH returns 0x%x, returning ASPERR_AUTO_LENGTH, 0x%x",
             errno, ASPERR_AUTO_LENGTH);
         return ASPERR_AUTO_LENGTH;
     }
 
-    if (errno = SIO_issue (pC->xInp[zMI].hRxSio,
-                           &pC->xInp[zMI].inpBufConfig, sizeof (pC->xInp[zMI].inpBufConfig),
-                           PAF_SIO_REQUEST_SYNC))
+    if (errno = SIO_issue(pAstCfg->xInp[zMI].hRxSio,
+                          &pAstCfg->xInp[zMI].inpBufConfig, sizeof(pAstCfg->xInp[zMI].inpBufConfig),
+                          PAF_SIO_REQUEST_SYNC))
     {
         TRACE_VERBOSE2("PAF_ASIT_autoProcessing: REQUEST_SYNC returns 0x%x, returning ASPERR_ISSUE, 0x%x",
             errno, ASPERR_ISSUE);
@@ -1749,16 +1752,16 @@ PAF_ASIT_autoProcessing(
     // 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
     // error so we mask it off.
-    nbytes = SIO_reclaim (pC->xInp[zMI].hRxSio, (Ptr)&pC->xInp[zMI].pInpBuf, NULL);
+    nbytes = SIO_reclaim(pAstCfg->xInp[zMI].hRxSio, (Ptr)&pAstCfg->xInp[zMI].pInpBuf, NULL);
     if (nbytes == -DIBERR_SYNC)
     {
         TRACE_TERSE2("PAF_ASIT_autoProcessing: AS%d: SIO_reclaim returned 0x%x, ignoring", as+zMS, nbytes);
         return 0;
     }
-    if (nbytes != sizeof (PAF_InpBufConfig))
+    if (nbytes != sizeof(PAF_InpBufConfig))
     {
-        TRACE_TERSE3("PAF_AST_autoProcessing. SIO_reclaim returned %d, not %d, returning ASPERR_RECLAIM (0x%x)",
-                     nbytes, sizeof (PAF_InpBufConfig), ASPERR_RECLAIM);
+        TRACE_TERSE3("PAF_ASIT_autoProcessing. SIO_reclaim returned %d, not %d, returning ASPERR_RECLAIM (0x%x)",
+            nbytes, sizeof(PAF_InpBufConfig), ASPERR_RECLAIM);
         return ASPERR_RECLAIM;
     }
     if (errno)
@@ -1839,28 +1842,35 @@ PAF_ASIT_autoProcessing(
 //         -> *?* must catch ASPERR_ISSUE from (zMI) SIO_issue()
 Int
 PAF_ASIT_decodeProcessing(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC, 
+    const PAF_ASIT_Params *pP, 
+    const PAF_ASIT_Patchs *pQ, 
+    PAF_ASIT_Config *pC, 
     Int sourceSelect
 )
 {
+    PAF_AST_Config *pAstCfg;
     //Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
     Int z;                              /* decode counter */
     Int errno;                          /* error number */
     Int getVal;
     enum { INIT, INFO1, INFO2, DECODE, FINAL, QUIT } state;
     ALG_Handle alg[DECODEN_MAX];
-    Int zMD = pC->masterDec;
-    Int zMS = pC->masterStr;
+    Int zMD;
+    Int zMS;
     Int size;
     //PAF_InpBufConfig *pIpBufConfig;
     Int frame; // decoder input frame count
     Int block; // (***) FL: formerly  -- decoder output block count / input frame
 
-
+    
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    zMD = pAstCfg->masterDec;
+    zMS = pAstCfg->masterStr;
+        
     for (z=DECODE1; z < DECODEN; z++)
-        alg[z] = pC->xDec[z].decAlg[PAF_SOURCE_PCM];
+    {
+        alg[z] = pAstCfg->xDec[z].decAlg[PAF_SOURCE_PCM];        
+    }
     alg[zMD] = NULL; // decAlgMaster; // FL: alg[] init is on slave
 
     //
@@ -1870,11 +1880,11 @@ PAF_ASIT_decodeProcessing(
     state = INIT;
     errno = 0; /* error number */
 
-    TRACE_TERSE1("PAF_ASIT_decodeProcessing: sourceSelect is %d", pC->xDec[zMD].decodeStatus.sourceSelect);
+    TRACE_TERSE1("PAF_ASIT_decodeProcessing: sourceSelect is %d", pAstCfg->xDec[zMD].decodeStatus.sourceSelect);
 
     for (;;) 
     {
-        if (pC->xDec[zMD].decodeStatus.sourceSelect == PAF_SOURCE_NONE)
+        if (pAstCfg->xDec[zMD].decodeStatus.sourceSelect == PAF_SOURCE_NONE)
         {
             TRACE_VERBOSE0("PAF_ASIT_decodeProcessing: sourceSelect == PAF_SOURCE_NONE");
             state = QUIT;
@@ -1925,17 +1935,15 @@ PAF_ASIT_decodeProcessing(
                 Cache_wait();
 #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);
-                Cache_wait();                
+                ////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);
+                //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("PAF_ASIT_decodeProcessing: INIT, errno 0x%x.  break after decodeInit", errno);
@@ -1966,16 +1974,16 @@ PAF_ASIT_decodeProcessing(
                 Log_info0("TaskAsip: state=INFO1");
                 
 #if 0
-                // (***) FL: revisit
-                // write back Inp configuration
-                Cache_wb(&gPAF_AST_config.xInp[0], INPUTN*sizeof(PAF_AST_InpBuf), Cache_Type_ALLD, 0);
-                // write back input data
-                pIpBufConfig = &gPAF_AST_config.xInp[0].inpBufConfig;
-                size = pIpBufConfig->frameLength * pIpBufConfig->sizeofElement;
-                Cache_wb(pIpBufConfig->pntr.pLgInt, size, Cache_Type_ALLD, 0);
-                // write back Dec configuration
-                Cache_wb(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
-                Cache_wait();            
+                //// (***) FL: revisit
+                //// write back Inp configuration
+                //Cache_wb(&gPAF_AST_config.xInp[0], INPUTN*sizeof(PAF_AST_InpBuf), Cache_Type_ALLD, 0);
+                //// write back input data
+                //pIpBufConfig = &gPAF_AST_config.xInp[0].inpBufConfig;
+                //size = pIpBufConfig->frameLength * pIpBufConfig->sizeofElement;
+                //Cache_wb(pIpBufConfig->pntr.pLgInt, size, Cache_Type_ALLD, 0);
+                //// write back Dec configuration
+                //Cache_wb(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+                //Cache_wait();            
 #endif                
 
                 // Establish primary timing
@@ -1986,27 +1994,27 @@ PAF_ASIT_decodeProcessing(
                 }
                 
 #if 0
-                // (***) FL: revisit
-                // invalidate Dec configuration
-                Cache_inv(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
-                Cache_wait();                            
+                //// (***) FL: revisit
+                //// invalidate Dec configuration
+                //Cache_inv(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+                //Cache_wait();                            
 #endif                
 
                 // Don't start decode until major access unit is found.
-                if (((pC->xDec[zMD].decodeStatus.sourceDecode == PAF_SOURCE_THD)    ||
-                     (pC->xDec[zMD].decodeStatus.sourceDecode == PAF_SOURCE_DXP)    ||
-                     (pC->xDec[zMD].decodeStatus.sourceDecode == PAF_SOURCE_DTSHD)) &&
-                     (pC->xStr[zMS].pAudioFrame->sampleRate == PAF_SAMPLERATE_UNKNOWN)) 
+                if (((pAstCfg->xDec[zMD].decodeStatus.sourceDecode == PAF_SOURCE_THD)    ||
+                     (pAstCfg->xDec[zMD].decodeStatus.sourceDecode == PAF_SOURCE_DXP)    ||
+                     (pAstCfg->xDec[zMD].decodeStatus.sourceDecode == PAF_SOURCE_DTSHD)) &&
+                     (pAstCfg->xStr[zMS].pAudioFrame->sampleRate == PAF_SAMPLERATE_UNKNOWN)) 
                 {
                     Int z;
                     for (z=DECODE1; z < DECODEN; z++) 
                     {
                         Int zI = pP->inputsFromDecodes[z];
-                        if (pC->xInp[zI].hRxSio && pC->xDec[z].decodeStatus.mode)
+                        if (pAstCfg->xInp[zI].hRxSio && pAstCfg->xDec[z].decodeStatus.mode)
                         {
                             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))
+                            if (SIO_issue(pAstCfg->xInp[zI].hRxSio, &pAstCfg->xInp[zI].inpBufConfig,
+                                sizeof(pAstCfg->xInp[zI].inpBufConfig), PAF_SIO_REQUEST_NEWFRAME))
                             {
                                 TRACE_TERSE0("PAF_ASIT_decodeProcessing. %d: INFO1, return (ASPERR_ISSUE)");
                                 return (ASPERR_ISSUE);
@@ -2036,16 +2044,16 @@ PAF_ASIT_decodeProcessing(
                 Log_info0("TaskAsip: state=INFO2");
 
 #if 0            
-                // (***) FL: revisit
-                // write back Inp configuration
-                Cache_wb(&gPAF_AST_config.xInp[0], INPUTN*sizeof(PAF_AST_InpBuf), Cache_Type_ALLD, 0);
-                // write back input data
-                pIpBufConfig = &gPAF_AST_config.xInp[0].inpBufConfig;
-                size = pIpBufConfig->frameLength * pIpBufConfig->sizeofElement;
-                Cache_wb(pIpBufConfig->pntr.pLgInt, size, Cache_Type_ALLD, 0);
-                // write back Dec configuration
-                Cache_wb(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
-                Cache_wait();
+                //// (***) FL: revisit
+                //// write back Inp configuration
+                //Cache_wb(&gPAF_AST_config.xInp[0], INPUTN*sizeof(PAF_AST_InpBuf), Cache_Type_ALLD, 0);
+                //// write back input data
+                //pIpBufConfig = &gPAF_AST_config.xInp[0].inpBufConfig;
+                //size = pIpBufConfig->frameLength * pIpBufConfig->sizeofElement;
+                //Cache_wb(pIpBufConfig->pntr.pLgInt, size, Cache_Type_ALLD, 0);
+                //// write back Dec configuration
+                //Cache_wb(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+                //Cache_wait();
 #endif                
 
                 // Establish primary timing
@@ -2056,10 +2064,10 @@ PAF_ASIT_decodeProcessing(
                 }
 
 #if 0            
-                // (***) FL: revisit
-                // invalidate Dec configuration
-                Cache_inv(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
-                Cache_wait();                                            
+                //// (***) FL: revisit
+                //// invalidate Dec configuration
+                //Cache_inv(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+                //Cache_wait();                                            
 #endif                
                 
                 if (errno = pP->fxns->decodeInfo2(pP, pQ, pC, frame, block))
@@ -2077,10 +2085,10 @@ PAF_ASIT_decodeProcessing(
                 Log_info0("TaskAsip: state=DECODE");
 
 #if 0
-                // (***) FL: revisit
-                // write back Dec configuration
-                Cache_wb(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
-                Cache_wait();                        
+                //// (***) FL: revisit
+                //// write back Dec configuration
+                //Cache_wb(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+                //Cache_wait();                        
 #endif
             
                 if (errno = pP->fxns->decodeDecode(pP, pQ, pC, sourceSelect, frame, block))
@@ -2090,10 +2098,10 @@ PAF_ASIT_decodeProcessing(
                 }
       
 #if 0      
-                // (***) FL: revisit
-                // invalidate Dec configuration
-                Cache_inv(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
-                Cache_wait();                                            
+                //// (***) FL: revisit
+                //// invalidate Dec configuration
+                //Cache_inv(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+                //Cache_wait();                                            
 #endif                
                 
                 TRACE_VERBOSE0("PAF_ASIT_decodeProcessing: state: DECODE->FINAL");
@@ -2166,33 +2174,36 @@ PAF_ASIT_decodeProcessing(
 
 Int
 PAF_ASIT_decodeCommand(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC
+    const PAF_ASIT_Params *pP, 
+    const PAF_ASIT_Patchs *pQ, 
+    PAF_ASIT_Config *pC
 )
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
-    Int z;                              /* decode counter */
+    PAF_AST_Config *pAstCfg;
+    Int as;                 /* Audio Stream Number (1, 2, etc.) */
+    Int z;                  /* decode counter */
     Int zS;
 
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
 
     for (z=DECODE1; z < DECODEN; z++) 
     {
         zS = pP->streamsFromDecodes[z];
-        if (!(pC->xDec[z].decodeStatus.command2 & 0x80)) 
+        if (!(pAstCfg->xDec[z].decodeStatus.command2 & 0x80)) 
         {
-            switch (pC->xDec[z].decodeStatus.command2) 
+            switch (pAstCfg->xDec[z].decodeStatus.command2) 
             {
                 case 0: // command none - process
-                    pC->xDec[z].decodeStatus.command2 |= 0x80;
+                    pAstCfg->xDec[z].decodeStatus.command2 |= 0x80;
                     break;
                 case 1: // command abort - leave now
                     TRACE_TERSE2("AS%d: PAF_ASIT_decodeCommand: decode command abort (0x%02x)", as+zS, 1);
-                    pC->xDec[z].decodeStatus.command2 |= 0x80;
+                    pAstCfg->xDec[z].decodeStatus.command2 |= 0x80;
                     return (ASPERR_ABORT);
                 case 2: // command restart - leave later
                     TRACE_TERSE2("AS%d: PAF_ASIT_decodeCommand: decode command quit (0x%02x)", as+zS, 2);
-                    pC->xDec[z].decodeStatus.command2 |= 0x80;
+                    pAstCfg->xDec[z].decodeStatus.command2 |= 0x80;
                     return (ASPERR_QUIT);
                 default: // command unknown - ignore
                     break;
@@ -2217,32 +2228,39 @@ PAF_ASIT_decodeCommand(
 //
 Int
 PAF_ASIT_decodeInit(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC, 
+    const PAF_ASIT_Params *pP, 
+    const PAF_ASIT_Patchs *pQ, 
+    PAF_ASIT_Config *pC, 
     Int sourceSelect
 )
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
+    PAF_AST_Config *pAstCfg;
+    PAF_AST_DecOpCircBufCtl *pCbCtl;    /* Decoder output circular buffer control */
+    Int as;                             /* Audio Stream Number (1, 2, etc.) */
     Int z;                              /* decode/encode counter */
     Int errno;                          /* error number */
     Int zI, zS;
-    Int zMD = pC->masterDec;
-    Int zMI = pP->zone.master;
+    Int zMD;
+    Int zMI;
     ASP_Msg* pAspMsg;                   /* Messaging */
     Int argIdx;
     Int decErrno;
     Int status;
-    PAF_DecodeOpCircBuf *pCb;           /* Decoder output circular buffer */
     
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
+    zMD = pAstCfg->masterDec;
+    zMI = pP->zone.master;
     (void)as;  // clear compiler warning in case not used with tracing disabled
+    
+    pCbCtl = &pC->pAspmCfg->decOpCircBufCtl; // get pointer to circular buffer control
 
     // reset frameCount
     for (z=DECODE1; z < DECODEN; z++)
     {
-        if (pC->xDec[z].decodeStatus.mode)
+        if (pAstCfg->xDec[z].decodeStatus.mode)
         {
-            pC->xDec[z].decodeStatus.frameCount = 0;
+            pAstCfg->xDec[z].decodeStatus.frameCount = 0;
         }
     }
 
@@ -2251,14 +2269,14 @@ PAF_ASIT_decodeInit(
         zI = pP->inputsFromDecodes[z];
         zS = pP->streamsFromDecodes[z];
         (void)zS; // clear compiler warning in case not used with tracing disabled
-        if (pC->xInp[zI].hRxSio && pC->xDec[z].decodeStatus.mode) 
+        if (pAstCfg->xInp[zI].hRxSio && pAstCfg->xDec[z].decodeStatus.mode) 
         {
             Uns gear;
             Int frameLength;
             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_wb(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
             Cache_wait();
             
             // FL: send dec activate message to slave
@@ -2373,7 +2391,7 @@ PAF_ASIT_decodeInit(
 
             // (***) FL: revisit
             // invalidate Dec configuration
-            Cache_inv(&gPAF_AST_config.xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+            Cache_inv(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
             Cache_wait();                            
             
 #if 0 // FL: decoder reset call, slave
@@ -2383,8 +2401,8 @@ PAF_ASIT_decodeInit(
                 return errno;
 #endif
             
-            gear = pC->xDec[z].decodeStatus.aspGearControl;
-            pC->xDec[z].decodeStatus.aspGearStatus = gear < GEARS ? gear : 0;
+            gear = pAstCfg->xDec[z].decodeStatus.aspGearControl;
+            pAstCfg->xDec[z].decodeStatus.aspGearStatus = gear < GEARS ? gear : 0;
             
 #if 0 // FL: change handle to decIdx (zone index)
             frameLength = pP->fxns->computeFrameLength(decAlg[z], 
@@ -2410,9 +2428,9 @@ PAF_ASIT_decodeInit(
             }
 #endif    
             
-            pC->xDec[z].decodeControl.frameLength = frameLength;
-            pC->xDec[z].decodeInStruct.sampleCount = frameLength;
-            pC->xDec[z].decodeControl.sampleRate = PAF_SAMPLERATE_UNKNOWN;
+            pAstCfg->xDec[z].decodeControl.frameLength = frameLength;
+            pAstCfg->xDec[z].decodeInStruct.sampleCount = frameLength;
+            pAstCfg->xDec[z].decodeControl.sampleRate = PAF_SAMPLERATE_UNKNOWN;
             
             // (***) FL: revisit. Count samples for DDP.
             // Add framework frame length and running sample count to decoder control.
@@ -2420,46 +2438,45 @@ PAF_ASIT_decodeInit(
             //pC->xDec[z].decodeControl.rdSampleCount = 0;
 
             // Initialize decoder output circular buffer for selected source
-            pCb = &pC->xDec[z].decOpCb;
-            errno = cbInit(sourceSelect, frameLength, FRAMELENGTH, pCb, 0);
+            errno = cbInitSourceSel(pCbCtl, z, sourceSelect, frameLength, FRAMELENGTH, 0);
             if (errno)
             {
                 SW_BREAKPOINT; // FL: debug
                 return errno;
             }
             // FL: debug
-            cbLog(pCb, 1, "PAF_ASIT_decodeInit:cbInit");
+            cbLog(pCbCtl, z, 1, "PAF_ASIT_decodeInit:cbInitSourceSel");
             
             if (z != zMD) 
             {
-                if (errno = SIO_idle(pC->xInp[zI].hRxSio))
+                if (errno = SIO_idle(pAstCfg->xInp[zI].hRxSio))
                 {
                     return errno;
                 }
             }
 
-            if (errno = SIO_ctrl(pC->xInp[zI].hRxSio, PAF_SIO_CONTROL_SET_SOURCESELECT,
-                DECSIOMAP(pC->xDec[z].decodeStatus.sourceSelect)))
+            if (errno = SIO_ctrl(pAstCfg->xInp[zI].hRxSio, PAF_SIO_CONTROL_SET_SOURCESELECT,
+                DECSIOMAP(pAstCfg->xDec[z].decodeStatus.sourceSelect)))
             {
                 return errno;
             }
-            if (errno = SIO_ctrl(pC->xInp[zI].hRxSio, PAF_SIO_CONTROL_SET_PCMFRAMELENGTH, 
+            if (errno = SIO_ctrl(pAstCfg->xInp[zI].hRxSio, PAF_SIO_CONTROL_SET_PCMFRAMELENGTH, 
                 frameLength))
             {
                 return errno;
             }
-            if (errno = pP->fxns->updateInputStatus(pC->xInp[zI].hRxSio, &pC->xInp[zI].inpBufStatus, 
-                &pC->xInp[zI].inpBufConfig))
+            if (errno = pP->fxns->updateInputStatus(pAstCfg->xInp[zI].hRxSio, &pAstCfg->xInp[zI].inpBufStatus, 
+                &pAstCfg->xInp[zI].inpBufConfig))
             {
                 return errno;
             }
         }
     }
 
-    if (pC->xInp[zMI].hRxSio) 
+    if (pAstCfg->xInp[zMI].hRxSio) 
     {
-        errno = SIO_issue(pC->xInp[zMI].hRxSio, &pC->xInp[zMI].inpBufConfig,
-            sizeof(pC->xInp[zMI].inpBufConfig), PAF_SIO_REQUEST_NEWFRAME);
+        errno = SIO_issue(pAstCfg->xInp[zMI].hRxSio, &pAstCfg->xInp[zMI].inpBufConfig,
+            sizeof(pAstCfg->xInp[zMI].inpBufConfig), PAF_SIO_REQUEST_NEWFRAME);
         if (errno)
         {
             return errno;
@@ -2484,31 +2501,37 @@ PAF_ASIT_decodeInit(
 //
 Int
 PAF_ASIT_decodeInfo(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC, 
+    const PAF_ASIT_Params *pP, 
+    const PAF_ASIT_Patchs *pQ, 
+    PAF_ASIT_Config *pC, 
     Int frame, 
     Int block
 )
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
-    Int z;                              /* input/decode/stream counter */
-    Int errno;                          /* error number */
-    Int sioErr;                         /* error number, SIO */
+    PAF_AST_Config *pAstCfg;
+    Int as;                    /* Audio Stream Number (1, 2, etc.) */
+    Int z;                     /* input/decode/stream counter */
+    Int errno;                 /* error number */
+    Int sioErr;                /* error number, SIO */
     Int zD, zI, zS, zX;
-    Int zMD = pC->masterDec;
-    Int zMI = pP->zone.master;
-    Int zMS = pC->masterStr;
+    Int zMD;
+    Int zMI;
+    Int zMS;
     UInt32 curTime;
-    ASP_Msg *pAspMsg;                   /* Messaging */
+    ASP_Msg *pAspMsg;          /* Messaging */
     Int argIdx;
     Int status;
     // FL: revisit
     //Int size;
     //PAF_InpBufConfig *pIpBufConfig;
 
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
+    zMD = pAstCfg->masterDec;
+    zMS = pAstCfg->masterStr;
+    zMI = pP->zone.master;
     (void)zMS;  (void)as;  // clear compiler warning in case not used with tracing disabled
-
+    
     // Set decode control: sample rate, emphasis
     for (z=INPUT1; z < INPUTN; z++)
     {
@@ -2522,52 +2545,52 @@ PAF_ASIT_decodeInfo(
             }
         }
 
-        if (pC->xInp[z].hRxSio) 
+        if (pAstCfg->xInp[z].hRxSio) 
         {
             //determine associated decoder
-            if (pC->xInp[z].inpBufStatus.sampleRateStatus != 
-                pC->xDec[zD].decodeControl.sampleRate) 
+            if (pAstCfg->xInp[z].inpBufStatus.sampleRateStatus != 
+                pAstCfg->xDec[zD].decodeControl.sampleRate) 
             {
-                if (pC->xDec[zD].decodeControl.sampleRate == PAF_SAMPLERATE_UNKNOWN) 
+                if (pAstCfg->xDec[zD].decodeControl.sampleRate == PAF_SAMPLERATE_UNKNOWN) 
                 {
-                    pC->xDec[zD].decodeControl.sampleRate = 
-                        pC->xInp[z].inpBufStatus.sampleRateStatus;
+                    pAstCfg->xDec[zD].decodeControl.sampleRate = 
+                        pAstCfg->xInp[z].inpBufStatus.sampleRateStatus;
                 }
                 else
                 {
-                    TRACE_TERSE1("AS%d: return error ASPERR_INFO_RATECHANGE", as+pC->masterStr);
+                    TRACE_TERSE1("AS%d: return error ASPERR_INFO_RATECHANGE", as+pAstCfg->masterStr);
                     TRACE_TERSE2("inpBufStatus.sampleRateStatus: 0x%x, decodeControl.sampleRate: 0x%x",
-                        pC->xInp[z].inpBufStatus.sampleRateStatus, 
-                        pC->xDec[zD].decodeControl.sampleRate);
+                        pAstCfg->xInp[z].inpBufStatus.sampleRateStatus, 
+                        pAstCfg->xDec[zD].decodeControl.sampleRate);
                     // return (ASPERR_INFO_RATECHANGE);
                 }
             }
-            pC->xDec[zD].decodeControl.emphasis = 
-                pC->xDec[zD].decodeStatus.sourceDecode != PAF_SOURCE_PCM
+            pAstCfg->xDec[zD].decodeControl.emphasis = 
+                pAstCfg->xDec[zD].decodeStatus.sourceDecode != PAF_SOURCE_PCM
                 ? PAF_IEC_PREEMPHASIS_NO // fix for Mantis ID #119
-                : pC->xInp[z].inpBufStatus.emphasisStatus;
+                : pAstCfg->xInp[z].inpBufStatus.emphasisStatus;
         }
         else 
         {
-            pC->xDec[zD].decodeControl.sampleRate = PAF_SAMPLERATE_UNKNOWN;
-            pC->xDec[zD].decodeControl.emphasis = PAF_IEC_PREEMPHASIS_UNKNOWN;
+            pAstCfg->xDec[zD].decodeControl.sampleRate = PAF_SAMPLERATE_UNKNOWN;
+            pAstCfg->xDec[zD].decodeControl.emphasis = PAF_IEC_PREEMPHASIS_UNKNOWN;
         }
     }
 
     // Wait for info input
     TRACE_VERBOSE2("PAF_ASIT_decodeInfo: AS%d: awaiting frame %d -- sync+info+data", as+zMS, frame);
-    if (pC->xInp[zMI].hRxSio) 
+    if (pAstCfg->xInp[zMI].hRxSio) 
     {
         TRACE_VERBOSE0("PAF_ASIT_decodeInfo: call SIO_reclaim to get input buffer.");
-        sioErr = SIO_reclaim(pC->xInp[zMI].hRxSio, (Ptr)&pC->xInp[zMI].pInpBuf, NULL);
-        if (sioErr != sizeof(pC->xInp[zMI].inpBufConfig))
+        sioErr = SIO_reclaim(pAstCfg->xInp[zMI].hRxSio, (Ptr)&pAstCfg->xInp[zMI].pInpBuf, NULL);
+        if (sioErr != sizeof(pAstCfg->xInp[zMI].inpBufConfig))
         {
             TRACE_TERSE1("SIO_reclaim on input returned error ASPERR_RECLAIM.  sioErr: 0x%x", sioErr);
             return ASPERR_RECLAIM;
         }
         
         // FL: debug, capture input buffer
-        //capIb(pC->xInp[zMI].pInpBuf);
+        //capIb(pAstCfg->xInp[zMI].pInpBuf);
         
         //
         // Simulate Rx SIO_reclaim() pend
@@ -2586,12 +2609,12 @@ PAF_ASIT_decodeInfo(
         zI = pP->inputsFromDecodes[z];
         zS = pP->streamsFromDecodes[z];
         (void)zS; // clear compiler warning in case not used with tracing disabled
-        if (pC->xInp[zI].hRxSio && pC->xDec[z].decodeStatus.mode) 
+        if (pAstCfg->xInp[zI].hRxSio && pAstCfg->xDec[z].decodeStatus.mode) 
         {
             TRACE_GEN2("PAF_ASIT_decodeInfo: AS%d: processing frame %d -- info", as+zS, frame);
 
-            if (errno = pP->fxns->updateInputStatus(pC->xInp[zI].hRxSio,
-                &pC->xInp[zI].inpBufStatus, &pC->xInp[zI].inpBufConfig))
+            if (errno = pP->fxns->updateInputStatus(pAstCfg->xInp[zI].hRxSio,
+                &pAstCfg->xInp[zI].inpBufStatus, &pAstCfg->xInp[zI].inpBufConfig))
             {
                 TRACE_TERSE1("return error errno 0x%x.", errno);
                 return errno;
@@ -2600,13 +2623,13 @@ PAF_ASIT_decodeInfo(
 #if 1
             // (***) FL: revisit
             // write back Inp configuration
-            Cache_wb(&gPAF_AST_config.xInp[zI], sizeof(PAF_AST_InpBuf), Cache_Type_ALLD, 0);
+            Cache_wb(&pAstCfg->xInp[zI], sizeof(PAF_AST_InpBuf), Cache_Type_ALLD, 0);
             // write back input data //  (***) GJ: don't need this for 1xI2S HDMI/SPDIF. Maybe need this for 4xI2S HDMI.
             //pIpBufConfig = &gPAF_AST_config.xInp[zI].inpBufConfig;
             //size = pIpBufConfig->frameLength * pIpBufConfig->sizeofElement;
             //Cache_wb((Ptr)pIpBufConfig->pntr.pSmInt, size, Cache_Type_ALLD, 0);
             // write back Dec configuration
-            Cache_wb(&gPAF_AST_config.xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+            Cache_wb(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
             Cache_wait();
 #endif
             
@@ -2659,7 +2682,7 @@ PAF_ASIT_decodeInfo(
 #if 1
             // (***) FL: revisit
             // invalidate Dec configuration
-            Cache_inv(&gPAF_AST_config.xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+            Cache_inv(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
             Cache_wait();                            
 #endif            
             
@@ -2674,47 +2697,33 @@ PAF_ASIT_decodeInfo(
                 return errno;
             }
             // increment decoded frame count
-            pC->xDec[z].decodeStatus.frameCount += 1;
+            pAstCfg->xDec[z].decodeStatus.frameCount += 1;
         }
     } // z=DECODE1 to DECODEN
 
     // query IB for latest sourceProgram (needed if we started decoding due to a force mode)
-    if (pC->xDec[zMD].decodeStatus.mode) 
+    if (pAstCfg->xDec[zMD].decodeStatus.mode) 
     {
         XDAS_Int8 sourceProgram;
-        if (errno = SIO_ctrl(pC->xInp[zMI].hRxSio, PAF_SIO_CONTROL_GET_SOURCEPROGRAM,
+        if (errno = SIO_ctrl(pAstCfg->xInp[zMI].hRxSio, PAF_SIO_CONTROL_GET_SOURCEPROGRAM,
             (Arg)&sourceProgram))
         {
             TRACE_TERSE1("return error ASPERR_AUTO_PROGRAM. errno 0x%x.", errno);
             return ASPERR_AUTO_PROGRAM;
         }
-        pC->xDec[zMD].decodeStatus.sourceProgram = sourceProgram;
-
-#if 0
-        // (***) FL: revisit
-        Cache_wb((Ptr)&pC->xDec[zMD].decodeStatus.sourceProgram,
-            sizeof(pC->xDec[zMD].decodeStatus.sourceProgram), Cache_Type_ALLD, 0);
-        Cache_wait();
-#endif        
+        pAstCfg->xDec[zMD].decodeStatus.sourceProgram = sourceProgram;
     }
 
     // since now decoding update decode status for all enabled decoders
     for (z=DECODE1; z < DECODEN; z++) 
     {
-        if (pC->xDec[z].decodeStatus.mode) 
+        if (pAstCfg->xDec[z].decodeStatus.mode) 
         {
-            pC->xDec[z].decodeStatus.sourceDecode = pC->xDec[z].decodeStatus.sourceProgram;
-            if (pC->xDec[z].decodeStatus.sourceSelect == PAF_SOURCE_SNG)
+            pAstCfg->xDec[z].decodeStatus.sourceDecode = pAstCfg->xDec[z].decodeStatus.sourceProgram;
+            if (pAstCfg->xDec[z].decodeStatus.sourceSelect == PAF_SOURCE_SNG)
             {
-                pC->xDec[z].decodeStatus.sourceDecode = PAF_SOURCE_SNG;
+                pAstCfg->xDec[z].decodeStatus.sourceDecode = PAF_SOURCE_SNG;
             }
-            
-#if 0
-            // (***) FL: revisit
-            Cache_wb((Ptr)&pC->xDec[z].decodeStatus.sourceDecode,
-                sizeof(pC->xDec[z].decodeStatus.sourceDecode), Cache_Type_ALLD, 0);
-            Cache_wait();
-#endif            
         }
     }
 
@@ -2767,9 +2776,9 @@ PAF_ASIT_decodeInfo(
 //
 Int
 PAF_ASIT_decodeInfo1(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC, 
+    const PAF_ASIT_Params *pP, 
+    const PAF_ASIT_Patchs *pQ, 
+    PAF_ASIT_Config *pC, 
     Int frame, 
     Int block
 )
@@ -2791,9 +2800,9 @@ PAF_ASIT_decodeInfo1(
 //
 Int
 PAF_ASIT_decodeInfo2(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC, 
+    const PAF_ASIT_Params *pP, 
+    const PAF_ASIT_Patchs *pQ, 
+    PAF_ASIT_Config *pC, 
     Int frame, 
     Int block
 )
@@ -2817,27 +2826,39 @@ PAF_ASIT_decodeInfo2(
 //
 
 Int
-PAF_AST_decodeCont (const PAF_AST_Params *pP, const PAF_AST_Patchs *pQ, PAF_AST_Config *pC, ALG_Handle decAlg[], Int frame, Int block)
+PAF_AST_decodeCont(
+    const PAF_ASIT_Params *pP, 
+    const PAF_ASIT_Patchs *pQ, 
+    PAF_ASIT_Config *pC, 
+    ALG_Handle decAlg[], 
+    Int frame, 
+    Int block
+)
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
-    Int z;                              /* decode counter */
+    PAF_AST_Config *pAstCfg;
+    Int as;                     /* Audio Stream Number (1, 2, etc.) */
+    Int z;                      /* decode counter */
     Int zI, zS;
-    Int zMD = pC->masterDec;
+    Int zMD;
 
+    
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
+    zMD = pAstCfg->masterDec;
     (void)as;  // clear compiler warning in case not used with tracing disabled
-
+    
     // Await slave inputs
     for (z=DECODE1; z < DECODEN; z++) {
         zI = pP->inputsFromDecodes[z];
         zS = pP->streamsFromDecodes[z];
         (void)zS;
         if (z == zMD
-            || ! pC->xInp[zI].hRxSio
-            || ! pC->xDec[z].decodeStatus.mode)
+            || ! pAstCfg->xInp[zI].hRxSio
+            || ! pAstCfg->xDec[z].decodeStatus.mode)
             continue;
         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))
+        if (SIO_reclaim(pAstCfg->xInp[zI].hRxSio, (Ptr)&pAstCfg->xInp[zI].pInpBuf, NULL)
+            != sizeof (pAstCfg->xInp[zI].inpBufConfig))
             return (ASPERR_RECLAIM);
     }
 
@@ -2859,24 +2880,27 @@ PAF_AST_decodeCont (const PAF_AST_Params *pP, const PAF_AST_Patchs *pQ, PAF_AST_
 //
 Int
 PAF_ASIT_decodeDecode(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC, 
+    const PAF_ASIT_Params *pP, 
+    const PAF_ASIT_Patchs *pQ, 
+    PAF_ASIT_Config *pC, 
     Int sourceSelect, 
     Int frame, 
     Int block
 )
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
-    Int z;                              /* decode/stream counter */
-    Int errno;                          /* error number */
+    PAF_AST_Config *pAstCfg;
+    Int as;                     /* Audio Stream Number (1, 2, etc.) */
+    Int z;                      /* decode/stream counter */
+    Int errno;                  /* error number */
     //Int ch;
-    ASP_Msg *pAspMsg;                   /* Messaging */
+    ASP_Msg *pAspMsg;           /* Messaging */
     Int argIdx;
     Int status;
     Int cbErrno;
     Int frameLength;    
 
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
     (void)as; // clear compiler warning in case not used with tracing disabled
 
 #if 0 // FL: slave
@@ -2896,21 +2920,21 @@ PAF_ASIT_decodeDecode(
         Int zI = pP->inputsFromDecodes[z];
         Int zS = pP->streamsFromDecodes[z];
         (void)zS; // clear compiler warning in case not used with tracing disabled
-        if (pC->xInp[zI].hRxSio && pC->xDec[z].decodeStatus.mode)
+        if (pAstCfg->xInp[zI].hRxSio && pAstCfg->xDec[z].decodeStatus.mode)
         {
             TRACE_GEN2("PAF_ASIT_decodeDecode: AS%d: decodeDecode: processing block %d -- decode", as+zS, block);
 
             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);
+                    (IArg)pAstCfg->xInp[z].pInpBuf->base.pVoid,
+                    (IArg)pAstCfg->xInp[z].pInpBuf->head.pVoid);
 
             // FL: debug, capture input buffer
-            //capIbPcm(pC->xInp[z].pInpBuf);
+            //capIbPcm(pAstCfg->xInp[z].pInpBuf);
             
             // (***) FL: revisit
             // write back Dec configuration
-            Cache_wb(&gPAF_AST_config.xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+            Cache_wb(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
             Cache_wait();                        
 
             // FL: send decode message to slave
@@ -2974,7 +2998,7 @@ PAF_ASIT_decodeDecode(
 
             // (***) FL: revisit
             // invalidate Dec configuration
-            Cache_inv(&gPAF_AST_config.xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+            Cache_inv(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
             Cache_wait();
 
 #if 0 // FL: decoder decode call, slave
@@ -3012,9 +3036,9 @@ PAF_ASIT_decodeDecode(
 
 // ............................................................................
 
-            pC->xDec[z].decodeControl.frameLength = frameLength;
-            pC->xDec[z].decodeInStruct.sampleCount = frameLength;
-            if (errno = SIO_ctrl(pC->xInp[zI].hRxSio,
+            pAstCfg->xDec[z].decodeControl.frameLength = frameLength;
+            pAstCfg->xDec[z].decodeInStruct.sampleCount = frameLength;
+            if (errno = SIO_ctrl(pAstCfg->xInp[zI].hRxSio,
                 PAF_SIO_CONTROL_SET_PCMFRAMELENGTH, frameLength))
             {
                 TRACE_VERBOSE1("PAF_ASIT_decodeDecode: SIO SET_PCMFRAMELENGTH returns 0x%x", errno);
@@ -3022,8 +3046,8 @@ PAF_ASIT_decodeDecode(
             }
                 
             TRACE_VERBOSE1("PAF_ASIT_decodeDecode: calling SIO_issue[%d]", zI);
-            if (errno = SIO_issue(pC->xInp[zI].hRxSio, &pC->xInp[zI].inpBufConfig,
-                sizeof(pC->xInp[zI].inpBufConfig),
+            if (errno = SIO_issue(pAstCfg->xInp[zI].hRxSio, &pAstCfg->xInp[zI].inpBufConfig,
+                sizeof(pAstCfg->xInp[zI].inpBufConfig),
                 PAF_SIO_REQUEST_NEWFRAME))
             {
                 TRACE_VERBOSE2("PAF_ASIT_decodeDecode: SIO_issue returns 0x%x, we return ASPERR_ISSUE (0x%x)", errno, ASPERR_ISSUE);
@@ -3081,20 +3105,23 @@ PAF_ASIT_decodeDecode(
 
 Int
 PAF_ASIT_decodeFinalTest(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC, 
+    const PAF_ASIT_Params *pP, 
+    const PAF_ASIT_Patchs *pQ, 
+    PAF_ASIT_Config *pC, 
     Int frame, 
     Int block
 )
 {
-    Int zMD = pC->masterDec;
+    PAF_AST_Config *pAstCfg;
+    Int zMD;
     Int sourceSelect;
     Int sourceProgram;
 
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    zMD = pAstCfg->masterDec;
 
-    sourceSelect  = pC->xDec[zMD].decodeStatus.sourceSelect;
-    sourceProgram = pC->xDec[zMD].decodeStatus.sourceProgram;
+    sourceSelect  = pAstCfg->xDec[zMD].decodeStatus.sourceSelect;
+    sourceProgram = pAstCfg->xDec[zMD].decodeStatus.sourceProgram;
 
     if ((sourceSelect == PAF_SOURCE_NONE) || (sourceSelect == PAF_SOURCE_PASS))
     {
@@ -3126,7 +3153,7 @@ PAF_ASIT_decodeFinalTest(
         }
         else 
         {
-            if (pC->xDec[zMD].decodeStatus.sourceSelect != pC->xDec[zMD].decodeStatus.sourceDecode)
+            if (pAstCfg->xDec[zMD].decodeStatus.sourceSelect != pAstCfg->xDec[zMD].decodeStatus.sourceDecode)
             {
                 return 1;
             }
@@ -3150,22 +3177,25 @@ PAF_ASIT_decodeFinalTest(
 //
 Int
 PAF_ASIT_decodeComplete(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC, 
+    const PAF_ASIT_Params *pP, 
+    const PAF_ASIT_Patchs *pQ, 
+    PAF_ASIT_Config *pC, 
     ALG_Handle decAlg[], 
     Int frame, 
     Int block
 )
 {
-    Int as  = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
-    Int z;                               /* decode/encode counter */
+    PAF_AST_Config *pAstCfg;
+    Int as;                     /* Audio Stream Number (1, 2, etc.) */
+    Int z;                      /* decode/encode counter */
     ASP_Msg* pAspMsg;
     Int argIdx;
-    Int errno;                           /* error number */
+    Int errno;                  /* error number */
     Int status;
-    PAF_DecodeOpCircBuf *pCb; // FL: decoder output circular buffer
 
+    
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
     (void)as;  // clear compiler warning in case not used with tracing disabled
 
 #ifdef PAF_ASP_FINAL
@@ -3177,13 +3207,13 @@ PAF_ASIT_decodeComplete(
         DEC_Handle dec = (DEC_Handle )decAlg[z];
 #endif /* PAF_ASP_FINAL */
         Int zI = pP->inputsFromDecodes[z];
-        if (pC->xInp[zI].hRxSio && pC->xDec[z].decodeStatus.mode) 
+        if (pAstCfg->xInp[zI].hRxSio && pAstCfg->xDec[z].decodeStatus.mode) 
         {
             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,
-                                 &pC->xDec[z].decodeStatus);
+                dec->fxns->final(dec, NULL, &pAstCfg->xDec[z].decodeControl,
+                                 &pAstCfg->xDec[z].decodeStatus);
 #endif /* PAF_ASP_FINAL */
             // FL: send dec deactivate message to slave
             pAspMsg = (ASP_Msg *)MessageQ_alloc(hAspMsgMaster->heapId, hAspMsgMaster->msgSize);  /* allocate message */
@@ -3233,17 +3263,7 @@ PAF_ASIT_decodeComplete(
 #if 0 // FL: decoder deactivate call, slave
             if (decAlg[z]->fxns->algDeactivate)
                 decAlg[z]->fxns->algDeactivate (decAlg[z]);
-#endif
-
-#if 0
-            // Stop decoder output circular buffer writes
-            pCb = &pC->xDec[z].decOpCb;
-            errno = cbWriteStop(pCb);
-            if (errno)
-            {
-                return errno;
-            }
-#endif            
+#endif    
         }
         else 
         {
@@ -3268,24 +3288,28 @@ PAF_ASIT_decodeComplete(
 //
 Int
 PAF_ASIT_selectDevices(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC
+    const PAF_ASIT_Params *pP, 
+    const PAF_ASIT_Patchs *pQ, 
+    PAF_ASIT_Config *pC
 )
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
-    Int z;                              /* input/output counter */
-    Int errno = 0;                      /* error number */
-    Int errme;                          /* error number, local */
+    PAF_AST_Config *pAstCfg;
+    Int as;                     /* Audio Stream Number (1, 2, etc.) */
+    Int z;                      /* input/output counter */
+    Int errno = 0;              /* error number */
+    Int errme;                  /* error number, local */
     Int device;
-    Int zMD = pC->masterDec;
+    Int zMD;
 
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
+    zMD = pAstCfg->masterDec;
     (void)as;  // clear compiler warning in case not used with tracing disabled
-
+    
     // Select input devices
     for (z=INPUT1; z < INPUTN; z++) 
     {
-        if ((device = pC->xInp[z].inpBufStatus.sioSelect) >= 0) 
+        if ((device = pAstCfg->xInp[z].inpBufStatus.sioSelect) >= 0) 
         {
             TRACE_VERBOSE2("PAF_ASIT_selectDevices: AS%d: input device %d selecting ...", as+z, device);
 
@@ -3295,7 +3319,7 @@ PAF_ASIT_selectDevices(
                 device = 0; /* treat as device None */
             }
 
-            errme = pP->fxns->deviceSelect(&pC->xInp[z].hRxSio, SIO_INPUT,
+            errme = pP->fxns->deviceSelect(&pAstCfg->xInp[z].hRxSio, SIO_INPUT,
                 HEAP_ID_INPBUF, (Ptr)pQ->devinp->x[device]);
 
             if (errme)
@@ -3305,21 +3329,21 @@ PAF_ASIT_selectDevices(
                 {
                     errno = ASPERR_DEVINP + errme;
                 }
-                pC->xInp[z].inpBufStatus.sioSelect = 0x80;
+                pAstCfg->xInp[z].inpBufStatus.sioSelect = 0x80;
             }
             else 
             {
-                pC->xInp[z].inpBufStatus.sioSelect = device | 0x80;
+                pAstCfg->xInp[z].inpBufStatus.sioSelect = device | 0x80;
                 // register decodeStatus pointer with input devices
                 // This allows, e.g., autoProcessing to exit when sourceSelect = none
                 // Use zMIs decodeStatus for all inputs
-                if (pC->xInp[z].hRxSio) 
+                if (pAstCfg->xInp[z].hRxSio) 
                 {
                     // register PAF_SIO_IALG object address
-                    SIO_ctrl(pC->xInp[z].hRxSio, PAF_SIO_CONTROL_SET_IALGADDR, 
-                        (Arg)pC->xInp[z].inpChainData.head->alg);
-                    SIO_ctrl(pC->xInp[z].hRxSio, PAF_SIO_CONTROL_SET_DECSTATUSADDR, 
-                        (Arg)&pC->xDec[zMD].decodeStatus);
+                    SIO_ctrl(pAstCfg->xInp[z].hRxSio, PAF_SIO_CONTROL_SET_IALGADDR, 
+                        (Arg)pAstCfg->xInp[z].inpChainData.head->alg);
+                    SIO_ctrl(pAstCfg->xInp[z].hRxSio, PAF_SIO_CONTROL_SET_DECSTATUSADDR, 
+                        (Arg)&pAstCfg->xDec[zMD].decodeStatus);
                 }
             }
         }
@@ -3342,19 +3366,22 @@ PAF_ASIT_selectDevices(
 //
 Int
 PAF_ASIT_sourceDecode(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC, 
+    const PAF_ASIT_Params *pP, 
+    const PAF_ASIT_Patchs *pQ, 
+    PAF_ASIT_Config *pC, 
     Int x
 )
 {
+    PAF_AST_Config *pAstCfg;
     Int z;                              /* decode counter */
 
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+
     for (z=DECODE1; z < DECODEN; z++)
     {
-        if (pC->xDec[z].decodeStatus.mode) 
+        if (pAstCfg->xDec[z].decodeStatus.mode) 
         {
-            pC->xDec[z].decodeStatus.sourceDecode = x;
+            pAstCfg->xDec[z].decodeStatus.sourceDecode = x;
         }
     }