PASDK69: added common API to access shared status structures.
authorChitresh Gupta <chitresh.g@pathpartnertech.com>
Tue, 29 Nov 2016 10:09:43 +0000 (15:39 +0530)
committerChitresh Gupta <chitresh.g@pathpartnertech.com>
Tue, 29 Nov 2016 10:09:43 +0000 (15:39 +0530)
pasdk/test_arm/.cproject
pasdk/test_arm/application/app.cmd
pasdk/test_arm/framework/audioStreamDecodeProc.c
pasdk/test_dsp/.cproject
pasdk/test_dsp/application/app.cmd
pasdk/test_dsp/framework/audioStreamInpProc.c

index 5f4de546524c10519474e94703750a68f6b3927d..abae3ef3b86d0008777b6ecbd5b6fe74dd3a0623 100644 (file)
@@ -94,6 +94,7 @@
                                                                        <listOptionValue builtIn="false" value="&quot;${PROC_AUDIO_SDK_ROOT}/pasdk/paf/pa/f/include&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROC_AUDIO_SDK_ROOT}/pasdk/paf/pa/f/alpha&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROC_AUDIO_SDK_ROOT}/pasdk/paf/pa/util/c67x_cintrins&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${PROC_AUDIO_SDK_ROOT}/pasdk/paf/pa/util/statusop_common&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROC_AUDIO_SDK_ROOT}/pasdk/common&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROC_AUDIO_SDK_ROOT}/pasdk/shared&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROC_AUDIO_SDK_ROOT}/pasdk/test_arm/framework&quot;"/>
index f5fe68203ac54718544ba262e140bfae450c1d71..7c5354e20f7769389a0c4fb5544d48edeee8a631 100644 (file)
@@ -38,7 +38,7 @@ SEARCH_DIR ( C:\ti\processor_audio_sdk_1_00_00_00\dolby_ip\ddp\Dolby_Digital_Plu
 SEARCH_DIR ( C:\ti\processor_audio_sdk_1_00_00_00\dolby_ip\ddp\Dolby_Digital_Plus_Decoder_Imp\Source_Code\make\ddp_udc_wrapper\a15 )
 
 INPUT ( c67x_cintrins_elf.lib simulate_dma_elf.lib )
-INPUT ( acp_elf.lib asp_std_elf.lib com_asp_elf.lib com_dec_elf.lib pcm1_elf.lib  )
+INPUT ( acp_elf.lib asp_std_elf.lib com_asp_elf.lib com_dec_elf.lib pcm1_elf.lib statusop_common_elf.lib )
 INPUT ( dlb_intrinsics_generic_float32_release.a )
 INPUT ( ddp_dec_lib_generic_wrapper_release.a ddp_dec_lib_generic_float32_release.a )
 
index b2e2703afdf3ca7eaf56e701892f8e18550455f7..8bca5546e3169a62aaefd14b56fbc5b736518ce5 100644 (file)
@@ -61,6 +61,9 @@ All rights reserved.
 #include "audioStreamProc_common.h"
 #include "audioStreamDecodeProc.h"
 
+#include "statusOp_common.h"
+
+#define CACHE_COHERENCE
 // FL: debug
 //#include "fwkSim.h"
 #include "dbgCapAf.h"
@@ -155,6 +158,7 @@ Void taskAsdpFxn(
     Int status;
     Int zI;
     Int bufEnd, wrapSize, currentBufSize, chunkSize;
+    Int8 temp8;
 
     
     Log_info0("Enter taskAsdpFxn()");
@@ -283,20 +287,20 @@ Void taskAsdpFxn(
     // (***) FL: revisit
     // write back Status structures for Beta Units initialized on Slave
     size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]->size;
-    Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]), size, Cache_Type_ALLD, 0);
+    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_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]), size, Cache_Type_ALLD, 0);
+    Cache_wbInv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]), size, Cache_Type_ALLD, 0);
     size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM2]->size;
-    Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM2]), size, Cache_Type_ALLD, 0);
+    Cache_wbInv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM2]), size, Cache_Type_ALLD, 0);
     size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]->size;
-    Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), size, Cache_Type_ALLD, 0);
+    Cache_wbInv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), size, Cache_Type_ALLD, 0);
     size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP2]->size;
-    Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP2]), size, Cache_Type_ALLD, 0);
+    Cache_wbInv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP2]), size, Cache_Type_ALLD, 0);
     Cache_wait();
 
     // (***) FL: revisit
     // write back Dec configuration
-    Cache_wb(&pAstCfg->xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+    Cache_wbInv(&pAstCfg->xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
     Cache_wait();
     
     // Send initialization complete message to master
@@ -439,11 +443,11 @@ Void taskAsdpFxn(
                     // invalidate Status structures for shared Beta Units
                     //size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]->size;
                     //Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]), size, Cache_Type_ALLD, 0);
-                    size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]->size;
+                    /*size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]->size;
                     Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]), size, Cache_Type_ALLD, 0);
                     size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]->size;
                     Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), size, Cache_Type_ALLD, 0);
-                    Cache_wait();
+                    Cache_wait();*/
                     
                     argIdx = 0; // get decIdx
                     z = *(Int32 *)&pAspMsg->buf[argIdx];
@@ -501,18 +505,18 @@ Void taskAsdpFxn(
                     }
 
                     // write back Dec configuration
-                    Cache_wb(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+                    Cache_wbInv(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
                     Cache_wait();            
 
                     // (***) FL: revisit
                     // write back Status structures for shared Beta Units
                     //size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]->size;
                     //Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]), size, Cache_Type_ALLD, 0);
-                    size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]->size;
-                    Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]), size, Cache_Type_ALLD, 0);
+                   /* size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_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_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), size, Cache_Type_ALLD, 0);
-                    Cache_wait();
+                    Cache_wbInv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), size, Cache_Type_ALLD, 0);
+                    Cache_wait();*/
                     
                     // send dec reset complete message to master
                     queId = MessageQ_getReplyQueue(pAspMsg);
@@ -592,15 +596,25 @@ Void taskAsdpFxn(
                     }
                     
                     // write back Dec configuration
-                    Cache_wb(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+                    Cache_wbInv(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
                     Cache_wait();            
                     
-                    // Re-initialize audio frame if decoder is disabled or 
-                    // doesn't have a valid input 
+#ifdef CACHE_COHERENCE
+                    statusOp_read(&(temp8), &(pAstCfg->xDec[z].decodeStatus.mode), sizeof(Int8));
+                    // Re-initialize audio frame if decoder is disabled or
+                    // doesn't have a valid input
+                    if (!temp8 || !pAstCfg->xInp[zI].hRxSio)
+                    {
+                        pP->fxns->initFrame1(pP, pQ, pC, z, 0);
+                    }
+#else
+                    // Re-initialize audio frame if decoder is disabled or
+                    // doesn't have a valid input
                     if (!pAstCfg->xDec[z].decodeStatus.mode || !pAstCfg->xInp[zI].hRxSio)
                     {
                         pP->fxns->initFrame1(pP, pQ, pC, z, 0);
                     }
+#endif
 
                     // send dec info complete message to master
                     queId = MessageQ_getReplyQueue(pAspMsg);
@@ -696,16 +710,25 @@ Void taskAsdpFxn(
                     }
                     
                     // write back Dec configuration
-                    Cache_wb(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+                    Cache_wbInv(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
                     Cache_wait();
                     
+#ifdef CACHE_COHERENCE
+                    statusOp_read(&(temp8), &(pAstCfg->xDec[z].decodeStatus.mode), sizeof(Int8));
                     // Re-initialize audio frame if decoder is disabled or 
                     // doesn't have a valid input 
+                    if (!temp8 || !pAstCfg->xInp[zI].hRxSio)
+                    {
+                        pP->fxns->initFrame1(pP, pQ, pC, z, 0);
+                    }
+#else
+                    // Re-initialize audio frame if decoder is disabled or
+                    // doesn't have a valid input
                     if (!pAstCfg->xDec[z].decodeStatus.mode || !pAstCfg->xInp[zI].hRxSio)
                     {
                         pP->fxns->initFrame1(pP, pQ, pC, z, 0);
                     }
-
+#endif
                     // send dec info complete message to master
                     queId = MessageQ_getReplyQueue(pAspMsg);
                     pAspMsg->procId = hAspMsgSlave->slaveProcId;
index b38a62496da6aacfaa63a9b49a0cb9a2c5a31c00..e1dc75911372f0c56e13f900c13500cfdef5a3fd 100644 (file)
                                                                        <listOptionValue builtIn="false" value="&quot;${PROC_AUDIO_SDK_ROOT}/pasdk/paf/pa/f/s3&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROC_AUDIO_SDK_ROOT}/pasdk/paf/pa/f/include&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROC_AUDIO_SDK_ROOT}/pasdk/paf/pa/f/alpha&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${PROC_AUDIO_SDK_ROOT}/pasdk/paf/pa/util/statusop_common&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROC_AUDIO_SDK_ROOT}/pasdk/test_dsp/framework&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROC_AUDIO_SDK_ROOT}/pasdk/test_dsp/application/itopo/evmk2g/alpha&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROC_AUDIO_SDK_ROOT}/pasdk/test_dsp/sio&quot;"/>
index 35473592f7990cc1ff5a8e519bf29957f9726b59..617499336f1459f71641aad37ab04c95ed9afe53 100644 (file)
@@ -50,6 +50,7 @@ All rights reserved.
 -l"pce2_elf.lib"
 -l"pcm1_elf.lib"
 -l"dcs7_elf.lib"
+-l"statusop_common_elf.lib"
 
 -l"dolby_oar_lib.lib"
 -l"libcar_c66_float_release.lib"
index 9e06ee9d85e84deebd4353d75564bab8db3bb225..79bdaa143f91069cf7337b636c196edfca33018c 100644 (file)
@@ -71,6 +71,10 @@ All rights reserved.
 // FL: debug
 #include "dbgCapAf.h"
 
+#include "statusOp_common.h"
+
+#define CACHE_COHERENCE
+
 
 // -----------------------------------------------------------------------------
 // Debugging Trace Control, local to this file.
@@ -334,6 +338,9 @@ Void taskAsipFxn(
     // Messaging
     ASP_Msg *pAspMsg;              
     Int status;
+#ifdef CACHE_COHERENCE
+    Int8 tempVar8;
+#endif
 
     Log_info0("Enter taskAsipFxn()");
     
@@ -597,7 +604,14 @@ Void taskAsipFxn(
         // so set to unknown and skip any remaining processing
         if (!pAstCfg->xInp[zMI].hRxSio)
         {
+#ifdef CACHE_COHERENCE
+            tempVar8 = PAF_SOURCE_UNKNOWN;
+            statusOp_write(&(pAstCfg->xDec[zMD].decodeStatus.sourceProgram),
+                           &tempVar8,
+                           sizeof(tempVar8));
+#else
             pAstCfg->xDec[zMD].decodeStatus.sourceProgram = PAF_SOURCE_UNKNOWN;
+#endif
             TRACE_VERBOSE1("TaskAsip: AS%d: No input selected...", as+zMS);
             continue;
         }
@@ -609,13 +623,40 @@ Void taskAsipFxn(
             continue;
         }
         
+#ifdef CACHE_COHERENCE
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[zMD].decodeStatus.mode),
+                      sizeof(tempVar8));
+        // If master decoder is not enabled, or the input is unlocked, then do nothing
+        if (!tempVar8 || !pAstCfg->xInp[zMI].inpBufStatus.lock)
+        {
+            TRACE_VERBOSE0("TaskAsip: Not locked, continue");
+            continue;
+        }
+#else
         // If master decoder is not enabled, or the input is unlocked, then do nothing
         if (!pAstCfg->xDec[zMD].decodeStatus.mode || !pAstCfg->xInp[zMI].inpBufStatus.lock)
         {
             TRACE_VERBOSE0("TaskAsip: Not locked, continue");
             continue;
         }
+#endif
         
+#ifdef CACHE_COHERENCE
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[zMD].decodeStatus.sourceSelect),
+                      sizeof(tempVar8));
+        // If no source selected then do nothing
+        if (tempVar8 == PAF_SOURCE_NONE)
+        {
+            tempVar8 = PAF_SOURCE_NONE;
+            statusOp_write(&(pAstCfg->xDec[zMD].decodeStatus.sourceProgram),
+                           &tempVar8,
+                           sizeof(tempVar8));
+            TRACE_VERBOSE1("TaskAsip: AS%d: no source selected, continue", as+zMS);
+            continue;
+        }
+#else
         // If no source selected then do nothing
         if (pAstCfg->xDec[zMD].decodeStatus.sourceSelect == PAF_SOURCE_NONE) 
         {
@@ -623,12 +664,28 @@ Void taskAsipFxn(
             TRACE_VERBOSE1("TaskAsip: AS%d: no source selected, continue", as+zMS);
             continue;
         }
+#endif
 
+#ifdef CACHE_COHERENCE
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[zMD].decodeStatus.sourceSelect),
+                      sizeof(tempVar8));
+        // If we want pass processing then proceed directly
+        if (tempVar8 == PAF_SOURCE_PASS)
+        {
+            TRACE_VERBOSE1("TaskAsip: AS%d: Pass processing ...", as+zMS);
+
+            tempVar8 = PAF_SOURCE_PASS;
+            statusOp_write(&(pAstCfg->xDec[zMD].decodeStatus.sourceProgram),
+                           &tempVar8,
+                           sizeof(tempVar8));
+#else
         // If we want pass processing then proceed directly
         if (pAstCfg->xDec[zMD].decodeStatus.sourceSelect == PAF_SOURCE_PASS) 
         {
             TRACE_VERBOSE1("TaskAsip: AS%d: Pass processing ...", as+zMS);
             pAstCfg->xDec[zMD].decodeStatus.sourceProgram = PAF_SOURCE_PASS;
+#endif
             pP->fxns->sourceDecode(pP, pQ, pC, PAF_SOURCE_PASS);
             if (pP->fxns->passProcessing)
             {
@@ -643,6 +700,21 @@ Void taskAsipFxn(
             continue;
         }
 
+#ifdef CACHE_COHERENCE
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[zMD].decodeStatus.sourceSelect),
+                      sizeof(tempVar8));
+        // .....................................................................
+        // At this point we have an enabled input and want to decode something.
+        // 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, tempVar8, NULL)) // (***) FL: re-visit this, hard-coded to use PCM framelength inside function
+        {
+            TRACE_VERBOSE1("TaskAsip: autoProcessing returns 0x%x, continue", errno);
+            continue;
+        }
+#else
         // .....................................................................
         // At this point we have an enabled input and want to decode something.
         // If no decoder selected then do nothing. Need to reset the sourceProgram, since
@@ -653,6 +725,7 @@ Void taskAsipFxn(
             TRACE_VERBOSE1("TaskAsip: autoProcessing returns 0x%x, continue", errno);
             continue;
         }
+#endif
         
         // query for input type
         if (errno = SIO_ctrl(pAstCfg->xInp[zMI].hRxSio, PAF_SIO_CONTROL_GET_SOURCEPROGRAM, (Arg )&sourceProgram))
@@ -661,7 +734,13 @@ Void taskAsipFxn(
             errno = ASPERR_AUTO_PROGRAM;
             continue;
         }
+#ifdef CACHE_COHERENCE
+        statusOp_write(&(pAstCfg->xDec[zMD].decodeStatus.sourceProgram),
+                      &(sourceProgram),
+                      sizeof(sourceProgram));
+#else
         pAstCfg->xDec[zMD].decodeStatus.sourceProgram = sourceProgram;
+#endif
 
         // if input is unclassifiable then do nothing
         if (sourceProgram == PAF_SOURCE_UNKNOWN)
@@ -674,8 +753,16 @@ Void taskAsipFxn(
         // input frame, we determine whether or not to call decodeProcessing and with
         // what decAlg.
         sourceSelect = PAF_SOURCE_NONE;
+#ifdef CACHE_COHERENCE
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[zMD].decodeStatus.sourceSelect),
+                      sizeof(tempVar8));
+        switch (tempVar8)
+        {
+#else
         switch (pAstCfg->xDec[zMD].decodeStatus.sourceSelect) 
         {
+#endif
             // If autodetecting, decoding everything, and input is something
             // (i.e. bitstream or PCM) then decode.
             case PAF_SOURCE_AUTO:
@@ -720,7 +807,14 @@ Void taskAsipFxn(
             // If user made specific selection then program must match select.
             // (NB: this compare relies on ordering of PAF_SOURCE)
             default:
+#ifdef CACHE_COHERENCE
+                sourceSelect = 0; // due to size difference
+                statusOp_read(&sourceSelect,
+                              &(pAstCfg->xDec[zMD].decodeStatus.sourceSelect),
+                              sizeof(Int8));
+#else
                 sourceSelect = pAstCfg->xDec[zMD].decodeStatus.sourceSelect;
+#endif
                 if ((sourceSelect >= PAF_SOURCE_PCM) && (sourceSelect <= PAF_SOURCE_N))
                 {
                     if (sourceProgram != sourceSelect)
@@ -1863,7 +1957,9 @@ PAF_ASIT_decodeProcessing(
     //PAF_InpBufConfig *pIpBufConfig;
     Int frame; // decoder input frame count
     Int block; // (***) FL: formerly  -- decoder output block count / input frame
-
+#ifdef CACHE_COHERENCE
+    Int8 tempVar8;
+#endif
     
     pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
     zMD = pAstCfg->masterDec;
@@ -1882,12 +1978,24 @@ PAF_ASIT_decodeProcessing(
     state = INIT;
     errno = 0; /* error number */
 
-    TRACE_TERSE1("PAF_ASIT_decodeProcessing: sourceSelect is %d", pAstCfg->xDec[zMD].decodeStatus.sourceSelect);
+#ifdef CACHE_COHERENCE
+    statusOp_read(&tempVar8,
+                  &(pAstCfg->xDec[zMD].decodeStatus.sourceSelect),
+                  sizeof(tempVar8));
+    TRACE_TERSE1("PAF_ASIT_decodeProcessing: sourceSelect is %d", tempVar8);
 
     for (;;) 
+    {
+        if (tempVar8 == PAF_SOURCE_NONE)
+        {
+#else
+    TRACE_TERSE1("PAF_ASIT_decodeProcessing: sourceSelect is %d", pAstCfg->xDec[zMD].decodeStatus.sourceSelect);
+
+    for (;;)
     {
         if (pAstCfg->xDec[zMD].decodeStatus.sourceSelect == PAF_SOURCE_NONE)
         {
+#endif
             TRACE_VERBOSE0("PAF_ASIT_decodeProcessing: sourceSelect == PAF_SOURCE_NONE");
             state = QUIT;
         }
@@ -1930,11 +2038,11 @@ PAF_ASIT_decodeProcessing(
                 // write back Status structures for shared Beta Units
                 //size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]->size;
                 //Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]), size, Cache_Type_ALLD, 0);
-                size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]->size;
+                /*size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]->size;
                 Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]), size, Cache_Type_ALLD, 0);
                 size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]->size;
                 Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), size, Cache_Type_ALLD, 0);
-                Cache_wait();
+                Cache_wait();*/
 #endif
 #if 0
                 ////size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]->size;
@@ -1957,11 +2065,11 @@ PAF_ASIT_decodeProcessing(
                 // invalidate Status structures for shared Beta Units
                 //size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]->size;
                 //Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]), size, Cache_Type_ALLD, 0);
-                size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]->size;
+               /* size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]->size;
                 Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]), size, Cache_Type_ALLD, 0);
                 size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]->size;
                 Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), size, Cache_Type_ALLD, 0);
-                Cache_wait();
+                Cache_wait();*/
 #endif
                 
                 frame = 0;
@@ -2002,18 +2110,38 @@ PAF_ASIT_decodeProcessing(
                 //Cache_wait();                            
 #endif                
 
+
+#ifdef CACHE_COHERENCE
+                statusOp_read(&tempVar8,
+                              &(pAstCfg->xDec[zMD].decodeStatus.sourceDecode),
+                              sizeof(tempVar8));
+                // Don't start decode until major access unit is found.
+                if (((tempVar8 == PAF_SOURCE_THD)    ||
+                     (tempVar8 == PAF_SOURCE_DXP)    ||
+                     (tempVar8 == PAF_SOURCE_DTSHD)) &&
+                     (pAstCfg->xStr[zMS].pAudioFrame->sampleRate == PAF_SAMPLERATE_UNKNOWN)) 
+#else
                 // Don't start decode until major access unit is found.
                 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)) 
+                     (pAstCfg->xStr[zMS].pAudioFrame->sampleRate == PAF_SAMPLERATE_UNKNOWN))
+#endif
                 {
                     Int z;
                     for (z=DECODE1; z < DECODEN; z++) 
                     {
                         Int zI = pP->inputsFromDecodes[z];
+#ifdef CACHE_COHERENCE
+                        statusOp_read(&tempVar8,
+                                      &(pAstCfg->xDec[z].decodeStatus.mode),
+                                      sizeof(tempVar8));
+                        if (pAstCfg->xInp[zI].hRxSio && tempVar8)
+                        {
+#else
                         if (pAstCfg->xInp[zI].hRxSio && pAstCfg->xDec[z].decodeStatus.mode)
                         {
+#endif
                             TRACE_VERBOSE0("TaskAsip: PAF_ASIT_decodeProcessing: INFO1, SIO_issue");
                             if (SIO_issue(pAstCfg->xInp[zI].hRxSio, &pAstCfg->xInp[zI].inpBufConfig,
                                 sizeof(pAstCfg->xInp[zI].inpBufConfig), PAF_SIO_REQUEST_NEWFRAME))
@@ -2185,6 +2313,9 @@ PAF_ASIT_decodeCommand(
     Int as;                 /* Audio Stream Number (1, 2, etc.) */
     Int z;                  /* decode counter */
     Int zS;
+#ifdef CACHE_COHERENCE
+    Int8 tempVar8;
+#endif
 
     pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
     as = pAstCfg->as;
@@ -2192,9 +2323,42 @@ PAF_ASIT_decodeCommand(
     for (z=DECODE1; z < DECODEN; z++) 
     {
         zS = pP->streamsFromDecodes[z];
-        if (!(pAstCfg->xDec[z].decodeStatus.command2 & 0x80)) 
+#ifdef CACHE_COHERENCE
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[z].decodeStatus.command2),
+                      sizeof(tempVar8));
+        if (!(tempVar8 & 0x80))
+        {
+            switch (tempVar8)
+            {
+                case 0: // command none - process
+                    tempVar8 |= 0x80;
+                    statusOp_write(&(pAstCfg->xDec[z].decodeStatus.command2),
+                                   &tempVar8,
+                                   sizeof(tempVar8));
+                    break;
+                case 1: // command abort - leave now
+                    TRACE_TERSE2("AS%d: PAF_ASIT_decodeCommand: decode command abort (0x%02x)", as+zS, 1);
+                    tempVar8 |= 0x80;
+                    statusOp_write(&(pAstCfg->xDec[z].decodeStatus.command2),
+                                   &tempVar8,
+                                   sizeof(tempVar8));
+                    return (ASPERR_ABORT);
+                case 2: // command restart - leave later
+                    TRACE_TERSE2("AS%d: PAF_ASIT_decodeCommand: decode command quit (0x%02x)", as+zS, 2);
+                    tempVar8 |= 0x80;
+                    statusOp_write(&(pAstCfg->xDec[z].decodeStatus.command2),
+                                   &tempVar8,
+                                   sizeof(tempVar8));
+                    return (ASPERR_QUIT);
+                default: // command unknown - ignore
+                    break;
+            }
+        }
+#else
+        if (!(pAstCfg->xDec[z].decodeStatus.command2 & 0x80))
         {
-            switch (pAstCfg->xDec[z].decodeStatus.command2) 
+            switch (pAstCfg->xDec[z].decodeStatus.command2)
             {
                 case 0: // command none - process
                     pAstCfg->xDec[z].decodeStatus.command2 |= 0x80;
@@ -2211,6 +2375,7 @@ PAF_ASIT_decodeCommand(
                     break;
             }
         }
+#endif
     }
 
     return 0;
@@ -2248,6 +2413,9 @@ PAF_ASIT_decodeInit(
     Int argIdx;
     Int decErrno;
     Int status;
+#ifdef CACHE_COHERENCE
+    Int8 tempVar8;
+#endif
     
     pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
     as = pAstCfg->as;
@@ -2257,6 +2425,33 @@ PAF_ASIT_decodeInit(
     
     pCbCtl = &pC->pAspmCfg->decOpCircBufCtl; // get pointer to circular buffer control
 
+#ifdef CACHE_COHERENCE
+    // reset frameCount
+    for (z=DECODE1; z < DECODEN; z++)
+    {
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[z].decodeStatus.mode),
+                      sizeof(tempVar8));
+        if (tempVar8)
+        {
+            tempVar8 = 0;
+            statusOp_write(&(pAstCfg->xDec[z].decodeStatus.frameCount),
+                          &tempVar8,
+                          sizeof(tempVar8));
+        }
+    }
+
+    for (z=DECODE1; z < DECODEN; z++) 
+    {
+        zI = pP->inputsFromDecodes[z];
+        zS = pP->streamsFromDecodes[z];
+        (void)zS; // clear compiler warning in case not used with tracing disabled
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[z].decodeStatus.mode),
+                      sizeof(tempVar8));
+        if (pAstCfg->xInp[zI].hRxSio && tempVar8)
+        {
+#else
     // reset frameCount
     for (z=DECODE1; z < DECODEN; z++)
     {
@@ -2266,13 +2461,14 @@ PAF_ASIT_decodeInit(
         }
     }
 
-    for (z=DECODE1; z < DECODEN; z++) 
+    for (z=DECODE1; z < DECODEN; z++)
     {
         zI = pP->inputsFromDecodes[z];
         zS = pP->streamsFromDecodes[z];
         (void)zS; // clear compiler warning in case not used with tracing disabled
-        if (pAstCfg->xInp[zI].hRxSio && pAstCfg->xDec[z].decodeStatus.mode) 
+        if (pAstCfg->xInp[zI].hRxSio && pAstCfg->xDec[z].decodeStatus.mode)
         {
+#endif
             Uns gear;
             Int frameLength;
             TRACE_VERBOSE1("AS%d: PAF_ASIT_decodeInit: initializing decode", as+zS);
@@ -2403,8 +2599,19 @@ PAF_ASIT_decodeInit(
                 return errno;
 #endif
             
+#ifdef CACHE_COHERENCE
+            gear = 0;  // due to size difference
+            statusOp_read(&gear,
+                          &(pAstCfg->xDec[z].decodeStatus.aspGearControl),
+                          sizeof(Int8));
+            tempVar8 = gear < GEARS ? gear : 0;
+            statusOp_write(&(pAstCfg->xDec[z].decodeStatus.aspGearStatus),
+                           &tempVar8,
+                           sizeof(tempVar8));
+#else
             gear = pAstCfg->xDec[z].decodeStatus.aspGearControl;
             pAstCfg->xDec[z].decodeStatus.aspGearStatus = gear < GEARS ? gear : 0;
+#endif
             
 #if 0 // FL: change handle to decIdx (zone index)
             frameLength = pP->fxns->computeFrameLength(decAlg[z], 
@@ -2457,11 +2664,22 @@ PAF_ASIT_decodeInit(
                 }
             }
 
+#ifdef CACHE_COHERENCE
+            statusOp_read(&tempVar8,
+                          &(pAstCfg->xDec[z].decodeStatus.sourceSelect),
+                          sizeof(Int8));
+            if (errno = SIO_ctrl(pAstCfg->xInp[zI].hRxSio, PAF_SIO_CONTROL_SET_SOURCESELECT,
+                DECSIOMAP(tempVar8)))
+            {
+                return errno;
+            }
+#else
             if (errno = SIO_ctrl(pAstCfg->xInp[zI].hRxSio, PAF_SIO_CONTROL_SET_SOURCESELECT,
                 DECSIOMAP(pAstCfg->xDec[z].decodeStatus.sourceSelect)))
             {
                 return errno;
             }
+#endif
             if (errno = SIO_ctrl(pAstCfg->xInp[zI].hRxSio, PAF_SIO_CONTROL_SET_PCMFRAMELENGTH, 
                 frameLength))
             {
@@ -2523,6 +2741,10 @@ PAF_ASIT_decodeInfo(
     ASP_Msg *pAspMsg;          /* Messaging */
     Int argIdx;
     Int status;
+#ifdef CACHE_COHERENCE
+    Int8 tempVar8;
+    Int tempVar;
+#endif
     // FL: revisit
     //Int size;
     //PAF_InpBufConfig *pIpBufConfig;
@@ -2567,10 +2789,20 @@ PAF_ASIT_decodeInfo(
                     // return (ASPERR_INFO_RATECHANGE);
                 }
             }
+#ifdef CACHE_COHERENCE
+            statusOp_read(&tempVar8,
+                          &(pAstCfg->xDec[zD].decodeStatus.sourceDecode),
+                          sizeof(Int8));
             pAstCfg->xDec[zD].decodeControl.emphasis = 
+                tempVar8 != PAF_SOURCE_PCM
+                ? PAF_IEC_PREEMPHASIS_NO // fix for Mantis ID #119
+                : pAstCfg->xInp[z].inpBufStatus.emphasisStatus;
+#else
+            pAstCfg->xDec[zD].decodeControl.emphasis =
                 pAstCfg->xDec[zD].decodeStatus.sourceDecode != PAF_SOURCE_PCM
                 ? PAF_IEC_PREEMPHASIS_NO // fix for Mantis ID #119
                 : pAstCfg->xInp[z].inpBufStatus.emphasisStatus;
+#endif
         }
         else 
         {
@@ -2611,8 +2843,16 @@ PAF_ASIT_decodeInfo(
         zI = pP->inputsFromDecodes[z];
         zS = pP->streamsFromDecodes[z];
         (void)zS; // clear compiler warning in case not used with tracing disabled
+#ifdef CACHE_COHERENCE
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[z].decodeStatus.mode),
+                      sizeof(Int8));
+        if (pAstCfg->xInp[zI].hRxSio && tempVar8)
+        {
+#else
         if (pAstCfg->xInp[zI].hRxSio && pAstCfg->xDec[z].decodeStatus.mode) 
         {
+#endif
             TRACE_GEN2("PAF_ASIT_decodeInfo: AS%d: processing frame %d -- info", as+zS, frame);
 
             if (errno = pP->fxns->updateInputStatus(pAstCfg->xInp[zI].hRxSio,
@@ -2698,11 +2938,68 @@ PAF_ASIT_decodeInfo(
                 TRACE_TERSE1("return error errno 0x%x.", errno);
                 return errno;
             }
+#ifdef CACHE_COHERENCE
+            statusOp_read(&tempVar,
+                          &(pAstCfg->xDec[z].decodeStatus.frameCount),
+                          sizeof(Int));
+            // increment decoded frame count
+            tempVar += 1;
+            statusOp_write(&(pAstCfg->xDec[z].decodeStatus.frameCount),
+                           &tempVar,
+                           sizeof(Int));
+#else
             // increment decoded frame count
             pAstCfg->xDec[z].decodeStatus.frameCount += 1;
+#endif
         }
     } // z=DECODE1 to DECODEN
 
+#ifdef CACHE_COHERENCE
+    statusOp_read(&tempVar8,
+                  &(pAstCfg->xDec[zMD].decodeStatus.mode),
+                  sizeof(Int8));
+    // query IB for latest sourceProgram (needed if we started decoding due to a force mode)
+    if (tempVar8)
+    {
+        XDAS_Int8 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;
+        }
+        statusOp_write(&(pAstCfg->xDec[zMD].decodeStatus.sourceProgram),
+                       &(sourceProgram),
+                       sizeof(Int8));
+    }
+
+    // since now decoding update decode status for all enabled decoders
+    for (z=DECODE1; z < DECODEN; z++)
+    {
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[z].decodeStatus.mode),
+                      sizeof(Int8));
+        if (tempVar8)
+        {
+            statusOp_read(&tempVar8,
+                          &(pAstCfg->xDec[z].decodeStatus.sourceProgram),
+                          sizeof(Int8));
+            statusOp_write(&(pAstCfg->xDec[z].decodeStatus.sourceDecode),
+                           &tempVar8,
+                           sizeof(Int8));
+            statusOp_read(&tempVar8,
+                          &(pAstCfg->xDec[z].decodeStatus.sourceSelect),
+                          sizeof(Int8));
+            if (tempVar8 == PAF_SOURCE_SNG)
+            {
+                tempVar8 = PAF_SOURCE_SNG;
+                statusOp_write(&(pAstCfg->xDec[z].decodeStatus.sourceDecode),
+                               &tempVar8,
+                               sizeof(Int8));
+            }
+        }
+    }
+#else
     // query IB for latest sourceProgram (needed if we started decoding due to a force mode)
     if (pAstCfg->xDec[zMD].decodeStatus.mode) 
     {
@@ -2728,6 +3025,7 @@ PAF_ASIT_decodeInfo(
             }
         }
     }
+#endif
 
 #if 0 // FL: ASDT (slave)
     // TODO: move this to start of this function so that it doesn't affect IO timing
@@ -2842,6 +3140,9 @@ PAF_AST_decodeCont(
     Int z;                      /* decode counter */
     Int zI, zS;
     Int zMD;
+#ifdef CACHE_COHERENCE
+    Int8 tempVar8;
+#endif
 
     
     pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
@@ -2850,14 +3151,25 @@ PAF_AST_decodeCont(
     (void)as;  // clear compiler warning in case not used with tracing disabled
     
     // Await slave inputs
-    for (z=DECODE1; z < DECODEN; z++) {
+    for (z=DECODE1; z < DECODEN; z++)
+    {
         zI = pP->inputsFromDecodes[z];
         zS = pP->streamsFromDecodes[z];
         (void)zS;
+#ifdef CACHE_COHERENCE
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[z].decodeStatus.mode),
+                      sizeof(Int8));
+        if (z == zMD
+            || ! pAstCfg->xInp[zI].hRxSio
+            || ! tempVar8)
+            continue;
+#else
         if (z == zMD
             || ! pAstCfg->xInp[zI].hRxSio
             || ! pAstCfg->xDec[z].decodeStatus.mode)
             continue;
+#endif
         TRACE_VERBOSE2("PAF_AST_decodeCont: AS%d: awaiting frame %d -- data", as+zS, frame);
         if (SIO_reclaim(pAstCfg->xInp[zI].hRxSio, (Ptr)&pAstCfg->xInp[zI].pInpBuf, NULL)
             != sizeof (pAstCfg->xInp[zI].inpBufConfig))
@@ -3124,12 +3436,26 @@ PAF_ASIT_decodeFinalTest(
     Int zMD;
     Int sourceSelect;
     Int sourceProgram;
+#ifdef CACHE_COHERENCE
+    Int8 tempVar8, temp2Var8;
+#endif
 
     pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
     zMD = pAstCfg->masterDec;
 
+#ifdef CACHE_COHERENCE
+    statusOp_read(&tempVar8,
+                  &(pAstCfg->xDec[zMD].decodeStatus.sourceSelect),
+                  sizeof(Int8));
+    sourceSelect = tempVar8;
+    statusOp_read(&tempVar8,
+                  &(pAstCfg->xDec[zMD].decodeStatus.sourceProgram),
+                  sizeof(Int8));
+    sourceProgram = tempVar8;
+#else
     sourceSelect  = pAstCfg->xDec[zMD].decodeStatus.sourceSelect;
     sourceProgram = pAstCfg->xDec[zMD].decodeStatus.sourceProgram;
+#endif
 
     if ((sourceSelect == PAF_SOURCE_NONE) || (sourceSelect == PAF_SOURCE_PASS))
     {
@@ -3161,10 +3487,23 @@ PAF_ASIT_decodeFinalTest(
         }
         else 
         {
+#ifdef CACHE_COHERENCE
+            statusOp_read(&tempVar8,
+                          &(pAstCfg->xDec[zMD].decodeStatus.sourceDecode),
+                          sizeof(Int8));
+            statusOp_read(&temp2Var8,
+                          &(pAstCfg->xDec[zMD].decodeStatus.sourceSelect),
+                          sizeof(Int8));
+            if (temp2Var8 != tempVar8)
+            {
+                return 1;
+            }
+#else
             if (pAstCfg->xDec[zMD].decodeStatus.sourceSelect != pAstCfg->xDec[zMD].decodeStatus.sourceDecode)
             {
                 return 1;
             }
+#endif
         }
     }
 
@@ -3200,6 +3539,9 @@ PAF_ASIT_decodeComplete(
     Int argIdx;
     Int errno;                  /* error number */
     Int status;
+#ifdef CACHE_COHERENCE
+    Int8 tempVar8;
+#endif
 
     
     pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
@@ -3215,8 +3557,16 @@ PAF_ASIT_decodeComplete(
         DEC_Handle dec = (DEC_Handle )decAlg[z];
 #endif /* PAF_ASP_FINAL */
         Int zI = pP->inputsFromDecodes[z];
+#ifdef CACHE_COHERENCE
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[z].decodeStatus.mode),
+                      sizeof(Int8));
+        if (pAstCfg->xInp[zI].hRxSio && tempVar8)
+        {
+#else
         if (pAstCfg->xInp[zI].hRxSio && pAstCfg->xDec[z].decodeStatus.mode) 
         {
+#endif
             TRACE_VERBOSE1("PAF_ASIT_decodeComplete: AS%d: finalizing decode", as+z);
 #ifdef PAF_ASP_FINAL
             if (dec->fxns->final)
@@ -3382,15 +3732,31 @@ PAF_ASIT_sourceDecode(
 {
     PAF_AST_Config *pAstCfg;
     Int z;                              /* decode counter */
+#ifdef CACHE_COHERENCE
+    Int8 tempVar8;
+#endif
 
     pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
 
     for (z=DECODE1; z < DECODEN; z++)
     {
+#ifdef CACHE_COHERENCE
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[z].decodeStatus.mode),
+                      sizeof(Int8));
+        if (tempVar8)
+        {
+            tempVar8 = x;
+            statusOp_write(&(pAstCfg->xDec[z].decodeStatus.sourceDecode),
+                           &tempVar8,
+                           sizeof(Int8));
+        }
+#else
         if (pAstCfg->xDec[z].decodeStatus.mode) 
         {
             pAstCfg->xDec[z].decodeStatus.sourceDecode = x;
         }
+#endif
     }
     
     return 0;