]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/commitdiff
PASDK-53: Experimental code,dynamically change Audio Stream Task priorities.
authorFrank Livingston <frank-livingston@ti.com>
Fri, 24 Feb 2017 23:18:30 +0000 (17:18 -0600)
committerFrank Livingston <frank-livingston@ti.com>
Fri, 24 Feb 2017 23:18:30 +0000 (17:18 -0600)
ASIT is higher priority than ASOT during autodetection
ASIT is the same priority as ASOT during decoding

pasdk/test_dsp/framework/audioStreamInpProc.c

index 7b1dbf891eacd612781ff3f497cc19bd8c421803..cb0adfafc00233232d16927705ba80a98f667bf4 100644 (file)
@@ -350,6 +350,7 @@ Void taskAsipFxn(
 #ifdef NON_CACHE_STATUS
     Int8 tempVar8;
 #endif
+    Task_Handle taskHandle;
 
     Log_info0("Enter taskAsipFxn()");
     
@@ -386,6 +387,8 @@ Void taskAsipFxn(
     pAstCfg->as = as;    
     TRACE_TERSE1("TaskAsip: Started with AS%d.", as);
 
+    taskHandle = Task_self();
+    
     //
     // Initialize message log trace and line number reporting
     //
@@ -932,6 +935,9 @@ Void taskAsipFxn(
         
         TRACE_VERBOSE1(procName[sourceProgram], as+zMS);
 
+        // Reduce priority level since autodetection complete
+        Task_setPri(taskHandle, Task_getPri(taskHandle)-1);
+        
         TRACE_VERBOSE0("TaskAsip: calling decodeProcessing.");
         errno = pP->fxns->decodeProcessing(pP, pQ, pC, sourceSelect);
         if (errno) 
@@ -943,6 +949,9 @@ Void taskAsipFxn(
             TRACE_VERBOSE0("TaskAsip: decodeProcessing complete with no error.");
         }        
 
+        // Increase priority level since decoding complete
+        Task_setPri(taskHandle, Task_getPri(taskHandle)+1);
+
         // FL: send dec exit message to slave
         pAspMsg = (ASP_Msg *)MessageQ_alloc(hAspMsgMaster->heapId, hAspMsgMaster->msgSize); /* allocate message */
         MessageQ_setReplyQueue(hAspMsgMaster->masterQue, (MessageQ_Msg)pAspMsg);            /* set the return address in the message header */
@@ -1916,6 +1925,18 @@ PAF_ASIT_autoProcessing(
     nbytes = SIO_reclaim(pAstCfg->xInp[zMI].hRxSio, (Ptr)&pAstCfg->xInp[zMI].pInpBuf, NULL);
     if (nbytes == -DIBERR_SYNC)
     {
+#if 0 // (***) FL: shows timing of autosync restart
+        // (***) debug // B5
+        {
+            static Uint8 toggleState = 0;
+            if (toggleState == 0)
+                GPIOSetOutput(GPIO_PORT_0, GPIO_PIN_99);
+            else
+                GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_99);
+            toggleState = ~(toggleState);
+        }
+#endif        
+        
         TRACE_TERSE2("PAF_ASIT_autoProcessing: AS%d: SIO_reclaim returned 0x%x, ignoring", as+zMS, nbytes);
         return nbytes;
     }
@@ -2936,7 +2957,7 @@ PAF_ASIT_decodeInfo(
         capIb(pAstCfg->xInp[zMI].pInpBuf);
         gcapIb_cnt++;
         
-#if 0
+#if 1 // (***) FL: shows timing of Input Rx SIO reclaim after decoding has started (autodet complete)
         {
             static Uint8 toggleState = 0;
             if (toggleState == 0)