From f865d70610990e33850e37572e4931e191adfd81 Mon Sep 17 00:00:00 2001 From: Frank Livingston Date: Tue, 25 Jul 2017 22:40:03 -0500 Subject: [PATCH] PASDK-218:Add rudimentary Dec Op CB status and alpha command interface --- pasdk/common/aspDecOpCircBuf_common.h | 89 ++++++++++--------- pasdk/paf | 2 +- pasdk/test_dsp/.cproject | 59 ++++++------ pasdk/test_dsp/application/app.cfg | 2 +- .../application/itopo/evmk2g/alpha/i13_a.h | 1 + pasdk/test_dsp/framework/alpha/pafdecopcb_a.h | 47 ++++++++++ .../framework/aspDecOpCircBuf_master.c | 5 +- .../framework/aspDecOpCircBuf_master.h | 3 +- pasdk/test_dsp/framework/audioStreamInpProc.c | 44 +++++++-- pasdk/test_dsp/framework/audioStreamInpProc.h | 1 + pasdk/test_dsp/framework/audioStreamOutProc.c | 10 +-- pasdk/test_dsp/framework/itopo/params.c | 21 ++++- 12 files changed, 191 insertions(+), 93 deletions(-) create mode 100644 pasdk/test_dsp/framework/alpha/pafdecopcb_a.h diff --git a/pasdk/common/aspDecOpCircBuf_common.h b/pasdk/common/aspDecOpCircBuf_common.h index f561b91b..9303631f 100644 --- a/pasdk/common/aspDecOpCircBuf_common.h +++ b/pasdk/common/aspDecOpCircBuf_common.h @@ -116,52 +116,59 @@ All rights reserved. //#define DEF_DEC_OP_FRAME_LEN ( PAF_SYS_FRAMELENGTH ) // default decoder output frame length //#define DEF_STR_FRAME_LEN ( PAF_SYS_FRAMELENGTH ) // default stream frame length +// Decoder output circular buffer status +typedef struct PAF_AST_DecOpCircBufStatus +{ + Int size; + Int16 strFrameLen; // stream frame length (output transaction size) +} PAF_AST_DecOpCircBufStatus; // Decoder output circular buffer 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; // metadata buffer, contains metadata associated with audio frames - Int8 sourceSel; // selected source - Int8 primedFlag; // flag indicated whether CB is primed: FALSE - CB not primed, TRUE - CB primed - Int16 targetNDSamps; // target CB Nominal Delay number of samples - Int16 deltaSamps; // number of 256 (N) sample output frames to block reader - Int8 afRdIdx; // audio frame CB read index - Int8 afWrtIdx; // audio frame CB write index - //Int8 afLagIdx; // audio frame CB Lag idx, - //Int8 afInitialLag; // Initial delay/lag between CB write and read - Int16 pcmRdIdx; // pcm buffer read index - Int8 prvMdRdIdx; // private metadata read index - Int8 numAfCb; // current number frames in CB - Int8 maxNumAfCb; // maximum number of audio frames in CB - Int32 numPcmSampsPerCh; // current number of PCM samples per channel in CB - Int32 maxNumPcmSampsPerCh; // max number of PCM samples per channel in CB - Int16 decOpFrameLen; // selected decoder output frame length (input transaction size) - Int16 strFrameLen; // stream frame length (output transaction size) - Int8 writerActiveFlag; // flag indicates whether CB writer is active: FALSE - writer not active, TRUE - writer active - Int8 readerActiveFlag; // flag indicates whether CB reader is active: FALSE - reader not active, TRUE - reader active - Int8 drainFlag; // flag indicates whether reader should drain (empty) remaining frames in CB: FALSE - reader should not drain, TRUE - reader should drain - Int32 readAfWriterInactiveCnt; // count of read audio frames with inactive writer & not draining - Int32 readAfNdCnt; // count of read audio frames for nominal delay - Int32 wrtAfReaderInactiveCnt; // count of write audio frames with inactive reader - Int32 wrtAfZeroSampsCnt; // count of write audio frames with zero samples - Int32 errAfUndCnt; // read error AF underflow count - Int32 errAfOvrCnt; // write error AF overflow count - Int32 errPcmUndCnt; // read error PCM underflow count - Int32 errPcmOvrCnt; // write error PCM overflow count - PAF_AudioData *pcmBufEnd; // PCM buffer, contains PCM data associated with audio frames end - UInt8 *metaBufEnd; // metadata buffer, contains metadata associated with audio frames end - Int8 maxAFChanNum; // maximum number of audio data channels in audio frame - Int16 maxAFSampCount; // maximum number of sample counts in audio frame - PAF_AudioFrame lastAf; // used to store the last valid read out audio frame info to generate mute frame + PAF_AudioFrame *afCb; // audio frame CB + PAF_AudioData *pcmBuf; // PCM buffer, contains PCM data associated with audio frames + UInt8 *metaBuf; // metadata buffer, contains metadata associated with audio frames + Int8 sourceSel; // selected source + Int8 primedFlag; // flag indicated whether CB is primed: FALSE - CB not primed, TRUE - CB primed + Int16 targetNDSamps; // target CB Nominal Delay number of samples + Int16 deltaSamps; // number of 256 (N) sample output frames to block reader + Int8 afRdIdx; // audio frame CB read index + Int8 afWrtIdx; // audio frame CB write index + //Int8 afLagIdx; // audio frame CB Lag idx, + //Int8 afInitialLag; // Initial delay/lag between CB write and read + Int16 pcmRdIdx; // pcm buffer read index + Int8 prvMdRdIdx; // private metadata read index + Int8 numAfCb; // current number frames in CB + Int8 maxNumAfCb; // maximum number of audio frames in CB + Int32 numPcmSampsPerCh; // current number of PCM samples per channel in CB + Int32 maxNumPcmSampsPerCh; // max number of PCM samples per channel in CB + Int16 decOpFrameLen; // selected decoder output frame length (input transaction size) + Int16 strFrameLen; // stream frame length (output transaction size) + Int8 writerActiveFlag; // flag indicates whether CB writer is active: FALSE - writer not active, TRUE - writer active + Int8 readerActiveFlag; // flag indicates whether CB reader is active: FALSE - reader not active, TRUE - reader active + Int8 drainFlag; // flag indicates whether reader should drain (empty) remaining frames in CB: FALSE - reader should not drain, TRUE - reader should drain + Int32 readAfWriterInactiveCnt; // count of read audio frames with inactive writer & not draining + Int32 readAfNdCnt; // count of read audio frames for nominal delay + Int32 wrtAfReaderInactiveCnt; // count of write audio frames with inactive reader + Int32 wrtAfZeroSampsCnt; // count of write audio frames with zero samples + Int32 errAfUndCnt; // read error AF underflow count + Int32 errAfOvrCnt; // write error AF overflow count + Int32 errPcmUndCnt; // read error PCM underflow count + Int32 errPcmOvrCnt; // write error PCM overflow count + PAF_AudioData *pcmBufEnd; // PCM buffer, contains PCM data associated with audio frames end + UInt8 *metaBufEnd; // metadata buffer, contains metadata associated with audio frames end + Int8 maxAFChanNum; // maximum number of audio data channels in audio frame + Int16 maxAFSampCount; // maximum number of sample counts in audio frame + PAF_AudioFrame lastAf; // used to store the last valid read out audio frame info to generate mute frame + PAF_AST_DecOpCircBufStatus cbStatus; // CB status #ifdef CB_RW_OP_CAP_PP // debug - UInt32 *cb_samples_op; // should be in shared memory, preferred NON cache - UInt8 *cb_op_owner; // should be in shared memory, preferred NON cache - UInt8 *cb_afRdIdx; // should be in shared memory, preferred NON cache - UInt8 *cb_afWrtIdx; // should be in shared memory, preferred NON cache - UInt8 *cb_numAfCb; // should be in shared memory, preferred NON cache - UInt32 cb_opCnt; // range (0 - CB_OP_COUNT_MAX) + UInt32 *cb_samples_op; // should be in shared memory, preferred NON cache + UInt8 *cb_op_owner; // should be in shared memory, preferred NON cache + UInt8 *cb_afRdIdx; // should be in shared memory, preferred NON cache + UInt8 *cb_afWrtIdx; // should be in shared memory, preferred NON cache + UInt8 *cb_numAfCb; // should be in shared memory, preferred NON cache + UInt32 cb_opCnt; // range (0 - CB_OP_COUNT_MAX) #endif } PAF_AST_DecOpCircBuf; diff --git a/pasdk/paf b/pasdk/paf index 768e5799..dad50bdc 160000 --- a/pasdk/paf +++ b/pasdk/paf @@ -1 +1 @@ -Subproject commit 768e579920deca65633cfb0ab1434e49595c9664 +Subproject commit dad50bdcd5b83aa799fcd1fda7fcf85fd33a3c8c diff --git a/pasdk/test_dsp/.cproject b/pasdk/test_dsp/.cproject index 29cebf1b..4f691ecd 100644 --- a/pasdk/test_dsp/.cproject +++ b/pasdk/test_dsp/.cproject @@ -11,8 +11,8 @@ - + @@ -28,13 +28,13 @@ - - - + - + + + @@ -134,6 +134,7 @@ + @@ -274,8 +275,8 @@ - + @@ -291,13 +292,13 @@ - - - + - + + + @@ -454,8 +455,8 @@ - + @@ -471,13 +472,13 @@ - - - + - + + + @@ -689,8 +690,8 @@ - + @@ -706,13 +707,13 @@ - - - + - + + + @@ -919,15 +920,6 @@ - - - -