From e9ab6fa2e71d6c4e7adaaba73886991348d28935 Mon Sep 17 00:00:00 2001 From: Frank Livingston Date: Tue, 6 Sep 2016 14:42:56 -0500 Subject: [PATCH] Add shared state for ASIT/ASOT. Add Decoder CB output control. --- .../pasdk/common/aspDecOpCircBuf_common.h | 10 +++- .../framework/audioStreamDecodeProc.c | 4 +- .../pasdk/test_dsp/application/app.cmd | 1 + .../test_dsp/framework/audioStreamInpProc.c | 6 +- .../test_dsp/framework/audioStreamInpProc.h | 6 +- .../test_dsp/framework/audioStreamOutProc.c | 5 +- .../test_dsp/framework/audioStreamOutProc.h | 8 ++- .../framework/audioStreamProc_master.c | 48 ++++++++++++++++ .../framework/audioStreamProc_master.h | 56 +++++++++++++++++++ 9 files changed, 132 insertions(+), 12 deletions(-) create mode 100644 processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamProc_master.c create mode 100644 processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamProc_master.h diff --git a/processor_audio_sdk_1_00_00_00/pasdk/common/aspDecOpCircBuf_common.h b/processor_audio_sdk_1_00_00_00/pasdk/common/aspDecOpCircBuf_common.h index f3b90f4d..7b74a725 100644 --- a/processor_audio_sdk_1_00_00_00/pasdk/common/aspDecOpCircBuf_common.h +++ b/processor_audio_sdk_1_00_00_00/pasdk/common/aspDecOpCircBuf_common.h @@ -37,6 +37,7 @@ All rights reserved. #define _ASP_DECOP_CB_COMMON_H_ #include +#include #include "paftyp.h" #define ASP_DECOP_CB_SOK ( 0 ) // ok @@ -53,7 +54,7 @@ typedef struct PAF_AST_DecOpCircBuf { PAF_AudioFrame *afCb; // audio frame CB PAF_AudioData *pcmBuf; // PCM buffer, contains PCM data associated with audio frames - UInt8 *metaBuf; // metafdata buffer, contains metadata associated with audio frames //QIN + UInt8 *metaBuf; // metadata buffer, contains metadata associated with audio frames //QIN Int8 afRdIdx; // audio frame CB read index Int8 afWrtIdx; // audio frame CB write index Int16 pcmRdIdx; // pcm buffer read index @@ -68,6 +69,13 @@ typedef struct PAF_AST_DecOpCircBuf Int8 errOvrCnt; // overflow count } PAF_AST_DecOpCircBuf; +// Decoder output circular buffer control +typedef struct PAF_AST_DecOpCircBufCtrl +{ + GateMP_Handle *gateHandle; // circular buffer gate handle + PAF_AST_DecOpCircBuf *xDecOpCb; // circular buffer base pointer +} PAF_AST_DecOpCircBufCtrl; + // Output log of circular buffer control variables (debug) Int cbLog( PAF_AST_DecOpCircBuf *pCb, diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_arm/framework/audioStreamDecodeProc.c b/processor_audio_sdk_1_00_00_00/pasdk/test_arm/framework/audioStreamDecodeProc.c index cdd23ce0..6d0fec4b 100644 --- a/processor_audio_sdk_1_00_00_00/pasdk/test_arm/framework/audioStreamDecodeProc.c +++ b/processor_audio_sdk_1_00_00_00/pasdk/test_arm/framework/audioStreamDecodeProc.c @@ -88,8 +88,8 @@ ERRNO_DEFN(TaskAsdp); /* Error number macros */ // ASDT configuration PAF_ASDT_Config gPAF_ASDT_config __attribute__ ((section(".globalSectionPafAsdtConfig"))) = { - NULL, - &gPAF_AST_config + NULL, // acp + &gPAF_AST_config // ASIT/ASOT/ASDT shared configuration }; PAF_AudioFrame *gpDecAudioFrame=NULL; diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/application/app.cmd b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/application/app.cmd index c12e2728..621942f8 100644 --- a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/application/app.cmd +++ b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/application/app.cmd @@ -54,6 +54,7 @@ SECTIONS { .globalSectionPafAsitConfig :> CORE0_DDR3 .globalSectionPafAsotConfig :> CORE0_DDR3 + .globalSectionPafAspmConfig :> CORE0_DDR3 GROUP: { .commonSectionPafAstConfig diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamInpProc.c b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamInpProc.c index bdb6adec..6fe77021 100644 --- a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamInpProc.c +++ b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamInpProc.c @@ -62,6 +62,7 @@ All rights reserved. #include "aspMsg_master.h" #include "aspDecOpCircBuf_master.h" #include "audioStreamProc_common.h" +#include "audioStreamProc_master.h" #include "audioStreamInpProc.h" // FL: porting @@ -289,8 +290,9 @@ ERRNO_DEFN(TaskAsip); /* Error number macros */ // ASIT configuration #pragma DATA_SECTION(gPAF_ASIT_config, ".globalSectionPafAsitConfig") PAF_ASIT_Config gPAF_ASIT_config = { - NULL, - &gPAF_AST_config + NULL, // acp + &gPAF_ASPM_config, // pAspmCfg, shared ASIT/ASOT configuration + &gPAF_AST_config // pAstCfg, shared ASIT/ASOT/ASDT configuration }; // Global debug counters */ diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamInpProc.h b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamInpProc.h index ebee5d1e..29774cee 100644 --- a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamInpProc.h +++ b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamInpProc.h @@ -45,6 +45,7 @@ All rights reserved. #include "audioStreamProc_params.h" #include "audioStreamProc_patchs.h" #include "audioStreamProc_config.h" +#include "audioStreamProc_master.h" // Global debug counter */ extern Uint32 gTaskAsipCnt; // debug counter for ASP task @@ -165,8 +166,9 @@ typedef struct PAF_ASIT_Patchs { // Audio Stream Input Task (ASIT) configuration typedef struct PAF_ASIT_Config { - ACP_Handle acp; - PAF_AST_Config *pAstCfg; // ASIT/ASOT/ASDT shared configuration + ACP_Handle acp; + PAF_ASPM_Config *pAspmCfg; // ASIT/ASOT shared configuration + PAF_AST_Config *pAstCfg; // ASIT/ASOT/ASDT shared configuration } PAF_ASIT_Config; 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 601d8477..9ff831a0 100644 --- 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 @@ -114,8 +114,9 @@ ERRNO_DEFN(TaskAsop); /* Error number macros */ // ASOT configuration #pragma DATA_SECTION(gPAF_ASOT_config, ".globalSectionPafAsotConfig") PAF_ASOT_Config gPAF_ASOT_config = { - NULL, - &gPAF_AST_config + NULL, // acp + &gPAF_ASPM_config, // pAspmCfg + &gPAF_AST_config // pAstCfg }; // Global debug counters */ diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamOutProc.h b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamOutProc.h index 90220aeb..c9df1352 100644 --- a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamOutProc.h +++ b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamOutProc.h @@ -45,6 +45,7 @@ All rights reserved. #include "audioStreamProc_params.h" #include "audioStreamProc_patchs.h" #include "audioStreamProc_config.h" +#include "audioStreamProc_master.h" // Global debug counter */ extern Uint32 gTaskAsopCnt; // debug counter for ASOP task @@ -75,7 +76,7 @@ typedef struct PAF_ASOT_Fxns { //Int (*decodeFinalTest) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int); Int (*decodeComplete) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, ALG_Handle *, Int, Int); Int (*selectDevices) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *); - Int (*sourceDecode) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int); + //Int (*sourceDecode) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int); Int (*startOutput) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *); Int (*stopOutput) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *); Int (*setCheckRateX) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int); @@ -165,8 +166,9 @@ typedef struct PAF_ASOT_Patchs { // Audio Stream Input Task (ASOT) configuration typedef struct PAF_ASOT_Config { - ACP_Handle acp; - PAF_AST_Config *pAstCfg; // ASIT/ASOT/ASDT shared configuration + ACP_Handle acp; + PAF_ASPM_Config *pAspmCfg; // ASIT/ASOT shared configuration + PAF_AST_Config *pAstCfg; // ASIT/ASOT/ASDT shared configuration } PAF_ASOT_Config; diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamProc_master.c b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamProc_master.c new file mode 100644 index 00000000..18562cbe --- /dev/null +++ b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamProc_master.c @@ -0,0 +1,48 @@ + +/* +Copyright (c) 2016, Texas Instruments Incorporated - http://www.ti.com/ +All rights reserved. + +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the +* distribution. +* +* Neither the name of Texas Instruments Incorporated nor the names of +* its contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ + +/* + * ======== audioStreamProc_master.c ======== + */ + +#include +#include "audioStreamProc_common.h" +#include "audioStreamProc_master.h" + +// ASPM configuration-- ASIT/ASOT shared +#pragma DATA_SECTION(gPAF_ASPM_config, ".globalSectionPafAspmConfig") +PAF_ASPM_Config gPAF_ASPM_config = { + { NULL, NULL } // gateHandle, xDecOpCb +}; diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamProc_master.h b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamProc_master.h new file mode 100644 index 00000000..3d1526db --- /dev/null +++ b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamProc_master.h @@ -0,0 +1,56 @@ + +/* +Copyright (c) 2016, Texas Instruments Incorporated - http://www.ti.com/ +All rights reserved. + +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the +* distribution. +* +* Neither the name of Texas Instruments Incorporated nor the names of +* its contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ + +/* + * ======== audioStreamProc_master.h ======== + */ + +#ifndef _ASP_MASTER_H_ +#define _ASP_MASTER_H_ + +#include +#include "aspDecOpCircBuf_common.h" + +// Audio Stream Processing Master configuration-- +// Audio Stream Input/Output Task shared +typedef struct PAF_ASPM_Config +{ + PAF_AST_DecOpCircBufCtrl decOpCircBufCtrl; +} PAF_ASPM_Config; + +extern PAF_ASPM_Config gPAF_ASPM_config; + + +#endif /* _ASP_MASTER_H_ */ -- 2.26.2