]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/commitdiff
PASDK-218: EDMA CCNT bug-fix + Rx & Tx McASP Events are both now on EDMA TC Que_Num...
authorGovind Jeyaram <govind.j@ti.com>
Mon, 17 Jul 2017 23:35:37 +0000 (16:35 -0700)
committerGovind Jeyaram <govind.j@ti.com>
Mon, 17 Jul 2017 23:35:37 +0000 (16:35 -0700)
pasdk/test_dsp/sap/sap.c

index 23eae4b8090f41e3e7ab32af9f393f91cae0eb17..08f09681619c64a01bacdcf1b91de88188309341 100644 (file)
@@ -102,20 +102,26 @@ int sap_OVER_1LANE = 0;     // used for overrun
 int sap_OVER_4LANE[4] = {0,0,0,0};      // used for overrun
 
 #ifdef DEBUG
-void DJDBG_SAP_EDMA_dumpParams(int tag_place)
+void SAP_EDMA_dumpParams(int tag_place)
 {
        //unsigned int *ptrPARAM_BASE = (unsigned int *)0x02704000;
-       //unsigned int *ptrPARAM0x18 = (unsigned int *)0x02704300; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[24]
-       unsigned int *ptrPARAM0x19 = (unsigned int *)0x02704320; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[24]
-       unsigned int *ptrPARAM0x41 = (unsigned int *)0x027048A0; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[24]
-       unsigned int *ptrPARAM0x42 = (unsigned int *)0x027048C0; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[24]
-       unsigned int *ptrPARAM0x43 = (unsigned int *)0x027048E0; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[24]
-       unsigned int *ptrPARAM0x44 = (unsigned int *)0x02704910; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[24]
+       unsigned int *ptrPARAM0x18 = (unsigned int *)0x02704300; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[24]
+       //unsigned int *ptrPARAM0x19 = (unsigned int *)0x02704320; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[24]
+       //unsigned int *ptrPARAM0x41 = (unsigned int *)0x027048A0; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[24]
+       //unsigned int *ptrPARAM0x42 = (unsigned int *)0x027048C0; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[24]
+       //unsigned int *ptrPARAM0x43 = (unsigned int *)0x027048E0; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[24]
+       //unsigned int *ptrPARAM0x48 = (unsigned int *)0x02704910; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[24]
+       unsigned int *ptrPARAM0x45 = (unsigned int *)0x027048A0; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[69]
+       unsigned int *ptrPARAM0x46 = (unsigned int *)0x027048C0; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[70]
+       unsigned int *ptrPARAM0x47 = (unsigned int *)0x027048E0; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[71]
+       unsigned int *ptrPARAM0x48 = (unsigned int *)0x02704900; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[72]
+       unsigned int *ptrPARAM0x49 = (unsigned int *)0x02704920; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[73]
+       unsigned int *ptrPARAM0x4A = (unsigned int *)0x02704940; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[74]
 
        //Log_info5("PARAM0x18a(%d): 0x%x 0x%x 0x%x 0x%x", tag_place, ptrPARAM0x18[0], ptrPARAM0x18[1], ptrPARAM0x18[2], ptrPARAM0x18[3]);
        //Log_info5("PARAM0x18b(%d): 0x%x 0x%x 0x%x 0x%x", tag_place, ptrPARAM0x18[4], ptrPARAM0x18[5], ptrPARAM0x18[6], ptrPARAM0x18[7]);
 
-       Log_info5("PARAM0x19a(%d): ITCINTEN: 0x%02x, TCINTEN: 0x%02x, TCC: 0x%02x, TCCMODE: %d", tag_place, ((ptrPARAM0x19[0] & 0x200000) >> 21), ((ptrPARAM0x19[0] & 0x100000) >> 20), ((ptrPARAM0x19[0] & 0x3F000) >> 12), ((ptrPARAM0x19[0] & 0x800) >> 11));
+       /*Log_info5("PARAM0x19a(%d): ITCINTEN: 0x%02x, TCINTEN: 0x%02x, TCC: 0x%02x, TCCMODE: %d", tag_place, ((ptrPARAM0x19[0] & 0x200000) >> 21), ((ptrPARAM0x19[0] & 0x100000) >> 20), ((ptrPARAM0x19[0] & 0x3F000) >> 12), ((ptrPARAM0x19[0] & 0x800) >> 11));
        Log_info5("PARAM0x19b(%d): SRC: 0x%08x, A_B_CNT: 0x%08x, DST: 0x%08x,  SRC_DST_BIDX: 0x%08x", tag_place, ptrPARAM0x19[1], ptrPARAM0x19[2], ptrPARAM0x19[3], ptrPARAM0x19[4]);
        Log_info4("PARAM0x19b(%d): LINK_BCNTRLD: 0x%08x, SRC_DST_CIDX: 0x%08x, CCNT: 0x%08x", tag_place, ptrPARAM0x19[5], ptrPARAM0x19[6], ptrPARAM0x19[7]);
 
@@ -131,10 +137,39 @@ void DJDBG_SAP_EDMA_dumpParams(int tag_place)
        Log_info5("PARAM0x43b(%d): SRC: 0x%08x, A_B_CNT: 0x%08x, DST: 0x%08x,  SRC_DST_BIDX: 0x%08x", tag_place, ptrPARAM0x43[1], ptrPARAM0x43[2], ptrPARAM0x43[3], ptrPARAM0x43[4]);
        Log_info4("PARAM0x43b(%d): LINK_BCNTRLD: 0x%08x, SRC_DST_CIDX: 0x%08x, CCNT: 0x%08x", tag_place, ptrPARAM0x43[5], ptrPARAM0x43[6], ptrPARAM0x43[7]);
 
-       Log_info5("PARAM0x44a(%d): ITCINTEN: 0x%02x, TCINTEN: 0x%02x, TCC: 0x%02x, TCCMODE: %d", tag_place, ((ptrPARAM0x44[0] & 0x200000) >> 21), ((ptrPARAM0x44[0] & 0x100000) >> 20), ((ptrPARAM0x44[0] & 0x3F000) >> 12), ((ptrPARAM0x44[0] & 0x800) >> 11));
-       Log_info5("PARAM0x44b(%d): SRC: 0x%08x, A_B_CNT: 0x%08x, DST: 0x%08x,  SRC_DST_BIDX: 0x%08x", tag_place, ptrPARAM0x44[1], ptrPARAM0x44[2], ptrPARAM0x44[3], ptrPARAM0x44[4]);
-       Log_info4("PARAM0x44b(%d): LINK_BCNTRLD: 0x%08x, SRC_DST_CIDX: 0x%08x, CCNT: 0x%08x", tag_place, ptrPARAM0x44[5], ptrPARAM0x44[6], ptrPARAM0x44[7]);
-    //Log_info1("TCC0: ERR reg %x", *((unsigned int *)0x02760120)); //DJDBG
+       Log_info5("PARAM0x48a(%d): ITCINTEN: 0x%02x, TCINTEN: 0x%02x, TCC: 0x%02x, TCCMODE: %d", tag_place, ((ptrPARAM0x48[0] & 0x200000) >> 21), ((ptrPARAM0x48[0] & 0x100000) >> 20), ((ptrPARAM0x48[0] & 0x3F000) >> 12), ((ptrPARAM0x48[0] & 0x800) >> 11));
+       Log_info5("PARAM0x48b(%d): SRC: 0x%08x, A_B_CNT: 0x%08x, DST: 0x%08x,  SRC_DST_BIDX: 0x%08x", tag_place, ptrPARAM0x48[1], ptrPARAM0x48[2], ptrPARAM0x48[3], ptrPARAM0x48[4]);
+       Log_info4("PARAM0x48b(%d): LINK_BCNTRLD: 0x%08x, SRC_DST_CIDX: 0x%08x, CCNT: 0x%08x", tag_place, ptrPARAM0x48[5], ptrPARAM0x48[6], ptrPARAM0x48[7]);*/
+
+       Log_info5("PARAM0x18a(%d): ITCINTEN: 0x%02x, TCINTEN: 0x%02x, TCC: 0x%02x, TCCMODE: %d", tag_place, ((ptrPARAM0x18[0] & 0x200000) >> 21), ((ptrPARAM0x18[0] & 0x100000) >> 20), ((ptrPARAM0x18[0] & 0x3F000) >> 12), ((ptrPARAM0x18[0] & 0x800) >> 11));
+       Log_info5("PARAM0x18b(%d): SRC: 0x%08x, A_B_CNT: 0x%08x, DST: 0x%08x,  SRC_DST_BIDX: 0x%08x", tag_place, ptrPARAM0x18[1], ptrPARAM0x18[2], ptrPARAM0x18[3], ptrPARAM0x18[4]);
+       Log_info4("PARAM0x18c(%d): LINK_BCNTRLD: 0x%08x, SRC_DST_CIDX: 0x%08x, CCNT: 0x%08x", tag_place, ptrPARAM0x18[5], ptrPARAM0x18[6], ptrPARAM0x18[7]);
+
+       Log_info5("PARAM0x45a(%d): ITCINTEN: 0x%02x, TCINTEN: 0x%02x, TCC: 0x%02x, TCCMODE: %d", tag_place, ((ptrPARAM0x45[0] & 0x200000) >> 21), ((ptrPARAM0x45[0] & 0x100000) >> 20), ((ptrPARAM0x45[0] & 0x3F000) >> 12), ((ptrPARAM0x45[0] & 0x800) >> 11));
+       Log_info5("PARAM0x45b(%d): SRC: 0x%08x, A_B_CNT: 0x%08x, DST: 0x%08x,  SRC_DST_BIDX: 0x%08x", tag_place, ptrPARAM0x45[1], ptrPARAM0x45[2], ptrPARAM0x45[3], ptrPARAM0x45[4]);
+       Log_info4("PARAM0x45c(%d): LINK_BCNTRLD: 0x%08x, SRC_DST_CIDX: 0x%08x, CCNT: 0x%08x", tag_place, ptrPARAM0x45[5], ptrPARAM0x45[6], ptrPARAM0x45[7]);
+
+       Log_info5("PARAM0x46a(%d): ITCINTEN: 0x%02x, TCINTEN: 0x%02x, TCC: 0x%02x, TCCMODE: %d", tag_place, ((ptrPARAM0x46[0] & 0x200000) >> 21), ((ptrPARAM0x46[0] & 0x100000) >> 20), ((ptrPARAM0x46[0] & 0x3F000) >> 12), ((ptrPARAM0x46[0] & 0x800) >> 11));
+       Log_info5("PARAM0x46b(%d): SRC: 0x%08x, A_B_CNT: 0x%08x, DST: 0x%08x,  SRC_DST_BIDX: 0x%08x", tag_place, ptrPARAM0x46[1], ptrPARAM0x46[2], ptrPARAM0x46[3], ptrPARAM0x46[4]);
+       Log_info4("PARAM0x46c(%d): LINK_BCNTRLD: 0x%08x, SRC_DST_CIDX: 0x%08x, CCNT: 0x%08x", tag_place, ptrPARAM0x46[5], ptrPARAM0x46[6], ptrPARAM0x46[7]);
+
+       Log_info5("PARAM0x47a(%d): ITCINTEN: 0x%02x, TCINTEN: 0x%02x, TCC: 0x%02x, TCCMODE: %d", tag_place, ((ptrPARAM0x47[0] & 0x200000) >> 21), ((ptrPARAM0x47[0] & 0x100000) >> 20), ((ptrPARAM0x47[0] & 0x3F000) >> 12), ((ptrPARAM0x47[0] & 0x800) >> 11));
+       Log_info5("PARAM0x47b(%d): SRC: 0x%08x, A_B_CNT: 0x%08x, DST: 0x%08x,  SRC_DST_BIDX: 0x%08x", tag_place, ptrPARAM0x47[1], ptrPARAM0x47[2], ptrPARAM0x47[3], ptrPARAM0x47[4]);
+       Log_info4("PARAM0x47c(%d): LINK_BCNTRLD: 0x%08x, SRC_DST_CIDX: 0x%08x, CCNT: 0x%08x", tag_place, ptrPARAM0x47[5], ptrPARAM0x47[6], ptrPARAM0x47[7]);
+
+       Log_info5("PARAM0x48a(%d): ITCINTEN: 0x%02x, TCINTEN: 0x%02x, TCC: 0x%02x, TCCMODE: %d", tag_place, ((ptrPARAM0x48[0] & 0x200000) >> 21), ((ptrPARAM0x48[0] & 0x100000) >> 20), ((ptrPARAM0x48[0] & 0x3F000) >> 12), ((ptrPARAM0x48[0] & 0x800) >> 11));
+       Log_info5("PARAM0x48b(%d): SRC: 0x%08x, A_B_CNT: 0x%08x, DST: 0x%08x,  SRC_DST_BIDX: 0x%08x", tag_place, ptrPARAM0x48[1], ptrPARAM0x48[2], ptrPARAM0x48[3], ptrPARAM0x48[4]);
+       Log_info4("PARAM0x48c(%d): LINK_BCNTRLD: 0x%08x, SRC_DST_CIDX: 0x%08x, CCNT: 0x%08x", tag_place, ptrPARAM0x48[5], ptrPARAM0x48[6], ptrPARAM0x48[7]);
+
+       Log_info5("PARAM0x49a(%d): ITCINTEN: 0x%02x, TCINTEN: 0x%02x, TCC: 0x%02x, TCCMODE: %d", tag_place, ((ptrPARAM0x49[0] & 0x200000) >> 21), ((ptrPARAM0x49[0] & 0x100000) >> 20), ((ptrPARAM0x49[0] & 0x3F000) >> 12), ((ptrPARAM0x49[0] & 0x800) >> 11));
+       Log_info5("PARAM0x49b(%d): SRC: 0x%08x, A_B_CNT: 0x%08x, DST: 0x%08x,  SRC_DST_BIDX: 0x%08x", tag_place, ptrPARAM0x49[1], ptrPARAM0x49[2], ptrPARAM0x49[3], ptrPARAM0x49[4]);
+       Log_info4("PARAM0x49c(%d): LINK_BCNTRLD: 0x%08x, SRC_DST_CIDX: 0x%08x, CCNT: 0x%08x", tag_place, ptrPARAM0x49[5], ptrPARAM0x49[6], ptrPARAM0x49[7]);
+
+       Log_info5("PARAM0x4Aa(%d): ITCINTEN: 0x%02x, TCINTEN: 0x%02x, TCC: 0x%02x, TCCMODE: %d", tag_place, ((ptrPARAM0x4A[0] & 0x200000) >> 21), ((ptrPARAM0x4A[0] & 0x100000) >> 20), ((ptrPARAM0x4A[0] & 0x3F000) >> 12), ((ptrPARAM0x4A[0] & 0x800) >> 11));
+       Log_info5("PARAM0x4Ab(%d): SRC: 0x%08x, A_B_CNT: 0x%08x, DST: 0x%08x,  SRC_DST_BIDX: 0x%08x", tag_place, ptrPARAM0x4A[1], ptrPARAM0x4A[2], ptrPARAM0x4A[3], ptrPARAM0x4A[4]);
+       Log_info4("PARAM0x4Ac(%d): LINK_BCNTRLD: 0x%08x, SRC_DST_CIDX: 0x%08x, CCNT: 0x%08x", tag_place, ptrPARAM0x4A[5], ptrPARAM0x4A[6], ptrPARAM0x4A[7]);
+
+       Log_info1("TCC0: ERR reg %x", *((unsigned int *)0x02760120)); //DJDBG
 }
 #endif
 // .............................................................................
@@ -231,6 +266,12 @@ Void SAP_init (Void)
 
 // -----------------------------------------------------------------------------
 
+int gSapInput_ControlOpen = 0;
+int gSapOutput_ControlOpen = 0;
+
+int gSapInput_ControlClose = 0;
+int gSapOutput_ControlClose = 0;
+
 Int SAP_ctrl (DEV2_Handle device, Uns code, Arg arg)
 {
     SAP_DeviceExtension *pDevExt = (SAP_DeviceExtension *)device->object;
@@ -262,6 +303,11 @@ Int SAP_ctrl (DEV2_Handle device, Uns code, Arg arg)
             if (!( pParams = (const SAP_Params *) arg ))
                 return SIO2_OK;
 
+            if(device->mode == DEV2_OUTPUT)
+               gSapOutput_ControlOpen++;
+            else
+               gSapInput_ControlOpen++;
+
             if (result = SAP_FTABLE_config (device, pParams))
                 return result;
 
@@ -291,6 +337,11 @@ Int SAP_ctrl (DEV2_Handle device, Uns code, Arg arg)
                                pDevExt->activeEdma = EDMA_HINV;
                        }
 
+            if(device->mode == DEV2_INPUT)
+               gSapInput_ControlClose++;
+            else
+               gSapOutput_ControlClose++;
+
             for (i=0; i < pDevExt->numEdmaParams; i++) {
                if (pDevExt->edmaParams[i].hEdmaParam != EDMA_HINV)
                {
@@ -559,6 +610,7 @@ Int SAP_idle (DEV2_Handle device, Bool flush)
 
     // signal stopped
     pDevExt->runState = 0;
+    Log_info0("SAP_idle: runState = 0");
 
     // reset errorState
     pDevExt->errorState = PAF_SIO_ERROR_NONE;
@@ -580,15 +632,8 @@ Int SAP_start (DEV2_Handle device)
     int result;
     EDMA3_DRV_Handle hEdma;
 
-    //TRACE_GEN((&TR_MOD, "SAP_start.%d (0x%x)", __LINE__, device));
+    Log_info2("SAP_start.%d (0x%x)", __LINE__, device);
 
-    // signal we have started
-    //    we change the state here since we have already moved a frame from the 
-    //    todevice queue to the xferQue. If an error occurs during one of the 
-    //    following resets/enables then we need to have runState !=0 in order
-    //    for SAP_idle to properly cleanup. Moreover, the following resets/enables
-    //    do not (and are now required not to) depend on runState being 0.
-    //pDevExt->runState = 1;
     // Assume todevice queue is not empty -- how else could we be here?
     pFrame = (DEV2_Frame *) Queue_get (device->todevice);
 
@@ -613,20 +658,22 @@ Int SAP_start (DEV2_Handle device)
     }
 
     // enable DMA processing
-
+    if (device->mode == DEV2_OUTPUT)
+       Log_info3("SAP_start.%d, pDevExt->activeEdma 0x%x (pDevExt->errorEdma = 0x%x)",
+                           __LINE__, pDevExt->activeEdma, pDevExt->errorEdma);
     // config active xfer for this buffer
     result = SAP_EDMA_setupXfer(device, pDevExt->activeEdma, EDMA_HINV, pDevExt->errorEdma, pFrame);
 
-    //Log_info3("SAP_start.%d, pDevExt->activeEdma 0x%x (pDevExt->errorEdma = 0x%x)",
-      //              __LINE__, pDevExt->activeEdma, pDevExt->errorEdma);
+
        // signal we have started -- this must come before last enable to prevent a race
        // condition where the initial EDMA transfer is very small (e.g. due to startClocks)
        // and completes before any further instructions in this thread are executed.
        // This comes before the EDMA enable since, if the # of samples is 1, then the EDMA
        // will be serviced and generate an interrupt even before the McASP is enabled.
-       pDevExt->runState = 1;
-       pDevExt->shutDown = 0;
-       Log_info1 ("SAP: %d, SAP_start runState=1 & ENABLE TRANSFERS", __LINE__);
+    pDevExt->runState = 1;
+    pDevExt->shutDown = 0;
+    if (device->mode == DEV2_OUTPUT)
+       Log_info2 ("SAP: %d, SAP_start runState=1 & ENABLE TRANSFERS for activeEdma = 0x%x", __LINE__, pDevExt->activeEdma);
        // enable interrupts and event servicing for this channel
        EDMA3_DRV_enableTransfer (hEdma, pDevExt->activeEdma, EDMA3_DRV_TRIG_MODE_EVENT);
 
@@ -654,7 +701,8 @@ Int SAP_issue (DEV2_Handle device)
     SAP_EDMA_Param *pParam;
     XDAS_UInt32 parentEdma;
 
-    //TRACE_GEN((&TR_MOD, "SAP_issue.%d (0x%x)", __LINE__, device));
+    if (device->mode == DEV2_OUTPUT)
+       Log_info1("SAP_issue for output device with pDevExt->errorState = 0x%x", pDevExt->errorState);
 
     if ((device->mode == DEV2_OUTPUT) && (pDevExt->errorState >= PAF_SIO_ERROR_ERRBUF_XFER))
     {
@@ -700,6 +748,9 @@ Int SAP_issue (DEV2_Handle device)
            parentEdma = ((SAP_EDMA_Param *) tail->misc)->hEdmaParam;
        }
 
+       //if (device->mode == DEV2_OUTPUT)
+          Log_info2("SAP_issue: Determined Parent = 0x%x for device = 0x%x", parentEdma, device->mode );
+
     // get frame and parameter table to use; ints off => non-atomic OK
     //     dont need to check for empty queues since were here then todevice
     //     must have a frame placed there by the SIO_issue layer.
@@ -712,7 +763,7 @@ Int SAP_issue (DEV2_Handle device)
     pParam = (SAP_EDMA_Param *) Queue_dequeue (Queue_handle(&pDevExt->paramQue));
 
     if (pParam->hEdmaParam == NULL)
-       Log_info0("SAP_issue: hEdma value is NULL");
+       Log_info1("SAP_issue: hEdma value is NULL for device = 0x%x", device->mode);
     // set misc argument to pParam so get enqueue later
     pFrame->misc = (Arg) pParam;
 
@@ -729,8 +780,12 @@ Int SAP_issue (DEV2_Handle device)
     pDevExt->numQueued += 1;
 
     result = SAP_EDMA_setupXfer (device, pParam->hEdmaParam, parentEdma, pDevExt->errorEdma, pFrame);
-    Log_info4("SAP_issue.%d, EDMA_setupXfer: Target EDMA: 0x%x, Parent Edma: 0x%x Error Edma: 0x%x",
-                    __LINE__, pParam->hEdmaParam, parentEdma, pDevExt->errorEdma);
+    if (device->mode == DEV2_OUTPUT)
+    {
+       Log_info4("SAP_issue.%d, EDMA_setupXfer: Target EDMA: 0x%x, Parent Edma: 0x%x Error Edma: 0x%x",
+                           __LINE__, pParam->hEdmaParam, parentEdma, pDevExt->errorEdma);
+    }
+
 
     /*if ((device->mode != DEV2_INPUT) && (gDmaParamsidx <=16))
        {
@@ -744,6 +799,9 @@ Int SAP_issue (DEV2_Handle device)
 
         pDevExt->shutDown = 0;
 
+        //if (device->mode == DEV2_OUTPUT)
+                       //SAP_EDMA_dumpParams(1);
+
     // special case enables when not yet started
     if (pDevExt->runState == 0) {
        gSAPSpecialCase++;
@@ -806,11 +864,12 @@ Int SAP_reclaim (DEV2_Handle device)
 #endif
 
     //TRACE_GEN((&TR_MOD, "SAP_reclaim.%d (0x%x)", __LINE__, device));
-
+    if (device->mode == DEV2_OUTPUT)
+               Log_info2("SAP_reclaim for output device with pDevExt->errorState = 0x%x & runState: 0x%x", pDevExt->errorState, pDevExt->runState);
     // must be running and  error free 
     if ((!pDevExt->runState) || (pDevExt->errorState))
     {
-        //TRACE_GEN((&TR_MOD, "SAP_reclaim.%d, not runState: 0x%x", __LINE__, pDevExt->errorState));
+        Log_info3("SAP_reclaim.%d, not runState: 0x%x, mode = 0x%x", __LINE__, pDevExt->errorState, device->mode);
         return SIO2_EBADIO;
     }
 
@@ -821,7 +880,7 @@ Int SAP_reclaim (DEV2_Handle device)
             return SIO2_EBADIO;
         }
 
-       // Log_info0("SAP_reclaim: Before SEM Pend");
+       Log_info1("SAP_reclaim: Before SEM Pend for mode: 0x%x", device->mode);
 
     // wait for ISR to signal block completion
     //TRACE_VERBOSE((&TR_MOD, "SAP_reclaim.%d wait for ISR to signal block completion", __LINE__));
@@ -830,14 +889,14 @@ Int SAP_reclaim (DEV2_Handle device)
        Log_info0("SAP_reclaim, SYS_ETIMEOUT");
         return SIO2_ETIMEOUT;
     }
-    //Log_info1("SAP_reclaim: After SEM Pend for mode: 0x%x", device->mode);
+    Log_info1("SAP_reclaim: After SEM Pend for mode: 0x%x", device->mode);
 
 #if 1
     // return error (owner must idle)
     if (pDevExt->errorState == PAF_SIO_ERROR_FATAL)
     {
        DEV2_idle (device, 1);
-        //TRACE_TERSE((&TR_MOD, "SAP_reclaim.%d, PAF_SIO_ERROR_FATAL: 0x%x", __LINE__, pDevExt->errorState));
+        Log_info2("SAP_reclaim.%d, PAF_SIO_ERROR_FATAL: 0x%x", __LINE__, pDevExt->errorState);
         return PAF_SIO_ERROR_FATAL;
     }
 #endif
@@ -1002,7 +1061,7 @@ Int SAP_config (DEV2_Handle device, const SAP_Params *pParams)
        }
        else
        {
-               Que_num = 1;
+               Que_num = 0;
                pDevExt->activeEdma = CSL_EDMACC_0_McASP_0_XEVT;
        }
     }
@@ -1017,7 +1076,7 @@ Int SAP_config (DEV2_Handle device, const SAP_Params *pParams)
                }
                else
                {
-                       Que_num = 1;
+                       Que_num = 0;
                        pDevExt->activeEdma = CSL_EDMACC_1_McASP_1_XEVT;
                }
     }
@@ -1032,7 +1091,7 @@ Int SAP_config (DEV2_Handle device, const SAP_Params *pParams)
                }
                else
                {
-                       Que_num = 1;
+                       Que_num = 0;
                        pDevExt->activeEdma = CSL_EDMACC_1_McASP_2_XEVT;
                }
     }
@@ -1150,7 +1209,7 @@ Int SAP_shutdown (DEV2_Handle device)
 
     //DJDBG_SAP_EDMA_dumpParams(1);
     // make sure active is linked to error
-        EDMA3_DRV_linkChannel (hEdma, pDevExt->activeEdma, pDevExt->errorEdma);
+    EDMA3_DRV_linkChannel (hEdma, pDevExt->activeEdma, pDevExt->errorEdma);
 
     // think this is better (from SIO_idle for standard model )
     // refill frame list -- so user needn't call reclaim, which may cause Rx underrun.
@@ -1201,12 +1260,12 @@ Void SAP_watchDog (Void)
     //oldMask = Hwi_disable ();
 
 
-    //TRACE_VERBOSE((&TR_MOD, "%s.%d: devices loop, numDevices = %d", __FUNCTION__, __LINE__, dapDrv.numDevices));
+    //Log_info3("%s.%d: devices loop, numDevices = %d", __FUNCTION__, __LINE__, sapDrv.numDevices);
 
     for (i=0; i < sapDrv.numDevices; i++) {
         device  = sapDrv.device[i];
 
-        //TRACE_VERBOSE((&TR_MOD, "%s.%d, devices loop start, device = 0x%x", __FUNCTION__, __LINE__, device));
+        //Log_info3("%s.%d, devices loop start, device = 0x%x", __FUNCTION__, __LINE__, device);
 
         pDevExt = (SAP_DeviceExtension *) device->object;
 
@@ -1227,7 +1286,11 @@ Void SAP_watchDog (Void)
             if(device->mode == DEV2_INPUT)
                gSapWatchDogIn++;
             else
-                gSapWatchDogOut++;
+            {
+               //if (gSapWatchDogOut == 0)
+                       //SAP_EDMA_dumpParams(1);
+               gSapWatchDogOut++;
+            }
 
             //TRACE_TERSE((&TR_MOD, "SAP_watchDog.%d, PAF_SIO_ERROR_FATAL: 0x%x", __LINE__, pDevExt->errorState));
            /* if(gSapWatchDogThrottle == 0) //DJDBG
@@ -1305,7 +1368,10 @@ void SAP_isrCallback (Uint32 tcc, EDMA3_RM_TccStatus status, Ptr context)
             pDevExt->numQueued -= 1;
             //gIsrCnt++;
             if (device->mode == 1)
+               {
                gIsrOutputCnt++;
+               //Log_info1("SAP isrCallback for 0x%x", pDevExt->activeEdma);
+               }
             else
                gIsrInputCnt++;
             // place frame onto user queue and signal user thread
@@ -1380,9 +1446,14 @@ Int SAP_EDMA_setupXfer (DEV2_Handle device, XDAS_UInt32 targetEdma, XDAS_UInt32
     }
     SAP_DMA_FTABLE_setupParam (device, targetEdma, childEdma, (XDAS_UInt32) pFrame->addr, pFrame->size);
 
+    if (device->mode == DEV2_OUTPUT)
+       Log_info4("SAP: Inside SAP_EDMA_setupXfer with childEdma=0x%x & targetEdma = 0x%x; pFrame->addr = 0x%x, pFrame->size=0x%x", childEdma, targetEdma, pFrame->addr, pFrame->size);
+
     if (parentEdma != EDMA_HINV)
         EDMA3_DRV_linkChannel (hEdma, parentEdma, targetEdma);
 
+    if (device->mode == DEV2_OUTPUT)
+               Log_info3("SAP: Inside SAP_EDMA_setupXfer linked targetEdma = 0x%x with parentEdma=0x%x on Edma=0x%x", targetEdma, parentEdma, hEdma);
 
     Hwi_restore (key); //DJDBG
 
@@ -1478,7 +1549,7 @@ Int SAP_EDMA_setupParam (DEV2_Handle device, XDAS_UInt32 targetEdma, XDAS_UInt32
         else {
             edmaConfig.srcBIdx  = 0;
             edmaConfig.srcAddr  = (unsigned int) &sap_UNDER[0];
-#if 1
+#if 0
             //edmaConfig.cCnt = (SAP_UNDER_LEN * sizeof(int))/(edmaConfig.aCnt * edmaConfig.bCnt); //DJDBG
             edmaConfig.cCnt = SAP_UNDER_LEN; //DJDBG, if underrun have frame of silence
 #endif
@@ -1487,14 +1558,16 @@ Int SAP_EDMA_setupParam (DEV2_Handle device, XDAS_UInt32 targetEdma, XDAS_UInt32
     edmaConfig.srcAddr  = (unsigned int) getGlobalAddr(edmaConfig.srcAddr);
     edmaConfig.destAddr  = (unsigned int) getGlobalAddr(edmaConfig.destAddr);
 
-    Log_info5("SAP: Inside SAP_EDMA_setupParam with size=0x%x, targetEdma = 0x%x, CCNT = %d with dest-addr: 0x%x and OPT=0x%x", size, targetEdma, edmaConfig.cCnt, edmaConfig.destAddr, edmaConfig.opt);
-    Log_info5("SAP: Inside SAP_EDMA_setupParam with aCnt=0x%x, bCnt = 0x%x, destBIdx = 0x%x destCIdx: 0x%x and bCntReload=0x%x", edmaConfig.aCnt, edmaConfig.bCnt, edmaConfig.destBIdx, edmaConfig.destCIdx, edmaConfig.bCntReload);
-
     EDMA3_DRV_setPaRAM (hEdma, targetEdma, &edmaConfig);
 
     // link child xfer
     if (childEdma != EDMA_HINV)
         EDMA3_DRV_linkChannel (hEdma, targetEdma, childEdma);
 
+    if (device->mode == DEV2_OUTPUT) {
+        Log_info5("SAP: Inside SAP_EDMA_setupParam: size=0x%x, targetEdma = 0x%x, CCNT = %d with dest-addr: 0x%x and OPT=0x%x", size, targetEdma, edmaConfig.cCnt, edmaConfig.destAddr, edmaConfig.opt);
+        Log_info5("SAP: Inside SAP_EDMA_setupParam: aCnt=0x%x, bCnt = 0x%x; linked targetEdma = 0x%x with childEdma=0x%x on Edma=0x%x", edmaConfig.aCnt, edmaConfig.bCnt, targetEdma, childEdma, hEdma );
+        }
+
     return SIO2_OK;
 } //SAP_setupParam