diff --git a/pasdk/test_dsp/framework/audioStreamOutProc.c b/pasdk/test_dsp/framework/audioStreamOutProc.c
index d9503c0af43e5c959e1ed31a2bcae4db04db61ff..d25f1e476b42a766ae0aef7f2f2160f15b1c626f 100644 (file)
Int frame
);
+// Encode function which handles encoding to two output buffers
static Int asopDecOutProcEncodeWrap(
const PAF_ASOT_Params *pP,
const PAF_ASOT_Patchs *pQ,
// FL: debug, allow modification of Output frame length via JTAG.
-Int16 gOutFrameLen=PAF_ASOT_FRAMELENGTH; // output frame length (PCM samples)
+//Int16 gOutFrameLen=PAF_ASOT_FRAMELENGTH; // output frame length (PCM samples)
// ASOT configuration
#pragma DATA_SECTION(gPAF_ASOT_config, ".globalSectionPafAsotConfig")
// check for valid index into device array
if (device >= pQ->devout->n) // DEVOUT_N
{
- device = 0; // treat as device None
+ device = 0; // treat as device OutNone
}
// Select Output Devices
*pOutDevSel = FALSE;
return status;
}
-
+
+#if 0
// Reset IO Buff & IO Phy
// FL, New IO: API for single Output
status = asopIoCompsInit(&pAstCfg->xOut[zO], &pAsotCfg->pIoOut[zO]);
*pOutDevSel = FALSE;
return status;
}
+#endif
+ // indicate SIO update request processed
pAstCfg->xOut[zO].outBufStatus.sioSelect = device | 0x80;
}
}
else
{
-// FL: moved to PAF_ASOT_initSyncDecDecode1()
+// FL: moved to PAF_ASOT_initSyncDecDecode1(), content of asopDecOutProcInfo1() moved to asopDecOutProcDec1().
// 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.
// Wake Timer + *POLLING* version.
// No explicit Rx ASDT message event from ASDT.
// ASOT wakes on Wake Timer event and polls for flag set.
-//static Int PAF_ASOT_initSyncDecDecode1(
static Int PAF_ASOT_initSyncDecDecode1(
const PAF_ASOT_Params *pP,
const PAF_ASOT_Patchs *pQ,
}
else
{
+// FL: moved from PAF_ASOT_initSyncDecInfo1()
#if 1
// Get pointer to circular buffer control
pCbCtl = &pAsotCfg->pAspmCfg->decOpCircBufCtl;
// - ASP chain reset,
// - Enc Info,
// - Start Output
- status = asopDecOutProcInfo1(pP, pQ, pAsotCfg, frame);
+ status = asopDecOutProcDec1(pP, pQ, pAsotCfg, frame);
if (status < 0)
{
return status;
}
}
+ // FL, New IO: API for single Output
+ // Reset IO Buff & IO Phy
+ status = asopIoCompsInit(pStrAf->sampleCount, &pAstCfg->xOut[zO], &pAsotCfg->pIoOut[zO]);
+ if (status < 0)
+ {
+ return status;
+ }
+
+ // Initialize Output buffer configuration
+ status = asopInitOutBufConfig(&pAstCfg->xOut[zO], &pAsotCfg->pIoOut[zO]);
+ if (status)
+ {
+ TRACE_TERSE1("PAF_ASOT_initSyncDecDecode1: asopInitOutBufConfig returns errno 0x%x ", status);
+ return status;
+ }
+
// FL, New IO: assumption here is Tx McASP clock dividers &
// Output frame size are set correctly before IO prime,
// i.e. IO prime is not using defaults
-
// FL, New IO: API for single Output
-
// I/O physical layer prime operation required by McASP LLD
asopIoPhyPrime(&pAsotCfg->pIoOut[zO]);
TRACE_VERBOSE0("PAF_ASOT_initSyncDecDecode1: ASOP McASP LLD primed.");
status = ASOP_SOK;
pAstCfg = pAsotCfg->pAstCfg;
-
+
if (*pFirstTime == TRUE)
{
// Initialize Decoder output processing
return status;
}
+// Encode function which handles encoding to two output buffers
static Int asopDecOutProcEncodeWrap(
const PAF_ASOT_Params *pP,
const PAF_ASOT_Patchs *pQ,
pOutBufCfg = &(pAstCfg->xOut[zO].outBufConfig);
pAf = pAstCfg->xEnc[zO].encodeInStruct.pAudioFrame;
- if(pAsotCfg->pIoOut[zO].buff2 == NULL)
+ if (pAsotCfg->pIoOut[zO].buff2 == NULL)
{
// Output buffer won't wrap around - to invoke the encoder once
pOutBufCfg->lengthofFrame = pAf->sampleCount;
}
else
{
+ //
+ // Not expected to occur since output buffer is allocated
+ // to be a multiple of Stream AF sample count x stride x size of element.
+ // See asopIoCompsInit().
+ //
+ SW_BREAKPOINT;
+
+#if 0
// Output buffer will wrap around - to invoke the encoder twice
XDAS_Int16 sampleCountSave;
- PAF_AudioData *afDataAddrSave[16];
+ PAF_AudioData *afDataAddrSave[PAF_MAXNUMCHAN_AF];
PAF_AudioData **afDataAddr;
int i, ch;
for(i=0; i<pOutBufCfg->stride; i++)
{
ch = pAstCfg->xEnc[zO].encodeStatus.channelMap.from[i];
- afDataAddrSave[i] = afDataAddr[ch]; // save audio frame buffer addresses
- afDataAddr[ch] = &afDataAddr[ch][pOutBufCfg->lengthofFrame];
+ if (ch >= 0)
+ {
+ afDataAddrSave[i] = afDataAddr[ch]; // save audio frame buffer addresses
+ afDataAddr[ch] = &afDataAddr[ch][pOutBufCfg->lengthofFrame];
+ }
}
// Invoke the encoder to write data to the beginning of output buffer (wrapping around)
for(i=0; i<pOutBufCfg->stride; i++)
{
ch = pAstCfg->xEnc[zO].encodeStatus.channelMap.from[i];
- afDataAddr[ch] = afDataAddrSave[i];
+ if (ch >= 0)
+ {
+ afDataAddr[ch] = afDataAddrSave[i];
+ }
}
pAsotCfg->pIoOut[zO].ioBuffBuf2AllocCnt++; // debug
+#endif
}
return status;