PASDK-218:Move cbInitSourceSel() from DSP to ARM.
authorFrank Livingston <frank-livingston@ti.com>
Sun, 2 Jul 2017 19:13:49 +0000 (14:13 -0500)
committerFrank Livingston <frank-livingston@ti.com>
Sun, 2 Jul 2017 19:13:49 +0000 (14:13 -0500)
Old location: DSP:ASIT:decodeProcessing():INIT:decodeInit()
New location: ARM:ASDT:INFO

cbInitSourceSel() still initializes CB using hard-coded values for some
parameters (e.g. sampling rate). Need to udpate function to take AF input
for initialization of these parameters.

pasdk/common/aspDecOpCircBuf_common.h
pasdk/test_arm/framework/aspDecOpCircBuf_slave.c
pasdk/test_arm/framework/aspDecOpCircBuf_slave.h
pasdk/test_arm/framework/audioStreamDecodeProc.c
pasdk/test_dsp/framework/aspDecOpCircBuf_master.c
pasdk/test_dsp/framework/aspDecOpCircBuf_master.h
pasdk/test_dsp/framework/audioStreamInpProc.c

index bdaa50ef975fdefb4370cb82569de44612904e47..8d31fe3fb61a2d3cac71460b067cfe02c413dba4 100644 (file)
@@ -41,6 +41,8 @@ All rights reserved.
 #include "paftyp.h"
 #include "pafdec.h"
 
+#include "dbgBenchmark.h" // PCM high-sampling rate + SRC + CAR benchmarking
+
 //#define CB_RW_OP_CAP_PP // debug
 #ifdef CB_RW_OP_CAP_PP
 #define CB_OP_NONE        0
@@ -99,6 +101,10 @@ All rights reserved.
 #define ASP_DECODE_CB_GATE_NAME                 ( "AspDecOpCbGate" ) // name of GateMP used for circular buffer shared memory protection
 #define ASP_DECODE_CB_GATE_REGION_ID            ( 0 )                // IPC shared region ID used for CB gate allocation   
 
+#define DEF_SOURCE_SEL                          ( PAF_SOURCE_PCM )          // default source select
+#define DEF_DEC_OP_FRAME_LEN                    ( PAF_SYS_FRAMELENGTH )     // default decoder output frame length
+#define DEF_STR_FRAME_LEN                       ( PAF_SYS_FRAMELENGTH )     // default stream frame length
+
 // Decoder output circular buffer
 typedef struct PAF_AST_DecOpCircBuf 
 {
index 806f1dbf57c7f2bf5d6445a8c69fdcd5350df188..b258f747b6d0c6c6e5a2f13466da37bd288c71f5 100644 (file)
@@ -47,7 +47,7 @@ All rights reserved.
 
 #include "evmc66x_gpio_dbg.h" // Debug
 
-#if 0
+#if 0 // FL: moved to common
 // Initialize circular buffer control
 Int cbCtlInit(
     PAF_AST_DecOpCircBufCtl *pCbCtl,    // decoder output circular buffer control
@@ -77,6 +77,253 @@ Int cbCtlInit(
 }
 #endif
 
+// debug
+//Int8 gCbInitSourceSelCnt=0;
+//Int8 gCbInitSourceSelThdCnt=0;
+
+// Initialize circular buffer based on selected source
+Int cbInitSourceSel(
+    PAF_AST_DecOpCircBufCtl *pCbCtl,    // decoder output circular buffer control
+    Int8 cbIdx,                         // decoder output circular buffer index
+    Int8 sourceSelect,                  // source select (PCM, DDP, etc.)
+    Int16 decOpFrameLen,                // decoder output frame length (PCM samples)
+    Int16 strFrameLen,                  // stream frame length (PCM samples)
+    Int8 resetRwFlags                   // whether to reset reader, writer, and drain flags
+)
+{
+    IArg key;
+    GateMP_Handle gateHandle;
+    PAF_AST_DecOpCircBuf *pCb;
+    PAF_AudioFrame *pAfCb;
+    PAF_AudioData *pPcmBuf;
+    UInt8 *pMetaBuf;
+    Int8 n;
+    Int8 i;
+
+    //gCbInitSourceSelCnt++; // debug
+    
+    // Get gate handle
+    gateHandle = pCbCtl->gateHandle;
+    // Enter gate
+    key = GateMP_enter(gateHandle);
+
+    // Get circular buffer base pointer
+    pCb = &((*pCbCtl->pXDecOpCb)[cbIdx]);
+    
+    // Invalidate circular buffer configuration
+    Cache_inv(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
+    Cache_wait();
+
+    //Log_info1("cbInitSourceSel:afCb=0x%04x", (IArg)pCb->afCb); // debug
+
+    // set source select
+    pCb->sourceSel = sourceSelect;
+
+    // set input frame length
+    pCb->decOpFrameLen = decOpFrameLen;
+    
+    // set output frame length
+    pCb->strFrameLen = strFrameLen;
+
+    //pCb->afInitialLag = 0;  // default No lag
+    //pCb->afLagIdx = 0;
+    // Initialize CB primed flag
+    pCb->primedFlag = 0;
+    // Initialize delta samples
+    pCb->deltaSamps = 0;
+    
+    // initialize circular buffer maximum number of audio frames
+    if (sourceSelect == PAF_SOURCE_PCM)
+    {
+        pCb->maxNumAfCb = ASP_DECOP_CB_MAX_NUM_AF_PCM;
+        
+        //pCb->afInitialLag = ASP_DECOP_CB_INIT_LAG_PCM;
+        // Initialize target nominal delay
+        pCb->targetNDSamps = ASP_DECOP_CB_TARGET_ND_SAMPS_48kPCM;
+        
+        pCb->afWrtIdx = ASP_DECOP_CB_INIT_WRTIDX_PCM;
+        pCb->afRdIdx = ASP_DECOP_CB_INIT_RDIDX_PCM;
+        pCb->pcmRdIdx = 0;
+        
+        pCb->maxAFChanNum = ASP_DECOP_CB_MAX_NUM_PCM_CH;
+        pCb->maxAFSampCount = DEF_DEC_OP_FRAME_LEN;
+        
+        // initialize audio frames
+        for (n=0; n<pCb->maxNumAfCb; n++)
+        {
+            pAfCb = &pCb->afCb[n];
+            pAfCb->sampleDecode = sourceSelect;
+            PAF_PROCESS_ZERO(pAfCb->sampleProcess);
+            pAfCb->sampleRate = PAF_SAMPLERATE_48000HZ;
+            pAfCb->sampleCount = decOpFrameLen;
+            pAfCb->channelConfigurationRequest.full = 0;
+            pAfCb->channelConfigurationRequest.part.sat = PAF_CC_SAT_SURROUND4;
+            pAfCb->channelConfigurationRequest.part.sub = PAF_CC_SUB_ONE;
+            pAfCb->channelConfigurationStream.full = 0;
+            pAfCb->channelConfigurationStream.part.sat = PAF_CC_SAT_SURROUND4;
+            pAfCb->channelConfigurationStream.part.sub = PAF_CC_SUB_ONE;
+            
+            // write metadata information updated by decoder
+            pAfCb->bsMetadata_type     = PAF_bsMetadata_channelData;    /* non zero if metadata is attached. */
+            pAfCb->pafBsMetadataUpdate = 0;                             /* indicates whether bit-stream metadata update */
+            pAfCb->numPrivateMetadata  = 0;                             /* number of valid private metadata (0 or 1 if metadata filtering enabled) */
+            pAfCb->bsMetadata_offset   = 0;                             /* offset into audio frame for change in bsMetadata_type field */
+        }
+    }
+    else if ((sourceSelect == PAF_SOURCE_DDP) || (sourceSelect == PAF_SOURCE_AC3))
+    {
+        pCb->maxNumAfCb = ASP_DECOP_CB_MAX_NUM_AF_DDP;
+        
+        //pCb->afInitialLag = ASP_DECOP_CB_INIT_LAG_DDP;
+        // Initialize target nominal delay
+        pCb->targetNDSamps = ASP_DECOP_CB_TARGET_ND_SAMPS_48kDDP;
+        
+        pCb->afWrtIdx = ASP_DECOP_CB_INIT_WRTIDX_DDP;
+        pCb->afRdIdx = ASP_DECOP_CB_INIT_RDIDX_DDP;
+        pCb->pcmRdIdx = 0;
+        
+        pCb->maxAFChanNum = ASP_DECOP_CB_MAX_NUM_PCM_CH_DDP;
+        pCb->maxAFSampCount = ASP_DECOP_CB_MAX_PCM_FRAME_LEN_48kDDP;
+        
+        // initialize audio frames
+        for (n=0; n<pCb->maxNumAfCb; n++)
+        {
+            pAfCb = &pCb->afCb[n];
+            pAfCb->sampleDecode = sourceSelect;
+            PAF_PROCESS_ZERO(pAfCb->sampleProcess);
+            pAfCb->sampleRate = PAF_SAMPLERATE_48000HZ;
+            pAfCb->sampleCount = decOpFrameLen;
+            pAfCb->channelConfigurationRequest.full = 0;
+            pAfCb->channelConfigurationRequest.part.sat = PAF_CC_SAT_SURROUND4;
+            pAfCb->channelConfigurationRequest.part.sub = PAF_CC_SUB_ONE;
+            pAfCb->channelConfigurationStream.full = 0;
+            pAfCb->channelConfigurationStream.part.sat = PAF_CC_SAT_SURROUND4;
+            pAfCb->channelConfigurationStream.part.sub = PAF_CC_SUB_ONE;
+            
+            // write metadata information updated by decoder
+            pAfCb->bsMetadata_type     = PAF_bsMetadata_channelData;    /* non zero if metadata is attached. */
+            pAfCb->pafBsMetadataUpdate = 0;                             /* indicates whether bit-stream metadata update */
+            pAfCb->numPrivateMetadata  = 0;                             /* number of valid private metadata (0 or 1 if metadata filtering enabled) */
+            pAfCb->bsMetadata_offset   = 0;                             /* offset into audio frame for change in bsMetadata_type field */
+        }
+    }
+    else if (sourceSelect == PAF_SOURCE_THD)
+    {
+        //gCbInitSourceSelThdCnt++; //debug
+        
+        pCb->maxNumAfCb = ASP_DECOP_CB_MAX_NUM_AF_THD;
+        
+        //pCb->afInitialLag = ASP_DECOP_CB_INIT_LAG_THD;
+        // Initialize target nominal delay
+        pCb->targetNDSamps = ASP_DECOP_CB_TARGET_ND_SAMPS_48kTHD;
+        
+        pCb->afWrtIdx = ASP_DECOP_CB_INIT_WRTIDX_THD;
+        pCb->afRdIdx = ASP_DECOP_CB_INIT_RDIDX_THD;
+        pCb->pcmRdIdx = 0;
+        
+        pCb->maxAFChanNum = ASP_DECOP_CB_MAX_NUM_PCM_CH_MAT;
+        pCb->maxAFSampCount = ASP_DECOP_CB_MAX_PCM_FRAME_LEN_48kMAT;
+        
+        // initialize audio frames
+        for (n=0; n<pCb->maxNumAfCb; n++)
+        {
+            pAfCb = &pCb->afCb[n];
+            pAfCb->sampleDecode = sourceSelect;
+            PAF_PROCESS_ZERO(pAfCb->sampleProcess);
+            pAfCb->sampleRate = PAF_SAMPLERATE_48000HZ;
+            pAfCb->sampleCount = decOpFrameLen;
+            pAfCb->channelConfigurationRequest.full = 0;
+            pAfCb->channelConfigurationRequest.part.sat = PAF_CC_SAT_SURROUND4;
+            pAfCb->channelConfigurationRequest.part.sub = PAF_CC_SUB_ONE;
+            pAfCb->channelConfigurationStream.full = 0;
+            pAfCb->channelConfigurationStream.part.sat = PAF_CC_SAT_SURROUND4;
+            pAfCb->channelConfigurationStream.part.sub = PAF_CC_SUB_ONE;
+            
+            // write metadata information updated by decoder
+            pAfCb->bsMetadata_type     = PAF_bsMetadata_channelData;    /* non zero if metadata is attached. */
+            pAfCb->pafBsMetadataUpdate = 0;                             /* indicates whether bit-stream metadata update */
+            pAfCb->numPrivateMetadata  = 0;                             /* number of valid private metadata (0 or 1 if metadata filtering enabled) */
+            pAfCb->bsMetadata_offset   = 0;                             /* offset into audio frame for change in bsMetadata_type field */
+        }
+    }
+    else
+    {
+        SW_BREAKPOINT;
+        
+        // Leave the gate
+        GateMP_leave(gateHandle, key);
+
+        return ASP_DECOP_CB_INIT_INV_SOURCE_SEL;
+    }
+
+    // initialize circular buffer current number of frames
+    pCb->numAfCb = pCb->afWrtIdx - pCb->afRdIdx;
+    
+    // initialize audio frame PCM buffers
+    pPcmBuf = pCb->pcmBuf;
+    pMetaBuf = pCb->metaBuf;
+    for (n=0; n<pCb->maxNumAfCb; n++)
+    {
+        pAfCb = &pCb->afCb[n];
+        pAfCb->data.nChannels = pCb->maxAFChanNum;
+        pAfCb->data.nSamples = decOpFrameLen;
+        for (i=0; i<pCb->maxAFChanNum; i++)
+        {
+            pAfCb->data.sample[i] = pPcmBuf;
+            memset(pAfCb->data.sample[i], 0, pCb->maxAFSampCount);
+            pPcmBuf += pCb->maxAFSampCount;
+            
+            pAfCb->data.samsiz[i] = 0;
+        }
+        
+        // Initialize metadata buffers
+        for (i=0; i<PAF_MAX_NUM_PRIVATE_MD; i++)
+        {
+            pAfCb->pafPrivateMetadata[i].offset = 0; 
+            pAfCb->pafPrivateMetadata[i].size   = 0; 
+            pAfCb->pafPrivateMetadata[i].pMdBuf = pMetaBuf;
+            pMetaBuf += PAF_MAX_PRIVATE_MD_SZ;
+        }
+    }
+    
+    // reset read/write flags
+    if (resetRwFlags)
+    {
+        pCb->writerActiveFlag = 0;
+        pCb->readerActiveFlag = 0;
+        pCb->drainFlag = 0;
+    }
+    
+    // reset stats
+    pCb->readAfWriterInactiveCnt = 0;
+    pCb->wrtAfReaderInactiveCnt = 0;
+    pCb->wrtAfZeroSampsCnt = 0;
+    pCb->errUndCnt = 0;
+    pCb->errOvrCnt = 0;
+    
+    // Write back circular buffer configuration
+    Cache_wb(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
+    // Write back AF circular buffer
+    Cache_wb(pCb->afCb, pCb->maxNumAfCb*sizeof(PAF_AudioFrame), Cache_Type_ALLD, 0);
+    // Write back PCM data
+    for (n=0; n<pCb->maxNumAfCb; n++)
+    {
+        pAfCb = &pCb->afCb[n];
+        Cache_wb(pAfCb->data.samsiz, pCb->maxAFChanNum*sizeof(PAF_AudioSize), Cache_Type_ALLD, 0);
+        Cache_wb(pAfCb->data.sample, pCb->maxAFChanNum*sizeof(PAF_AudioData *), Cache_Type_ALLD, 0);
+        for (i=0; i<pCb->maxAFChanNum; i++)
+        {
+            Cache_wb(pAfCb->data.sample[i], pCb->maxAFSampCount*sizeof(PAF_AudioData), Cache_Type_ALLD, 0);
+        }
+    }
+    Cache_wait();
+
+    // Leave the gate
+    GateMP_leave(gateHandle, key);
+    
+    return ASP_DECOP_CB_SOK;
+}
+
 //Int8 gCbWriteStartCnt=0; // debug
 
 // Start writes to circular buffer
index 766c3f5456e23a277719ca253269067c8bd6e99c..ba066492e6f5886ac50149a900967808ad894809 100644 (file)
@@ -40,9 +40,20 @@ All rights reserved.
 #include "paftyp.h"
 #include "aspDecOpCircBuf_common.h"
 
-#define ASP_DECOP_CB_WRITE_OVERFLOW         ( ASP_DECOP_CB_ERR_START-1 ) // error: write overflow
+#define ASP_DECOP_CB_INIT_INV_SOURCE_SEL    ( ASP_DECOP_CB_ERR_START-1 )    // error: invalid source selection on init
+#define ASP_DECOP_CB_WRITE_OVERFLOW         ( ASP_DECOP_CB_ERR_START-2 )    // error: write overflow
 
-// Start writes to circular buffer
+// Initialize circular buffer for selected source
+Int cbInitSourceSel(
+    PAF_AST_DecOpCircBufCtl *pCbCtl,    // decoder output circular buffer control
+    Int8 cbIdx,                         // decoder output circular buffer index
+    Int8 sourceSelect,                  // source select (PCM, DDP, etc.)
+    Int16 decOpFrameLen,                // decoder output frame length (PCM samples)
+    Int16 strFrameLen,                  // stream frame length (PCM samples)
+    Int8 resetRwFlags                   // whether to reset reader, writer, and drain flags
+);
+
+    // Start writes to circular buffer
 Int cbWriteStart(
     PAF_AST_DecOpCircBufCtl *pCbCtl,    // decoder output circular buffer control
     Int8 cbIdx                          // decoder output circular buffer index
index 54ef3c31e390896c51a4ea26ad8c897aa5b62199..d4ad58dddb67a8229d3ab6684aca4aa4570b2d34 100644 (file)
@@ -165,9 +165,9 @@ Void taskAsdpFxn(
     PAF_AudioFrame *pAfWrt;             // pointer to audio frame written to CB
     Int cbErrno;                        // CB error number
     // Output Init-Sync
+    PAF_AudioFrame *pDecInitAf;         // pointer to Dec Info1 output audio frame
     PAF_AST_OutInitSyncCtl *pOutIsCtl;  // OutIS control
     Int8 outIsDecInfo1Flag;             // indicates whether Dec Info Init-Sync has executed
-    PAF_AudioFrame *pOutIsAfWrt;        // pointer to audio frame written to OutIS Info
     Int outIsErrno;                     // OutIS error number
     // Messaging
     PAF_InpBufConfig *pIpBufConfig;     // IB buffer configuration
@@ -548,12 +548,14 @@ Void taskAsdpFxn(
                     {
                         errno = dec->fxns->reset(dec, NULL, &pAstCfg->xDec[z].decodeControl, &pAstCfg->xDec[z].decodeStatus);
 
+                        // get pointer to Dec Reset output audio frame
+                        pDecInitAf = pAstCfg->xDec[z].decodeControl.pAudioFrame;
+
                         // Perform Dec Reset Init-Sync
                         //  - Write Dec Reset output audio frame
                         //  - Set Dec Reset decoder stage flag
-                        pOutIsAfWrt = pAstCfg->xDec[z].decodeControl.pAudioFrame; // get pointer to audio frame to write
                         outIsErrno = outIsWriteDecStageFlagAndAf(pOutIsCtl, z, 
-                            ASP_OUTIS_DEC_STAGE_RESET_IDX, 1, pOutIsAfWrt);
+                            ASP_OUTIS_DEC_STAGE_RESET_IDX, 1, pDecInitAf);
                         if (outIsErrno < 0)
                         {
                             SW_BREAKPOINT; // debug
@@ -647,21 +649,47 @@ Void taskAsdpFxn(
                     if (dec->fxns->info)
                     {
                         pfpBegin(PFP_ID_ASDT_1, pAsdtCfg->taskHandle);
-                        errno = dec->fxns->info(dec, NULL, &pAstCfg->xDec[z].decodeControl, &pAstCfg->xDec[z].decodeStatus);
+                        errno = dec->fxns->info(dec, NULL, 
+                            &pAstCfg->xDec[z].decodeControl, 
+                            &pAstCfg->xDec[z].decodeStatus);
                         pfpEnd(PFP_ID_ASDT_1, PFP_FINISH_MEAS);
 
                         if (outIsDecInfo1Flag == 0)
                         {
+                            // get pointer to Dec Info1 output audio frame
+                            pDecInitAf = pAstCfg->xDec[z].decodeControl.pAudioFrame;
+
                             // Perform Dec Info Init-Sync
                             //  - Write Dec Info1 output audio frame
                             //  - Set Dec Info1 decoder stage flag
-                            pOutIsAfWrt = pAstCfg->xDec[z].decodeControl.pAudioFrame; // get pointer to audio frame to write
                             outIsErrno = outIsWriteDecStageFlagAndAf(pOutIsCtl, z, 
-                                ASP_OUTIS_DEC_STAGE_INFO1_IDX, 1, pOutIsAfWrt);
+                                ASP_OUTIS_DEC_STAGE_INFO1_IDX, 1, pDecInitAf);
                             if (outIsErrno < 0)
                             {
                                 SW_BREAKPOINT; // debug
                             }
+
+                            //
+                            // FL: cbInitSourceSel() moved from DSP:ASIT:INIT:decodeInit()
+                            //  frameLength: changed to decodeControl.frameLength.
+                            //    Written by ASIT:decodeInit:getFrameLengthSourceSel().
+                            //  FRAMELENGTH: pP->frameLength.
+                            //    Formerly ASIT, now ASDT but same value (PAF_SYS_FRAMELENGTH).
+                            //
+                            // FL: hard-coded CB init, not using DEC Info1 output AF
+                            
+                            // Initialize decoder output circular buffer for selected source
+                            errno = cbInitSourceSel(pCbCtl, z, sourceSelect, 
+                                pAstCfg->xDec[z].decodeControl.frameLength, 
+                                FRAMELENGTH, 0);
+                            if (errno)
+                            {
+                                SW_BREAKPOINT; // debug
+                                return errno;
+                            }
+                            // debug
+                            cbLog(pCbCtl, z, 1, "cbInitSourceSel");
+
                             outIsDecInfo1Flag = 1; // set flag to indicate OutIS Dec Info has executed
                         }
                     }
index 040b8ace19a8612887b5e18aef6ca1a663a9282b..b4b6db1083a078aae78fe2b321bb8aead782518e 100644 (file)
@@ -45,8 +45,6 @@ All rights reserved.
 #include "pafdec.h"
 #include "aspDecOpCircBuf_master.h"
 
-#include "dbgBenchmark.h" // PCM high-sampling rate + SRC + CAR benchmarking
-
 #include "evmc66x_gpio_dbg.h" // Debug
 
 #ifdef CB_RW_OP_CAP_PP // debug
@@ -59,10 +57,6 @@ Uint8 *gCB_afWrtIdx = NULL;
 Uint8 *gCB_numAfCb = NULL;
 #endif
 
-#define DEF_SOURCE_SEL          ( PAF_SOURCE_PCM ) // default source select
-#define DEF_DEC_OP_FRAME_LEN    ( PAF_SYS_FRAMELENGTH )   // ( 256 )     // default decoder output frame length
-#define DEF_STR_FRAME_LEN       ( PAF_SYS_FRAMELENGTH )     // default stream frame length
-
 #if 0
 // Generate mute AF on circular buffer read
 static Void cbReadAfMute(
@@ -82,7 +76,7 @@ static Void cbReadMuteWithLastAfInfo (
     PAF_AudioFrame *pAfRd         // audio frame into which to read
 );
 
-#if 0
+#if 0 // FL: moved to common
 // Initialize circular buffer control
 Int cbCtlInit(
     PAF_AST_DecOpCircBufCtl *pCbCtl,    // decoder output circular buffer control
@@ -246,6 +240,8 @@ Int cbInit(
     return ASP_DECOP_CB_SOK;
 }
 
+
+#if 0 // FL: moved to ARM
 // debug
 //Int8 gCbInitSourceSelCnt=0;
 //Int8 gCbInitSourceSelThdCnt=0;
@@ -492,6 +488,7 @@ Int cbInitSourceSel(
     
     return ASP_DECOP_CB_SOK;
 }
+#endif
 
 // Start reads from circular buffer
 Int cbReadStart(
index e2c39025d91f9a45df27144314d161c7f812224f..56d15396aa465b5ea229270e2d53b07d9072ccfb 100644 (file)
@@ -40,9 +40,8 @@ All rights reserved.
 #include "paftyp.h"
 #include "aspDecOpCircBuf_common.h"
 
-#define ASP_DECOP_CB_INIT_INV_SOURCE_SEL    ( ASP_DECOP_CB_ERR_START-1 )  // error: invalid source selection on init
-#define ASP_DECOP_CB_READ_UNDERFLOW         ( ASP_DECOP_CB_ERR_START-2 )  // error: read underflow
-#define ASP_DECOP_CB_READ_INVSTATE          ( ASP_DECOP_CB_ERR_START-3 )  // error: circular buffer invalid state on read
+#define ASP_DECOP_CB_READ_UNDERFLOW         ( ASP_DECOP_CB_ERR_START-1 )  // error: read underflow
+#define ASP_DECOP_CB_READ_INVSTATE          ( ASP_DECOP_CB_ERR_START-2 )  // error: circular buffer invalid state on read
 
 #define ASP_DECOP_CHECK_DRAINSTATE_ALL      ( -1 )  // check circular buffer combined drain state      
 
@@ -52,6 +51,7 @@ Int cbInit(
     PAF_AST_DecOpCircBuf *pCb
 );
 
+#if 0 // FL: moved to ARM
 // Initialize circular buffer for selected source
 Int cbInitSourceSel(
     PAF_AST_DecOpCircBufCtl *pCbCtl,    // decoder output circular buffer control
@@ -61,6 +61,7 @@ Int cbInitSourceSel(
     Int16 strFrameLen,                  // stream frame length (PCM samples)
     Int8 resetRwFlags                   // whether to reset reader, writer, and drain flags
 );
+#endif
 
 // Start reads from circular buffer
 Int cbReadStart(
index ca53098ca095be30ee5dd00eeacfb4cb41c88d67..4c8dfc333c97e7184a259c38ade6c3da48512798 100644 (file)
@@ -2836,16 +2836,18 @@ PAF_ASIT_decodeInit(
             pAstCfg->xDec[z].decodeControl.frameLength = frameLength;
             pAstCfg->xDec[z].decodeInStruct.sampleCount = frameLength;
             pAstCfg->xDec[z].decodeControl.sampleRate = PAF_SAMPLERATE_UNKNOWN;
-            
+          
+#if 0 // FL: Moved to ARM:ASDT:INFO
             // Initialize decoder output circular buffer for selected source
             errno = cbInitSourceSel(pCbCtl, z, sourceSelect, frameLength, FRAMELENGTH, 0);
             if (errno)
             {
-                SW_BREAKPOINT; // FL: debug
+                SW_BREAKPOINT; // debug
                 return errno;
             }
-            // FL: debug
+            // debug
             cbLog(pCbCtl, z, 1, "PAF_ASIT_decodeInit:cbInitSourceSel");
+#endif
             
             if (z != zMD) 
             {
@@ -4118,7 +4120,7 @@ static Int getFrameLengthSourceSel(
             frameLength = FRAMELENGTH;
             break;
         case PAF_SOURCE_AC3: 
-        case PAF_SOURCE_DDP:
+        case PAF_SOURCE_DDP: 
             frameLength = ASIP_FRAMELEN_SS_DDP_AC3;
             break;
         case PAF_SOURCE_THD: