]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/commitdiff
Fix ASIT decodeInfo() to properly return error return to from ARM.
authorFrank Livingston <frank-livingston@ti.com>
Wed, 1 Mar 2017 19:07:46 +0000 (13:07 -0600)
committerFrank Livingston <frank-livingston@ti.com>
Wed, 1 Mar 2017 19:07:46 +0000 (13:07 -0600)
Remove ML0 from DSP build.

pasdk/test_dsp/framework/aspDecOpCircBuf_master.c
pasdk/test_dsp/framework/audioStreamInpProc.c
pasdk/test_dsp/framework/itopo/patchs.c

index bdd0d8717d1b9f4693e7834f571fc20954ff6673..c1474bdc07e45d55a06358e084abab241c568db5 100644 (file)
@@ -567,7 +567,7 @@ Int cbReadAf(
     
     // (writerActiveFlag,emptyFlag)=(1,0) and (0,1) are left
     // Here we are checking (1,0) state here
-    if ((pCb->writerActiveFlag == 1))
+    if (pCb->writerActiveFlag == 1)
     {
         // check underflow
         if (pCb->numAfCb <= 0)
index e791f6c141cb30bb34f29dbb030135f1a0d37177..a12b52214233c5a75a9a2d257826b909b6c27f73 100644 (file)
@@ -306,12 +306,14 @@ UInt32 gAsipDecodeCnt           =0;
 UInt32 gAsipDecodeErrCnt        =0;
 UInt32 gAsipFinalCnt            =0;
 UInt32 gAsipQuitCnt             =0;
-UInt32 gIbReset_cnt             =0;
-UInt32 gcapIb_cnt               =0;
+UInt32 gAsipInfo1_PrimaryErrCnt =0;
+UInt32 gAsipInfo1_ErrCnt        =0;
 UInt32 gAsipInfo2_PrimaryErrCnt =0;
 UInt32 gAsipInfo2_ErrCnt        =0;
+UInt32 gCapIbReset_cnt          =0;
+UInt32 gCapIb_cnt               =0;
 // debug
-UInt32 gCbWrtAfErrCnt           =0; // // decoder output circular buffer write error count (returned from ARM to DSP)
+UInt32 gCbWrtAfErrCnt           =0; // decoder output circular buffer write error count (returned from ARM to DSP)
                                    
 
 #include "dbgDib.h" // debug
@@ -886,7 +888,7 @@ Void taskAsipFxn(
 
         // FL: debug, reset IB capture buffer
         capIbReset();
-        gIbReset_cnt++;
+        gCapIbReset_cnt++;
         Log_info0("capIbReset()");
 
         // FL: send source select message to slave
@@ -2202,7 +2204,7 @@ PAF_ASIT_decodeProcessing(
                 // Establish primary timing
                 if (errno = pP->fxns->decodeInfo(pP, pQ, pC, frame, block))
                 {
-                    gProbe1Err++;
+                    gAsipInfo1_PrimaryErrCnt++;
                     TRACE_TERSE1("INFO1: errno 0x%x after decodeInfo, primary timing", errno);
                     break;
                 }
@@ -2274,6 +2276,7 @@ PAF_ASIT_decodeProcessing(
                 if (errno = pP->fxns->decodeInfo1(pP, pQ, pC, frame, block))
                 {
                     TRACE_VERBOSE1("PAF_ASIT_decodeProcessing: INFO1, errno 0x%x.  break after decodeInfo1", errno);
+                    gAsipInfo1_ErrCnt++;
                     break;
                 }
 
@@ -2530,7 +2533,7 @@ PAF_ASIT_decodeInit(
     Int zMI;
     ASP_Msg* pAspMsg;                   /* Messaging */
     Int argIdx;
-    Int decErrno;
+    Int errno;
     Int status;
 #ifdef NON_CACHE_STATUS
     Int8 tempVar8;
@@ -2690,14 +2693,13 @@ PAF_ASIT_decodeInit(
                 TRACE_MSG1("decErrno=%d", pAspMsg->buf[0]);
 
                 argIdx = 0; // get decErrno
-                decErrno = *(Int32 *)&pAspMsg->buf[argIdx];
-                if (decErrno != 0)
-                {
-                    return decErrno;
-                }
+                errno = *(Int32 *)&pAspMsg->buf[argIdx];
             }
             else
             {
+                //
+                // Invalid message received
+                //
                 TRACE_TERSE3("ERROR: Rx ASP message: procId=%d, cmd=%d, messageId=0x%04x", pAspMsg->procId, pAspMsg->cmd, pAspMsg->messageId);
                 SW_BREAKPOINT; // temporary
                 return -1; // temporary
@@ -2708,7 +2710,7 @@ PAF_ASIT_decodeInit(
             {
                 SW_BREAKPOINT;
             }
-
+            
             // (***) FL: revisit
             // invalidate Dec configuration
             Cache_inv(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
@@ -2720,6 +2722,10 @@ PAF_ASIT_decodeInit(
                                               &pC->xDec[z].decodeControl, &pC->xDec[z].decodeStatus)))
                 return errno;
 #endif
+            if (errno != 0)
+            {
+                return errno;
+            }
             
 #ifdef NON_CACHE_STATUS
             gear = 0;  // due to size difference
@@ -2955,7 +2961,7 @@ PAF_ASIT_decodeInfo(
         
         // FL: debug, capture input buffer
         capIb(pAstCfg->xInp[zMI].pInpBuf);
-        gcapIb_cnt++;
+        gCapIb_cnt++;
         
 #if 1 // (***) FL: shows timing of Input Rx SIO reclaim after decoding has started (autodet complete)
         {
@@ -3048,15 +3054,26 @@ PAF_ASIT_decodeInfo(
                 SW_BREAKPOINT;
                 return -1; // temporary
             }
-            if ((pAspMsg->procId != hAspMsgMaster->slaveProcId) || 
-                (pAspMsg->cmd != ASP_MASTER_DEC_INFO_DONE) || 
-                (pAspMsg->messageId != (hAspMsgMaster->messageId | ((UInt32)1<<31))))
+            if ((pAspMsg->procId == hAspMsgMaster->slaveProcId) &&
+                (pAspMsg->cmd == ASP_MASTER_DEC_INFO_DONE) && 
+                (pAspMsg->messageId == (hAspMsgMaster->messageId | ((UInt32)1<<31))))
+            {
+                hAspMsgMaster->messageId = (hAspMsgMaster->messageId + 1) & ~(1<<31);
+                TRACE_TERSE3("Rx ASP message: procId=%d, cmd=%d, messageId=0x%04x", pAspMsg->procId, pAspMsg->cmd, pAspMsg->messageId);
+                TRACE_MSG1("decErrno=%d", pAspMsg->buf[0]);
+                
+                argIdx = 0; // get decErrno
+                errno = *(Int32 *)&pAspMsg->buf[argIdx];
+            }
+            else
             {
+                //
+                // Invalid message received
+                //
                 TRACE_TERSE3("ERROR: Rx ASP message: procId=%d, cmd=%d, messageId=0x%04x", pAspMsg->procId, pAspMsg->cmd, pAspMsg->messageId);
                 SW_BREAKPOINT; // temporary
-            }           
-            hAspMsgMaster->messageId = (hAspMsgMaster->messageId + 1) & ~(1<<31);
-            TRACE_MSG3("Rx ASP message: procId=%d, cmd=%d, messageId=0x%04x", pAspMsg->procId, pAspMsg->cmd, pAspMsg->messageId);
+                return -1; // temporary
+            }
             // free the message
             status = MessageQ_free((MessageQ_Msg)pAspMsg); /* free the message */
             if (status != MessageQ_S_SUCCESS)
@@ -3081,6 +3098,7 @@ PAF_ASIT_decodeInfo(
                 TRACE_TERSE1("return error errno 0x%x.", errno);
                 return errno;
             }
+
 #ifdef NON_CACHE_STATUS
             statusOp_read(&tempVar,
                           &(pAstCfg->xDec[z].decodeStatus.frameCount),
@@ -3441,9 +3459,9 @@ PAF_ASIT_decodeDecode(
                 hAspMsgMaster->messageId = (hAspMsgMaster->messageId + 1) & ~(1<<31);
                 TRACE_MSG3("Rx ASP message: procId=%d, cmd=%d, messageId=0x%04x", pAspMsg->procId, pAspMsg->cmd, pAspMsg->messageId);
                 
-                argIdx = 0;
+                argIdx = 0; // get decErrno
                 errno = *(Int32 *)&pAspMsg->buf[argIdx];
-                argIdx += sizeof(Int32);
+                argIdx += sizeof(Int32); // get cbErrno
                 cbErrno = *(Int32 *)&pAspMsg->buf[argIdx];
                 if (cbErrno != 0)
                 {
@@ -3454,6 +3472,9 @@ PAF_ASIT_decodeDecode(
             }
             else
             {
+                //
+                // Invalid message received
+                //
                 TRACE_TERSE3("ERROR: Rx ASP message: procId=%d, cmd=%d, messageId=0x%04x", pAspMsg->procId, pAspMsg->cmd, pAspMsg->messageId);
                 SW_BREAKPOINT; // temporary
             }
index 7c183d274309e0a296cfd53c99ce123706067390..2f8d34a8c4de2c10f51b951afe6ba62df15ba632 100644 (file)
@@ -98,7 +98,7 @@ All rights reserved.
 #include <bmda_tig.h>
 #endif
 
-#define _ML0_
+//#define _ML0_
 #ifdef _ML0_
 #include <ml.h>
 #include <ml_mds.h>