]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blobdiff - pasdk/test_dsp/framework/audioStreamOutProc.c
PASDK-516:Add updates for PCE
[processor-sdk/performance-audio-sr.git] / pasdk / test_dsp / framework / audioStreamOutProc.c
index 51c045ed2d2af3dd56266d918256ec1c42eaf9c2..a4e9327dfd12af59a5d1c02298a944c9a6fcce64 100644 (file)
@@ -52,8 +52,7 @@ All rights reserved.
 //Int32 gNumPfpAsot1=0; // debug
 
 // debug
-//#include "evmc66x_gpio_dbg.h"
-//#include "dbgCapAf.h"
+#include "evmc66x_gpio_dbg.h"
 
 //#include "ioConfig.h"
 
@@ -622,7 +621,19 @@ Void taskAsopFxn(
                 if (events & Evt_Id_AsotTxMcaspEdma)
                 {
                     gProcDecOutState_EvtTxMcaspEdma_cnt++;
-                    events &= Evt_Id_AsotTxMcaspEdma; // clear event
+                    events &= ~Evt_Id_AsotTxMcaspEdma; // clear event
+                    
+#if 1 // (***) FL: shows timing of Output (Tx McASP EDMA)
+                    // (***) debug // B8
+                    {
+                        static Uint8 toggleState = 0;
+                        if (toggleState == 0)
+                            GPIOSetOutput(GPIO_PORT_0, GPIO_PIN_106);
+                        else
+                            GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_106);
+                        toggleState = ~(toggleState);
+                    }
+#endif                                 
                     
                     // Process Output
                     status = PAF_ASOT_procDecOut(pP, pQ, pAsotCfg, &procOutFirstTime, asopFrameCount);
@@ -938,10 +949,6 @@ static Int PAF_ASOT_selectDevices(
                 *pOutDevSel = FALSE;
                 return status;
             }
-                
-            //// I/O physical layer prime operation required by McASP LLD
-            ////  FL, New IO: API for single Output
-            //asopIoPhyPrime(&pAsotCfg->pIoOut[zO]);
         }
 
         pAstCfg->xOut[zO].outBufStatus.sioSelect = device | 0x80;
@@ -1208,12 +1215,13 @@ static Int PAF_ASOT_initSyncDecDecode1(
             }
         }
 
-        // FL, New IO: assumption here is Output frame size (output frame size)
-        //             & McASP Tx clock dividers are set correctly (stream)
-        //             before IO prime, i.e. IO prime is not set to default
+        // FL, New IO: assumption here is Tx McASP clock dividers &
+        //  Output frame size are set correctly before IO prime, 
+        //  i.e. IO prime is not using defaults
         
+        // FL, New IO: API for single Output
+
         // I/O physical layer prime operation required by McASP LLD
-        //  FL, New IO: API for single Output
         asopIoPhyPrime(&pAsotCfg->pIoOut[zO]);        
         
         return ASOP_SOK;
@@ -1313,12 +1321,30 @@ static Int PAF_ASOT_procDecOut(
 
     if (status == ASOP_SOK)
     {
-        // Execute encode
-        errno = asopDecOutProcEncode(pP, pQ, pAsotCfg, frame);
-        if (errno < 0)
+        // Update Output buffer configuration
+        errno = asopUpdateOutBufConfig(&pAstCfg->xOut[zO], &pAsotCfg->pIoOut[zO]);
+        if (errno)
         {
             status = errno;
         }
+        else
+        {
+            // Execute encode
+            errno = asopDecOutProcEncode(pP, pQ, pAsotCfg, frame);
+            if (errno < 0)
+            {
+                status = errno;
+            }
+            else
+            {
+                // Mark Output buffers write complete
+                errno = asopMarkOutBuffsWriteComplete(&pAstCfg->xOut[zO], &pAsotCfg->pIoOut[zO]);
+                if (errno)
+                {
+                    status = errno;
+                }
+            }
+        }
     }
 
     if (status == ASOP_SOK)