summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (from parent 1: f633ef1)
raw | patch | inline | side by side (from parent 1: f633ef1)
author | Frank Livingston <frank-livingston@ti.com> | |
Tue, 8 May 2018 17:31:53 +0000 (12:31 -0500) | ||
committer | Frank Livingston <frank-livingston@ti.com> | |
Tue, 8 May 2018 17:31:53 +0000 (12:31 -0500) |
McASP LLD driver handle stored in mcaspLLDconfig for each Output Interface
for Interface
for Interface
diff --git a/pasdk/test_dsp/framework/audioStreamInpProcNewIO.c b/pasdk/test_dsp/framework/audioStreamInpProcNewIO.c
index 15cdb70b46e96ea2b06b23b67922816f77217e1c..8975f512ccac16bded7386ee39f95330a397ac9a 100644 (file)
@@ -1140,7 +1140,7 @@ Int asitSelectDevices(const PAF_ASIT_Patchs *pQ, PAF_AST_Config *pAstCfg, PAF_AS
mcaspChanHandle = NULL;
status = mcasplldChanCreate(lldCfg, &mcaspChanHandle);
if(status != Aud_EOK) {
- Log_info0("McASP channel creation failed!\n");
+ Log_info0("asitSelectDevices(): McASP channel creation failed!\n");
return ASIT_ERR_MCASP_CFG;
}
diff --git a/pasdk/test_dsp/framework/audioStreamOutIo.c b/pasdk/test_dsp/framework/audioStreamOutIo.c
index b93a5f052e03b516b7eaf668f5773dce2595c848..7ba0c8b914696dac21d0b59c1bf4935929fa4cf7 100644 (file)
extern Int d10Initialized;
-// FL, New IO: this function is currently a stub
-// FL, New IO: need to McASP/EDMA configuration using SAP configuration from Output shortcut
// Select Output devices
Int asopSelectDevices(void *pConfig, PAF_AST_IoOut *pOut)
{
- if((pOut->hIoBuff == NULL) || (pOut->hIoPhy == NULL) || (!d10Initialized)) {
- return -1;
+ mcaspLLDconfig *lldCfg;
+ Ptr mcaspChanHandle;
+ Aud_STATUS status;
+
+ if ((pOut->hIoBuff == NULL) || (pOut->hIoPhy == NULL) || (!d10Initialized)) {
+ return ASOP_IO_ERR_IO_UNINIT;
}
- if(pOut->hMcaspChan == NULL) {
- Aud_STATUS status;
- mcaspLLDconfig * lldCfg;
- Ptr mcaspChanHandle;
-
- lldCfg = (mcaspLLDconfig *)pConfig;
+ lldCfg = (mcaspLLDconfig *)pConfig;
+ if (lldCfg->hMcaspChan == NULL) {
+ mcaspChanHandle = NULL;
status = mcasplldChanCreate(lldCfg, &mcaspChanHandle);
- if(status != Aud_EOK) {
- return -1;
+ if (status != Aud_EOK) {
+ Log_info0("asopSelectDevices(): McASP channel creation failed!\n");
+ return ASOP_IO_ERR_MCASP_CFG;
}
- pOut->hMcaspChan = mcaspChanHandle;
+ lldCfg->hMcaspChan = mcaspChanHandle;
+ pOut->hMcaspChan = lldCfg->hMcaspChan;
pOut->stride = lldCfg->mcaspChanParams->noOfSerRequested * lldCfg->mcaspChanParams->noOfChannels;
}
- return 0;
+ return ASOP_IO_SOK;
}
// Check if Output device SIO selection changed
if ((z < OUTPUT1) || (z >= OUTPUTN))
{
*pOutDevSelUpdate = FALSE;
- return -1;
+ return ASOP_IO_ERR_INV_PARAMS;
}
*pOutDevSelUpdate = (Bool)(pAstCfg->xOut[z].outBufStatus.sioSelect >= 0);
- return 0;
+ return ASOP_IO_SOK;
}
// Check if any Output device SIO selection changed
*pOutDevSelUpdate = outDevSelUpdate;
- return 0;
+ return ASOP_IO_SOK;
}
// -----------------------------------------------------------------------------
}
}
- return 0;
+ return ASOP_IO_SOK;
} //asopSetCheckRateX
// -----------------------------------------------------------------------------
}
}
- return 0;
+ return ASOP_IO_SOK;
} /* asopStartOutput */
// -----------------------------------------------------------------------------
PAF_AST_IoOut *pOut;
Int as; /* Audio Stream Number (1, 2, etc.) */
Int z; /* output counter */
- Int errno = 0, getVal;
+ Int errno, getVal;
Int zS, zX;
PAF_SIO_IALG_Obj *pObj;
PAF_SIO_IALG_Config *pAlgConfig;
as = pAstCfg->as;
(void)as; // clear compiler warning in case not used with tracing disabled
+ errno = ASOP_IO_SOK;
for (z=OUTPUT1; z < OUTPUTN; z++)
{
if (pOut[z].hIoPhy)
ioBuffParams.nominalDelay = NUM_CYCLE_PER_OUTPUT_FRAME_DEF * pOutIo->stride * WORD_SIZE_PCM * (NUM_PRIME_XFERS+1);
if(ioBuffInit(pOutIo->hIoBuff, &ioBuffParams) != IOBUFF_NOERR)
{
- return -1; // to remove magic number
+ return ASOP_IO_ERR_IOBUFF_INIT; // to remove magic number
}
ioPhyParams.ioBuffHandle = pOutIo->hIoBuff;
ioPhyParams.ioBuffOp = IOPHY_IOBUFFOP_READ;
if(ioPhyInit(pOutIo->hIoPhy, &ioPhyParams) != IOPHY_NOERR)
{
- return -1; // to remove magic number
+ return ASOP_IO_ERR_IOPHY_INIT; // to remove magic number
}
pOutIo->phyXferSize = ioPhyParams.xferFrameSize;
pOutIo->errIoBuffOvrCnt = 0; // initialize IO buff overflow count
pOutIo->errIoBuffUndCnt = 0; // initialize IO buff underflow count
- return 0;
+ return ASOP_IO_SOK;
} /* asopIoCompsInit */
/*======================================================================================
pOutBuf->pOutBuf = &(pOutBuf->outBufConfig);
- return 0;
+ return ASOP_IO_SOK;
}
Int asopGetOutBufPtrs(
//System_printf ("asopGetOutBufPtrs: output buff overflow\n"); // debug
// skip processing since output buffer overflows
- return -1;
+ return ASOP_IO_ERR_OUTBUF_OVERFLOW;
}
else if (status == IOBUFF_ERR_UNDERFLOW)
{
pOutIo->buff2 = buff2;
pOutIo->size2 = size2;
- return 0;
+ return ASOP_IO_SOK;
}
#if 0
//System_printf ("asopUpdateOutBufConfig: output buff overflow\n"); // debug
// skip processing since output buffer overflows
- return -1;
+ return ASOP_IO_ERR_OUTBUF_OVERFLOW;
}
else if (status == IOBUFF_ERR_UNDERFLOW)
{
pOutIo->buff2 = buff2;
pOutIo->size2 = size2;
- return 0;
+ return ASOP_IO_SOK;
}
#endif
ioBuffWriteComplete(hIoBuff, buff2, size2);
}
- return 0;
+ return ASOP_IO_SOK;
}
/*======================================================================================
diff --git a/pasdk/test_dsp/framework/audioStreamOutIo.h b/pasdk/test_dsp/framework/audioStreamOutIo.h
index 605438489066252ceb8428cc1af87aa6d530c12d..2245474ab1fb471c6b85ab8453624a86f7d375b5 100644 (file)
#include "audioStreamOutProc.h"
+// status codes
+#define ASOP_IO_SOK ( 0 ) // ok
+#define ASOP_IO_ERR_INV_PARAMS ( -1 ) // error, invalid parameters
+#define ASOP_IO_ERR_IO_UNINIT ( -2 ) // error, IO uninitialized
+#define ASOP_IO_ERR_MCASP_CFG ( -3 ) // error, McASP configuration
+#define ASOP_IO_ERR_IOBUFF_INIT ( -4 ) // error, IO Buff initialization
+#define ASOP_IO_ERR_IOPHY_INIT ( -5 ) // error, IO Phy initialization
+#define ASOP_IO_ERR_OUTBUF_OVERFLOW ( -6 ) // error, Output buffer overflow
+
// Select Output devices
Int asopSelectDevices(