diff --git a/pasdk/test_dsp/framework/audioStreamInpDec.c b/pasdk/test_dsp/framework/audioStreamInpDec.c
index cc48d809c1e8f7b61042b22f8e5ee4d5da1a98e7..fe2bb19b3474b7500be2444e5a237218b392a7c9 100644 (file)
PAF_ASIT_Config *pAsitCfg);
Int decCheckMajorAu(PAF_AST_Config *pAstCfg);
+#if 0
Int AspMsgSnd(UInt32 sndCmd, char *sndMsgBuf);
Int AspMsgAck(UInt32 ackCmd, char *ackMsgBuf);
+#endif
extern UInt32 gCbWrtAfErrCnt;
case DEC_STATE_INFO_ACK_DECODE_SND:
//if(decMsg != DEC_MSGMSK_INFOACK) {
// only DEC_MSGMSK_INFOACK is expected in this state
- if((decMsg&DEC_MSGMSK_INFOACK) != DEC_MSGMSK_INFOACK) {
- // During debugging, it is possible that INPDATA and INFOACK
- // come at the same time (e.g. due to breaking point).
- decErr = DEC_ERR_WRONG_MSG;
- }
- else {
- decMsg &= ~DEC_MSGMSK_INFOACK; // clear the bit mask
+ //if((decMsg&DEC_MSGMSK_INFOACK) != DEC_MSGMSK_INFOACK) {
+ // // During debugging, it is possible that INPDATA and INFOACK
+ // // come at the same time (e.g. due to breaking point).
+ // decErr = DEC_ERR_WRONG_MSG;
+ //}
+ //else {
+
+ if (decMsg & DEC_MSGMSK_RXACK) {
+ decMsg &= ~DEC_MSGMSK_RXACK; // clear the bit mask
// Process the INFO acknowledgment from decoder
decErr = decInfoAck(pP, pQ, pAsitCfg);
}
}
}
+
+ if (decMsg != 0) {
+ decErr = DEC_ERR_WRONG_MSG;
+ }
break;
case DEC_STATE_DECODE_ACK:
// Two different messages may be received: DECACK (decode acknowledgment)
// or INPDATA (input data ready).
- if(decMsg & DEC_MSGMSK_DECACK) {
- decMsg &= ~DEC_MSGMSK_DECACK;
-
+ //if(decMsg & DEC_MSGMSK_DECACK) {
+ // decMsg &= ~DEC_MSGMSK_DECACK;
+
+ if (decMsg & DEC_MSGMSK_RXACK)
+ {
+ decMsg &= ~DEC_MSGMSK_RXACK; // clear the bit mask
+
// Process DECODE ACK from decoder
decErr = decDecodeAck(pP, pQ, pAsitCfg);
if(decErr == DEC_NO_ERR) {
}
}
}
- else if(decMsg & DEC_MSGMSK_INPDATA) {
+
+ if (decMsg & DEC_MSGMSK_INPDATA) {
// If we're here, it means decode acknowledgment from decoder
// is delayed, i.e., a new frame of input data is ready before
// current frame decoding is finished.
TRACE_VERBOSE0("decDecodeFsm: receiving INPDATA in DEC_STATE_DECODE_ACK");
}
- else {
+
+ if (decMsg != 0) {
decErr = DEC_ERR_WRONG_MSG;
}
break;
{
PAF_AST_Config *pAstCfg;
PAF_AST_IoInp *pInp;
+ AspMsgMaster_Handle hAspMsgMaster; // ASIT message master handle
//PAF_AST_DecOpCircBufCtl *pCbCtl; /* Decoder output circular buffer control */
Int as; /* Audio Stream Number (1, 2, etc.) */
Int z; /* decode/encode counter */
Int argIdx;
Int8 tempVar8;
char decMsgBuf[ASP_MSG_BUF_LEN];
+ Int status;
- pAstCfg = pAsitCfg->pAstCfg; // get pointer to AST common (shared) configuration
- pInp = pAsitCfg->pIoInp;
+ pAstCfg = pAsitCfg->pAstCfg; // get pointer to AST common (shared) configuration
+ pInp = pAsitCfg->pIoInp; // get pointer to IO configuration
+ hAspMsgMaster = pAsitCfg->hAspMsgMaster; // get message master handle
as = pAstCfg->as;
(void)as; // clear compiler warning in case not used with tracing disabled
// send dec activate message to slave
argIdx = 0; // set decIdx (zone index)
*(Int32 *)&decMsgBuf[argIdx] = z;
- if(AspMsgSend(ASP_SLAVE_DEC_ACTIVATE, ASP_MASTER_DEC_ACTIVATE_DONE,
- decMsgBuf, NULL) != ASP_MSG_NO_ERR)
+ status = AspMsgSnd(hAspMsgMaster, ASP_SLAVE_DEC_ACTIVATE, decMsgBuf);
+ if (status != ASP_MSG_NO_ERR)
{
TRACE_TERSE0("decodeInit: error in sending DEC_ACTIVATE message ");
SW_BREAKPOINT; // temporary
return ASIP_ERR_DECODE_MSG; // temporary
}
+ status = AspMsgRcvAck(hAspMsgMaster, ASP_MASTER_DEC_ACTIVATE_DONE, NULL, TRUE);
+ if (status != ASP_MSG_NO_ERR)
+ {
+ TRACE_TERSE0("decodeInit: error in receiving DEC_ACTIVATE_DONE ack message ");
+ SW_BREAKPOINT; // temporary
+ return ASIP_ERR_DECODE_MSG; // temporary
+ }
// send dec reset message to slave
argIdx = 0; // set decIdx
*(Int32 *)&decMsgBuf[argIdx] = z;
- if(AspMsgSend(ASP_SLAVE_DEC_RESET, ASP_MASTER_DEC_RESET_DONE,
- decMsgBuf, decMsgBuf) != ASP_MSG_NO_ERR)
+ status = AspMsgSnd(hAspMsgMaster, ASP_SLAVE_DEC_RESET, decMsgBuf);
+ if (status != ASP_MSG_NO_ERR)
+ {
+ TRACE_TERSE0("decodeInit: error in sending DEC_RESET message ");
+ SW_BREAKPOINT; // temporary
+ return ASIP_ERR_DECODE_MSG; // temporary
+ }
+ status = AspMsgRcvAck(hAspMsgMaster, ASP_MASTER_DEC_RESET_DONE, decMsgBuf, TRUE);
+ if (status != ASP_MSG_NO_ERR)
{
TRACE_TERSE0("decodeInit: error in sending DEC_RESET message ");
SW_BREAKPOINT; // temporary
PAF_ASIT_Config *pAsitCfg)
{
PAF_AST_Config *pAstCfg;
+ AspMsgMaster_Handle hAspMsgMaster; // ASIT message master handle
Int as; /* Audio Stream Number (1, 2, etc.) */
Int z; /* decode/encode counter */
Int argIdx;
Int8 tempVar8;
char decMsgBuf[ASP_MSG_BUF_LEN];
+ Int status;
- pAstCfg = pAsitCfg->pAstCfg; // get pointer to AST common (shared) configuration
+ pAstCfg = pAsitCfg->pAstCfg; // get pointer to AST common (shared) configuration
+ hAspMsgMaster = pAsitCfg->hAspMsgMaster; // get message master handle
as = pAstCfg->as;
(void)as; // clear compiler warning in case not used with tracing disabled
{
TRACE_VERBOSE1("decDecodeComplete: AS%d: finalizing decode", as+z);
- // FL: send dec deactivate message to slave
+ // send dec deactivate message to slave
argIdx = 0; // set decIdx
*(Int32 *)&decMsgBuf[argIdx] = z;
- if(AspMsgSend(ASP_SLAVE_DEC_DEACTIVATE, ASP_MASTER_DEC_DEACTIVATE_DONE,
- decMsgBuf, NULL) != ASP_MSG_NO_ERR)
+ status = AspMsgSnd(hAspMsgMaster, ASP_SLAVE_DEC_DEACTIVATE, decMsgBuf);
+ if (status != ASP_MSG_NO_ERR)
+ {
+ TRACE_TERSE0("decodeComplete: error in sending DEC_DEACTIVATE message.");
+ SW_BREAKPOINT;
+ return DEC_ERR_COMPLETE_MSG;
+ }
+ status = AspMsgRcvAck(hAspMsgMaster, ASP_MASTER_DEC_DEACTIVATE_DONE, NULL, TRUE);
+ if (status != ASP_MSG_NO_ERR)
{
TRACE_TERSE0("decodeComplete: error in sending DEC_DEACTIVATE message.");
SW_BREAKPOINT;
{
PAF_AST_Config *pAstCfg;
PAF_AST_IoInp *pInp;
+ AspMsgMaster_Handle hAspMsgMaster; // ASIT message master handle
Int as; /* Audio Stream Number (1, 2, etc.) */
Int z; /* input/decode/stream counter */
Int errno; /* error number */
Int argIdx;
Int8 tempVar8;
char decMsgBuf[ASP_MSG_BUF_LEN];
+ Int status;
- pAstCfg = pAsitCfg->pAstCfg; // get pointer to common (shared) configuration
- pInp = pAsitCfg->pIoInp;
+ pAstCfg = pAsitCfg->pAstCfg; // get pointer to common (shared) configuration
+ pInp = pAsitCfg->pIoInp; // get pointer to IO configuration
+ hAspMsgMaster = pAsitCfg->hAspMsgMaster; // get message master handle
as = pAstCfg->as;
// Set decode control: sample rate, emphasis
// send info message to slave
argIdx = 0; // set decIdx
*(Int32 *)&decMsgBuf[argIdx] = z;
- if(AspMsgSnd(ASP_SLAVE_DEC_INFO, decMsgBuf) != ASP_MSG_NO_ERR)
+ status = AspMsgSnd(hAspMsgMaster, ASP_SLAVE_DEC_INFO, decMsgBuf);
+ if (status != ASP_MSG_NO_ERR)
{
TRACE_TERSE0("decodeInfo: error in sending DEC_INFO message ");
SW_BREAKPOINT; // temporary
} // z=DECODE1 to DECODEN
//////////////////////////////////////////////////////////////////////////////
- asitPostInfoEvent();
+ //asitPostInfoEvent(); // simulation
//////////////////////////////////////////////////////////////////////////////
return ASIP_NO_ERR;
{
PAF_AST_Config *pAstCfg;
PAF_AST_IoInp *pInp;
+ AspMsgMaster_Handle hAspMsgMaster;
Int as; /* Audio Stream Number (1, 2, etc.) */
Int z; /* input/decode/stream counter */
Int errno; /* error number */
Int8 tempVar8;
Int tempVar;
char decMsgBuf[ASP_MSG_BUF_LEN];
+ Int status;
- pAstCfg = pAsitCfg->pAstCfg; // get pointer to common (shared) configuration
- pInp = pAsitCfg->pIoInp;
+ pAstCfg = pAsitCfg->pAstCfg; // get pointer to common (shared) configuration
+ pInp = pAsitCfg->pIoInp; // get pointer to IO configuration
+ hAspMsgMaster = pAsitCfg->hAspMsgMaster; // get message master handle
as = pAstCfg->as;
zMD = pAstCfg->masterDec;
zMS = pAstCfg->masterStr;
GATEMP_INDEX_DEC);
if (pInp[zI].hIoPhy && tempVar8)
{
- // FL: acknowledge info message from slave
- argIdx = 0; // set decIdx
- *(Int32 *)&decMsgBuf[argIdx] = z;
- if(AspMsgAck(ASP_MASTER_DEC_INFO_DONE,
- decMsgBuf) != ASP_MSG_NO_ERR)
+ // acknowledge info message from slave
+ errno = 0;
+ //argIdx = 0; // set decIdx
+ //*(Int32 *)&decMsgBuf[argIdx] = z;
+ status = AspMsgRcvAck(hAspMsgMaster, ASP_MASTER_DEC_INFO_DONE, decMsgBuf, FALSE);
+ if (status != ASP_MSG_NO_ERR)
{
- TRACE_TERSE0("decodeInfo: error in receiving DEC_INFO message ");
+ TRACE_TERSE0("decodeInfo: error in receiving DEC_INFO_DONE ack message ");
SW_BREAKPOINT; // temporary
- return -1; // temporary
+ errno = -1; // temporary error return value
+ return errno; // temporary
}
else
{
{
PAF_AST_Config *pAstCfg;
PAF_AST_IoInp *pInp;
+ AspMsgMaster_Handle hAspMsgMaster; // ASIT message master handle
Int as; /* Audio Stream Number (1, 2, etc.) */
Int z; /* decode/stream counter */
Int argIdx;
Int cbErrno, errno;
char decMsgBuf[ASP_MSG_BUF_LEN];
+ Int status;
- pAstCfg = pAsitCfg->pAstCfg; // get pointer to common (shared) configuration
- pInp = pAsitCfg->pIoInp;
+ pAstCfg = pAsitCfg->pAstCfg; // get pointer to common (shared) configuration
+ pInp = pAsitCfg->pIoInp; // get pointer to IO configuration
+ hAspMsgMaster = pAsitCfg->hAspMsgMaster; // get message master handle
as = pAstCfg->as;
(void)as; // clear compiler warning in case not used with tracing disabled
errno = 0;
argIdx = 0; // set decIdx
*(Int32 *)&decMsgBuf[argIdx] = z;
- if(AspMsgSnd(ASP_SLAVE_DEC_DECODE, decMsgBuf) != ASP_MSG_NO_ERR)
+ status = AspMsgSnd(hAspMsgMaster, ASP_SLAVE_DEC_DECODE, decMsgBuf);
+ if (status != ASP_MSG_NO_ERR)
{
TRACE_TERSE0("decodeDecode: error in sending DEC_DECODE message ");
SW_BREAKPOINT; // temporary
} // z=DECODE1 to DECODEN
//////////////////////////////////////////////////////////////////////////////
- asitPostDecEvent();
+ //asitPostDecEvent(); // simulation
//////////////////////////////////////////////////////////////////////////////
return ASIP_NO_ERR;
{
PAF_AST_Config *pAstCfg;
PAF_AST_IoInp *pInp;
+ AspMsgMaster_Handle hAspMsgMaster; // ASIT message master handle
Int as; /* Audio Stream Number (1, 2, etc.) */
Int z; /* decode/stream counter */
Int errno; /* error number */
Int argIdx;
Int cbErrno;
char decMsgBuf[ASP_MSG_BUF_LEN];
+ Int status;
- pAstCfg = pAsitCfg->pAstCfg; // get pointer to common (shared) configuration
- pInp = pAsitCfg->pIoInp;
+ pAstCfg = pAsitCfg->pAstCfg; // get pointer to common (shared) configuration
+ pInp = pAsitCfg->pIoInp; // get pointer to IO configuration
+ hAspMsgMaster = pAsitCfg->hAspMsgMaster; // get message master handle
as = pAstCfg->as;
(void)as; // clear compiler warning in case not used with tracing disabled
@@ -957,16 +1014,17 @@ static Int decDecodeAck(const PAF_ASIT_Params *pP, const PAF_ASIT_Patchs *pQ,
(void)zS; // clear compiler warning in case not used with tracing disabled
if ( pInp[zI].hIoPhy && pAstCfg->xDec[z].decodeStatus.mode )
{
- // FL: send decode message to slave
+ // receive decode ack message from slave
errno = 0;
- argIdx = 0; // set decIdx
- *(Int32 *)&decMsgBuf[argIdx] = z;
- errno = AspMsgAck(ASP_MASTER_DEC_DECODE_DONE, decMsgBuf);
- if(errno != ASP_MSG_NO_ERR)
+ //argIdx = 0; // set decIdx
+ //*(Int32 *)&decMsgBuf[argIdx] = z;
+ status = AspMsgRcvAck(hAspMsgMaster, ASP_MASTER_DEC_DECODE_DONE, decMsgBuf, FALSE);
+ if (status != ASP_MSG_NO_ERR)
{
- TRACE_TERSE0("decodeDecode: error in sending DEC_DECODE message ");
+ TRACE_TERSE0("decodeDecode: error in receiving DEC_DECODE_DONE ack message ");
SW_BREAKPOINT; // temporary
- return -1; // temporary
+ errno = -1; // temporary error return value
+ return errno;
}
else
{
} /* decDecodeAck */
-
+#if 0
/************************************************************************************
* ASP message sending function. Refer to aspMsg_master.h for detailed description.
************************************************************************************/
// may be error in returned (acknowledgement) message.
return (ASP_MSG_NO_ERR);
} /* AspMsgAck */
+#endif
#if 0