]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blobdiff - pasdk/test_dsp/framework/audioStreamInpProc.c
PASDK183: maxFramelength updated to 8192
[processor-sdk/performance-audio-sr.git] / pasdk / test_dsp / framework / audioStreamInpProc.c
index 94cdf30f01e83a375d616aa562e2f78495f7c273..318a5feb73b80179fdaa898c90fb4e4047b04fdf 100644 (file)
@@ -71,6 +71,8 @@ All rights reserved.
 // FL: debug
 #include "dbgCapAf.h"
 
+#include "statusOp_common.h"
+
 
 // -----------------------------------------------------------------------------
 // Debugging Trace Control, local to this file.
@@ -334,6 +336,9 @@ Void taskAsipFxn(
     // Messaging
     ASP_Msg *pAspMsg;              
     Int status;
+#ifdef NON_CACHE_STATUS
+    Int8 tempVar8;
+#endif
 
     Log_info0("Enter taskAsipFxn()");
     
@@ -528,8 +533,30 @@ Void taskAsipFxn(
     Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_THD2]), sizeof(Int), Cache_Type_ALLD, 0);
     size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_THD2]->size;
     Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_THD2]), size, Cache_Type_ALLD, 0);
+    size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DTSUHDA]->size;
+    Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DTSUHDA]), size, Cache_Type_ALLD, 0);
     Cache_wait();
     
+#ifdef NON_CACHE_STATUS
+    // Get the shared status structure GateMP handles. Initialized at slave.
+    if (statusOp_Init(GATEMP_INDEX_DEC) == STATUSOP_INIT_FAIL)
+    {
+        Log_info1("TaskAfp: Gate Index %d:Open status GateMP Fail.", GATEMP_INDEX_DEC);
+    }
+    if (statusOp_Init(GATEMP_INDEX_DDP) == STATUSOP_INIT_FAIL)
+    {
+        Log_info1("TaskAfp: Gate Index %d:Open status GateMP Fail.", GATEMP_INDEX_DDP);
+    }
+    if (statusOp_Init(GATEMP_INDEX_PCM) == STATUSOP_INIT_FAIL)
+    {
+        Log_info1("TaskAfp: Gate Index %d:Open status GateMP Fail.", GATEMP_INDEX_PCM);
+    }
+    if (statusOp_Init(GATEMP_INDEX_THD) == STATUSOP_INIT_FAIL)
+    {
+        Log_info1("TaskAfp: Gate Index %d:Open status GateMP Fail.", GATEMP_INDEX_THD);
+    }
+#endif
+
     // (***) FL: revisit
     // invalidate Dec configuration
     Cache_inv(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
@@ -607,7 +634,15 @@ Void taskAsipFxn(
         // so set to unknown and skip any remaining processing
         if (!pAstCfg->xInp[zMI].hRxSio)
         {
+#ifdef NON_CACHE_STATUS
+            tempVar8 = PAF_SOURCE_UNKNOWN;
+            statusOp_write(&(pAstCfg->xDec[zMD].decodeStatus.sourceProgram),
+                           &tempVar8,
+                           sizeof(tempVar8),
+                           GATEMP_INDEX_DEC);
+#else
             pAstCfg->xDec[zMD].decodeStatus.sourceProgram = PAF_SOURCE_UNKNOWN;
+#endif
             TRACE_VERBOSE1("TaskAsip: AS%d: No input selected...", as+zMS);
             continue;
         }
@@ -619,13 +654,43 @@ Void taskAsipFxn(
             continue;
         }
         
+#ifdef NON_CACHE_STATUS
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[zMD].decodeStatus.mode),
+                      sizeof(tempVar8),
+                      GATEMP_INDEX_DEC);
+        // 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 NON_CACHE_STATUS
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[zMD].decodeStatus.sourceSelect),
+                      sizeof(tempVar8),
+                      GATEMP_INDEX_DEC);
+        // 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),
+                           GATEMP_INDEX_DEC);
+            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) 
         {
@@ -633,12 +698,30 @@ Void taskAsipFxn(
             TRACE_VERBOSE1("TaskAsip: AS%d: no source selected, continue", as+zMS);
             continue;
         }
+#endif
+
+#ifdef NON_CACHE_STATUS
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[zMD].decodeStatus.sourceSelect),
+                      sizeof(tempVar8),
+                      GATEMP_INDEX_DEC);
+        // 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),
+                           GATEMP_INDEX_DEC);
+#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)
             {
@@ -653,6 +736,22 @@ Void taskAsipFxn(
             continue;
         }
 
+#ifdef NON_CACHE_STATUS
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[zMD].decodeStatus.sourceSelect),
+                      sizeof(tempVar8),
+                      GATEMP_INDEX_DEC);
+        // .....................................................................
+        // 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
@@ -663,6 +762,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))
@@ -671,7 +771,14 @@ Void taskAsipFxn(
             errno = ASPERR_AUTO_PROGRAM;
             continue;
         }
+#ifdef NON_CACHE_STATUS
+        statusOp_write(&(pAstCfg->xDec[zMD].decodeStatus.sourceProgram),
+                      &(sourceProgram),
+                      sizeof(sourceProgram),
+                      GATEMP_INDEX_DEC);
+#else
         pAstCfg->xDec[zMD].decodeStatus.sourceProgram = sourceProgram;
+#endif
 
         // if input is unclassifiable then do nothing
         if (sourceProgram == PAF_SOURCE_UNKNOWN)
@@ -684,8 +791,17 @@ Void taskAsipFxn(
         // input frame, we determine whether or not to call decodeProcessing and with
         // what decAlg.
         sourceSelect = PAF_SOURCE_NONE;
+#ifdef NON_CACHE_STATUS
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[zMD].decodeStatus.sourceSelect),
+                      sizeof(tempVar8),
+                      GATEMP_INDEX_DEC);
+        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:
@@ -730,7 +846,15 @@ Void taskAsipFxn(
             // If user made specific selection then program must match select.
             // (NB: this compare relies on ordering of PAF_SOURCE)
             default:
+#ifdef NON_CACHE_STATUS
+                sourceSelect = 0; // due to size difference
+                statusOp_read(&sourceSelect,
+                              &(pAstCfg->xDec[zMD].decodeStatus.sourceSelect),
+                              sizeof(Int8),
+                              GATEMP_INDEX_DEC);
+#else
                 sourceSelect = pAstCfg->xDec[zMD].decodeStatus.sourceSelect;
+#endif
                 if ((sourceSelect >= PAF_SOURCE_PCM) && (sourceSelect <= PAF_SOURCE_N))
                 {
                     if (sourceProgram != sourceSelect)
@@ -900,6 +1024,16 @@ PAF_ASIT_initPhaseMalloc(
         INPUTN * sizeof (*pAstCfg->xInp),
         HEAP_ID_INTERNAL1_SHM, (IArg)pAstCfg->xInp);
 
+#ifdef NON_CACHE_STATUS
+    /* Decode memory */
+    if (!(pAstCfg->xDec = Memory_calloc((IHeap_Handle)HEAP_EXTERNAL_NONCACHED_SHM,
+        DECODEN * sizeof (*pAstCfg->xDec), 4, &eb)))
+    {
+        TRACE_TERSE1("PAF_ASIT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
+        SW_BREAKPOINT;
+        return __LINE__;
+    }
+#else
     /* Decode memory */
     if (!(pAstCfg->xDec = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, 
         DECODEN * sizeof (*pAstCfg->xDec), 4, &eb)))
@@ -908,6 +1042,7 @@ PAF_ASIT_initPhaseMalloc(
         SW_BREAKPOINT;
         return __LINE__;
     }
+#endif
     TRACE_TERSE3("PAF_ASIT_initPhaseMalloc. (pC->xDec) %d bytes from space %d at 0x%x.",
         DECODEN * sizeof (*pAstCfg->xDec),
         HEAP_ID_INTERNAL1_SHM, (IArg)pAstCfg->xDec);
@@ -1083,11 +1218,12 @@ PAF_ASIT_initPhaseCommon(
     //
     TRACE_TERSE0("PAF_ASIT_initPhaseCommon: calling PAF_ALG_setup.");
     PAF_ALG_setup(&pafAlgConfig, 
-        HEAP_ID_INTERNAL,       HEAP_INTERNAL, 
-        HEAP_ID_INTERNAL1,      HEAP_INTERNAL1, 
-        HEAP_ID_EXTERNAL,       HEAP_EXTERNAL, 
-        HEAP_ID_INTERNAL1_SHM,  HEAP_INTERNAL1_SHM, 
-        HEAP_ID_EXTERNAL_SHM,   HEAP_EXTERNAL_SHM, 
+        HEAP_ID_INTERNAL,               HEAP_INTERNAL, 
+        HEAP_ID_INTERNAL1,              HEAP_INTERNAL1, 
+        HEAP_ID_EXTERNAL,               HEAP_EXTERNAL, 
+        HEAP_ID_INTERNAL1_SHM,          HEAP_INTERNAL1_SHM, 
+        HEAP_ID_EXTERNAL_SHM,           HEAP_EXTERNAL_SHM, 
+        HEAP_ID_EXTERNAL_NONCACHED_SHM, HEAP_EXTERNAL_NONCACHED_SHM,
         HEAP_CLEAR);
 
     if (pP->fxns->headerPrint)
@@ -1286,11 +1422,12 @@ PAF_ASIT_initPhaseDevice(
     if (pP->fxns->bufMemPrint)
     {
         PAF_ALG_setup (&pafAlgConfig, 
-            HEAP_ID_INTERNAL,       HEAP_INTERNAL, 
-            HEAP_ID_INTERNAL1,      HEAP_INTERNAL1,
-            HEAP_ID_EXTERNAL,       HEAP_EXTERNAL,
-            HEAP_ID_INTERNAL1_SHM,  HEAP_INTERNAL1_SHM,
-            HEAP_ID_EXTERNAL_SHM,   HEAP_EXTERNAL_SHM,
+            HEAP_ID_INTERNAL,               HEAP_INTERNAL, 
+            HEAP_ID_INTERNAL1,              HEAP_INTERNAL1,
+            HEAP_ID_EXTERNAL,               HEAP_EXTERNAL,
+            HEAP_ID_INTERNAL1_SHM,          HEAP_INTERNAL1_SHM,
+            HEAP_ID_EXTERNAL_SHM,           HEAP_EXTERNAL_SHM,
+            HEAP_ID_EXTERNAL_NONCACHED_SHM, HEAP_EXTERNAL_NONCACHED_SHM,
             HEAP_CLEAR);
         TRACE_TERSE2("PAF_ASIT_initPhaseDevice: AS%d: calling PAF_ALG_setup with clear at %d.", as, HEAP_CLEAR);
     }
@@ -1366,6 +1503,7 @@ PAF_ASIT_initPhaseDecOpCircBuf(
         SW_BREAKPOINT;
         return __LINE__;
     }
+
     TRACE_TERSE3("PAF_ASIT_initPhaseDecOpCircBuf. (pC->xDecOpCb) %d bytes from space %d at 0x%x.",
         DECODEN * sizeof (*pAstCfg->xDecOpCb),
         HEAP_ID_INTERNAL1_SHM, (IArg)pAstCfg->xDecOpCb);
@@ -1874,7 +2012,9 @@ PAF_ASIT_decodeProcessing(
     //PAF_InpBufConfig *pIpBufConfig;
     Int frame; // decoder input frame count
     Int block; // (***) FL: formerly  -- decoder output block count / input frame
-
+#ifdef NON_CACHE_STATUS
+    Int8 tempVar8, tempVar8_2;
+#endif
     
     pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
     zMD = pAstCfg->masterDec;
@@ -1893,12 +2033,25 @@ PAF_ASIT_decodeProcessing(
     state = INIT;
     errno = 0; /* error number */
 
-    TRACE_TERSE1("PAF_ASIT_decodeProcessing: sourceSelect is %d", pAstCfg->xDec[zMD].decodeStatus.sourceSelect);
+#ifdef NON_CACHE_STATUS
+    statusOp_read(&tempVar8,
+                  &(pAstCfg->xDec[zMD].decodeStatus.sourceSelect),
+                  sizeof(tempVar8),
+                  GATEMP_INDEX_DEC);
+    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;
         }
@@ -1941,12 +2094,13 @@ 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);
-                size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_THD]->size;
-                Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_THD]), size, Cache_Type_ALLD, 0);
+                Cache_wait();*/
+                size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DTSUHDA]->size;
+                Cache_wb((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DTSUHDA]), size, Cache_Type_ALLD, 0);
                 Cache_wait();
 #endif
 #if 0
@@ -1970,12 +2124,13 @@ 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);
-                size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_THD]->size;
-                Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_THD]), size, Cache_Type_ALLD, 0);
+                Cache_wait();*/
+                size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DTSUHDA]->size;
+                Cache_inv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DTSUHDA]), size, Cache_Type_ALLD, 0);
                 Cache_wait();
 #endif
                 
@@ -2017,18 +2172,48 @@ PAF_ASIT_decodeProcessing(
                 //Cache_wait();                            
 #endif                
 
+
+#ifdef NON_CACHE_STATUS
+                statusOp_read(&tempVar8,
+                              &(pAstCfg->xDec[zMD].decodeStatus.sourceDecode),
+                              sizeof(tempVar8),
+                              GATEMP_INDEX_DEC);
+
+                statusOp_read(&tempVar8_2,
+                              &(pAstCfg->xDec[zMD].decodeStatus.sampleRate),
+                              sizeof(tempVar8),
+                              GATEMP_INDEX_DEC);
+                // 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)
+                     (tempVar8_2 == PAF_SAMPLERATE_UNKNOWN)  // debug chitresh as per govind
+                        )
+#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 NON_CACHE_STATUS
+                        statusOp_read(&tempVar8,
+                                      &(pAstCfg->xDec[z].decodeStatus.mode),
+                                      sizeof(tempVar8),
+                                      GATEMP_INDEX_DEC);
+                        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))
@@ -2200,6 +2385,9 @@ PAF_ASIT_decodeCommand(
     Int as;                 /* Audio Stream Number (1, 2, etc.) */
     Int z;                  /* decode counter */
     Int zS;
+#ifdef NON_CACHE_STATUS
+    Int8 tempVar8;
+#endif
 
     pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
     as = pAstCfg->as;
@@ -2207,9 +2395,46 @@ PAF_ASIT_decodeCommand(
     for (z=DECODE1; z < DECODEN; z++) 
     {
         zS = pP->streamsFromDecodes[z];
-        if (!(pAstCfg->xDec[z].decodeStatus.command2 & 0x80)) 
+#ifdef NON_CACHE_STATUS
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[z].decodeStatus.command2),
+                      sizeof(tempVar8),
+                      GATEMP_INDEX_DEC);
+        if (!(tempVar8 & 0x80))
+        {
+            switch (tempVar8)
+            {
+                case 0: // command none - process
+                    tempVar8 |= 0x80;
+                    statusOp_write(&(pAstCfg->xDec[z].decodeStatus.command2),
+                                   &tempVar8,
+                                   sizeof(tempVar8),
+                                   GATEMP_INDEX_DEC);
+                    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),
+                                   GATEMP_INDEX_DEC);
+                    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),
+                                   GATEMP_INDEX_DEC);
+                    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;
@@ -2226,6 +2451,7 @@ PAF_ASIT_decodeCommand(
                     break;
             }
         }
+#endif
     }
 
     return 0;
@@ -2263,6 +2489,9 @@ PAF_ASIT_decodeInit(
     Int argIdx;
     Int decErrno;
     Int status;
+#ifdef NON_CACHE_STATUS
+    Int8 tempVar8;
+#endif
     
     pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
     as = pAstCfg->as;
@@ -2272,6 +2501,36 @@ PAF_ASIT_decodeInit(
     
     pCbCtl = &pC->pAspmCfg->decOpCircBufCtl; // get pointer to circular buffer control
 
+#ifdef NON_CACHE_STATUS
+    // reset frameCount
+    for (z=DECODE1; z < DECODEN; z++)
+    {
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[z].decodeStatus.mode),
+                      sizeof(tempVar8),
+                      GATEMP_INDEX_DEC);
+        if (tempVar8)
+        {
+            tempVar8 = 0;
+            statusOp_write(&(pAstCfg->xDec[z].decodeStatus.frameCount),
+                          &tempVar8,
+                          sizeof(tempVar8),
+                          GATEMP_INDEX_DEC);
+        }
+    }
+
+    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),
+                      GATEMP_INDEX_DEC);
+        if (pAstCfg->xInp[zI].hRxSio && tempVar8)
+        {
+#else
     // reset frameCount
     for (z=DECODE1; z < DECODEN; z++)
     {
@@ -2281,13 +2540,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);
@@ -2418,8 +2678,21 @@ PAF_ASIT_decodeInit(
                 return errno;
 #endif
             
+#ifdef NON_CACHE_STATUS
+            gear = 0;  // due to size difference
+            statusOp_read(&gear,
+                          &(pAstCfg->xDec[z].decodeStatus.aspGearControl),
+                          sizeof(Int8),
+                          GATEMP_INDEX_DEC);
+            tempVar8 = gear < GEARS ? gear : 0;
+            statusOp_write(&(pAstCfg->xDec[z].decodeStatus.aspGearStatus),
+                           &tempVar8,
+                           sizeof(tempVar8),
+                           GATEMP_INDEX_DEC);
+#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], 
@@ -2443,6 +2716,17 @@ PAF_ASIT_decodeInit(
             {
                 frameLength = 1536; //QIN FIX ME
             }
+            else if ((sourceSelect == PAF_SOURCE_DTS)   ||
+                     (sourceSelect == PAF_SOURCE_DTSHD) ||
+                     (sourceSelect == PAF_SOURCE_DTS12) ||
+                     (sourceSelect == PAF_SOURCE_DTS13) ||
+                     (sourceSelect == PAF_SOURCE_DTS14) ||
+                     (sourceSelect == PAF_SOURCE_DTS16) ||
+                     (sourceSelect == PAF_SOURCE_DTSALL)
+                    )
+            {
+                frameLength = 8192; // TODO: Chitresh FIX ME
+            }
             else
             {
                 frameLength = 256;
@@ -2476,11 +2760,23 @@ PAF_ASIT_decodeInit(
                 }
             }
 
+#ifdef NON_CACHE_STATUS
+            statusOp_read(&tempVar8,
+                          &(pAstCfg->xDec[z].decodeStatus.sourceSelect),
+                          sizeof(Int8),
+                          GATEMP_INDEX_DEC);
+            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))
             {
@@ -2542,6 +2838,10 @@ PAF_ASIT_decodeInfo(
     ASP_Msg *pAspMsg;          /* Messaging */
     Int argIdx;
     Int status;
+#ifdef NON_CACHE_STATUS
+    Int8 tempVar8;
+    Int tempVar;
+#endif
     // FL: revisit
     //Int size;
     //PAF_InpBufConfig *pIpBufConfig;
@@ -2586,10 +2886,21 @@ PAF_ASIT_decodeInfo(
                     // return (ASPERR_INFO_RATECHANGE);
                 }
             }
+#ifdef NON_CACHE_STATUS
+            statusOp_read(&tempVar8,
+                          &(pAstCfg->xDec[zD].decodeStatus.sourceDecode),
+                          sizeof(Int8),
+                          GATEMP_INDEX_DEC);
             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 
         {
@@ -2630,8 +2941,17 @@ PAF_ASIT_decodeInfo(
         zI = pP->inputsFromDecodes[z];
         zS = pP->streamsFromDecodes[z];
         (void)zS; // clear compiler warning in case not used with tracing disabled
+#ifdef NON_CACHE_STATUS
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[z].decodeStatus.mode),
+                      sizeof(Int8),
+                      GATEMP_INDEX_DEC);
+        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,
@@ -2717,11 +3037,77 @@ PAF_ASIT_decodeInfo(
                 TRACE_TERSE1("return error errno 0x%x.", errno);
                 return errno;
             }
+#ifdef NON_CACHE_STATUS
+            statusOp_read(&tempVar,
+                          &(pAstCfg->xDec[z].decodeStatus.frameCount),
+                          sizeof(Int),
+                          GATEMP_INDEX_DEC);
+            // increment decoded frame count
+            tempVar += 1;
+            statusOp_write(&(pAstCfg->xDec[z].decodeStatus.frameCount),
+                           &tempVar,
+                           sizeof(Int),
+                           GATEMP_INDEX_DEC);
+#else
             // increment decoded frame count
             pAstCfg->xDec[z].decodeStatus.frameCount += 1;
+#endif
         }
     } // z=DECODE1 to DECODEN
 
+#ifdef NON_CACHE_STATUS
+    statusOp_read(&tempVar8,
+                  &(pAstCfg->xDec[zMD].decodeStatus.mode),
+                  sizeof(Int8),
+                  GATEMP_INDEX_DEC);
+    // 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),
+                       GATEMP_INDEX_DEC);
+    }
+
+    // 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),
+                      GATEMP_INDEX_DEC);
+        if (tempVar8)
+        {
+            statusOp_read(&tempVar8,
+                          &(pAstCfg->xDec[z].decodeStatus.sourceProgram),
+                          sizeof(Int8),
+                          GATEMP_INDEX_DEC);
+            statusOp_write(&(pAstCfg->xDec[z].decodeStatus.sourceDecode),
+                           &tempVar8,
+                           sizeof(Int8),
+                           GATEMP_INDEX_DEC);
+            statusOp_read(&tempVar8,
+                          &(pAstCfg->xDec[z].decodeStatus.sourceSelect),
+                          sizeof(Int8),
+                          GATEMP_INDEX_DEC);
+            if (tempVar8 == PAF_SOURCE_SNG)
+            {
+                tempVar8 = PAF_SOURCE_SNG;
+                statusOp_write(&(pAstCfg->xDec[z].decodeStatus.sourceDecode),
+                               &tempVar8,
+                               sizeof(Int8),
+                               GATEMP_INDEX_DEC);
+            }
+        }
+    }
+#else
     // query IB for latest sourceProgram (needed if we started decoding due to a force mode)
     if (pAstCfg->xDec[zMD].decodeStatus.mode) 
     {
@@ -2747,6 +3133,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
@@ -2861,6 +3248,9 @@ PAF_AST_decodeCont(
     Int z;                      /* decode counter */
     Int zI, zS;
     Int zMD;
+#ifdef NON_CACHE_STATUS
+    Int8 tempVar8;
+#endif
 
     
     pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
@@ -2869,14 +3259,26 @@ 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 NON_CACHE_STATUS
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[z].decodeStatus.mode),
+                      sizeof(Int8),
+                      GATEMP_INDEX_DEC);
+        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))
@@ -3059,6 +3461,17 @@ PAF_ASIT_decodeDecode(
             {
                 frameLength = 1536; //QIN FIX ME
             }
+            else if ((sourceSelect == PAF_SOURCE_DTS)   ||
+                     (sourceSelect == PAF_SOURCE_DTSHD) ||
+                     (sourceSelect == PAF_SOURCE_DTS12) ||
+                     (sourceSelect == PAF_SOURCE_DTS13) ||
+                     (sourceSelect == PAF_SOURCE_DTS14) ||
+                     (sourceSelect == PAF_SOURCE_DTS16) ||
+                     (sourceSelect == PAF_SOURCE_DTSALL)
+                    )
+            {
+                frameLength = 8192; // TODO: Chitresh FIX ME
+            }
             else
             {
                 frameLength = 256;
@@ -3147,12 +3560,28 @@ PAF_ASIT_decodeFinalTest(
     Int zMD;
     Int sourceSelect;
     Int sourceProgram;
+#ifdef NON_CACHE_STATUS
+    Int8 tempVar8, temp2Var8;
+#endif
 
     pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
     zMD = pAstCfg->masterDec;
 
+#ifdef NON_CACHE_STATUS
+    statusOp_read(&tempVar8,
+                  &(pAstCfg->xDec[zMD].decodeStatus.sourceSelect),
+                  sizeof(Int8),
+                  GATEMP_INDEX_DEC);
+    sourceSelect = tempVar8;
+    statusOp_read(&tempVar8,
+                  &(pAstCfg->xDec[zMD].decodeStatus.sourceProgram),
+                  sizeof(Int8),
+                  GATEMP_INDEX_DEC);
+    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))
     {
@@ -3184,10 +3613,25 @@ PAF_ASIT_decodeFinalTest(
         }
         else 
         {
+#ifdef NON_CACHE_STATUS
+            statusOp_read(&tempVar8,
+                          &(pAstCfg->xDec[zMD].decodeStatus.sourceDecode),
+                          sizeof(Int8),
+                          GATEMP_INDEX_DEC);
+            statusOp_read(&temp2Var8,
+                          &(pAstCfg->xDec[zMD].decodeStatus.sourceSelect),
+                          sizeof(Int8),
+                          GATEMP_INDEX_DEC);
+            if (temp2Var8 != tempVar8)
+            {
+                return 1;
+            }
+#else
             if (pAstCfg->xDec[zMD].decodeStatus.sourceSelect != pAstCfg->xDec[zMD].decodeStatus.sourceDecode)
             {
                 return 1;
             }
+#endif
         }
     }
 
@@ -3223,6 +3667,9 @@ PAF_ASIT_decodeComplete(
     Int argIdx;
     Int errno;                  /* error number */
     Int status;
+#ifdef NON_CACHE_STATUS
+    Int8 tempVar8;
+#endif
 
     
     pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
@@ -3238,8 +3685,17 @@ PAF_ASIT_decodeComplete(
         DEC_Handle dec = (DEC_Handle )decAlg[z];
 #endif /* PAF_ASP_FINAL */
         Int zI = pP->inputsFromDecodes[z];
+#ifdef NON_CACHE_STATUS
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[z].decodeStatus.mode),
+                      sizeof(Int8),
+                      GATEMP_INDEX_DEC);
+        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)
@@ -3405,15 +3861,33 @@ PAF_ASIT_sourceDecode(
 {
     PAF_AST_Config *pAstCfg;
     Int z;                              /* decode counter */
+#ifdef NON_CACHE_STATUS
+    Int8 tempVar8;
+#endif
 
     pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
 
     for (z=DECODE1; z < DECODEN; z++)
     {
+#ifdef NON_CACHE_STATUS
+        statusOp_read(&tempVar8,
+                      &(pAstCfg->xDec[z].decodeStatus.mode),
+                      sizeof(Int8),
+                      GATEMP_INDEX_DEC);
+        if (tempVar8)
+        {
+            tempVar8 = x;
+            statusOp_write(&(pAstCfg->xDec[z].decodeStatus.sourceDecode),
+                           &tempVar8,
+                           sizeof(Int8),
+                           GATEMP_INDEX_DEC);
+        }
+#else
         if (pAstCfg->xDec[z].decodeStatus.mode) 
         {
             pAstCfg->xDec[z].decodeStatus.sourceDecode = x;
         }
+#endif
     }
     
     return 0;