PASDK-218:Add traces, fix typo in decodeEncode
authorFrank Livingston <frank-livingston@ti.com>
Mon, 3 Jul 2017 21:23:25 +0000 (16:23 -0500)
committerFrank Livingston <frank-livingston@ti.com>
Mon, 3 Jul 2017 21:23:25 +0000 (16:23 -0500)
pasdk/test_dsp/framework/audioStreamOutProc.c

index 4a0c140a9d57758ec0a4385880479d1bf54ade4d..7e97225430a701691b40f77e2f4cef0fe679a34b 100644 (file)
@@ -409,6 +409,8 @@ Void taskAsopFxn(
         switch (state)
         {
             case INIT_OUT_PROC_STATE:
+                Log_info0("TaskAsop: state=INIT_OUT_PROC_STATE");
+                
                 //
                 // Output Processing initialization.
                 //
@@ -425,6 +427,8 @@ Void taskAsopFxn(
                 break;
                 
             case INITSYNC_DEC_RESET_STATE:
+                Log_info0("TaskAsop: state=INITSYNC_DEC_RESET_STATE");
+
                 //
                 // Dec Reset Init-Sync.
                 //  
@@ -434,16 +438,19 @@ Void taskAsopFxn(
                 errno = PAF_ASOT_initSyncDecReset(pP, pQ, pAsotCfg, &decResetAf);
                 if (errno < 0)
                 {
+                    Log_info1("TaskAsop: state=INITSYNC_DEC_RESET_STATE errno=%d", errno);
                     // sync error -- start over
                     state = INIT_OUT_PROC_STATE;
                 }
                 else if (errno == ASOP_INITSYNC_NOTREADY)
                 {
+                    Log_info1("TaskAsop: state=INITSYNC_DEC_RESET_STATE not sync'd errno=%d", errno);
                     // sync not ready -- try again
                     state = INITSYNC_DEC_RESET_STATE;
                 }
-                else
+                else // errno==0
                 {
+                    Log_info1("TaskAsop: state=INITSYNC_DEC_RESET_STATE sync'd, errno=%d", errno);
                     // sync'd -- move on
                     state = INITSYNC_DEC_INFO1_STATE;
                 }
@@ -451,6 +458,8 @@ Void taskAsopFxn(
                 break;
             
             case INITSYNC_DEC_INFO1_STATE:
+                Log_info0("TaskAsop: state=INITSYNC_DEC_INFO1_STATE");
+                
                 //
                 // Dec Info1 Init-Sync.
                 //
@@ -460,16 +469,19 @@ Void taskAsopFxn(
                 errno = PAF_ASOT_initSyncDecInfo1(pP, pQ, pAsotCfg, &decInfo1Af);
                 if (errno < 0)
                 {
+                    Log_info1("TaskAsop: state=INITSYNC_DEC_INFO1_STATE errno=%d", errno);
                     // sync error -- start over
                     state = INIT_OUT_PROC_STATE;
                 }
                 else if (errno == ASOP_INITSYNC_NOTREADY)
                 {
+                    Log_info1("TaskAsop: state=INITSYNC_DEC_INFO1_STATE not sync'd errno=%d", errno);
                     // sync not ready -- try again
                     state = INITSYNC_DEC_INFO1_STATE;
                 }
-                else
+                else // errno = 0
                 {
+                    Log_info1("TaskAsop: state=INITSYNC_DEC_INFO1_STATE sync'd errno=%d", errno);
                     // sync'd -- move on
                     state = OUT_PROC_STATE;
                 }
@@ -477,6 +489,8 @@ Void taskAsopFxn(
                 break;
             
             case INITSYNC_RESYNC_STATE:
+                Log_info0("TaskAsop: state=INITSYNC_RESYNC_STATE");
+
                 //
                 // Re-Sync.
                 // Use stored AF info from init-sync.
@@ -488,11 +502,13 @@ Void taskAsopFxn(
                     &decInfo1Af);
                 if (errno < 0)
                 {
+                    Log_info1("TaskAsop: state=INITSYNC_RESYNC_STATE errno=%d", errno);
                     // sync error -- start over
                     state = INIT_OUT_PROC_STATE;
                 }
                 else
                 {
+                    Log_info1("TaskAsop: state=INITSYNC_RESYNC_STATE sync'd errno=%d", errno);
                     // re-sync'd -- move on
                     state = OUT_PROC_STATE;
                 }
@@ -500,19 +516,23 @@ Void taskAsopFxn(
                 break;
             
             case OUT_PROC_STATE:        
+                Log_info0("TaskAsop: state=OUT_PROC_STATE");
+                
                 //
                 // Output Processing.
                 //
 
-                TRACE_VERBOSE0("TaskAsop: calling outputProcessing.");
+                TRACE_VERBOSE0("TaskAsop: calling decodeProcessing.");
                 errno = pP->fxns->decodeProcessing(pP, pQ, pAsotCfg);
                 if (errno < 0)
                 {
+                    Log_info1("TaskAsop: state=OUT_PROC_STATE errno=%d", errno);
+                    
                     //
                     // Output Processing exit, due to error
                     //
                     
-                    TRACE_TERSE1("TaskAsop: outputProcessing returns 0x%x, continue", errno);
+                    TRACE_TERSE1("TaskAsop: decodeProcessing returns 0x%x, continue", errno);
                     if (errno == ASOP_DP_FORWARD_ERR)
                     {
                         // forward (ASIT) error -- start over
@@ -526,11 +546,13 @@ Void taskAsopFxn(
                 }
                 else if (errno > 0)
                 {
+                    Log_info1("TaskAsop: state=OUT_PROC_STATE errno=%d", errno);
+
                     //
                     // Output Processing exit, not due to error
                     //
 
-                    TRACE_TERSE1("TaskAsop: outputProcessing returns 0x%x, continue", errno);                    
+                    TRACE_TERSE1("TaskAsop: decodeProcessing returns 0x%x, continue", errno);                    
                     if (errno == ASOP_DP_OUT_SIO_UPDATE)
                     {
                         // skip re-sync
@@ -540,6 +562,8 @@ Void taskAsopFxn(
                 }
                 else
                 {
+                    Log_info1("TaskAsop: state=OUT_PROC_STATE errno=%d", errno);
+
                     //
                     // Output Processing exit, normal
                     //
@@ -1930,7 +1954,7 @@ PAF_ASOT_decodeInit(
         if (errno)
         {
             TRACE_TERSE1("PAF_ASOT_decodeInit:cbReadStart() error=%d", errno);
-            SW_BREAKPOINT; // FL: debug
+            SW_BREAKPOINT; // debug
             return errno;
         }
         gCbReadAfErr=0;         // reset read circular buffer error count
@@ -2374,8 +2398,10 @@ PAF_ASOT_decodeEncode(
             {
                 pAstCfg->xEnc[z].encodeOutStruct.bypassFlag =
                         pP->z_pEncodeStatus[z]->encBypass;
-                if (errno = enc->fxns->encode(enc, NULL, 
-                    &pAstCfg->xEnc[z].encodeInStruct, &pAstCfg->xEnc[z].encodeOutStruct))
+                errno = enc->fxns->encode(enc, NULL, 
+                    &pAstCfg->xEnc[z].encodeInStruct, 
+                    &pAstCfg->xEnc[z].encodeOutStruct);
+                if (errno)
                 {
                     if (errno != PCEERR_OUTPUT_POINTERNULL)
                     {