summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dd317ae)
raw | patch | inline | side by side (parent: dd317ae)
author | Frank Livingston <frank-livingston@ti.com> | |
Sat, 22 Jul 2017 02:40:09 +0000 (21:40 -0500) | ||
committer | Frank Livingston <frank-livingston@ti.com> | |
Sat, 22 Jul 2017 02:40:09 +0000 (21:40 -0500) |
- Add PCM over/underflow detection
- Increase size of CB PCM buffer using THD HSR "fudge factor". Need to
investigate proper worst case sizing of buffer.
- Increase size of CB PCM buffer using THD HSR "fudge factor". Need to
investigate proper worst case sizing of buffer.
index 50ab1b1f91163931ff7d7c6023ad489b0b82539d..e0192d0e669952701c0b8946a4957aabdb427049 100644 (file)
{
pCb->afWrtIdx = ASP_DECOP_CB_INIT_WRTIDX_PCM;
pCb->afRdIdx = ASP_DECOP_CB_INIT_RDIDX_PCM;
- pCb->pcmRdIdx = 0;
- pCb->prvMdRdIdx = 0;
}
else if (pCb->sourceSel == PAF_SOURCE_DDP)
{
pCb->afWrtIdx = ASP_DECOP_CB_INIT_WRTIDX_DDP;
pCb->afRdIdx = ASP_DECOP_CB_INIT_RDIDX_DDP;
- pCb->pcmRdIdx = 0;
- pCb->prvMdRdIdx = 0;
}
else if (pCb->sourceSel == PAF_SOURCE_THD)
{
pCb->afWrtIdx = ASP_DECOP_CB_INIT_WRTIDX_THD;
pCb->afRdIdx = ASP_DECOP_CB_INIT_RDIDX_THD;
- pCb->pcmRdIdx = 0;
- pCb->prvMdRdIdx = 0;
}
+ else
+ {
+ //
+ // Currently unsupported source select
+ //
+ return ASP_DECOP_CB_RESET_INV_SOURCE_SEL;
+ }
+
+ // Reset circular buffer:
+ // - PCM read index
+ // - Private metadata read index
+ // - number of PCM samples in CB
+ pCb->pcmRdIdx = 0;
+ pCb->prvMdRdIdx = 0;
+ pCb->numPcmSampsPerCh = 0;
// initialize circular buffer current number of frames
pCb->numAfCb = pCb->afWrtIdx - pCb->afRdIdx;
pCb->readAfNdCnt = 0;
pCb->wrtAfReaderInactiveCnt = 0;
pCb->wrtAfZeroSampsCnt = 0;
- pCb->errUndCnt = 0;
- pCb->errOvrCnt = 0;
+ pCb->errAfUndCnt = 0;
+ pCb->errAfOvrCnt = 0;
+ pCb->errPcmUndCnt = 0;
+ pCb->errPcmOvrCnt = 0;
// Write back circular buffer configuration
Cache_wb(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
pCbStats->readAfNdCnt = pCb->readAfNdCnt;
pCbStats->wrtAfReaderInactiveCnt = pCb->wrtAfReaderInactiveCnt;
pCbStats->wrtAfZeroSampsCnt = pCb->wrtAfZeroSampsCnt;
- pCbStats->errUndCnt = pCb->errUndCnt;
- pCbStats->errOvrCnt = pCb->errOvrCnt;
+ pCbStats->errAfUndCnt = pCb->errAfUndCnt;
+ pCbStats->errAfOvrCnt = pCb->errAfOvrCnt;
+ pCbStats->errPcmUndCnt = pCb->errPcmUndCnt;
+ pCbStats->errPcmOvrCnt = pCb->errPcmOvrCnt;
// Leave the gate
GateMP_leave(gateHandle, key);
index 19b8a6c4d50a429d326e7342d2062e507d03550b..a17aeff67eda9aedfc055c6fb0220c24d117f19b 100644 (file)
#define ASP_DECODE_CB_GATE_REGION_ID ( 0 ) // IPC shared region ID used for CB gate allocation
// error return codes
-#define ASP_DECOP_CB_SOK ( 0 ) // ok
-#define ASP_DECOP_CB_CTL_INIT_INV_GATE ( ASP_DECOP_CB_SOK-1 ) // error: invalid gate handle
-#define ASP_DECOP_CB_ERR_START ( ASP_DECOP_CB_CTL_INIT_INV_GATE ) // start error return ID for master & slave error return definitions
+#define ASP_DECOP_CB_SOK ( 0 ) // ok
+#define ASP_DECOP_CB_CTL_INIT_INV_GATE ( ASP_DECOP_CB_SOK-1 ) // error: invalid gate handle
+#define ASP_DECOP_CB_RESET_INV_SOURCE_SEL ( ASP_DECOP_CB_CTL_INIT_INV_GATE - 1 ) // error: invalid source selection on init
+#define ASP_DECOP_CB_ERR_START ( ASP_DECOP_CB_RESET_INV_SOURCE_SEL ) // start error return ID for master & slave error return definitions
#define ASP_DECOP_CB_MAX_NUM_AF ( 30 ) // decoder output circular buffer maximum number audio frames
#define ASP_DECOP_CB_MAX_NUM_PCM_CH_MAT ( 32 ) // decoder output circular buffer maximum number audio PCM channels for MAT
#define ASP_DECOP_CB_MAX_PCM_FRAME_LEN_48kMAT ( 4*256 ) // decoder output circular buffer maximum PCM frame length at 48kHz sampling rate
-#define ASP_DECOP_CB_PCM_BUF_SZ ( ASP_DECOP_CB_MAX_NUM_PCM_CH * ASP_DECOP_CB_MAX_NUM_PCM_FRAMES * ASP_DECOP_CB_MAX_PCM_FRAME_LEN )
-#define ASP_DECOP_CB_PCM_BUF_SZ_32CH48kMAT ( ASP_DECOP_CB_MAX_NUM_PCM_CH_MAT * ASP_DECOP_CB_MAX_NUM_PCM_FRAMES * ASP_DECOP_CB_MAX_PCM_FRAME_LEN_48kMAT )
+// (***) !!! REVISIT!!! FL: THD 192 kHz "fudge factor" for CB PCM buffer size.
+// Using this factor in PCM buffer size definition, buffer large enough to execute 96/192 kHz w/o CB OVR/UND.
+// Need to define CB size in different terms than existing macros, e.g. eliminate usage of ASP_DECOP_CB_MAX_NUM_PCM_FRAMES,
+// increase size of ASP_DECOP_CB_MAX_PCM_FRAME_LEN for worst case THD decoder output frame size in 20 msec.
+#define THD_HSR_FUDGE_FACTOR ( 2 )
+#define ASP_DECOP_CB_PCM_BUF_SZ ( THD_HSR_FUDGE_FACTOR * ASP_DECOP_CB_MAX_NUM_PCM_CH * ASP_DECOP_CB_MAX_NUM_PCM_FRAMES * ASP_DECOP_CB_MAX_PCM_FRAME_LEN )
+// FL: unused
+//#define ASP_DECOP_CB_PCM_BUF_SZ_32CH48kMAT ( ASP_DECOP_CB_MAX_NUM_PCM_CH_MAT * ASP_DECOP_CB_MAX_NUM_PCM_FRAMES * ASP_DECOP_CB_MAX_PCM_FRAME_LEN_48kMAT )
#define ASP_DECOP_CB_MAX_NUM_AF_PCM ( 4 )
#if (ASP_DECOP_CB_MAX_NUM_AF_PCM > ASP_DECOP_CB_MAX_NUM_AF)
Int8 prvMdRdIdx; // private metadata read index
Int8 numAfCb; // current number frames in CB
Int8 maxNumAfCb; // maximum number of audio frames in CB
+ Int32 numPcmSampsPerCh; // current number of PCM samples per channel in CB
+ Int32 maxNumPcmSampsPerCh; // max number of PCM samples per channel in CB
Int16 decOpFrameLen; // selected decoder output frame length (input transaction size)
Int16 strFrameLen; // stream frame length (output transaction size)
Int8 writerActiveFlag; // flag indicates whether CB writer is active: FALSE - writer not active, TRUE - writer active
Int32 readAfNdCnt; // count of read audio frames for nominal delay
Int32 wrtAfReaderInactiveCnt; // count of write audio frames with inactive reader
Int32 wrtAfZeroSampsCnt; // count of write audio frames with zero samples
- Int32 errUndCnt; // read error underflow count
- Int32 errOvrCnt; // write error overflow count
+ Int32 errAfUndCnt; // read error AF underflow count
+ Int32 errAfOvrCnt; // write error AF overflow count
+ Int32 errPcmUndCnt; // read error PCM underflow count
+ Int32 errPcmOvrCnt; // write error PCM overflow count
PAF_AudioData *pcmBufEnd; // PCM buffer, contains PCM data associated with audio frames end
UInt8 *metaBufEnd; // metadata buffer, contains metadata associated with audio frames end
Int8 maxAFChanNum; // maximum number of audio data channels in audio frame
Int32 readAfNdCnt; // count of read audio frames for nominal delay
Int32 wrtAfReaderInactiveCnt; // count of write audio frames with inactive reader
Int32 wrtAfZeroSampsCnt; // count of write audio frames with zero samples
- Int32 errUndCnt; // read error underflow count
- Int32 errOvrCnt; // write error overflow count
+ Int32 errAfUndCnt; // read error AF underflow count
+ Int32 errAfOvrCnt; // write error AF overflow count
+ Int32 errPcmUndCnt; // read error PCM underflow count
+ Int32 errPcmOvrCnt; // write error PCM overflow count
} PAF_AST_DecOpCircBufStats;
// Decoder output circular buffer control
diff --git a/pasdk/test_arm/framework/aspDecOpCircBuf_slave.c b/pasdk/test_arm/framework/aspDecOpCircBuf_slave.c
index 7a80156fa85a29a7dac4066619ee2ccfbe28d8c5..e32daef6ca7731a0ab612b534a423a4c6b5504de 100644 (file)
// - target nominal delay
// - AF write, read indices
// - maximum AF channel and sample counts
+ // - maximum number of PCM samples per channel
if (sourceSelect == PAF_SOURCE_PCM)
{
pCb->maxNumAfCb = ASP_DECOP_CB_MAX_NUM_AF_PCM;
pCb->afWrtIdx = ASP_DECOP_CB_INIT_WRTIDX_PCM;
pCb->afRdIdx = ASP_DECOP_CB_INIT_RDIDX_PCM;
- pCb->pcmRdIdx = 0;
- pCb->prvMdRdIdx = 0;
pCb->maxAFChanNum = ASP_DECOP_CB_MAX_NUM_PCM_CH;
- pCb->maxAFSampCount = DEF_DEC_OP_FRAME_LEN;
+ pCb->maxAFSampCount = DEF_DEC_OP_FRAME_LEN;
+
+ pCb->maxNumPcmSampsPerCh = (Int32)(pCb->pcmBufEnd - pCb->pcmBuf)/pCb->maxAFChanNum;
}
else if ((sourceSelect == PAF_SOURCE_DDP) || (sourceSelect == PAF_SOURCE_AC3))
{
pCb->afWrtIdx = ASP_DECOP_CB_INIT_WRTIDX_DDP;
pCb->afRdIdx = ASP_DECOP_CB_INIT_RDIDX_DDP;
- pCb->pcmRdIdx = 0;
- pCb->prvMdRdIdx = 0;
pCb->maxAFChanNum = ASP_DECOP_CB_MAX_NUM_PCM_CH_DDP;
pCb->maxAFSampCount = ASP_DECOP_CB_MAX_PCM_FRAME_LEN_48kDDP;
+
+ pCb->maxNumPcmSampsPerCh = (Int32)(pCb->pcmBufEnd - pCb->pcmBuf)/pCb->maxAFChanNum;
}
else if (sourceSelect == PAF_SOURCE_THD)
{
pCb->afWrtIdx = ASP_DECOP_CB_INIT_WRTIDX_THD;
pCb->afRdIdx = ASP_DECOP_CB_INIT_RDIDX_THD;
- pCb->pcmRdIdx = 0;
- pCb->prvMdRdIdx = 0;
pCb->maxAFChanNum = ASP_DECOP_CB_MAX_NUM_PCM_CH_MAT;
pCb->maxAFSampCount = ASP_DECOP_CB_MAX_PCM_FRAME_LEN_48kMAT;
+
+ pCb->maxNumPcmSampsPerCh = (Int32)(pCb->pcmBufEnd - pCb->pcmBuf)/pCb->maxAFChanNum;
}
else
{
return ASP_DECOP_CB_INIT_INV_SOURCE_SEL;
}
-
+
+ // Initialize circular buffer:
+ // - PCM read index
+ // - Private metadata read index
+ // - number of PCM samples in CB
+ pCb->pcmRdIdx = 0;
+ pCb->prvMdRdIdx = 0;
+ pCb->numPcmSampsPerCh = 0;
+
// Initialize audio frames
for (n = 0; n < pCb->maxNumAfCb; n++)
{
pCb->readAfNdCnt = 0;
pCb->wrtAfReaderInactiveCnt = 0;
pCb->wrtAfZeroSampsCnt = 0;
- pCb->errUndCnt = 0;
- pCb->errOvrCnt = 0;
+ pCb->errAfUndCnt = 0;
+ pCb->errAfOvrCnt = 0;
+ pCb->errPcmUndCnt = 0;
+ pCb->errPcmOvrCnt = 0;
// Write back circular buffer configuration
Cache_wb(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
Int8 i;
Int16 j;
PAF_AudioData *pPcmBuf;UInt8 *pMetaBuf; int nextWrtIdx;PAF_AudioFrame *pAfCbNextAf;
-
+
// Get gate handle
gateHandle = pCbCtl->gateHandle;
// Enter gate
{
//Log_info2("cbWriteAf:pCb->numAfCb=%d, pCb->maxNumAfCb=%d", (IArg)pCb->readerActiveFlag, (IArg)pCb->maxNumAfCb); // debug
- // check overflow
- //while (pCb->numAfCb >= pCb->maxNumAfCb); // debug
+ // check AF overflow
if (pCb->numAfCb >= pCb->maxNumAfCb)
{
- pCb->errOvrCnt++;
+ pCb->errAfOvrCnt++;
//SW_BREAKPOINT;
- Log_info1("cbWriteAf: ERROR: overflow, numAfCb=%d", pCb->numAfCb);
+ Log_info1("cbWriteAf: ERROR: AF CB overflow, numAfCb=%d", pCb->numAfCb);
// Write back circular buffer configuration
Cache_wb(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
//Log_info2("cbWriteAf:gate leave, gateHandle=0x%04x, key=%d", (IArg)gateHandle, (IArg)key); // debug
- return ASP_DECOP_CB_WRITE_OVERFLOW;
+ return ASP_DECOP_CB_AF_WRITE_OVERFLOW;
}
+
+ // check PCM overflow
+ if ((pCb->numPcmSampsPerCh + pAfWrt->sampleCount) > pCb->maxNumPcmSampsPerCh)
+ {
+ pCb->errPcmOvrCnt++;
+ Log_info3("cbWriteAf: ERROR: PCM CB overflow, sampleCount=%d, numPcmSampsPerCh=%d, maxNumPcmSampsPerCh=%d",
+ pCb->numPcmSampsPerCh, pAfWrt->sampleCount, pCb->maxNumPcmSampsPerCh);
+
+ // Write back circular buffer configuration
+ Cache_wb(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
+ Cache_wait();
+
+ // Leave the gate
+ GateMP_leave(gateHandle, key);
+
+ return ASP_DECOP_CB_PCM_WRITE_OVERFLOW;
+ }
+
pAfCb = &pCb->afCb[pCb->afWrtIdx];
pPcmBuf = pAfCb->data.sample[0];
pMetaBuf = pAfCb->pafPrivateMetadata[0].pMdBuf;
{
pPcmBuf = pCb->pcmBuf;
}
-
+
for (i=0; i<pCb->maxAFChanNum; i++)
{
pAfCb->data.sample[i] = pPcmBuf;
Cache_inv(pAfCb->data.sample, pCb->maxAFChanNum*sizeof(PAF_AudioData *), Cache_Type_ALLD, 0); // FL: this is write back and invalidate??
Cache_wait();
- //for (i=0; i<pCb->maxAFChanNum; i++){
- //}
+ // FL: brute force reset of all metadata in CB AF?
for (i=0; i<PAF_MAX_NUM_PRIVATE_MD; i++)
{
pAfCb->pafPrivateMetadata[i].offset = 0;
}
nextWrtIdx = 0;
- if ((pCb->afWrtIdx +1) >= pCb->maxNumAfCb)
+ if ((pCb->afWrtIdx + 1) >= pCb->maxNumAfCb)
{
//Log_info0("cbWriteAf: AF Wrap around **** ");
// next audio frame will be audio frame 0
pAfCb->data.samsiz[i] = pAfWrt->data.samsiz[i];
}
}
-
+
+ // Update PCM samples per channel
+ pCb->numPcmSampsPerCh += pAfWrt->sampleCount;
+
#ifdef CB_RW_OP_CAP_PP // debug
if (pCb->cb_opCnt < CB_OP_COUNT_MAX)
{
diff --git a/pasdk/test_arm/framework/aspDecOpCircBuf_slave.h b/pasdk/test_arm/framework/aspDecOpCircBuf_slave.h
index f7db4322b2c344a5b88ea7e5f36ba31abee6412a..57883a430259b0fcea2c6df08201a1d58306434e 100644 (file)
#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_WRITE_OVERFLOW ( ASP_DECOP_CB_ERR_START-2 ) // error: write overflow
+#define ASP_DECOP_CB_AF_WRITE_OVERFLOW ( ASP_DECOP_CB_ERR_START-2 ) // error: write audio frame overflow
+#define ASP_DECOP_CB_PCM_WRITE_OVERFLOW ( ASP_DECOP_CB_ERR_START-3 ) // error: write PCM overflow
#define DEF_DEC_OP_FRAME_LEN ( PAF_SYS_FRAMELENGTH ) // default decoder output frame length
diff --git a/pasdk/test_arm/framework/audioStreamDecodeProc.c b/pasdk/test_arm/framework/audioStreamDecodeProc.c
index 66c3af631a8d30d78d7a561c682d8956e37bc6fa..1c71f193c219aec7b3502fdaf773b33f750541ce 100644 (file)
//GPIOSetOutput(GPIO_PORT_0, GPIO_PIN_99); // debug
cbErrno = cbWriteAf(pCbCtl, z, pAfWrt);
//GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_99);
- if ((cbErrno < 0) && (cbErrno != ASP_DECOP_CB_WRITE_OVERFLOW))
+ if ((cbErrno < 0) &&
+ (cbErrno != ASP_DECOP_CB_AF_WRITE_OVERFLOW) &&
+ (cbErrno != ASP_DECOP_CB_PCM_WRITE_OVERFLOW))
{
gCbWrtAfErrCnt++;
//SW_BREAKPOINT; // debug
}
// Handle circular buffer overflows
- if (cbErrno == ASP_DECOP_CB_WRITE_OVERFLOW)
+ if ((cbErrno == ASP_DECOP_CB_AF_WRITE_OVERFLOW) ||
+ (cbErrno == ASP_DECOP_CB_PCM_WRITE_OVERFLOW))
{
gDecOpCbWrtAfOvr++; // increment circular buffer overflow count
if (gDecOpCbWrtAfOvr >= DEC_OP_CB_WRTAF_OVR_THR)
diff --git a/pasdk/test_dsp/framework/aspDecOpCircBuf_master.c b/pasdk/test_dsp/framework/aspDecOpCircBuf_master.c
index af544e00fc5adb81689da5f2f03bf0f02ccec128..25224c1460cde14954633d307c9fb61ba9589335 100644 (file)
//
// Increment underflow count
//
- pCb->errUndCnt++;
+ pCb->errAfUndCnt++;
// Mute output on underflow
//cbReadAfMute(pAfRd, pCb->strFrameLen);
// Leave the gate
GateMP_leave(gateHandle, key);
- return ASP_DECOP_CB_READ_UNDERFLOW;
+ return ASP_DECOP_CB_AF_READ_UNDERFLOW;
}
}
// interpolation change in in bit-stream metadata type, or CC stream?
//
- // debug
- //gCbReadAfCnt++;
- //if (gCbReadAfCnt == 1404)
- //{
- // Log_info1("cbReadAf: gCbReadAfCnt=%d", gCbReadAfCnt); // debug
- //}
-
// Get pointer to current CB Audio Frame
pAfCb = &pCb->afCb[pCb->afRdIdx];
pAfRd->sampleCount = totNumSampsRd; // write Read AF sample count
pAfRd->numPrivateMetadata = prvMdWrtIdx; // write Read AF number of metadata
+
+ pCb->numPcmSampsPerCh -= totNumSampsRd; // update PCM samples per channel
if (totNumSampsRd < pCb->strFrameLen)
{
//
// Increment underflow count
//
- pCb->errUndCnt++;
+ pCb->errPcmUndCnt++;
// Mute output on underflow
cbReadMuteWithLastAfInfo(pCb, pAfRd);
// Leave the gate
GateMP_leave(gateHandle, key);
- return ASP_DECOP_CB_READ_UNDERFLOW;
+ return ASP_DECOP_CB_PCM_READ_UNDERFLOW;
}
}
diff --git a/pasdk/test_dsp/framework/aspDecOpCircBuf_master.h b/pasdk/test_dsp/framework/aspDecOpCircBuf_master.h
index e74dbf080dacff399d43186b177351e923bac34c..b3c5e79f20daebb8ff541febd0bbfc1cc390c83c 100644 (file)
#include "paftyp.h"
#include "aspDecOpCircBuf_common.h"
-#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_CB_AF_READ_UNDERFLOW ( ASP_DECOP_CB_ERR_START-1 ) // error: read AF underflow
+#define ASP_DECOP_CB_PCM_READ_UNDERFLOW ( ASP_DECOP_CB_ERR_START-2 ) // error: read PCM underflow
+#define ASP_DECOP_CB_READ_INVSTATE ( ASP_DECOP_CB_ERR_START-3 ) // error: circular buffer invalid state on read
#define ASP_DECOP_CHECK_DRAINSTATE_ALL ( -1 ) // check circular buffer combined drain state
diff --git a/pasdk/test_dsp/framework/audioStreamInpProc.c b/pasdk/test_dsp/framework/audioStreamInpProc.c
index dabd0ed8e7a8fae733dcffb1490af681228dfbbe..7a30dfed572bbe5a72e896735f0439c321438f11 100644 (file)
return ASPERR_RECLAIM;
}
- // FL: debug, capture input buffer
- capIb(pAstCfg->xInp[zMI].pInpBuf);
- gCapIb_cnt++;
+ //// FL: debug, capture input buffer
+ //capIb(pAstCfg->xInp[zMI].pInpBuf);
+ //gCapIb_cnt++;
#if 0 // (***) FL: shows timing of Input Rx SIO reclaim after decoding has started (autodet complete)
// (***) debug // B5
diff --git a/pasdk/test_dsp/framework/audioStreamOutProc.c b/pasdk/test_dsp/framework/audioStreamOutProc.c
index 43784ca53354bbd12ad3be4367e64dc4a246c7f4..0aa46a6fe91daf0d8826fb10486b3baf2008d51d 100644 (file)
// FL: debug
#include "evmc66x_gpio_dbg.h"
+#include "dbgCapAf.h"
#define TRACE_TIME(a)
//GPIOSetOutput(GPIO_PORT_0, GPIO_PIN_106); // debug
cbErrno = cbReadAf(pCbCtl, z, pAfRd);
//GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_106);
- if ((cbErrno < 0) && (cbErrno != ASP_DECOP_CB_READ_UNDERFLOW))
+ if ((cbErrno < 0) &&
+ (cbErrno != ASP_DECOP_CB_AF_READ_UNDERFLOW) &&
+ (cbErrno != ASP_DECOP_CB_PCM_READ_UNDERFLOW))
{
gCbReadAfErr++;
TRACE_TERSE1("PAF_ASOT_decodeStream:cbReadAf() error=%d", cbErrno);
- //SW_BREAKPOINT; // FL: debug
+ //SW_BREAKPOINT; // debug
return cbErrno;
}
// Handle underflows
- if (cbErrno == ASP_DECOP_CB_READ_UNDERFLOW)
+ if ((cbErrno == ASP_DECOP_CB_AF_READ_UNDERFLOW) ||
+ (cbErrno == ASP_DECOP_CB_PCM_READ_UNDERFLOW))
{
- // FL: some number of underflows alway occur on start of stream when ASOT only depends on configured Output.
- // DDP: ~2 underflows
- // MAT-THD: ~16 underflows
- // Need to check behavior of cbReset().
+ // (***) FL: Need to check behavior of cbReset().
// Need to check behavior on exit/re-entry into Output processing.
-
gDecOpCbRdAfUnd++; // increment circular buffer underflow count
if (gDecOpCbRdAfUnd >= DEC_OP_CB_RDAF_UND_THR)
{
//cbGetStats(pCbCtl, z, &cbStats);
cbGetStats(pCbCtl, z, &gCbStats);
- // FL: debug
+ // debug
cbLog(pCbCtl, z, 1, "PAF_ASOT_decodeStream:cbReadAf");
- //if (capAfWrite(pAfRd, 0) != CAP_AF_SOK)
+ //if (capAfWrite(pAfRd, PAF_LEFT) != CAP_AF_SOK)
//{
// Log_info0("capAfWrite() error");
//}
if (pAstCfg->xOut[z].hTxSio)
{
TRACE_GEN2("PAF_ASOT_decodeEncode: AS%d: processing block %d -- output", as+zS, block);
- GPIOSetOutput(GPIO_PORT_0, GPIO_PIN_106); // debug
+ //GPIOSetOutput(GPIO_PORT_0, GPIO_PIN_106); // debug
errno = SIO_issue(pAstCfg->xOut[z].hTxSio,
&pAstCfg->xOut[z].outBufConfig, sizeof (pAstCfg->xOut[z].outBufConfig), 0);
- GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_106);
+ //GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_106);
if (errno)
{
SIO_idle(pAstCfg->xOut[z].hTxSio);
return ASOP_SOK;
}
+// FL: debug, allow modification of output frame length via JTAG
+Int16 gOutFrameLen=DEF_STR_FRAME_LEN; // stream frame length (PCM samples)
+
// Purpose: Init-Sync Dec Info1 state function.
// Performes Dec Info1 Init-Sync.
static Int PAF_ASOT_initSyncDecInfo1(
// THD sets this to 256 (hard-coded in Dec Info)
// DDP sets this to 0 (audio frame passthrough, 0 from ASDT AF frame length)
// PCM sets this to 256 (decodeControl.frameLength)
- pDecInfo1Af->sampleCount = 256; // !!!! GJ: Revisit !!!!
+ //pDecInfo1Af->sampleCount = 256; // !!!! GJ: Revisit !!!!
+ pDecInfo1Af->sampleCount = gOutFrameLen;
outIsCpyAf(pDecInfo1Af, pStrAf);
index d540eb21a035f6d5bdd6b2d3af0e95e3189027a3..4887b32b55b738b0f5e86a5c1806469f41d04c3f 100644 (file)
// NOT performing PCM high-sampling rate + SRC + CAR benchmarking
//
-//#define _AE0_
-//#define _SRC4_
-#define _CAR_
-#define _OAR_
-//#define _DAP_
-#define _BMDA_
-//#define _ML0_
+////#define _AE0_
+#define _SRC4_
+//#define _CAR_
+//#define _OAR_
+////#define _DAP_
+//#define _BMDA_
+////#define _ML0_
#else // _ENABLE_BENCHMARK_PCMHSR_SRC_CAR_
//