summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8ad4f80)
raw | patch | inline | side by side (parent: 8ad4f80)
author | Frank Livingston <frank-livingston@ti.com> | |
Thu, 19 Apr 2018 20:19:54 +0000 (15:19 -0500) | ||
committer | Frank Livingston <frank-livingston@ti.com> | |
Thu, 19 Apr 2018 20:19:54 +0000 (15:19 -0500) |
ARM:
- latch 1st decode AF output
DSP:
- in Decode IS, use latched AF to initialize Stream AF
- overwrite Stream AF sample count to CB stream frame length.
CB stream frame length can be configured via alpha command or
automatically.
- Execute ASP chain reset, Enc Info, SetCheckRateX & StartOutput.
ASP chain reset will have proper AF sample count in case SRC enabled for
decimation (Stream AF sample count will be updated in this case).
StartOuput Phy frame length & delay setup will have proper sample count
for frame length parameter.
- latch 1st decode AF output
DSP:
- in Decode IS, use latched AF to initialize Stream AF
- overwrite Stream AF sample count to CB stream frame length.
CB stream frame length can be configured via alpha command or
automatically.
- Execute ASP chain reset, Enc Info, SetCheckRateX & StartOutput.
ASP chain reset will have proper AF sample count in case SRC enabled for
decimation (Stream AF sample count will be updated in this case).
StartOuput Phy frame length & delay setup will have proper sample count
for frame length parameter.
diff --git a/pasdk/test_arm/framework/audioStreamDecodeProc.c b/pasdk/test_arm/framework/audioStreamDecodeProc.c
index 59d39bd49ebe5ce7c4f784cb6f936a5ec3789a60..2abec192a85a0abecea06fd4c8b46a9452734d6b 100644 (file)
cbLog(pCbCtl, z, 1, "cbInitSourceSel");
// Perform Dec Decode1 Init-Sync
+ // - Write Dec Decode1 output audio frame
// - Set Dec Decode1 decoder stage flag
- outIsErrno = outIsWriteDecStageFlag(pOutIsCtl, z,
- ASP_OUTIS_DEC_STAGE_DECODE1_IDX, 1);
+ outIsErrno = outIsWriteDecStageFlagAndAf(pOutIsCtl, z,
+ ASP_OUTIS_DEC_STAGE_DECODE1_IDX, 1, pAfWrt);
if (outIsErrno < 0)
{
SW_BREAKPOINT; // debug
diff --git a/pasdk/test_dsp/framework/aspDecOpCircBuf_master.c b/pasdk/test_dsp/framework/aspDecOpCircBuf_master.c
index 57a7fe685255468d92fb3b71b62691aa75570fb6..ca3f92354170a5dd218501f5d3df0c32ee336956 100644 (file)
pAfRd->resetCount = 0; /* used for communication between DTSX and PARMA */
}
+// Read CB stream frame length
+Int cbReadStrFrameLen(
+ PAF_AST_DecOpCircBufCtl *pCbCtl, // decoder output circular buffer control
+ Int8 cbIdx, // decoder output circular buffer index, or indicator combined drain state desired
+ Int16 *pStrFrameLen // stream frame length
+)
+{
+ PAF_AST_DecOpCircBuf *pCb;
+
+ // CB stream frame length only updated on DSP,
+ // so no need for GateMP protection
+
+ // Get circular buffer base pointer
+ pCb = &((*pCbCtl->pXDecOpCb)[cbIdx]);
+
+ // Set output frame length
+ *pStrFrameLen = pCb->strFrameLen;
+
+ return ASP_DECOP_CB_SOK;
+}
+
// Check circular buffer drain state
Int cbCheckDrainState(
PAF_AST_DecOpCircBufCtl *pCbCtl, // decoder output circular buffer control
diff --git a/pasdk/test_dsp/framework/aspDecOpCircBuf_master.h b/pasdk/test_dsp/framework/aspDecOpCircBuf_master.h
index 24c33b1853d26aff9804308a8031018f5f59c909..b62689117927777ef2ffc70f58906fa64cb3ed88 100644 (file)
PAF_AudioFrame *pAfRd // audio frame into which to read
);
+// Read CB stream frame length
+Int cbReadStrFrameLen(
+ PAF_AST_DecOpCircBufCtl *pCbCtl, // decoder output circular buffer control
+ Int8 cbIdx, // decoder output circular buffer index, or indicator combined drain state desired
+ Int16 *pStrFrameLen // stream frame length
+);
+
// Check circular buffer drain state
Int cbCheckDrainState(
PAF_AST_DecOpCircBufCtl *pCbCtl, // decoder output circular buffer control
diff --git a/pasdk/test_dsp/framework/audioStreamOutProc.c b/pasdk/test_dsp/framework/audioStreamOutProc.c
index 3515ac05cf05839ee40e2d62e2dd65c17db0daac..cfd43a2ed9b3809f17765472f74bed73e0c4888e 100644 (file)
#include <ti/sysbios/BIOS.h>
#include "aspOutInitSync_master.h"
+#include "aspDecOpCircBuf_master.h"
#include "audioStreamProc_common.h"
#include "audioStreamOutProc.h"
#include "audioStreamOutInit.h"
const PAF_ASOT_Params *pP,
const PAF_ASOT_Patchs *pQ,
PAF_ASOT_Config *pAsotCfg,
+ PAF_AudioFrame *pDecDecode1Af,
Int frame
);
// ASOT SM function
// Purpose: Init-Sync Re-Sync state function.
-// Performs Init-Sync using stored Dec Reset/Info1 AFs.
+// Performs Init-Sync using stored Init-Sync AFs.
static Int PAF_ASOT_initSyncResync(
const PAF_ASOT_Params *pP,
const PAF_ASOT_Patchs *pQ,
PAF_ASOT_Config *pAsotCfg,
PAF_AudioFrame *pDecResetAf,
PAF_AudioFrame *pDecInfo1Af,
+ PAF_AudioFrame *pDecDecode1Af,
Int frame
);
// ASOT SM function
// Purpose: Re-select devices used for Output.
-// Performs Init-Sync using stored Dec Reset/Info1 AFs.
+// Performs Init-Sync using stored Init-Sync AFs.
static Int PAF_ASOT_reselectDevices(
const PAF_ASOT_Params *pP,
const PAF_ASOT_Patchs *pQ,
PAF_ASOT_Config *pAsotCfg,
PAF_AudioFrame *pDecResetAf,
PAF_AudioFrame *pDecInfo1Af,
+ PAF_AudioFrame *pDecDecode1Af,
Int frame,
Bool *pOutDevSel
);
Bool outDevSel; // whether output device selected
PAF_AudioFrame decResetAf;
PAF_AudioFrame decInfo1Af;
+ PAF_AudioFrame decDecode1Af;
UInt events; // latched event flags
Bool procEvents; // process events flags
Bool procOutFirstTime; // first time process output flag
gInitSyncDecDecode1State_EvtWakeTimer_cnt++;
events &= ~Evt_Id_AsotWakeTimer; // clear event
- status = PAF_ASOT_initSyncDecDecode1(pP, pQ, pAsotCfg, asopFrameCount);
+ status = PAF_ASOT_initSyncDecDecode1(pP, pQ, pAsotCfg, &decDecode1Af, asopFrameCount);
if (status < 0)
{
// FL, New IO:
gReselOutDevState_EvtWakeTimer_cnt++;
events &= ~Evt_Id_AsotWakeTimer; // clear event
- status = PAF_ASOT_reselectDevices(pP, pQ, pAsotCfg, &decResetAf, &decInfo1Af, asopFrameCount, &outDevSel);
+ status = PAF_ASOT_reselectDevices(pP, pQ, pAsotCfg, &decResetAf, &decInfo1Af, &decDecode1Af, asopFrameCount, &outDevSel);
if (status < 0)
{
// FL, New IO:
case ASOT_STATE_INITSYNC_RESYNC: // not event driven state
gAsotInitSyncResyncState_Cnt++;
- status = PAF_ASOT_initSyncResync(pP, pQ, pAsotCfg, &decResetAf, &decInfo1Af, asopFrameCount);
+ status = PAF_ASOT_initSyncResync(pP, pQ, pAsotCfg, &decResetAf, &decInfo1Af, &decDecode1Af, asopFrameCount);
if (status < 0)
{
// FL, New IO:
)
{
PAF_AST_Config *pAstCfg; // ASIT/ASOT/ASDT shared configuration
- Int zMD, zMS; // Dec and Stream Master indices
+ Int zMD; // Dec Master index
+ Int zMS; // Stream Master index
PAF_AudioFrame *pStrAf; // stream audio frame
PAF_AST_OutInitSyncCtl *pOutIsCtl; // Output Init-Sync control
Int8 decFlag; // dec stage flag
)
{
PAF_AST_Config *pAstCfg; // ASIT/ASOT/ASDT shared configuration
- Int zMD, zMS; // Dec and Stream Master indices
+ Int zMD; // Dec Master index
+ Int zMS; // Stream Master index
PAF_AudioFrame *pStrAf; // stream audio frame
PAF_AST_OutInitSyncCtl *pOutIsCtl; // Output Init-Sync control
Int8 decFlag; // dec stage flag
zMD = pAstCfg->masterDec;
pOutIsCtl = &pAsotCfg->pAspmCfg->outIsCtl;
- // Check for Dec Reset,
- // Store dec reset AF
+ // Check for Dec Info1,
+ // Store Dec Info1 AF
status = outIsReadDecStageFlagAndAf(pOutIsCtl, zMD,
ASP_OUTIS_DEC_STAGE_INFO1_IDX, &decFlag, pDecInfo1Af);
if (status < 0)
zMS = pAstCfg->masterStr;
pStrAf = pAstCfg->xStr[zMS].pAudioFrame;
- // Set ASOT output frame length.
- // THD sets this to 256 (hard-coded in Dec Info)
- // DDP sets this to 0 (audio frame pass through, 0 from ASDT AF frame length)
- // PCM sets this to 256 (decodeControl.frameLength)
+ // Set ASOT output frame length
pDecInfo1Af->sampleCount = gOutFrameLen; // !!!! GJ: Revisit !!!!
-
+
+// FL: moved to PAF_ASOT_initSyncDecDecode1()
+// Decode parameters necessary for CB stream FL auto config are known at that time.
+// CB stream FL used to configure Stream AF sample count.
+// ASP chain reset can adjust Stream AF sample count, depending on whether SRC enabled & decimation factor.
+#if 0
// Update Stream Audio Frame.
- // Copy Dec Reset AF to Stream AF.
+ // Copy Dec Info1 AF to Stream AF.
outIsCpyAf(pDecInfo1Af, pStrAf);
// outputInfo1():
{
return status;
}
+#endif
return ASOP_SOK;
}
static Int PAF_ASOT_initSyncDecDecode1(
const PAF_ASOT_Params *pP,
const PAF_ASOT_Patchs *pQ,
- PAF_ASOT_Config *pAsotCfg,
+ PAF_ASOT_Config *pAsotCfg,
+ PAF_AudioFrame *pDecDecode1Af,
Int frame
)
{
PAF_AST_Config *pAstCfg; // ASIT/ASOT/ASDT shared configuration
Int zMD; // Dec Master index
+ Int zMS; // Stream Master index
+ PAF_AudioFrame *pStrAf; // stream audio frame
PAF_AST_OutInitSyncCtl *pOutIsCtl; // Output Init-Sync control
Int8 decFlag; // dec stage flag
Int z;
Int zS, zO;
Int status; // status code
+ PAF_AST_DecOpCircBufCtl *pCbCtl; // Decoder output circular buffer control
pAstCfg = pAsotCfg->pAstCfg;
zMD = pAstCfg->masterDec;
- pOutIsCtl = &pAsotCfg->pAspmCfg->outIsCtl;
+ pOutIsCtl = &pAsotCfg->pAspmCfg->outIsCtl; // get pointer to output init-sync control
+
- // Check for Dec Reset,
- // Store dec reset AF
- status = outIsReadDecStageFlag(pOutIsCtl, zMD,
- ASP_OUTIS_DEC_STAGE_DECODE1_IDX, &decFlag);
+ // Check for Dec Decode1,
+ // Store Dec Decode1 AF
+ status = outIsReadDecStageFlagAndAf(pOutIsCtl, zMD,
+ ASP_OUTIS_DEC_STAGE_DECODE1_IDX, &decFlag, pDecDecode1Af);
if (status < 0)
{
return status;
}
else
{
+ // Get pointer to circular buffer control
+ pCbCtl = &pAsotCfg->pAspmCfg->decOpCircBufCtl;
+
+ // Initialize decoder output circular buffer for stream reads
+ cbInitStreamRead(pCbCtl, zMD);
+
+ // Get pointer to stream audio frame
+ zMS = pAstCfg->masterStr;
+ pStrAf = pAstCfg->xStr[zMS].pAudioFrame;
+
+ // Set ASOT output frame length.
+ // Frame length is initialized to CB stream (read) frame length.
+ // CB stream frame length modified via SRC reset in ASP chain reset if SRC enabled.
+ //pDecDecode1Af->sampleCount = 256; // 48/96/192 kHz pass through
+ //pDecDecode1Af->sampleCount = 512; // 96 kHz, SRC DF=2
+ //pDecDecode1Af->sampleCount = 1024; // 192 kHz, SRC DF=4
+ //pDecDecode1Af->sampleCount = gOutFrameLen; // !!!! GJ: Revisit !!!!
+ cbReadStrFrameLen(pCbCtl, zMD, &pDecDecode1Af->sampleCount);
+
+ // Update Stream Audio Frame.
+ // Copy Dec Reset AF to Stream AF.
+ outIsCpyAf(pDecDecode1Af, pStrAf);
+
+ // outputInfo1():
+ // - ASP chain reset,
+ // - Enc Info,
+ // - Start Output
+ status = asopDecOutProcInfo1(pP, pQ, pAsotCfg, frame);
+ if (status < 0)
+ {
+ return status;
+ }
+
// Find first Output associated with Master Stream
zO = OUTPUT1;
for (z=ENCODE1; z < ENCODEN; z++)
// FL, New IO: API for single Output
// I/O physical layer prime operation required by McASP LLD
- asopIoPhyPrime(&pAsotCfg->pIoOut[zO]);
+ asopIoPhyPrime(&pAsotCfg->pIoOut[zO]);
return ASOP_SOK;
}
// ASOT SM function
// Purpose: Init-Sync Re-Sync state function.
-// Performs Init-Sync using stored Dec Reset/Info1 AFs.
+// Performs Init-Sync using stored Init-Sync AFs.
static Int PAF_ASOT_initSyncResync(
const PAF_ASOT_Params *pP,
const PAF_ASOT_Patchs *pQ,
PAF_ASOT_Config *pAsotCfg,
PAF_AudioFrame *pDecResetAf,
PAF_AudioFrame *pDecInfo1Af,
+ PAF_AudioFrame *pDecDecode1Af,
Int frame
)
{
- PAF_AST_Config *pAstCfg; // ASIT/ASOT/ASDT shared configuration
- Int zMS; // Stream Master index
- PAF_AudioFrame *pStrAf; // stream audio frame
- Int status; // status code
+ PAF_AST_Config *pAstCfg; // ASIT/ASOT/ASDT shared configuration
+ Int zMD; // Dec Master index
+ Int zMS; // Stream Master index
+ PAF_AudioFrame *pStrAf; // stream audio frame
+ Int status; // status code
+ PAF_AST_DecOpCircBufCtl *pCbCtl; // Decoder output circular buffer control
pAstCfg = pAsotCfg->pAstCfg;
+ zMD = pAstCfg->masterDec;
zMS = pAstCfg->masterStr;
pStrAf = pAstCfg->xStr[zMS].pAudioFrame;
// Dec Info1 re-sync using stored Dec Info1 AF
//
+#if 0
// Update Stream Audio Frame.
// Copy Dec Info1 AF to Stream AF.
outIsCpyAf(pDecInfo1Af, pStrAf);
{
return status;
}
+#endif
+
+ //
+ // Dec Decode1 re-sync using stored Dec Decode1 AF
+ //
+
+ // Get pointer to circular buffer control
+ pCbCtl = &pAsotCfg->pAspmCfg->decOpCircBufCtl;
+
+ // Initialize decoder output circular buffer for stream reads
+ cbInitStreamRead(pCbCtl, zMD);
+
+ // Set ASOT output frame length.
+ // Frame length is initialized to CB stream (read) frame length.
+ // CB stream frame length modified via SRC reset in ASP chain reset if SRC enabled.
+ cbReadStrFrameLen(pCbCtl, zMD, &pDecDecode1Af->sampleCount);
- return ASOP_SOK;
+ // Update Stream Audio Frame.
+ // Copy Dec Info1 AF to Stream AF.
+ outIsCpyAf(pDecInfo1Af, pStrAf);
+
+ // outputInfo1():
+ // - ASP chain reset,
+ // - Enc Info,
+ // - Start Output
+ status = asopDecOutProcInfo1(pP, pQ, pAsotCfg, frame);
+ if (status < 0)
+ {
+ return status;
+ }
+
+ return ASOP_SOK;
}
// ASOT SM function
// Purpose: Re-select devices used for Output.
-// Performs Init-Sync using stored Dec Reset/Info1 AFs.
+// Performs Init-Sync using stored Init-Sync AFs.
static Int PAF_ASOT_reselectDevices(
const PAF_ASOT_Params *pP,
const PAF_ASOT_Patchs *pQ,
PAF_ASOT_Config *pAsotCfg,
PAF_AudioFrame *pDecResetAf,
PAF_AudioFrame *pDecInfo1Af,
+ PAF_AudioFrame *pDecDecode1Af,
Int frame,
Bool *pOutDevSel
)
else
{
// Init-Sync Resync
- status = PAF_ASOT_initSyncResync(pP, pQ, pAsotCfg, pDecResetAf, pDecInfo1Af, frame);
+ status = PAF_ASOT_initSyncResync(pP, pQ, pAsotCfg, pDecResetAf, pDecInfo1Af, pDecDecode1Af, frame);
if (status < 0)
{
outDevSel = FALSE;