Customize ASOT params, patchs, and configuration
[processor-sdk/performance-audio-sr.git] / processor_audio_sdk_1_00_00_00 / pasdk / test_dsp / framework / audioStreamOutProc.c
index 01b02a3d302b730d9bbeebefbf0f0778bbdeef88..84dcacfdc0e3741346ef8d9bacc5c935e16de183 100644 (file)
@@ -93,24 +93,31 @@ All rights reserved.
 
 #define __TASK_NAME__  "TaskAsop"
 
+
 /* FL: Check if at least one output selected */
 static Int checkOutSel(
-    const PAF_AST_Params *pP, 
-    PAF_AST_Config *pC,
+    const PAF_ASOT_Params *pP, 
+    PAF_ASOT_Config *pC,
     Int *pOutSel
 );
 
 /* FL: Check if at least one output sio changed */
 static Int checkOutSio(
-    const PAF_AST_Params *pP, 
-    PAF_AST_Config *pC,
+    const PAF_ASOT_Params *pP, 
+    PAF_ASOT_Config *pC,
     Int *pOutSioUpdate
 );
 
-
 LINNO_DEFN(TaskAsop); /* Line number macros */
 ERRNO_DEFN(TaskAsop); /* Error number macros */
 
+// ASOT configuration
+#pragma DATA_SECTION(gPAF_ASOT_config, ".globalSectionPafAsotConfig")
+PAF_ASOT_Config gPAF_ASOT_config = {
+    NULL,
+    &gPAF_AST_config
+};
+
 // Global debug counters */
 UInt32 gTaskAsopCnt=0; // debug
 UInt32 gAsopInitCnt     =0;
@@ -126,11 +133,12 @@ UInt32 gAsopQuitCnt     =0;
  */
 Void taskAsopFxn(
 //    Int betaPrimeValue, // FL: revisit
-    const PAF_AST_Params *pP,
-    const PAF_AST_Patchs *pQ
+    const PAF_ASOT_Params *pP,
+    const PAF_ASOT_Patchs *pQ
 )
 {
-    PAF_AST_Config *pC;             /* Local configuration pointer */
+    PAF_ASOT_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 */
@@ -160,10 +168,11 @@ Void taskAsopFxn(
     //
     // Audio Framework Configuration (*pC):
     //
-    pC = &gPAF_AST_config;
+    pC = &gPAF_ASOT_config;
+    pAstCfg = pC->pAstCfg;
 
     /* Obtain Audio Stream Number (1, 2, etc.) */    
-    as = pC->as;
+    as = pAstCfg->as;
     TRACE_TERSE1("TaskAsop: Started with AS%d.", as);
 
     //
@@ -178,7 +187,7 @@ Void taskAsopFxn(
     //
     // Determine stream index
     //
-    zMS = pC->masterStr;
+    zMS = pAstCfg->masterStr;
 
     // Initialize as per parametrized phases:
     //
@@ -241,9 +250,9 @@ Void taskAsopFxn(
         {
             for (z=OUTPUT1; z < OUTPUTN; z++)
             {
-                if (pC->xOut[z].hTxSio)
+                if (pAstCfg->xOut[z].hTxSio)
                 {
-                    SIO_idle(pC->xOut[z].hTxSio);
+                    SIO_idle(pAstCfg->xOut[z].hTxSio);
                 }
             }
         
@@ -306,31 +315,36 @@ Void taskAsopFxn(
 
 Int
 PAF_ASOT_initPhaseMalloc (
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC
+    const PAF_ASOT_Params *pP, 
+    const PAF_ASOT_Patchs *pQ, 
+    PAF_ASOT_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_ASOT_initPhaseMalloc: AS%d: initialization phase - memory allocation", as+zMS);
 
     // Initialize error block
     Error_init(&eb); 
 
     /* Stream memory */
-    if (!(pC->xStr = Memory_calloc((IHeap_Handle)HEAP_INTERNAL, STREAMN * sizeof (*pC->xStr), 4, &eb)))
+    if (!(pAstCfg->xStr = Memory_calloc((IHeap_Handle)HEAP_INTERNAL, STREAMN * sizeof (*pAstCfg->xStr), 4, &eb)))
     {
         TRACE_TERSE1("PAF_ASOT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
         SW_BREAKPOINT;
         return __LINE__;
     }
-    TRACE_TERSE3("PAF_ASOT_initPhaseMalloc. (pC->xStr) %d bytes from space %d at 0x%x.",
-            STREAMN * sizeof (*pC->xStr),
-            HEAP_ID_INTERNAL, (IArg)pC->xStr);
+    TRACE_TERSE3("PAF_ASOT_initPhaseMalloc. (pAstCfg->xStr) %d bytes from space %d at 0x%x.",
+            STREAMN * sizeof (*pAstCfg->xStr),
+            HEAP_ID_INTERNAL, (IArg)pAstCfg->xStr);
 
     {
         Int z;                          /* stream counter */
@@ -349,32 +363,32 @@ PAF_ASOT_initPhaseMalloc (
 
         for (z=STREAM1; z < STREAMN; z++)
         {
-            pC->xStr[z].pAudioFrame = &fBuf[z-STREAM1];
-            TRACE_TERSE2("pC->xStr[%d].pAudioFrame = 0x%x", z, (IArg)pC->xStr[z].pAudioFrame);
+            pAstCfg->xStr[z].pAudioFrame = &fBuf[z-STREAM1];
+            TRACE_TERSE2("pAstCfg->xStr[%d].pAudioFrame = 0x%x", z, (IArg)pAstCfg->xStr[z].pAudioFrame);
         }
     }
 
     /* Encode memory */
-    if (!(pC->xEnc = Memory_calloc((IHeap_Handle)HEAP_INTERNAL, ENCODEN * sizeof (*pC->xEnc), 4, &eb)))
+    if (!(pAstCfg->xEnc = Memory_calloc((IHeap_Handle)HEAP_INTERNAL, ENCODEN * sizeof (*pAstCfg->xEnc), 4, &eb)))
     {
         TRACE_TERSE1("PAF_ASOT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
         SW_BREAKPOINT;
         return __LINE__;
     }
-    TRACE_TERSE3("PAF_ASOT_initPhaseMalloc. (pC->xEnc) %d bytes from space %d at 0x%x.",
-            ENCODEN * sizeof (*pC->xEnc),
-            HEAP_ID_INTERNAL, (IArg)pC->xEnc);
+    TRACE_TERSE3("PAF_ASOT_initPhaseMalloc. (pAstCfg->xEnc) %d bytes from space %d at 0x%x.",
+            ENCODEN * sizeof (*pAstCfg->xEnc),
+            HEAP_ID_INTERNAL, (IArg)pAstCfg->xEnc);
 
     /* Output memory */
-    if (!(pC->xOut = Memory_calloc((IHeap_Handle)HEAP_INTERNAL, OUTPUTN * sizeof (*pC->xOut), 4, &eb)))
+    if (!(pAstCfg->xOut = Memory_calloc((IHeap_Handle)HEAP_INTERNAL, OUTPUTN * sizeof (*pAstCfg->xOut), 4, &eb)))
     {
         TRACE_TERSE1("PAF_ASOT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
         SW_BREAKPOINT;
         return __LINE__;
     }
-    TRACE_TERSE3("PAF_ASOT_initPhaseMalloc. (pC->xOut) %d bytes from space %d at 0x%x.",
-            OUTPUTN * sizeof (*pC->xOut),
-            HEAP_ID_INTERNAL, (IArg)pC->xOut);
+    TRACE_TERSE3("PAF_ASOT_initPhaseMalloc. (pAstCfg->xOut) %d bytes from space %d at 0x%x.",
+            OUTPUTN * sizeof (*pAstCfg->xOut),
+            HEAP_ID_INTERNAL, (IArg)pAstCfg->xOut);
 
     TRACE_TERSE1("PAF_ASOT_initPhaseMalloc: AS%d: initialization phase - memory allocation complete.", as+zMS);
     return 0;
@@ -396,14 +410,19 @@ PAF_ASOT_initPhaseMalloc (
 //
 Int
 PAF_ASOT_initPhaseConfig(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC
+    const PAF_ASOT_Params *pP, 
+    const PAF_ASOT_Patchs *pQ, 
+    PAF_ASOT_Config *pC
 )
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
-    Int z;                              /* input/encode/stream/decode/output counter */
-    Int zMS = pC->masterStr;
+    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_ASOT_initPhaseConfig: AS%d: initialization phase - configuration", as+zMS);
 
@@ -428,19 +447,19 @@ PAF_ASOT_initPhaseConfig(
     {
         Int zO = pP->outputsFromEncodes[z];
         Int zS = pP->streamsFromEncodes[z];
-        pC->xEnc[z].encodeControl.size = sizeof(pC->xEnc[z].encodeControl);
-        pC->xEnc[z].encodeControl.pAudioFrame = pC->xStr[zS].pAudioFrame;
-        pC->xEnc[z].encodeControl.pVolumeStatus = &pC->xEnc[z].volumeStatus;
-        pC->xEnc[z].encodeControl.pOutBufConfig = &pC->xOut[zO].outBufConfig;
-        pC->xEnc[z].encodeStatus = *pP->z_pEncodeStatus[z];
-        pC->xEnc[z].encodeControl.encActive = pC->xEnc[z].encodeStatus.select;
-        pC->xEnc[z].volumeStatus = *pP->pVolumeStatus;
-        pC->xEnc[z].encodeInStruct.pAudioFrame = pC->xStr[zS].pAudioFrame;
+        pAstCfg->xEnc[z].encodeControl.size = sizeof(pAstCfg->xEnc[z].encodeControl);
+        pAstCfg->xEnc[z].encodeControl.pAudioFrame = pAstCfg->xStr[zS].pAudioFrame;
+        pAstCfg->xEnc[z].encodeControl.pVolumeStatus = &pAstCfg->xEnc[z].volumeStatus;
+        pAstCfg->xEnc[z].encodeControl.pOutBufConfig = &pAstCfg->xOut[zO].outBufConfig;
+        pAstCfg->xEnc[z].encodeStatus = *pP->z_pEncodeStatus[z];
+        pAstCfg->xEnc[z].encodeControl.encActive = pAstCfg->xEnc[z].encodeStatus.select;
+        pAstCfg->xEnc[z].volumeStatus = *pP->pVolumeStatus;
+        pAstCfg->xEnc[z].encodeInStruct.pAudioFrame = pAstCfg->xStr[zS].pAudioFrame;
     }
 
     for (z=OUTPUT1; z < OUTPUTN; z++)
     {
-        pC->xOut[z].outBufStatus = *pP->pOutBufStatus;
+        pAstCfg->xOut[z].outBufStatus = *pP->pOutBufStatus;
     }
 
     TRACE_TERSE1("PAF_ASOT_initPhaseConfig: AS%d: initialization phase - configuration complete.", as+zMS);
@@ -464,18 +483,23 @@ PAF_ASOT_initPhaseConfig(
 //
 Int
 PAF_ASOT_initPhaseAcpAlg(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC
+    const PAF_ASOT_Params *pP, 
+    const PAF_ASOT_Patchs *pQ, 
+    PAF_ASOT_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_ASOT_initPhaseAcpAlg: AS%d: initialization phase - ACP Algorithm", as+zMS);
 
     ACP_MDS_init();
@@ -495,10 +519,10 @@ PAF_ASOT_initPhaseAcpAlg(
         zS = pP->streamsFromEncodes[z];
         acp->fxns->attach(acp, ACP_SERIES_STD,
             STD_BETA_ENCODE + betaPrimeOffset * (as-1+zS),
-            (IALG_Status *)&pC->xEnc[z].encodeStatus);
+            (IALG_Status *)&pAstCfg->xEnc[z].encodeStatus);
         acp->fxns->attach(acp, ACP_SERIES_STD,
             STD_BETA_VOLUME + betaPrimeOffset * (as-1+zS),
-            (IALG_Status *)&pC->xEnc[z].volumeStatus);
+            (IALG_Status *)&pAstCfg->xEnc[z].volumeStatus);
         /* Ignore errors, not reported. */
     }
 
@@ -515,7 +539,7 @@ PAF_ASOT_initPhaseAcpAlg(
         }
         acp->fxns->attach(acp, ACP_SERIES_STD,
             STD_BETA_OB + betaPrimeOffset * (as-1+zS),
-            (IALG_Status *)&pC->xOut[z].outBufStatus);
+            (IALG_Status *)&pAstCfg->xOut[z].outBufStatus);
         /* Ignore errors, not reported. */
     }
 
@@ -544,18 +568,23 @@ PAF_ASOT_initPhaseAcpAlg(
 //
 Int
 PAF_ASOT_initPhaseCommon(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC
+    const PAF_ASOT_Params *pP, 
+    const PAF_ASOT_Patchs *pQ, 
+    PAF_ASOT_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 */
+    Int g;                      /* gear */
+    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_ASOT_initPhaseCommon: initialization phase - Common Memory");
 
     //
@@ -638,7 +667,7 @@ PAF_ASOT_initPhaseCommon(
             TRACE_TERSE1("PAF_ASOT_initPhaseCommon: calling PAF_ALG_ALLOC outLinkInit common[%d].", z);
             if (PAF_ALG_ALLOC(outLinkInit[z-OUTPUT1], common[z]))
             {
-                TRACE_TERSE1("PAF_AST_initPhaseMalloc: AS%d: PAF_ALG_alloc failed", as+z);
+                TRACE_TERSE1("PAF_ASOT_initPhaseMalloc: 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__;
@@ -705,14 +734,14 @@ PAF_ASOT_initPhaseCommon(
             }
         }
 
-        pC->xStr[z].aspChain[0] = NULL;
+        pAstCfg->xStr[z].aspChain[0] = NULL;
         for (g=0; g < GEARS; g++) 
         {
             PAF_ASP_Chain *chain;
             TRACE_TERSE0("PAF_ASOT_initPhaseCommon: calling PAF_ASP_chainInit for ASPs.");
-            chain = PAF_ASP_chainInit(&pC->xStr[z].aspChainData[g], pP->pChainFxns,
+            chain = PAF_ASP_chainInit(&pAstCfg->xStr[z].aspChainData[g], pP->pChainFxns,
                 HEAP_INTERNAL, as+z, acp, &trace,
-                aspLinkInit[z-STREAM1][g], pC->xStr[z].aspChain[0], common[z], &pafAlgConfig);
+                aspLinkInit[z-STREAM1][g], pAstCfg->xStr[z].aspChain[0], common[z], &pafAlgConfig);
             if (!chain) 
             {
                 TRACE_TERSE2("AS%d: ASP chain %d initialization failed", as+z, g);
@@ -720,7 +749,7 @@ PAF_ASOT_initPhaseCommon(
             }
             else
             {
-                pC->xStr[z].aspChain[g] = chain;
+                pAstCfg->xStr[z].aspChain[g] = chain;
             }
         }
 
@@ -728,7 +757,7 @@ PAF_ASOT_initPhaseCommon(
         {
             PAF_ASP_Chain *chain;
             TRACE_TERSE0("PAF_ASOT_initPhaseCommon: calling PAF_ASP_chainInit for encode.");
-            chain = PAF_ASP_chainInit(&pC->xEnc[zE].encChainData, pP->pChainFxns,
+            chain = PAF_ASP_chainInit(&pAstCfg->xEnc[zE].encChainData, pP->pChainFxns,
                 HEAP_INTERNAL, as+z, acp, &trace,
                 encLinkInit[zE-ENCODE1], NULL, common[z], &pafAlgConfig);
             if (!chain) 
@@ -746,7 +775,7 @@ PAF_ASOT_initPhaseCommon(
             PAF_ASP_Chain *chain;
             TRACE_TERSE2("PAF_ASOT_initPhaseMalloc: AS%d: non-common output chain init for %d",
                            as+z, z);
-            chain = PAF_ASP_chainInit (&pC->xOut[z].outChainData, pP->pChainFxns,
+            chain = PAF_ASP_chainInit (&pAstCfg->xOut[z].outChainData, pP->pChainFxns,
                         HEAP_EXTERNAL, as+z, acp, &trace,
                         outLinkInit[z-OUTPUT1], NULL, common[z], &pafAlgConfig);
             if (!chain) 
@@ -777,16 +806,19 @@ PAF_ASOT_initPhaseCommon(
 // .............................................................................
 Int
 PAF_ASOT_initPhaseAlgKey(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC
+    const PAF_ASOT_Params *pP, 
+    const PAF_ASOT_Patchs *pQ, 
+    PAF_ASOT_Config *pC
 )
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
-    Int z;                              /* decode/encode counter */
-    Int s;                              /* key number */
+    PAF_AST_Config *pAstCfg;
+    Int as;                     /* Audio Stream Number (1, 2, etc.) */
+    Int z;                      /* decode/encode counter */
+    Int s;                      /* key number */
     PAF_ASP_Link *that;
 
+    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_ASOT_initPhaseAlgKey: AS%d: initialization phase - Algorithm Keys", as);
@@ -796,14 +828,14 @@ PAF_ASOT_initPhaseAlgKey(
         for (s=0; s < pP->pEncAlgKey->length; s++) 
         {
             if ((pP->pEncAlgKey->code[s].full != 0) && 
-                (that = PAF_ASP_chainFind(&pC->xEnc[z].encChainData, pP->pEncAlgKey->code[s])))
+                (that = PAF_ASP_chainFind(&pAstCfg->xEnc[z].encChainData, pP->pEncAlgKey->code[s])))
             {
-                pC->xEnc[z].encAlg[s] = (ALG_Handle )that->alg;
+                pAstCfg->xEnc[z].encAlg[s] = (ALG_Handle )that->alg;
             }
             /* Cast in interface, for now --Kurt */
             else
             {
-                pC->xEnc[z].encAlg[s] = NULL;                
+                pAstCfg->xEnc[z].encAlg[s] = NULL;                
             }
         }
     }
@@ -827,17 +859,20 @@ PAF_ASOT_initPhaseAlgKey(
 //
 Int
 PAF_ASOT_initPhaseDevice(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC
+    const PAF_ASOT_Params *pP, 
+    const PAF_ASOT_Patchs *pQ, 
+    PAF_ASOT_Config *pC
 )
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
-    Int z;                              /* input/output counter */
+    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_ASOT_initPhaseDevice: AS%d: initialization phase - I/O Devices", as);
@@ -855,12 +890,12 @@ PAF_ASOT_initPhaseDevice(
     
     for (z=OUTPUT1; z < OUTPUTN; z++) 
     {
-        PAF_OutBufConfig *pConfig = &pC->xOut[z].outBufConfig;
+        PAF_OutBufConfig *pConfig = &pAstCfg->xOut[z].outBufConfig;
 
-        pObj = (PAF_SIO_IALG_Obj *)pC->xOut[z].outChainData.head->alg;
+        pObj = (PAF_SIO_IALG_Obj *)pAstCfg->xOut[z].outChainData.head->alg;
         pAlgConfig = &pObj->config;
 
-        pC->xOut[z].hTxSio = NULL;
+        pAstCfg->xOut[z].hTxSio = NULL;
         pConfig->base.pVoid     = pAlgConfig->pMemRec[0].base;
         pConfig->pntr.pVoid     = pAlgConfig->pMemRec[0].base;
         pConfig->head.pVoid     = pAlgConfig->pMemRec[0].base;
@@ -901,13 +936,14 @@ extern PAF_ChannelConfigurationMaskTable PAF_ASP_stdCCMT_patch;
 
 Int
 PAF_ASOT_initFrame0(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC, 
+    const PAF_ASOT_Params *pP, 
+    const PAF_ASOT_Patchs *pQ, 
+    PAF_ASOT_Config *pC, 
     Int z
 )
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
+    PAF_AST_Config *pAstCfg;
+    Int as;                     /* Audio Stream Number (1, 2, etc.) */
     Int ch;
     //Int aLen;
     Int aLen_int=0,aLen_ext=0;
@@ -921,6 +957,9 @@ PAF_ASOT_initFrame0(
     char i;
     Error_Block    eb;
 
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
+
     // Initialize error block
     Error_init(&eb); 
 
@@ -942,13 +981,13 @@ PAF_ASOT_initFrame0(
     //
     // Initialize audio frame elements directly
     //
-    pC->xStr[z].pAudioFrame->fxns = pP->pAudioFrameFunctions;
-    pC->xStr[z].pAudioFrame->data.nChannels = PAF_MAXNUMCHAN; ///
-///    pC->xStr[z].pAudioFrame->data.nChannels = PAF_MAXNUMCHAN_AF;
-    pC->xStr[z].pAudioFrame->data.nSamples = FRAMELENGTH;
-    pC->xStr[z].pAudioFrame->data.sample = pC->xStr[z].audioFrameChannelPointers;
-    pC->xStr[z].pAudioFrame->data.samsiz = pC->xStr[z].audioFrameChannelSizes;
-    pC->xStr[z].pAudioFrame->pChannelConfigurationMaskTable = &PAF_ASP_stdCCMT;
+    pAstCfg->xStr[z].pAudioFrame->fxns = pP->pAudioFrameFunctions;
+    pAstCfg->xStr[z].pAudioFrame->data.nChannels = PAF_MAXNUMCHAN; ///
+///    pAstCfg->xStr[z].pAudioFrame->data.nChannels = PAF_MAXNUMCHAN_AF;
+    pAstCfg->xStr[z].pAudioFrame->data.nSamples = FRAMELENGTH;
+    pAstCfg->xStr[z].pAudioFrame->data.sample = pAstCfg->xStr[z].audioFrameChannelPointers;
+    pAstCfg->xStr[z].pAudioFrame->data.samsiz = pAstCfg->xStr[z].audioFrameChannelSizes;
+    pAstCfg->xStr[z].pAudioFrame->pChannelConfigurationMaskTable = &PAF_ASP_stdCCMT;
 
     //
     // Allocate memory for and initialize pointers to audio data buffers
@@ -1007,7 +1046,7 @@ PAF_ASOT_initFrame0(
 #pragma UNROLL(1)
         for (i=0; i < PAF_MAXNUMCHAN_AF; i++)
         {
-            pC->xStr[z].audioFrameChannelPointers[i] = NULL;
+            pAstCfg->xStr[z].audioFrameChannelPointers[i] = NULL;
         }
     }
 
@@ -1029,41 +1068,41 @@ PAF_ASOT_initFrame0(
             {
                 if(pP->pAudioFrameBufStatus->space[i] == IALG_SARAM)
                 {
-                    pC->xStr[z].audioFrameChannelPointers[chan] = aBuf_int + maxFrameLength*(j+1) - FRAMELENGTH;
+                    pAstCfg->xStr[z].audioFrameChannelPointers[chan] = aBuf_int + maxFrameLength*(j+1) - FRAMELENGTH;
                     j++;
                 }
                 else
                 {        
-                    pC->xStr[z].audioFrameChannelPointers[chan] = aBuf_ext + maxFrameLength*(k+1) - FRAMELENGTH;
+                    pAstCfg->xStr[z].audioFrameChannelPointers[chan] = aBuf_ext + maxFrameLength*(k+1) - FRAMELENGTH;
                     k++;
                 }    
                 TRACE_TERSE3("PAF_ASOT_initFrame0: chan = %d = AFChanPtrMap[%d][%d].", chan, numchan[z], i);
-                TRACE_TERSE2("PAF_ASOT_initFrame0: audioFrameChannelPointers[%d]: 0x%x", chan, (IArg)pC->xStr[z].audioFrameChannelPointers[chan]);
+                TRACE_TERSE2("PAF_ASOT_initFrame0: audioFrameChannelPointers[%d]: 0x%x", chan, (IArg)pAstCfg->xStr[z].audioFrameChannelPointers[chan]);
             }
         }
     }
 
     for (ch=PAF_LEFT; ch < PAF_MAXNUMCHAN_AF; ch++) 
     {
-        if (pC->xStr[z].audioFrameChannelPointers[ch])
+        if (pAstCfg->xStr[z].audioFrameChannelPointers[ch])
         {
-            pC->xStr[z].origAudioFrameChannelPointers[ch] = pC->xStr[z].audioFrameChannelPointers[ch];
+            pAstCfg->xStr[z].origAudioFrameChannelPointers[ch] = pAstCfg->xStr[z].audioFrameChannelPointers[ch];
         }
     }
 
     //
     // Initialize meta data elements
     //
-    pC->xStr[z].pAudioFrame->pafBsMetadataUpdate = XDAS_FALSE;
-    pC->xStr[z].pAudioFrame->numPrivateMetadata = 0;
-    pC->xStr[z].pAudioFrame->bsMetadata_offset = 0;
-    pC->xStr[z].pAudioFrame->bsMetadata_type = PAF_bsMetadata_channelData;
-    pC->xStr[z].pAudioFrame->privateMetadataBufSize = pP->pMetadataBufStatus->bufSize;
+    pAstCfg->xStr[z].pAudioFrame->pafBsMetadataUpdate = XDAS_FALSE;
+    pAstCfg->xStr[z].pAudioFrame->numPrivateMetadata = 0;
+    pAstCfg->xStr[z].pAudioFrame->bsMetadata_offset = 0;
+    pAstCfg->xStr[z].pAudioFrame->bsMetadata_type = PAF_bsMetadata_channelData;
+    pAstCfg->xStr[z].pAudioFrame->privateMetadataBufSize = pP->pMetadataBufStatus->bufSize;
     for(i=0;i<pP->pMetadataBufStatus->NumBuf;i++)
     {
-        pC->xStr[z].pAudioFrame->pafPrivateMetadata[i].offset = 0;
-        pC->xStr[z].pAudioFrame->pafPrivateMetadata[i].size = 0;
-        pC->xStr[z].pAudioFrame->pafPrivateMetadata[i].pMdBuf = metadataBuf + pP->pMetadataBufStatus->bufSize*i;
+        pAstCfg->xStr[z].pAudioFrame->pafPrivateMetadata[i].offset = 0;
+        pAstCfg->xStr[z].pAudioFrame->pafPrivateMetadata[i].size = 0;
+        pAstCfg->xStr[z].pAudioFrame->pafPrivateMetadata[i].pMdBuf = metadataBuf + pP->pMetadataBufStatus->bufSize*i;
     }
 
     //
@@ -1075,11 +1114,11 @@ PAF_ASOT_initFrame0(
         if (pP->streamsFromDecodes[zX] == z) 
         {
 #ifdef NOAUDIOSHARE
-            pC->xDec[zX].decodeInStruct.audioShare.nSamples = 0;
-            pC->xDec[zX].decodeInStruct.audioShare.sample = NULL;
+            pAstCfg->xDec[zX].decodeInStruct.audioShare.nSamples = 0;
+            pAstCfg->xDec[zX].decodeInStruct.audioShare.sample = NULL;
 #else /* NOAUDIOSHARE */
-            pC->xDec[zX].decodeInStruct.audioShare.nSamples = aLen_int;
-            pC->xDec[zX].decodeInStruct.audioShare.sample = aBuf_int;
+            pAstCfg->xDec[zX].decodeInStruct.audioShare.nSamples = aLen_int;
+            pAstCfg->xDec[zX].decodeInStruct.audioShare.sample = aBuf_int;
 #endif /* NOAUDIOSHARE */
         }
     }
@@ -1105,13 +1144,17 @@ PAF_ASOT_initFrame0(
 //
 Int
 PAF_ASOT_initFrame1(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC, 
+    const PAF_ASOT_Params *pP, 
+    const PAF_ASOT_Patchs *pQ, 
+    PAF_ASOT_Config *pC, 
     Int z, 
     Int apply
 )
 {
+    PAF_AST_Config *pAstCfg;
+
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+
     //
     // Reinitialize audio frame elements:
     //
@@ -1123,23 +1166,23 @@ PAF_ASOT_initFrame1(
 
     if (apply < 0) 
     {
-        pC->xStr[z].pAudioFrame->channelConfigurationRequest.legacy = PAF_CC_UNKNOWN;
-        pC->xStr[z].pAudioFrame->channelConfigurationStream.legacy = PAF_CC_UNKNOWN;
+        pAstCfg->xStr[z].pAudioFrame->channelConfigurationRequest.legacy = PAF_CC_UNKNOWN;
+        pAstCfg->xStr[z].pAudioFrame->channelConfigurationStream.legacy = PAF_CC_UNKNOWN;
     }
     else 
     {
-        pC->xStr[z].pAudioFrame->channelConfigurationRequest.legacy = PAF_CC_NONE;
-        pC->xStr[z].pAudioFrame->channelConfigurationStream.legacy = PAF_CC_NONE;
+        pAstCfg->xStr[z].pAudioFrame->channelConfigurationRequest.legacy = PAF_CC_NONE;
+        pAstCfg->xStr[z].pAudioFrame->channelConfigurationStream.legacy = PAF_CC_NONE;
     }
 
     if (apply < 1) 
     {
-        pC->xStr[z].pAudioFrame->sampleRate = PAF_SAMPLERATE_UNKNOWN;
-        pC->xStr[z].pAudioFrame->sampleCount = 0;
+        pAstCfg->xStr[z].pAudioFrame->sampleRate = PAF_SAMPLERATE_UNKNOWN;
+        pAstCfg->xStr[z].pAudioFrame->sampleCount = 0;
     }
 
     return 0;
-} //PAF_AST_initFrame1
+} //PAF_ASOT_initFrame1
 
 // -----------------------------------------------------------------------------
 // ASOT Selection Function - Output Device Selection
@@ -1156,23 +1199,26 @@ PAF_ASOT_initFrame1(
 //
 Int
 PAF_ASOT_selectDevices(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC
+    const PAF_ASOT_Params *pP, 
+    const PAF_ASOT_Patchs *pQ, 
+    PAF_ASOT_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;
 
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
     (void)as;  // clear compiler warning in case not used with tracing disabled
 
     // Select output devices
     for (z=OUTPUT1; z < OUTPUTN; z++) 
     {
-        if ((device = pC->xOut[z].outBufStatus.sioSelect) >= 0) 
+        if ((device = pAstCfg->xOut[z].outBufStatus.sioSelect) >= 0) 
         {
             TRACE_VERBOSE2("PAF_ASOT_selectDevices: AS%d: output device %d selecting ...", as+z, device);
 
@@ -1182,7 +1228,7 @@ PAF_ASOT_selectDevices(
                 device = 0; /* treat as device None */
             }
 
-            errme = pP->fxns->deviceSelect(&pC->xOut[z].hTxSio, SIO_OUTPUT, 
+            errme = pP->fxns->deviceSelect(&pAstCfg->xOut[z].hTxSio, SIO_OUTPUT, 
                 HEAP_ID_OUTBUF, (Ptr)pQ->devout->x[device]);
             if (errme)
             {
@@ -1191,41 +1237,41 @@ PAF_ASOT_selectDevices(
                 {
                     errno = ASPERR_DEVOUT + errme;
                 }
-                pC->xOut[z].outBufStatus.sioSelect = 0x80;
+                pAstCfg->xOut[z].outBufStatus.sioSelect = 0x80;
             }
             else 
             {
                 Int zE;
 
-                pC->xOut[z].outBufStatus.sioSelect = device | 0x80;
+                pAstCfg->xOut[z].outBufStatus.sioSelect = device | 0x80;
                 // register outBufStatus and encodeStatus pointers with output devices
                 // This enables proper IEC encapsulation.
-                if (pC->xOut[z].hTxSio) 
+                if (pAstCfg->xOut[z].hTxSio) 
                 {
                     // set max # of output buffers (use override if necessary)
-                    if (pC->xOut[z].outBufStatus.maxNumBufOverride == 0)
+                    if (pAstCfg->xOut[z].outBufStatus.maxNumBufOverride == 0)
                     {
-                        SIO_ctrl(pC->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_MAX_NUMBUF,
+                        SIO_ctrl(pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_MAX_NUMBUF,
                             (Arg)pP->poutNumBufMap[z]->maxNumBuf);
                     }
                     else
                     {
-                        SIO_ctrl(pC->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_MAX_NUMBUF,
-                            (Arg)pC->xOut[z].outBufStatus.maxNumBufOverride);
+                        SIO_ctrl(pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_MAX_NUMBUF,
+                            (Arg)pAstCfg->xOut[z].outBufStatus.maxNumBufOverride);
                     }
 
                     // register PAF_SIO_IALG object address
-                    SIO_ctrl(pC->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_IALGADDR,
-                        (Arg)pC->xOut[z].outChainData.head->alg);
-                    SIO_ctrl(pC->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_BUFSTATUSADDR, 
-                        (Arg)&pC->xOut[z].outBufStatus);
+                    SIO_ctrl(pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_IALGADDR,
+                        (Arg)pAstCfg->xOut[z].outChainData.head->alg);
+                    SIO_ctrl(pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_BUFSTATUSADDR, 
+                        (Arg)&pAstCfg->xOut[z].outBufStatus);
                     for (zE=ENCODE1; zE < ENCODEN; zE++) 
                     {
                         if (pP->outputsFromEncodes[zE] == z) 
                         {
-                            SIO_ctrl (pC->xOut[z].hTxSio, 
+                            SIO_ctrl(pAstCfg->xOut[z].hTxSio, 
                                 PAF_SIO_CONTROL_SET_ENCSTATUSADDR, 
-                                (Arg)&pC->xEnc[zE].encodeStatus);
+                                (Arg)&pAstCfg->xEnc[zE].encodeStatus);
                             break;
                         }
                     }
@@ -1235,14 +1281,14 @@ PAF_ASOT_selectDevices(
 
         // if device selected and valid then enable stat tracking if
         // required and start clocking
-        if ((pC->xOut[z].outBufStatus.sioSelect < 0) && (pC->xOut[z].hTxSio)) 
+        if ((pAstCfg->xOut[z].outBufStatus.sioSelect < 0) && (pAstCfg->xOut[z].hTxSio)) 
         {
             TRACE_VERBOSE0("PAF_ASOT_selectDevices: start SIO clocks");
-            errme = SIO_ctrl(pC->xOut[z].hTxSio, PAF_SIO_CONTROL_OUTPUT_START_CLOCKS, 0);
+            errme = SIO_ctrl(pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_OUTPUT_START_CLOCKS, 0);
             if (errme)
             {
                 TRACE_VERBOSE2("PAF_ASOT_selectDevices: errme 0x%x, errno 0x%x", errme, errno);
-                SIO_idle (pC->xOut[z].hTxSio);
+                SIO_idle(pAstCfg->xOut[z].hTxSio);
                 if (!errno)
                 {
                     errno = ASPERR_DEVOUT + errme;
@@ -1262,12 +1308,13 @@ PAF_ASOT_selectDevices(
 //
 Int
 PAF_ASOT_decodeProcessing(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC, 
+    const PAF_ASOT_Params *pP, 
+    const PAF_ASOT_Patchs *pQ, 
+    PAF_ASOT_Config *pC, 
     Int sourceSelect
 )
 {
+    PAF_AST_Config *pAstCfg;
     Int z;                              /* decode counter */
     Int errno;                          /* error number */
     Int getVal;
@@ -1278,6 +1325,8 @@ PAF_ASOT_decodeProcessing(
     Int block; // decoder output block count / input frame
     Int outSioUpdate;
     
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+
     for (;;) 
     {
         // FL: Check if any change in output SIO, e.g. from Output shortcut.
@@ -1313,10 +1362,10 @@ PAF_ASOT_decodeProcessing(
                     Int ch;
                     for (ch=PAF_LEFT; ch < PAF_MAXNUMCHAN_AF; ch++) 
                     {
-                        if (pC->xStr[z].audioFrameChannelPointers[ch])
+                        if (pAstCfg->xStr[z].audioFrameChannelPointers[ch])
                         {
-                            pC->xStr[z].audioFrameChannelPointers[ch] = 
-                                pC->xStr[z].origAudioFrameChannelPointers[ch];
+                            pAstCfg->xStr[z].audioFrameChannelPointers[ch] = 
+                                pAstCfg->xStr[z].origAudioFrameChannelPointers[ch];
                         }
                     }
                 }
@@ -1327,15 +1376,15 @@ PAF_ASOT_decodeProcessing(
                     
                     for (z=STREAM1; z < STREAMN; z++) 
                     {
-                        pC->xStr[z].pAudioFrame->pafBsMetadataUpdate = XDAS_FALSE;
-                        pC->xStr[z].pAudioFrame->numPrivateMetadata = 0;
-                        pC->xStr[z].pAudioFrame->bsMetadata_offset = 0;
-                        pC->xStr[z].pAudioFrame->bsMetadata_type = PAF_bsMetadata_channelData;
+                        pAstCfg->xStr[z].pAudioFrame->pafBsMetadataUpdate = XDAS_FALSE;
+                        pAstCfg->xStr[z].pAudioFrame->numPrivateMetadata = 0;
+                        pAstCfg->xStr[z].pAudioFrame->bsMetadata_offset = 0;
+                        pAstCfg->xStr[z].pAudioFrame->bsMetadata_type = PAF_bsMetadata_channelData;
 
                         for (i=0; i<pP->pMetadataBufStatus->NumBuf; i++)
                         {
-                            pC->xStr[z].pAudioFrame->pafPrivateMetadata[i].offset = 0;
-                            pC->xStr[z].pAudioFrame->pafPrivateMetadata[i].size = 0;
+                            pAstCfg->xStr[z].pAudioFrame->pafPrivateMetadata[i].offset = 0;
+                            pAstCfg->xStr[z].pAudioFrame->pafPrivateMetadata[i].size = 0;
                         }
                     }
                 }
@@ -1395,10 +1444,10 @@ PAF_ASOT_decodeProcessing(
                     Int ch;
                     for (ch=PAF_LEFT; ch < PAF_MAXNUMCHAN_AF; ch++) 
                     {
-                        if (pC->xStr[z].audioFrameChannelPointers[ch])
+                        if (pAstCfg->xStr[z].audioFrameChannelPointers[ch])
                         {
-                            pC->xStr[z].audioFrameChannelPointers[ch] = 
-                                pC->xStr[z].origAudioFrameChannelPointers[ch];
+                            pAstCfg->xStr[z].audioFrameChannelPointers[ch] = 
+                                pAstCfg->xStr[z].origAudioFrameChannelPointers[ch];
                         }
                     }
                 }
@@ -1437,10 +1486,10 @@ PAF_ASOT_decodeProcessing(
                 {
                     for (z=OUTPUT1; z < OUTPUTN; z++)
                     {
-                        if ((pC->xOut[z].outBufStatus.audio & 0x0f) == PAF_OB_AUDIO_SOUND)
+                        if ((pAstCfg->xOut[z].outBufStatus.audio & 0x0f) == PAF_OB_AUDIO_SOUND)
                         {
-                            TRACE_VERBOSE0("PAF_AST_outputProcessing: state: FINAL: SOUND -> QUIET");
-                            pC->xOut[z].outBufStatus.audio++; // SOUND -> QUIET
+                            TRACE_VERBOSE0("PAF_ASOT_outputProcessing: state: FINAL: SOUND -> QUIET");
+                            pAstCfg->xOut[z].outBufStatus.audio++; // SOUND -> QUIET
                         }
                     }
                     break;
@@ -1498,33 +1547,37 @@ PAF_ASOT_decodeProcessing(
 //
 Int
 PAF_ASOT_encodeCommand(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC
+    const PAF_ASOT_Params *pP, 
+    const PAF_ASOT_Patchs *pQ, 
+    PAF_ASOT_Config *pC
 )
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
-    Int z;                              /* encode counter */
-    Int errno = 0;                      /* error number */
+    PAF_AST_Config *pAstCfg;
+    Int as;                     /* Audio Stream Number (1, 2, etc.) */
+    Int z;                      /* encode counter */
+    Int errno = 0;              /* error number */
     Int zO, zS;
 
 
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
+
     for (z=ENCODE1; z < ENCODEN; z++) 
     {
         zO = pP->outputsFromEncodes[z];
         zS = pP->streamsFromEncodes[z];
-        if (! (pC->xEnc[z].encodeStatus.command2 & 0x80)) 
+        if (! (pAstCfg->xEnc[z].encodeStatus.command2 & 0x80)) 
         {
-            switch (pC->xEnc[z].encodeStatus.command2) 
+            switch (pAstCfg->xEnc[z].encodeStatus.command2) 
             {
                 case 0: // command none - process
-                    pC->xEnc[z].encodeStatus.command2 |= 0x80;
+                    pAstCfg->xEnc[z].encodeStatus.command2 |= 0x80;
                     break;
                 case 1: // mute command
                     TRACE_VERBOSE2("AS%d: PAF_ASOT_encodeCommand: encode command mute (0x%02x)", as+zS, 1);
-                    if ((pC->xOut[zO].outBufStatus.audio & 0x0f) != PAF_OB_AUDIO_QUIET
-                        && pC->xOut[zO].hTxSio
-                        && (errno = SIO_ctrl (pC->xOut[zO].hTxSio, PAF_SIO_CONTROL_MUTE, 0))) 
+                    if ((pAstCfg->xOut[zO].outBufStatus.audio & 0x0f) != PAF_OB_AUDIO_QUIET
+                        && pAstCfg->xOut[zO].hTxSio
+                        && (errno = SIO_ctrl (pAstCfg->xOut[zO].hTxSio, PAF_SIO_CONTROL_MUTE, 0))) 
                     {
                         errno = (errno & 0xff) | ASPERR_MUTE;
                         /* convert to sensical errno */
@@ -1533,15 +1586,15 @@ PAF_ASOT_encodeCommand(
                     }
                     else 
                     {
-                        pC->xOut[zO].outBufStatus.audio |= PAF_OB_AUDIO_MUTED;
+                        pAstCfg->xOut[zO].outBufStatus.audio |= PAF_OB_AUDIO_MUTED;
                     }
-                    pC->xEnc[z].encodeStatus.command2 |= 0x80;
+                    pAstCfg->xEnc[z].encodeStatus.command2 |= 0x80;
                     break;
                 case 2: // unmute command
                     TRACE_VERBOSE2("AS%d: PAF_ASOT_encodeCommand: encode command unmute (0x%02x)", as+zS, 2);
-                    if ((pC->xOut[zO].outBufStatus.audio & 0x0f) != PAF_OB_AUDIO_QUIET
-                        && pC->xOut[zO].hTxSio
-                        && (errno = SIO_ctrl (pC->xOut[zO].hTxSio, PAF_SIO_CONTROL_UNMUTE, 0))) 
+                    if ((pAstCfg->xOut[zO].outBufStatus.audio & 0x0f) != PAF_OB_AUDIO_QUIET
+                        && pAstCfg->xOut[zO].hTxSio
+                        && (errno = SIO_ctrl (pAstCfg->xOut[zO].hTxSio, PAF_SIO_CONTROL_UNMUTE, 0))) 
                     {
                         errno = (errno & 0xff) | ASPERR_MUTE;
                         /* convert to sensical errno */
@@ -1550,9 +1603,9 @@ PAF_ASOT_encodeCommand(
                     }
                     else 
                     {
-                        pC->xOut[zO].outBufStatus.audio &= ~PAF_OB_AUDIO_MUTED;
+                        pAstCfg->xOut[zO].outBufStatus.audio &= ~PAF_OB_AUDIO_MUTED;
                     }
-                    pC->xEnc[z].encodeStatus.command2 |= 0x80;
+                    pAstCfg->xEnc[z].encodeStatus.command2 |= 0x80;
                     break;
                 default: // command unknown - ignore
                     break;
@@ -1568,22 +1621,27 @@ PAF_ASOT_encodeCommand(
 //   Purpose:   Decoding Function for reinitializing the decoding process.
 Int
 PAF_ASOT_decodeInit(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC, 
+    const PAF_ASOT_Params *pP, 
+    const PAF_ASOT_Patchs *pQ, 
+    PAF_ASOT_Config *pC, 
     Int sourceSelect
 )
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
-    Int z;                              /* decode/encode counter */
-    Int errno;                          /* error number */
+    PAF_AST_Config *pAstCfg;
+    Int as;                     /* Audio Stream Number (1, 2, etc.) */
+    Int z;                      /* decode/encode counter */
+    Int errno;                  /* error number */
     Int zO, zS;
-    PAF_AST_DecOpCircBuf *pCb;          /* decoder output circular buffer */
+    PAF_AST_DecOpCircBuf *pCb; /* decoder output circular buffer */
+
+
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
 
     for (z=DECODE1; z < DECODEN; z++)
     {
         // Start decoder output circular buffer reads
-        pCb = &pC->xDecOpCb[z];
+        pCb = &pAstCfg->xDecOpCb[z];
         errno = cbReadStart(pCb);
         if (errno)
         {
@@ -1600,10 +1658,10 @@ PAF_ASOT_decodeInit(
     {
         zO = pP->outputsFromEncodes[z];
         zS = pP->streamsFromEncodes[z];
-        if (pC->xOut[zO].hTxSio && pC->xEnc[z].encodeStatus.mode) 
+        if (pAstCfg->xOut[zO].hTxSio && pAstCfg->xEnc[z].encodeStatus.mode) 
         {
-            Int select = pC->xEnc[z].encodeStatus.select;
-            ALG_Handle encAlg = pC->xEnc[z].encAlg[select];
+            Int select = pAstCfg->xEnc[z].encodeStatus.select;
+            ALG_Handle encAlg = pAstCfg->xEnc[z].encAlg[select];
             ENC_Handle enc = (ENC_Handle )encAlg;
             TRACE_VERBOSE1("AS%d: PAF_ASOT_decodeInit: initializing encode", as+zS);
             if (encAlg->fxns->algActivate)
@@ -1612,7 +1670,7 @@ PAF_ASOT_decodeInit(
             }
             if (enc->fxns->reset
                 && (errno = enc->fxns->reset(enc, NULL,
-                    &pC->xEnc[z].encodeControl, &pC->xEnc[z].encodeStatus)))
+                    &pAstCfg->xEnc[z].encodeControl, &pAstCfg->xEnc[z].encodeStatus)))
             {
                 return errno;
             }
@@ -1637,16 +1695,19 @@ PAF_ASOT_decodeInit(
 //
 Int
 PAF_ASOT_decodeInfo1(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC, 
+    const PAF_ASOT_Params *pP, 
+    const PAF_ASOT_Patchs *pQ, 
+    PAF_ASOT_Config *pC, 
     Int frame, 
     Int block
 )
 {
+    PAF_AST_Config *pAstCfg;
     Int z;                              /* decode/encode counter */
     Int errno;                          /* error number */
 
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+
     // run the chain of ASP's on the stream.
     TRACE_VERBOSE0("PAF_ASOT_decodeInfo1: calling streamChainFunction.");
     if (errno = pP->fxns->streamChainFunction(pP, pQ, pC, 
@@ -1660,14 +1721,14 @@ PAF_ASOT_decodeInfo1(
     for (z=ENCODE1; z < ENCODEN; z++) 
     {
         Int zO = pP->outputsFromEncodes[z];
-        if (pC->xOut[zO].hTxSio && pC->xEnc[z].encodeStatus.mode) 
+        if (pAstCfg->xOut[zO].hTxSio && pAstCfg->xEnc[z].encodeStatus.mode) 
         {
-            Int select = pC->xEnc[z].encodeStatus.select;
-            ALG_Handle encAlg = pC->xEnc[z].encAlg[select];
+            Int select = pAstCfg->xEnc[z].encodeStatus.select;
+            ALG_Handle encAlg = pAstCfg->xEnc[z].encAlg[select];
             ENC_Handle enc = (ENC_Handle )encAlg;
             if (enc->fxns->info
                 && (errno = enc->fxns->info(enc, NULL,
-                    &pC->xEnc[z].encodeControl, &pC->xEnc[z].encodeStatus)))
+                    &pAstCfg->xEnc[z].encodeControl, &pAstCfg->xEnc[z].encodeStatus)))
             {
                 TRACE_TERSE1("PAF_ASOT_decodeInfo1: info returns errno 0x%x ", errno);
                 return errno;
@@ -1722,15 +1783,19 @@ PAF_ASOT_decodeInfo1(
 //
 Int
 PAF_ASOT_decodeInfo2(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC, 
+    const PAF_ASOT_Params *pP, 
+    const PAF_ASOT_Patchs *pQ, 
+    PAF_ASOT_Config *pC, 
     Int frame, 
     Int block
 )
 {
+    PAF_AST_Config *pAstCfg;
     Int errno;
 
+    
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+
     errno = pP->fxns->setCheckRateX (pP, pQ, pC, 1);
     TRACE_VERBOSE1("PAF_ASOT_decodeInfo2: return 0x%x", errno);
     return errno;
@@ -1751,19 +1816,23 @@ PAF_ASOT_decodeInfo2(
 //
 Int
 PAF_ASOT_decodeStream(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC, 
+    const PAF_ASOT_Params *pP, 
+    const PAF_ASOT_Patchs *pQ, 
+    PAF_ASOT_Config *pC, 
     Int frame, 
     Int block
 )
 {
+    PAF_AST_Config *pAstCfg;
     Int z;                              /* decode/stream counter */
     PAF_AST_DecOpCircBuf *pCb;          /* decoder output circular buffer */
     PAF_AudioFrame *pAfRd;
     Int cbErrno;
     Int errno;
 
+
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+
     for (z=DECODE1; z < DECODEN; z++) 
     {
         Int zS = pP->streamsFromDecodes[z];
@@ -1771,8 +1840,8 @@ PAF_ASOT_decodeStream(
         //
         // (***) FL: read circular buffer
         //
-        pCb = &pC->xDecOpCb[z];
-        pAfRd = pC->xStr[zS].pAudioFrame;
+        pCb = &pAstCfg->xDecOpCb[z];
+        pAfRd = pAstCfg->xStr[zS].pAudioFrame;
         cbErrno = cbReadAf(pCb, pAfRd);
         if (cbErrno != 0)
         {
@@ -1818,19 +1887,22 @@ PAF_ASOT_decodeStream(
 //
 Int
 PAF_ASOT_decodeEncode(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC, 
+    const PAF_ASOT_Params *pP, 
+    const PAF_ASOT_Patchs *pQ, 
+    PAF_ASOT_Config *pC, 
     Int frame, 
     Int block
 )
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
-    Int z;                              /* encode/output counter */
-    Int errno;                          /* error number */
+    PAF_AST_Config *pAstCfg;
+    Int as;                     /* Audio Stream Number (1, 2, etc.) */
+    Int z;                      /* encode/output counter */
+    Int errno;                  /* error number */
     Int zX, zE, zS;
     UInt32 curTime;
 
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
 
     // Await output buffers (but not first time)
     for (z=OUTPUT1; z < OUTPUTN; z++) 
@@ -1847,16 +1919,16 @@ PAF_ASOT_decodeEncode(
         }
         zS = pP->streamsFromEncodes[zE];
 
-        if (pC->xOut[z].hTxSio) 
+        if (pAstCfg->xOut[z].hTxSio) 
         {
             // update length (e.g. ARC may have changed)
-            pC->xOut[z].outBufConfig.lengthofFrame = 
-                pC->xEnc[zE].encodeInStruct.pAudioFrame->sampleCount;
+            pAstCfg->xOut[z].outBufConfig.lengthofFrame = 
+                pAstCfg->xEnc[zE].encodeInStruct.pAudioFrame->sampleCount;
             TRACE_GEN2("PAF_ASOT_decodeEncode: AS%d: processing block %d -- idle", as+zS, block);
-            errno = SIO_reclaim(pC->xOut[z].hTxSio,(Ptr *) &pC->xOut[z].pOutBuf, NULL);
+            errno = SIO_reclaim(pAstCfg->xOut[z].hTxSio,(Ptr *) &pAstCfg->xOut[z].pOutBuf, NULL);
             if (errno < 0)
             {
-                SIO_idle(pC->xOut[z].hTxSio);
+                SIO_idle(pAstCfg->xOut[z].hTxSio);
                 TRACE_TERSE2("PAF_ASOT_decodeEncode: AS%d: SIO_reclaim returns error %d", as+zS, -errno);
                 return -errno; // SIO negates error codes
             }
@@ -1883,21 +1955,21 @@ PAF_ASOT_decodeEncode(
         Int zO = pP->outputsFromEncodes[z];
         Int zS = pP->streamsFromEncodes[z];
         (void)zS; // clear compiler warning in case not used with tracing disabled
-        if (pC->xOut[zO].hTxSio && pC->xEnc[z].encodeStatus.mode) 
+        if (pAstCfg->xOut[zO].hTxSio && pAstCfg->xEnc[z].encodeStatus.mode) 
         {
-            Int select = pC->xEnc[z].encodeStatus.select;
-            ALG_Handle encAlg = pC->xEnc[z].encAlg[select];
+            Int select = pAstCfg->xEnc[z].encodeStatus.select;
+            ALG_Handle encAlg = pAstCfg->xEnc[z].encAlg[select];
             ENC_Handle enc = (ENC_Handle )encAlg;
-            if (select != pC->xEnc[z].encodeControl.encActive)
+            if (select != pAstCfg->xEnc[z].encodeControl.encActive)
             {
-                pC->xEnc[z].encodeControl.encActive = select;
+                pAstCfg->xEnc[z].encodeControl.encActive = select;
                 TRACE_TERSE0("PAF_ASOT_decodeEncode: return error");
                 return (-1);
             }
             TRACE_GEN2("AS%d: PAF_ASOT_decodeEncode: processing block %d -- encode", as+zS, block);
 
             // (MID 1933) temp. workaround for PCE2
-            pC->xEnc[z].encodeInStruct.pAudioFrame->data.nChannels = PAF_MAXNUMCHAN;
+            pAstCfg->xEnc[z].encodeInStruct.pAudioFrame->data.nChannels = PAF_MAXNUMCHAN;
 
           /*
           #if (CURRENT_TRACE_MASK & TRACE_MASK_DATA)
@@ -1919,10 +1991,10 @@ PAF_ASOT_decodeEncode(
 
             if (enc->fxns->encode)
             {
-                pC->xEnc[z].encodeOutStruct.bypassFlag =
+                pAstCfg->xEnc[z].encodeOutStruct.bypassFlag =
                         pP->z_pEncodeStatus[z]->encBypass;
                 if (errno = enc->fxns->encode(enc, NULL, 
-                    &pC->xEnc[z].encodeInStruct, &pC->xEnc[z].encodeOutStruct))
+                    &pAstCfg->xEnc[z].encodeInStruct, &pAstCfg->xEnc[z].encodeOutStruct))
                 {
                     if (errno != PCEERR_OUTPUT_POINTERNULL)
                     {
@@ -1963,14 +2035,14 @@ PAF_ASOT_decodeEncode(
         }
         zS = pP->streamsFromEncodes[zE];
 
-        if (pC->xOut[z].hTxSio) 
+        if (pAstCfg->xOut[z].hTxSio) 
         {
             TRACE_GEN2("PAF_ASOT_decodeEncode: AS%d: processing block %d -- output", as+zS, block);
-            errno = SIO_issue(pC->xOut[z].hTxSio, 
-                &pC->xOut[z].outBufConfig, sizeof (pC->xOut[z].outBufConfig), 0);
+            errno = SIO_issue(pAstCfg->xOut[z].hTxSio, 
+                &pAstCfg->xOut[z].outBufConfig, sizeof (pAstCfg->xOut[z].outBufConfig), 0);
             if (errno)
             {
-                SIO_idle(pC->xOut[z].hTxSio);
+                SIO_idle(pAstCfg->xOut[z].hTxSio);
                 if (errno == 0x105)     // 0x105 == RINGIO_EBUFFULL
                 {
 //                    statStruct_LogFullRing(STATSTRUCT_AS1_F2);
@@ -2019,25 +2091,29 @@ PAF_ASOT_decodeEncode(
 //
 Int
 PAF_ASOT_decodeComplete(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC, 
+    const PAF_ASOT_Params *pP, 
+    const PAF_ASOT_Patchs *pQ, 
+    PAF_ASOT_Config *pC, 
     ALG_Handle decAlg[], 
     Int frame, 
     Int block
 )
 {
-    Int as  = pC->as;                   /* Audio Stream Number (1, 2, etc.) */
-    Int z;                              /* decode/encode counter */
-    Int errno;                          /* error number */
-    PAF_AST_DecOpCircBuf *pCb;          /* decoder output circular buffer */
+    PAF_AST_Config *pAstCfg;
+    Int as;                     /* Audio Stream Number (1, 2, etc.) */
+    Int z;                      /* decode/encode counter */
+    Int errno;                  /* error number */
+    PAF_AST_DecOpCircBuf *pCb; /* 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
 
     for (z=DECODE1; z < DECODEN; z++)
     {
         // Stop decoder output circular buffer reads
-        pCb = &pC->xDecOpCb[z];
+        pCb = &pAstCfg->xDecOpCb[z];
         errno = cbReadStop(pCb);
         if (errno)
         {
@@ -2054,18 +2130,18 @@ PAF_ASOT_decodeComplete(
     for (z=ENCODE1; z < ENCODEN; z++) 
     {
         Int zO = pP->outputsFromEncodes[z];
-        if (pC->xOut[zO].hTxSio && pC->xEnc[z].encodeStatus.mode) 
+        if (pAstCfg->xOut[zO].hTxSio && pAstCfg->xEnc[z].encodeStatus.mode) 
         {
-            Int select = pC->xEnc[z].encodeStatus.select;
-            ALG_Handle encAlg = pC->xEnc[z].encAlg[select];
+            Int select = pAstCfg->xEnc[z].encodeStatus.select;
+            ALG_Handle encAlg = pAstCfg->xEnc[z].encAlg[select];
 #ifdef PAF_ASP_FINAL
             ENC_Handle enc = (ENC_Handle)encAlg;
 #endif /* PAF_ASP_FINAL */
             TRACE_VERBOSE1("PAF_ASOT_decodeComplete: AS%d: finalizing encode", as+z);
 #ifdef PAF_ASP_FINAL
             if (enc->fxns->final)
-                enc->fxns->final(enc, NULL, &pC->xEnc[z].encodeControl,
-                                 &pC->xEnc[z].encodeStatus);
+                enc->fxns->final(enc, NULL, &pAstCfg->xEnc[z].encodeControl,
+                                 &pAstCfg->xEnc[z].encodeStatus);
 #endif /* PAF_ASP_FINAL */
             if (encAlg->fxns->algDeactivate)
             {
@@ -2102,23 +2178,28 @@ PAF_ASOT_decodeComplete(
 
 Int
 PAF_ASOT_startOutput(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC
+    const PAF_ASOT_Params *pP, 
+    const PAF_ASOT_Patchs *pQ, 
+    PAF_ASOT_Config *pC
 ) 
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
-    Int z;                              /* output counter */
-    Int errno,nbufs;                    /* error number */
+    PAF_AST_Config *pAstCfg;
+    Int as;                     /* Audio Stream Number (1, 2, etc.) */
+    Int z;                      /* output counter */
+    Int errno,nbufs;            /* error number */
     Int zE, zS, zX;
-    Int zMD = pC->masterDec;
+    Int zMD;
     PAF_SIO_IALG_Obj    *pObj;
     PAF_SIO_IALG_Config *pAlgConfig;
 
+    
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
+    zMD = pAstCfg->masterDec;
 
     for (z=OUTPUT1; z < OUTPUTN; z++) 
     {
-        if (pC->xOut[z].hTxSio) 
+        if (pAstCfg->xOut[z].hTxSio) 
         {
             // determine associated encoder and stream
             zE = z;
@@ -2134,37 +2215,37 @@ PAF_ASOT_startOutput(
             }
 
             // Set sample count so that DOB knows how much data to send
-            pC->xOut[z].outBufConfig.lengthofFrame =
-                pC->xEnc[zE].encodeInStruct.pAudioFrame->sampleCount;
+            pAstCfg->xOut[z].outBufConfig.lengthofFrame =
+                pAstCfg->xEnc[zE].encodeInStruct.pAudioFrame->sampleCount;
 
-            if (pC->xOut[z].outBufStatus.markerMode == PAF_OB_MARKER_ENABLED) 
+            if (pAstCfg->xOut[z].outBufStatus.markerMode == PAF_OB_MARKER_ENABLED) 
             {
-                pObj = (PAF_SIO_IALG_Obj *) pC->xOut[z].outChainData.head->alg;
+                pObj = (PAF_SIO_IALG_Obj *) pAstCfg->xOut[z].outChainData.head->alg;
                 pAlgConfig = &pObj->config;
-                memset(pC->xOut[z].outBufConfig.base.pVoid, 0xAA, 
+                memset(pAstCfg->xOut[z].outBufConfig.base.pVoid, 0xAA, 
                     pAlgConfig->pMemRec[0].size);
             }
 
             // The index to DEC_OUTNUMBUF_MAP will always come from the primary/master
             // decoder. How should we handle the sourceProgram for multiple decoders?
             // Override as needed
-            nbufs = DEC_OUTNUMBUF_MAP(pC->xDec[zMD].decodeStatus.sourceProgram);
-            if (pC->xOut[z].outBufStatus.numBufOverride[pC->xDec[zMD].decodeStatus.sourceProgram] > 0)
+            nbufs = DEC_OUTNUMBUF_MAP(pAstCfg->xDec[zMD].decodeStatus.sourceProgram);
+            if (pAstCfg->xOut[z].outBufStatus.numBufOverride[pAstCfg->xDec[zMD].decodeStatus.sourceProgram] > 0)
             {
-                nbufs = pC->xOut[z].outBufStatus.numBufOverride[pC->xDec[zMD].decodeStatus.sourceProgram];
+                nbufs = pAstCfg->xOut[z].outBufStatus.numBufOverride[pAstCfg->xDec[zMD].decodeStatus.sourceProgram];
             }
-            SIO_ctrl(pC->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_NUMBUF, nbufs);
+            SIO_ctrl(pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_NUMBUF, nbufs);
 
-            if (errno = SIO_issue(pC->xOut[z].hTxSio,
-                &pC->xOut[z].outBufConfig, sizeof(pC->xOut[z].outBufConfig), 0)) 
+            if (errno = SIO_issue(pAstCfg->xOut[z].hTxSio,
+                &pAstCfg->xOut[z].outBufConfig, sizeof(pAstCfg->xOut[z].outBufConfig), 0)) 
             {
-                SIO_idle(pC->xOut[z].hTxSio);
+                SIO_idle(pAstCfg->xOut[z].hTxSio);
                 TRACE_TERSE2("PAF_ASOT_startOutput: AS%d: SIO_issue failed (0x%x)", as+zS, errno);
                 return errno;
             }
 
-            if (!(pC->xOut[z].outBufStatus.audio & 0xf0) && 
-                (errno =  SIO_ctrl (pC->xOut[z].hTxSio, PAF_SIO_CONTROL_UNMUTE, 0))) 
+            if (!(pAstCfg->xOut[z].outBufStatus.audio & 0xf0) && 
+                (errno =  SIO_ctrl (pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_UNMUTE, 0))) 
             {
                 errno = (errno & 0xff) | ASPERR_MUTE;
                 /* convert to sensical errno */
@@ -2173,8 +2254,8 @@ PAF_ASOT_startOutput(
             }
             else
             {
-                pC->xOut[z].outBufStatus.audio
-                    = (pC->xOut[z].outBufStatus.audio & 0xf0) | PAF_OB_AUDIO_SOUND;                
+                pAstCfg->xOut[z].outBufStatus.audio
+                    = (pAstCfg->xOut[z].outBufStatus.audio & 0xf0) | PAF_OB_AUDIO_SOUND;                
             }
 
             TRACE_VERBOSE1("PAF_ASOT_startOutput: AS%d: output started", as+zS);
@@ -2199,23 +2280,26 @@ PAF_ASOT_startOutput(
 //
 Int
 PAF_ASOT_stopOutput(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC
+    const PAF_ASOT_Params *pP, 
+    const PAF_ASOT_Patchs *pQ, 
+    PAF_ASOT_Config *pC
 )
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
-    Int z;                              /* output counter */
+    PAF_AST_Config *pAstCfg;
+    Int as;                     /* Audio Stream Number (1, 2, etc.) */
+    Int z;                      /* output counter */
     Int errno = 0, getVal;
     Int zS, zX;
     PAF_SIO_IALG_Obj    *pObj;
     PAF_SIO_IALG_Config *pAlgConfig;
 
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
     (void)as;  // clear compiler warning in case not used with tracing disabled
 
     for (z=OUTPUT1; z < OUTPUTN; z++) 
     {
-        if (pC->xOut[z].hTxSio) 
+        if (pAstCfg->xOut[z].hTxSio) 
         {
             // determine associated encoder and stream
             zS = z;
@@ -2233,9 +2317,9 @@ PAF_ASOT_stopOutput(
             // where such termination is due to decode error or user command.
             // Identification of this as the usual case is provided by the
             // "decode processing" state machine.
-            if (!(pC->xOut[z].outBufStatus.audio & 0xf0) &&
-                ((pC->xOut[z].outBufStatus.audio & 0x0f) == PAF_OB_AUDIO_SOUND) &&
-                (getVal = SIO_ctrl(pC->xOut[z].hTxSio, PAF_SIO_CONTROL_MUTE, 0))) 
+            if (!(pAstCfg->xOut[z].outBufStatus.audio & 0xf0) &&
+                ((pAstCfg->xOut[z].outBufStatus.audio & 0x0f) == PAF_OB_AUDIO_SOUND) &&
+                (getVal = SIO_ctrl(pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_MUTE, 0))) 
             {
                 if (!errno) 
                 {
@@ -2263,9 +2347,9 @@ PAF_ASOT_stopOutput(
 #else
             // This form should be used when driver support for truncating
             // data is supported for both internal and external clocks.
-            getVal = SIO_ctrl(pC->xOut[z].hTxSio, PAF_SIO_CONTROL_IDLE,
-                pC->xOut[z].outBufStatus.flush ? 1 :
-                (pC->xOut[z].outBufStatus.audio & 0x0f) == PAF_OB_AUDIO_FLUSH
+            getVal = SIO_ctrl(pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_IDLE,
+                pAstCfg->xOut[z].outBufStatus.flush ? 1 :
+                (pAstCfg->xOut[z].outBufStatus.audio & 0x0f) == PAF_OB_AUDIO_FLUSH
                 ? 1 : 0);
             /* TESTED */
 #endif
@@ -2281,9 +2365,9 @@ PAF_ASOT_stopOutput(
             // where such termination is due to processing of a final frame
             // or user command. Identification of this as a special case is
             // provided by the "decode processing" state machine.
-            if (!(pC->xOut[z].outBufStatus.audio & 0xf0) &&
-                ((pC->xOut[z].outBufStatus.audio & 0x0f) == PAF_OB_AUDIO_FLUSH) &&
-                (getVal = SIO_ctrl(pC->xOut[z].hTxSio, PAF_SIO_CONTROL_MUTE, 0)))
+            if (!(pAstCfg->xOut[z].outBufStatus.audio & 0xf0) &&
+                ((pAstCfg->xOut[z].outBufStatus.audio & 0x0f) == PAF_OB_AUDIO_FLUSH) &&
+                (getVal = SIO_ctrl(pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_MUTE, 0)))
             {
                 if (!errno) 
                 {
@@ -2293,17 +2377,17 @@ PAF_ASOT_stopOutput(
                 TRACE_VERBOSE1("as1-f2: PAF_ASOT_stopOutput:  AS%d: SIO control failed (mute)", as+zS);
             }
 
-            pC->xOut[z].outBufStatus.audio &= ~0x0f;
+            pAstCfg->xOut[z].outBufStatus.audio &= ~0x0f;
 
             // zero output buffers
-            pObj = (PAF_SIO_IALG_Obj *) pC->xOut[z].outChainData.head->alg;
+            pObj = (PAF_SIO_IALG_Obj *) pAstCfg->xOut[z].outChainData.head->alg;
             pAlgConfig = &pObj->config;
-            memset (pC->xOut[z].outBufConfig.base.pVoid, 0, pAlgConfig->pMemRec[0].size);
-        } //pC->xOut[z].hTxSio
+            memset (pAstCfg->xOut[z].outBufConfig.base.pVoid, 0, pAlgConfig->pMemRec[0].size);
+        } //pAstCfg->xOut[z].hTxSio
     }//OUTPUT
 
     return errno;
-} //PAF_AST_stopOutput
+} //PAF_ASOT_stopOutput
 
 // -----------------------------------------------------------------------------
 // ASOT Decoding Function Helper - SIO Driver Change
@@ -2321,31 +2405,36 @@ PAF_ASOT_stopOutput(
 /* 0: set, 1: check, unused for now. --Kurt */
 Int
 PAF_ASOT_setCheckRateX(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC, 
+    const PAF_ASOT_Params *pP, 
+    const PAF_ASOT_Patchs *pQ, 
+    PAF_ASOT_Config *pC, 
     Int check
 )
 {
+    PAF_AST_Config *pAstCfg;
     float rateX;
     PAF_SampleRateHz rateO /* std */, rateI /* inv */;
     Int z;                              /* output counter */
     Int zx;                             /* output re-counter */
     Int getVal;
     int inputRate, inputCount, outputRate, outputCount;
-    Int zMD = pC->masterDec;
-    Int zMI = pP->zone.master;
-    Int zMS = pC->masterStr;
+    Int zMD;
+    Int zMI;
+    Int zMS;
     Int zE, zX;
 
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    zMD = pAstCfg->masterDec;
+    zMS = pAstCfg->masterStr;
+    zMI = pP->zone.master;
 
-    inputRate = pC->xInp[zMI].inpBufStatus.sampleRateStatus;
-    inputCount = pC->xDec[zMD].decodeStatus.frameLength;
-    rateI = pC->xStr[zMS].pAudioFrame->fxns->sampleRateHz
-        (pC->xStr[zMS].pAudioFrame, inputRate, PAF_SAMPLERATEHZ_INV);
+    inputRate = pAstCfg->xInp[zMI].inpBufStatus.sampleRateStatus;
+    inputCount = pAstCfg->xDec[zMD].decodeStatus.frameLength;
+    rateI = pAstCfg->xStr[zMS].pAudioFrame->fxns->sampleRateHz
+        (pAstCfg->xStr[zMS].pAudioFrame, inputRate, PAF_SAMPLERATEHZ_INV);
 
     for (z=OUTPUT1; z < OUTPUTN; z++) {
-        if (pC->xOut[z].hTxSio && (pC->xOut[z].outBufStatus.clock & 0x01)) {
+        if (pAstCfg->xOut[z].hTxSio && (pAstCfg->xOut[z].outBufStatus.clock & 0x01)) {
 
             // determine associated encoder
             zE = z;
@@ -2356,10 +2445,10 @@ PAF_ASOT_setCheckRateX(
                 }
             }
 
-            outputRate = pC->xEnc[zE].encodeStatus.sampleRate;
-            outputCount = pC->xEnc[zE].encodeStatus.frameLength;
-            rateO = pC->xStr[zMS].pAudioFrame->fxns->sampleRateHz
-                (pC->xStr[zMS].pAudioFrame, outputRate, PAF_SAMPLERATEHZ_STD);
+            outputRate = pAstCfg->xEnc[zE].encodeStatus.sampleRate;
+            outputCount = pAstCfg->xEnc[zE].encodeStatus.frameLength;
+            rateO = pAstCfg->xStr[zMS].pAudioFrame->fxns->sampleRateHz
+                (pAstCfg->xStr[zMS].pAudioFrame, outputRate, PAF_SAMPLERATEHZ_STD);
             if (rateI > 0 && rateO > 0)
                 rateX = rateO /* std */ * rateI /* inv */;
             else if (inputCount != 0)
@@ -2367,11 +2456,11 @@ PAF_ASOT_setCheckRateX(
             else
                 return ( ASPERR_INFO_RATERATIO );
 
-            getVal = SIO_ctrl (pC->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_RATEX, (Arg) &rateX);
+            getVal = SIO_ctrl (pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_RATEX, (Arg) &rateX);
             if (getVal == DOBERR_RATECHANGE) {
                 for (zx=OUTPUT1; zx < OUTPUTN; zx++)
-                    if (pC->xOut[zx].hTxSio)
-                        SIO_idle (pC->xOut[zx].hTxSio);
+                    if (pAstCfg->xOut[zx].hTxSio)
+                        SIO_idle (pAstCfg->xOut[zx].hTxSio);
 
                 // this forces an exit from the calling state machine which will
                 // eventually call startOutput which calls setCheckRateX for all outputs
@@ -2403,21 +2492,24 @@ PAF_ASOT_setCheckRateX(
 //
 Int
 PAF_ASOT_streamChainFunction(
-    const PAF_AST_Params *pP, 
-    const PAF_AST_Patchs *pQ, 
-    PAF_AST_Config *pC, 
+    const PAF_ASOT_Params *pP, 
+    const PAF_ASOT_Patchs *pQ, 
+    PAF_ASOT_Config *pC, 
     Int iChainFrameFxns, 
     Int abortOnError, 
     Int logArg
 )
 {
-    Int as = pC->as;                    /* Audio Stream Number (1, 2, etc.) */
-    Int z;                              /* stream counter */
-    Int errno;                          /* error number */
+    PAF_AST_Config *pAstCfg;
+    Int as;                     /* Audio Stream Number (1, 2, etc.) */
+    Int z;                      /* stream counter */
+    Int errno;                  /* error number */
     Int dFlag, eFlag, gear;
     Int zX;
     Int zS;
 
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+    as = pAstCfg->as;
     (void)as; // clear compiler warning in case not used with tracing disabled
 
     for (zS = STREAM1; zS < STREAMN; zS++)
@@ -2434,22 +2526,22 @@ PAF_ASOT_streamChainFunction(
         gear = 0;
         for (zX = DECODE1; zX < DECODEN; zX++) {
             if (pP->streamsFromDecodes[zX] == z) {
-                dFlag = pC->xDec[zX].decodeStatus.mode;
-                gear = pC->xDec[zX].decodeStatus.aspGearStatus;
+                dFlag = pAstCfg->xDec[zX].decodeStatus.mode;
+                gear = pAstCfg->xDec[zX].decodeStatus.aspGearStatus;
                 break;
             }
         }
         eFlag = 1;
         for (zX = ENCODE1; zX < ENCODEN; zX++) {
             if (pP->streamsFromEncodes[zX] == z) {
-                eFlag = pC->xEnc[zX].encodeStatus.mode;
+                eFlag = pAstCfg->xEnc[zX].encodeStatus.mode;
                 break;
             }
         }
 
         if (dFlag && eFlag) {
-            PAF_ASP_Chain *chain = pC->xStr[z].aspChain[gear];
-            PAF_AudioFrame *frame = pC->xStr[z].pAudioFrame;
+            PAF_ASP_Chain *chain = pAstCfg->xStr[z].aspChain[gear];
+            PAF_AudioFrame *frame = pAstCfg->xStr[z].pAudioFrame;
             Int (*func) (PAF_ASP_Chain *, PAF_AudioFrame *) =
                 chain->fxns->chainFrameFunction[iChainFrameFxns];
 
@@ -2495,22 +2587,25 @@ PAF_ASOT_streamChainFunction(
     }
 
     return 0;
-} //PAF_AST_streamChainFunction
+} //PAF_ASOT_streamChainFunction
 
 /* FL: Check if at least one output selected */
 static Int checkOutSel(
-    const PAF_AST_Params *pP, 
-    PAF_AST_Config *pC,
+    const PAF_ASOT_Params *pP, 
+    PAF_ASOT_Config *pC,
     Int *pOutSel
 )
 {
+    PAF_AST_Config *pAstCfg;
     Int outSel;
     Int z;
     
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+
     outSel = 0;
     for (z=OUTPUT1; z < OUTPUTN; z++) 
     {
-        if (pC->xOut[z].hTxSio)
+        if (pAstCfg->xOut[z].hTxSio)
         {
             outSel = 1;
             break;
@@ -2524,18 +2619,21 @@ static Int checkOutSel(
 
 /* FL: Check if at least one output sio changed */
 static Int checkOutSio(
-    const PAF_AST_Params *pP, 
-    PAF_AST_Config *pC,
+    const PAF_ASOT_Params *pP, 
+    PAF_ASOT_Config *pC,
     Int *pOutSioUpdate
 )
 {
+    PAF_AST_Config *pAstCfg;
     Int outSioUpdate;
     Int z;
     
+    pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+
     outSioUpdate = 0;
     for (z=OUTPUT1; z < OUTPUTN; z++) 
     {
-        if (pC->xOut[z].outBufStatus.sioSelect >= 0)
+        if (pAstCfg->xOut[z].outBufStatus.sioSelect >= 0)
         {
             outSioUpdate = 1;
             break;