summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eb8940c)
raw | patch | inline | side by side (parent: eb8940c)
author | Frank Livingston <frank-livingston@ti.com> | |
Sat, 3 Jun 2017 14:36:18 +0000 (09:36 -0500) | ||
committer | Frank Livingston <frank-livingston@ti.com> | |
Sat, 3 Jun 2017 14:36:18 +0000 (09:36 -0500) |
Captures show ASIT exits & re-enters decodeProcessing().
Because of this, cbInitSourceSel() is called twice during MAT-THD stream,
both "early" in stream. Because of this, ~5 decode frames are lost from CB.
Data accumulation in the CB associated with these 5 frames is lost.
(variable fill rate - fixed empty rate). As a result, CB can underflow
for MAT-THD streams.
Current approach(s) to circumvent CB underflow problem center around
artificially accumulating some amount of data at point in stream where
decodeProcessing() is re-entered.
- PP approach will accumulate first 5 frames of data (of whatever size in stream).
- Bogdan's approach will accumulate some number of samples:
(fixed nominal delay - size of frame where decodeProcessing is resumed).
Neither approach will gaurantee no underflow.
Because of this, cbInitSourceSel() is called twice during MAT-THD stream,
both "early" in stream. Because of this, ~5 decode frames are lost from CB.
Data accumulation in the CB associated with these 5 frames is lost.
(variable fill rate - fixed empty rate). As a result, CB can underflow
for MAT-THD streams.
Current approach(s) to circumvent CB underflow problem center around
artificially accumulating some amount of data at point in stream where
decodeProcessing() is re-entered.
- PP approach will accumulate first 5 frames of data (of whatever size in stream).
- Bogdan's approach will accumulate some number of samples:
(fixed nominal delay - size of frame where decodeProcessing is resumed).
Neither approach will gaurantee no underflow.
pasdk/test_arm/framework/aspDecOpCircBuf_slave.c | patch | blob | history | |
pasdk/test_dsp/framework/aspDecOpCircBuf_master.c | patch | blob | history |
diff --git a/pasdk/test_arm/framework/aspDecOpCircBuf_slave.c b/pasdk/test_arm/framework/aspDecOpCircBuf_slave.c
index 6a3bc915072fefdd40faec894d75d8887d2dd5d2..9a37e6eeaaad839456d0639e5d7c136ea3be5baf 100644 (file)
}
+//Int8 gCbWriteStartCnt=0; // debug
+
// Start writes to circular buffer
Int cbWriteStart(
PAF_AST_DecOpCircBufCtl *pCbCtl, // decoder output circular buffer control
Int8 n;
//Int8 i;
+ //gCbWriteStartCnt++; // debug
+
// Get gate handle
gateHandle = pCbCtl->gateHandle;
// Enter gate
return ASP_DECOP_CB_SOK;
}
+// debug
+//Int16 gSampleCountBuf[10];
+//Int16 gCalcDeltaSampsBuf[10];
+//Int8 gPrimedFlagCnt=0;
+
// Write audio frame to circular buffer
Int cbWriteAf(
PAF_AST_DecOpCircBufCtl *pCbCtl, // decoder output circular buffer control
// Calculate number of output frames to block reader.
// This is sample count reader waits before allowed to actually read samples from the CB.
pCb->deltaSamps = (pCb->targetNDSamps - pAfWrt->sampleCount + (pCb->strFrameLen-1)) / pCb->strFrameLen * pCb->strFrameLen;
+
+ // debug
+ //gSampleCountBuf[gPrimedFlagCnt] = pAfWrt->sampleCount;
+ //gCalcDeltaSampsBuf[gPrimedFlagCnt] = pCb->deltaSamps;
+ //if (gPrimedFlagCnt < 10)
+ // gPrimedFlagCnt++;
}
// (***) FL: revisit
diff --git a/pasdk/test_dsp/framework/aspDecOpCircBuf_master.c b/pasdk/test_dsp/framework/aspDecOpCircBuf_master.c
index 851e003d86b77e11b43551bf5c1bf5d1cb5484a0..f79f85128dbdd25db0b9ec8491776a4374c830a0 100644 (file)
return ASP_DECOP_CB_SOK;
}
+// 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 n;
Int8 i;
+ //gCbInitSourceSelCnt++; // debug
+
// Get gate handle
gateHandle = pCbCtl->gateHandle;
// Enter gate
}
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;
return ASP_DECOP_CB_SOK;
}
+// debug
+//Int16 gDeltaSampsBuf[20];
+//Int8 gDeltaSampsBufIdx=0;
+
// Read audio frame from circular buffer
Int cbReadAf(
PAF_AST_DecOpCircBufCtl *pCbCtl, // decoder output circular buffer control
if (pCb->primedFlag == 1)
{
pCb->deltaSamps = pCb->deltaSamps - pCb->strFrameLen;
+
+ // debug
+ //gDeltaSampsBuf[gDeltaSampsBufIdx] = pCb->deltaSamps;
+ //if (gDeltaSampsBufIdx < 20)
+ // gDeltaSampsBufIdx++;
}
cbReadMuteWithLastAfInfo(pCb, pAfRd);