summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 80d9fa4)
raw | patch | inline | side by side (parent: 80d9fa4)
author | Frank Livingston <frank-livingston@ti.com> | |
Thu, 1 Sep 2016 16:20:02 +0000 (11:20 -0500) | ||
committer | Frank Livingston <frank-livingston@ti.com> | |
Thu, 1 Sep 2016 16:20:02 +0000 (11:20 -0500) |
processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamOutProc.c | patch | blob | history |
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamOutProc.c b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamOutProc.c
index 4e2dd775781ecfbd6e2d90919087cf7cfea0bd88..30228251423eb2865377898a9e3c25ec6c1c7322 100644 (file)
#include "common.h"
#include "aspMsg_common.h"
#include "aspMsg_master.h"
+#include "paf_decOpCircBuf.h"
#include "audioStreamProc_common.h"
#include "audioStreamOutProc.h"
//
if (!pP)
{
- TRACE_TERSE1("TaskAso: AS%d: No Parameters defined. Exiting.", as);
+ TRACE_TERSE1("TaskAsop: AS%d: No Parameters defined. Exiting.", as);
LINNO_RPRT(TaskAsop, -1);
return;
}
/* Stream memory */
if (!(pC->xStr = Memory_calloc((IHeap_Handle)HEAP_INTERNAL, STREAMN * sizeof (*pC->xStr), 4, &eb)))
{
- TRACE_TERSE1("PAF_AST_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
+ TRACE_TERSE1("PAF_ASOT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
SW_BREAKPOINT;
return __LINE__;
}
- TRACE_TERSE3("PAF_AST_initPhaseMalloc. (pC->xStr) %d bytes from space %d at 0x%x.",
+ TRACE_TERSE3("PAF_ASOT_initPhaseMalloc. (pC->xStr) %d bytes from space %d at 0x%x.",
STREAMN * sizeof (*pC->xStr),
HEAP_ID_INTERNAL, (IArg)pC->xStr);
if (!(fBuf = (PAF_AudioFrame *)Memory_calloc((IHeap_Handle)HEAP_INTERNAL, STREAMS * sizeof (*fBuf), 4, &eb)))
{
- TRACE_TERSE1("PAF_AST_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
+ TRACE_TERSE1("PAF_ASOT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
SW_BREAKPOINT;
return __LINE__;
}
- TRACE_TERSE3("PAF_AST_initPhaseMalloc. (fBuf) %d bytes from space %d at 0x%x.",
+ TRACE_TERSE3("PAF_ASOT_initPhaseMalloc. (fBuf) %d bytes from space %d at 0x%x.",
STREAMS * sizeof (*fBuf),
HEAP_ID_INTERNAL, (IArg)fBuf);
/* Encode memory */
if (!(pC->xEnc = Memory_calloc((IHeap_Handle)HEAP_INTERNAL, ENCODEN * sizeof (*pC->xEnc), 4, &eb)))
{
- TRACE_TERSE1("PAF_AST_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
+ TRACE_TERSE1("PAF_ASOT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
SW_BREAKPOINT;
return __LINE__;
}
- TRACE_TERSE3("PAF_AST_initPhaseMalloc. (pC->xEnc) %d bytes from space %d at 0x%x.",
+ TRACE_TERSE3("PAF_ASOT_initPhaseMalloc. (pC->xEnc) %d bytes from space %d at 0x%x.",
ENCODEN * sizeof (*pC->xEnc),
HEAP_ID_INTERNAL, (IArg)pC->xEnc);
/* Output memory */
if (!(pC->xOut = Memory_calloc((IHeap_Handle)HEAP_INTERNAL, OUTPUTN * sizeof (*pC->xOut), 4, &eb)))
{
- TRACE_TERSE1("PAF_AST_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
+ TRACE_TERSE1("PAF_ASOT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
SW_BREAKPOINT;
return __LINE__;
}
- TRACE_TERSE3("PAF_AST_initPhaseMalloc. (pC->xOut) %d bytes from space %d at 0x%x.",
+ TRACE_TERSE3("PAF_ASOT_initPhaseMalloc. (pC->xOut) %d bytes from space %d at 0x%x.",
OUTPUTN * sizeof (*pC->xOut),
HEAP_ID_INTERNAL, (IArg)pC->xOut);
pC->xOut[z].outBufStatus = *pP->pOutBufStatus;
}
- TRACE_TERSE1("PAF_AST_initPhaseConfig: AS%d: initialization phase - configuration complete.", as+zMS);
+ TRACE_TERSE1("PAF_ASOT_initPhaseConfig: AS%d: initialization phase - configuration complete.", as+zMS);
return 0;
} //PAF_ASOT_initPhaseConfig
if (!(acp = (ACP_Handle )ACP_MDS_create(NULL)))
{
- TRACE_TERSE1("PAF_AST_initPhaseAcpAlg: AS%d: ACP algorithm instance creation failed", as+zMS);
+ TRACE_TERSE1("PAF_ASOT_initPhaseAcpAlg: AS%d: ACP algorithm instance creation failed", as+zMS);
return __LINE__;
}
pC->acp = acp;
if (OUTPUT1 <= z && z < OUTPUTN)
{
- TRACE_TERSE1("%PAF_ASOT_initPhaseCommon: calling PAF_ALG_ALLOC outLinkInit common[%d].", z);
+ TRACE_TERSE1("PAF_ASOT_initPhaseCommon: calling PAF_ALG_ALLOC outLinkInit common[%d].", z);
if (PAF_ALG_ALLOC(outLinkInit[z-OUTPUT1], common[z]))
{
TRACE_TERSE1("PAF_AST_initPhaseMalloc: AS%d: PAF_ALG_alloc failed", as+z);
if (OUTPUT1 <= z && z < OUTPUTN)
{
PAF_ASP_Chain *chain;
- TRACE_TERSE2("PAF_AST_initPhaseMalloc: AS%d: non-common output chain init for %d",
+ TRACE_TERSE2("PAF_ASOT_initPhaseMalloc: AS%d: non-common output chain init for %d",
as+z, z);
chain = PAF_ASP_chainInit (&pC->xOut[z].outChainData, pP->pChainFxns,
HEAP_EXTERNAL, as+z, acp, &trace,
// Changes will break FSM and allow Output reconfiguration.
if (errno = checkOutSio(pP, pC, &outSioUpdate))
{
- TRACE_TERSE1("PAF_AST_outputProcessing: checkOutSio returned errno = 0x%04x", errno);
+ TRACE_TERSE1("PAF_ASOT_decodeProcessing: checkOutSio returned errno = 0x%04x", errno);
break;
}
else if (outSioUpdate)
{
- TRACE_VERBOSE0("PAF_AST_outputProcessing: Change in Output SIO selection");
+ TRACE_VERBOSE0("PAF_ASOT_decodeProcessing: Change in Output SIO selection");
state = QUIT;
}
if (errno = pP->fxns->decodeInit(pP, pQ, pC, sourceSelect))
{
- TRACE_VERBOSE1("PAF_AST_outputProcessing: INIT, errno 0x%x. break after decodeInit", errno);
+ TRACE_VERBOSE1("PAF_ASOT_decodeProcessing: INIT, errno 0x%x. break after decodeInit", errno);
break;
}
// Establish secondary timing
if (errno = pP->fxns->decodeInfo1(pP, pQ, pC, frame, block))
{
- TRACE_VERBOSE1("PAF_AST_decodeProcessing: INIT, errno 0x%x. break after decodeInfo1", errno);
+ TRACE_VERBOSE1("PAF_ASOT_decodeProcessing: INIT, errno 0x%x. break after decodeInfo1", errno);
break;
}
frame = 0;
block = 0;
- TRACE_VERBOSE0("PAF_AST_outputProcessing: state: INIT->STREAM");
+ TRACE_VERBOSE0("PAF_ASOT_decodeProcessing: state: INIT->STREAM");
state = STREAM;
continue;
if (errno = pP->fxns->decodeStream(pP, pQ, pC, frame, block))
{
- TRACE_TERSE1("PAF_AST_outputProcessing: state: STREAM. decodeStream err 0x%x", errno);
+ TRACE_TERSE1("PAF_ASOT_decodeProcessing: state: STREAM. decodeStream err 0x%x", errno);
break;
}
- TRACE_VERBOSE0("PAF_AST_outputProcessing: state: STREAM->ENCODE");
+ TRACE_VERBOSE0("PAF_ASOT_decodeProcessing: state: STREAM->ENCODE");
state = ENCODE;
continue;
if (errno = pP->fxns->decodeEncode(pP, pQ, pC, frame, block))
{
- TRACE_TERSE1("PAF_AST_outputProcessing: state: ENCODE. decodeEncode err 0x%x", errno);
+ TRACE_TERSE1("PAF_ASOT_decodeProcessing: state: ENCODE. decodeEncode err 0x%x", errno);
break;
}
// Contained in INFO2 in combined FSM.
if (errno = pP->fxns->decodeInfo2(pP, pQ, pC, frame, block))
{
- TRACE_TERSE1("PAF_AST_decodeProcessing: ENCODE break on decodeInfo2. errno 0x%x", errno);
+ TRACE_TERSE1("PAF_ASOT_decodeProcessing: ENCODE break on decodeInfo2. errno 0x%x", errno);
break;
}
block++;
- TRACE_VERBOSE0("PAF_AST_outputProcessing: state: ENCODE->FINAL");
+ TRACE_VERBOSE0("PAF_ASOT_decodeProcessing: state: ENCODE->FINAL");
state = FINAL;
continue;
}
#endif
- TRACE_VERBOSE0("PAF_AST_outputProcessing: state: FINAL->STREAM");
+ TRACE_VERBOSE0("PAF_ASOT_decodeProcessing: state: FINAL->STREAM");
state = STREAM;
continue;
gAsopQuitCnt++;
Log_info0("TaskAsop: state=QUIT");
- TRACE_VERBOSE0("PAF_AST_outputProcessing: state: QUIT");
+ TRACE_VERBOSE0("PAF_ASOT_decodeProcessing: state: QUIT");
errno = ASPERR_QUIT;
break;
// - Set error number registers.
// - Exit state machine to "complete" processing.
- TRACE_TERSE1("PAF_AST_outputProcessing: state: unknown, 0x%x", state);
+ TRACE_TERSE1("PAF_ASOT_decodeProcessing: state: unknown, 0x%x", state);
errno = ASPERR_UNKNOWNSTATE;
break;
} // End of switch (state).
- TRACE_VERBOSE0("PAF_AST_outputProcessing: Calling decode complete");
+ TRACE_VERBOSE0("PAF_ASOT_decodeProcessing: Calling decode complete");
if (pP->fxns->decodeComplete(pP, pQ, pC, NULL, frame, block))
{
/* ignored? */;
errno = cbReadStart(pCb);
if (errno)
{
+ TRACE_TERSE1("PAF_ASOT_decodeInit:cbReadStart() error=%d", errno);
+ SW_BREAKPOINT; // FL: debug
return errno;
}
+ // FL: debug
+ cbLog(pCb, 1, "PAF_ASOT_decodeInit:cbReadStart");
}
// TODO: move this to start of this function so that it doesn't affect IO timing
Int select = pC->xEnc[z].encodeStatus.select;
ALG_Handle encAlg = pC->xEnc[z].encAlg[select];
ENC_Handle enc = (ENC_Handle )encAlg;
- TRACE_VERBOSE1("AS%d: PAF_AST_decodeInit: initializing encode", as+zS);
+ TRACE_VERBOSE1("AS%d: PAF_ASOT_decodeInit: initializing encode", as+zS);
if (encAlg->fxns->algActivate)
{
encAlg->fxns->algActivate (encAlg);
// added latency.
if (errno != ASPERR_INFO_RATECHANGE)
{
- TRACE_TERSE1("PAF_ASIT_decodeInfo1: setCheckRateX returns errno 0x%x, not RATECHANGE", errno);
+ TRACE_TERSE1("PAF_ASOT_decodeInfo1: setCheckRateX returns errno 0x%x, not RATECHANGE", errno);
return errno;
}
else
{
- TRACE_TERSE0("PAF_ASIT_decodeInfo1: RATECHANGE returns RATECHANGE, ignoring");
+ TRACE_TERSE0("PAF_ASOT_decodeInfo1: RATECHANGE returns RATECHANGE, ignoring");
}
}
if (cbErrno != 0)
{
TRACE_TERSE1("PAF_ASOT_decodeStream:cbReadAf() error=%d", cbErrno);
- //SW_BREAKPOINT; // temporary//QIN - need to put underflow stats counter here.
+ //SW_BREAKPOINT; // FL: debug
+ //return cbErrno; // (***) FL: ignoring read failures??
}
//Log_info0("PAF_ASOT_decodeStream:cbReadAf() complete.");
// FL: debug
- //cbLog(pCb, 0);
+ cbLog(pCb, 1, "PAF_ASOT_decodeStream:cbReadAf");
//if (capAfWrite(pAfRd, 0) != CAP_AF_SOK)
//{
// Log_info0("capAfWrite() error");
// update length (e.g. ARC may have changed)
pC->xOut[z].outBufConfig.lengthofFrame =
pC->xEnc[zE].encodeInStruct.pAudioFrame->sampleCount;
- TRACE_GEN2("AS%d: PAF_AST_outputEncode: processing block %d -- idle", as+zS, block);
+ TRACE_GEN2("PAF_ASOT_decodeEncode: AS%d: processing block %d -- idle", as+zS, block);
errno = SIO_reclaim(pC->xOut[z].hTxSio,(Ptr *) &pC->xOut[z].pOutBuf, NULL);
if (errno < 0)
{
SIO_idle(pC->xOut[z].hTxSio);
- TRACE_TERSE2("PAF_AST_outputEncode: AS%d: SIO_reclaim returns error %d", as+zS, -errno);
+ TRACE_TERSE2("PAF_ASOT_decodeEncode: AS%d: SIO_reclaim returns error %d", as+zS, -errno);
return -errno; // SIO negates error codes
}
// TODO: use pC->xOut[z].pOutBuf in following ->encode call
}
else
{
- TRACE_VERBOSE2("AS%d: PAF_AST_outputEncode: processing block %d -- idle <ignored>", as+zS, block);
+ TRACE_VERBOSE2("AS%d: PAF_ASOT_decodeEncode: processing block %d -- idle <ignored>", as+zS, block);
}
}
if (select != pC->xEnc[z].encodeControl.encActive)
{
pC->xEnc[z].encodeControl.encActive = select;
- TRACE_TERSE0("PAF_AST_outputEncode: return error");
+ TRACE_TERSE0("PAF_ASOT_decodeEncode: return error");
return (-1);
}
- TRACE_GEN2("AS%d: PAF_AST_outputEncode: processing block %d -- encode", as+zS, block);
+ TRACE_GEN2("AS%d: PAF_ASOT_decodeEncode: processing block %d -- encode", as+zS, block);
// (MID 1933) temp. workaround for PCE2
pC->xEnc[z].encodeInStruct.pAudioFrame->data.nChannels = PAF_MAXNUMCHAN;
{
if (errno != PCEERR_OUTPUT_POINTERNULL)
{
- TRACE_TERSE1("PAF_AST_outputEncode: return error %d line %d", errno);
+ TRACE_TERSE1("PAF_ASOT_decodeEncode: return error %d line %d", errno);
return errno;
}
}
}
else
{
- TRACE_VERBOSE2("AS%d: PAF_AST_outputEncode: processing block %d -- encode <ignored>",
+ TRACE_VERBOSE2("PAF_ASOT_decodeEncode: AS%d: processing block %d -- encode <ignored>",
as+pP->streamsFromEncodes[z], block);
}
}
if (pC->xOut[z].hTxSio)
{
- TRACE_GEN2("AS%d: PAF_AST_outputEncode: processing block %d -- output", as+zS, block);
+ TRACE_GEN2("PAF_ASOT_decodeEncode: AS%d: processing block %d -- output", as+zS, block);
errno = SIO_issue(pC->xOut[z].hTxSio,
&pC->xOut[z].outBufConfig, sizeof (pC->xOut[z].outBufConfig), 0);
if (errno)
}
else
{
- TRACE_GEN2("AS%d: PAF_ASOT_decodeEncode: processing block %d -- output <ignored>", as+zS, block);
+ TRACE_GEN2("PAF_ASOT_decodeEncode: AS%d: processing block %d -- output <ignored>", as+zS, block);
}
}
errno = cbReadStop(pCb);
if (errno)
{
+ TRACE_TERSE1("PAF_ASOT_decodeComplete:cbReadStop() error=%d", errno);
+ SW_BREAKPOINT; // FL: debug
return errno;
}
+ // FL: debug
+ cbLog(pCb, 1, "PAF_ASOT_decodeComplete:cbReadStop");
}
pP->fxns->streamChainFunction(pP, pQ, pC, PAF_ASP_CHAINFRAMEFXNS_FINAL, 0, frame);
#ifdef PAF_ASP_FINAL
ENC_Handle enc = (ENC_Handle)encAlg;
#endif /* PAF_ASP_FINAL */
- TRACE_VERBOSE1("PAF_AST_decodeComplete: AS%d: finalizing encode", as+z);
+ TRACE_VERBOSE1("PAF_ASOT_decodeComplete: AS%d: finalizing encode", as+z);
#ifdef PAF_ASP_FINAL
if (enc->fxns->final)
enc->fxns->final(enc, NULL, &pC->xEnc[z].encodeControl,
}
else
{
- TRACE_VERBOSE1("PAF_AST_decodeComplete: AS%d: finalizing encode <ignored>", as+z);
+ TRACE_VERBOSE1("PAF_ASOT_decodeComplete: AS%d: finalizing encode <ignored>", as+z);
}
}
&pC->xOut[z].outBufConfig, sizeof(pC->xOut[z].outBufConfig), 0))
{
SIO_idle(pC->xOut[z].hTxSio);
- TRACE_TERSE2("PAF_AST_startOutput: AS%d: SIO_issue failed (0x%x)", as+zS, errno);
+ TRACE_TERSE2("PAF_ASOT_startOutput: AS%d: SIO_issue failed (0x%x)", as+zS, errno);
return errno;
}
{
errno = (errno & 0xff) | ASPERR_MUTE;
/* convert to sensical errno */
- TRACE_TERSE2("as1-f2: PAF_AST_startOutput: AS%d: SIO control failed (unmute) 0x%x", as+zS, errno);
+ TRACE_TERSE2("as1-f2: PAF_ASOT_startOutput: AS%d: SIO control failed (unmute) 0x%x", as+zS, errno);
return (errno);
}
else
= (pC->xOut[z].outBufStatus.audio & 0xf0) | PAF_OB_AUDIO_SOUND;
}
- TRACE_VERBOSE1("PAF_AST_startOutput: AS%d: output started", as+zS);
+ TRACE_VERBOSE1("PAF_ASOT_startOutput: AS%d: output started", as+zS);
}
}
errno = (getVal & 0xff) | ASPERR_MUTE;
/* convert to sensical errno */
}
- TRACE_VERBOSE1("PAF_ASIT_stopOutput: AS%d: SIO control failed (mute)", as+zS);
+ TRACE_VERBOSE1("PAF_ASOT_stopOutput: AS%d: SIO control failed (mute)", as+zS);
}
TRACE_TIME((&TIME_MOD, "... + %d = %d (stopOutput -- begin PAF_SIO_CONTROL_IDLE)", dtime(), TSK_time()));
errno = (getVal & 0xff) | ASPERR_MUTE;
/* convert to sensical errno */
}
- TRACE_VERBOSE1("as1-f2: PAF_AST_stopOutput: AS%d: SIO control failed (mute)", as+zS);
+ TRACE_VERBOSE1("as1-f2: PAF_ASOT_stopOutput: AS%d: SIO control failed (mute)", as+zS);
}
pC->xOut[z].outBufStatus.audio &= ~0x0f;
chain->fxns->chainFrameFunction[iChainFrameFxns];
TRACE_GEN2(iChainFrameFxns == PAF_ASP_CHAINFRAMEFXNS_RESET
- ? "AS%d: PAF_AST_streamChainFunction: processing frame %d -- audio stream (reset)"
+ ? "PAF_ASOT_streamChainFunction: AS%d: processing frame %d -- audio stream (reset)"
: iChainFrameFxns == PAF_ASP_CHAINFRAMEFXNS_APPLY
- ? "AS%d: PAF_AST_streamChainFunction: processing block %d -- audio stream (apply)"
+ ? "PAF_ASOT_streamChainFunction: AS%d: processing block %d -- audio stream (apply)"
: iChainFrameFxns == PAF_ASP_CHAINFRAMEFXNS_FINAL
- ? "AS%d: PAF_AST_streamChainFunction: processing frame %d -- audio stream (final)"
- : "AS%d: PAF_AST_streamChainFunction: processing frame %d -- audio stream (?????)",
+ ? "PAF_ASOT_streamChainFunction: AS%d: processing frame %d -- audio stream (final)"
+ : "PAF_ASOT_streamChainFunction: AS%d: processing frame %d -- audio stream (?????)",
as+z, logArg);
errno = (*func) (chain, frame);
- TRACE_VERBOSE2("AS%d: PAF_AST_streamChainFunction: errno 0x%x.",
+ TRACE_VERBOSE2("PAF_ASOT_streamChainFunction: AS%d: errno 0x%x.",
as+z, errno);
if (errno && abortOnError)
}
else {
TRACE_GEN2(iChainFrameFxns == PAF_ASP_CHAINFRAMEFXNS_RESET
- ? "AS%d: PAF_AST_streamChainFunction: processing frame %d -- audio stream (reset) <ignored>"
+ ? "PAF_ASOT_streamChainFunction: AS%d: processing frame %d -- audio stream (reset) <ignored>"
: iChainFrameFxns == PAF_ASP_CHAINFRAMEFXNS_APPLY
- ? "AS%d: PAF_AST_streamChainFunction: processing block %d -- audio stream (apply) <ignored>"
+ ? "PAF_ASOT_streamChainFunction: AS%d: processing block %d -- audio stream (apply) <ignored>"
: iChainFrameFxns == PAF_ASP_CHAINFRAMEFXNS_FINAL
- ? "AS%d: PAF_AST_streamChainFunction: processing frame %d -- audio stream (final) <ignored>"
- : "AS%d: PAF_AST_streamChainFunction: processing frame %d -- audio stream (?????) <ignored>",
+ ? "PAF_ASOT_streamChainFunction: AS%d: processing frame %d -- audio stream (final) <ignored>"
+ : "PAF_ASOT_streamChainFunction: AS%d: processing frame %d -- audio stream (?????) <ignored>",
as+z, logArg);
}