]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blobdiff - pasdk/test_dsp/mib/mib.c
Merge branch 'dev_pasdk_frank_pasdk516AsotRefactoring' into dev_pasdk_pasdk29Integration
[processor-sdk/performance-audio-sr.git] / pasdk / test_dsp / mib / mib.c
index f3646902b1821d6fac821835e249c446b4fd6ab1..504cef8ce70bf33a8c304ffe531125b4377f03f9 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
-Copyright (c) 2016, Texas Instruments Incorporated - http://www.ti.com/
+Copyright (c) 2017, Texas Instruments Incorporated - http://www.ti.com/
 All rights reserved.
 
 * Redistribution and use in source and binary forms, with or without 
@@ -71,26 +71,7 @@ extern const ti_sysbios_heaps_HeapMem_Handle heapMemDdr3;
 #define HEAPMALLOC (IHeap_Handle)heapMemDdr3
 extern HeapMem_Handle DEV2_memSpaceToHeap (IALG_MemSpace space);
 
-#if 0
-#if ((PAF_DEVICE&0xFF000000) == 0xD8000000)
-#ifndef dMAX_CFG
-#include <dap_dmax.h>
-#else
-#include <dmax_struct.h>
-#include <dmax_params.h>
-#endif /* dMAX_CFG */
-#include "psdkaf_hjt.h"
-extern Uint32 DAT_cacheop_and_copy (void *src, void *dst, Uint16 byteCnt);
-#undef DAT_copy
-#define DAT_copy DAT_cacheop_and_copy
-#else
-#include "pafhjt.h"
-#include "dmax_dat.h" // this has to come after pafhjt
-#endif
-
-#else
 #include "pafhjt.h"
-#endif
 
 #include <ti/sysbios/knl/Clock.h>
 #include <xdc/runtime/Log.h>
@@ -239,7 +220,7 @@ const SmUns iecPafSource[23] =
 };
 
 // IEC framelengths (in 16bit words)
-static const MdUns iecFrameLength[23] =
+const MdUns iecFrameLength[23] =
 {
     0,
     1536*2,
@@ -283,13 +264,14 @@ static const MdUns iecFrameLength[23] =
 
 // This is used at a couple of locations to ensure the transfer
 // size is sufficiently long to be useful.
-//#define NOMINAL_XFERSIZE         128
 #define NOMINAL_XFERSIZE         128 //GJ Debug
-//#define NOMINAL_XFERSIZE         512 //GJ Debug
 
 #define min(a, b)  (((a) < (b)) ? (a) : (b))
 #define max(a, b)  (((a) > (b)) ? (a) : (b))
 
+// debug
+//#include "evmc66x_gpio_dbg.h"
+
 // -----------------------------------------------------------------------------
 
 inline void IncrementPtr (PAF_InpBufConfig *pBufConfig, Ptr *pPtr, int numWords)
@@ -355,42 +337,7 @@ Int DIB_issue (DEV2_Handle device)
 
     Queue_put (device->fromdevice, (Queue_Elem *)srcFrame);
 
-//GJ: PAF_SIO_REQUEST_AUTO, Not Supported, yet.
-    if (srcFrame->arg == PAF_SIO_REQUEST_AUTO) {
-#if 0
-        // if not yet running, prime input buffer
-        if (pDevExt->syncState == SYNC_NONE) {
-
-            status = DIB_FTABLE_reset (device, pBufConfig);
-            if (status)
-                return status;
-
-            pDevExt->sourceProgram = PAF_SOURCE_UNKNOWN;
-
-            status = DIB_FTABLE_issueChild (device, &pDevExt->bufConfig, pDevExt->autoRequestSize, 0);
-            if (status)
-                return status;
-
-            // * also reset pDevExt->zeroCount, as in DIB_getSync()?
-            // just for PAF_SOURCE_PCMAUTO? *
-            pDevExt->pcmTimeout =
-                pDevExt->sourceSelect == PAF_SOURCE_PCMAUTO ? 0 :
-                2 * pBufConfig->pBufStatus->unknownTimeout;
-            pDevExt->syncState = SYNC_AUTO;
-
-            // allows PCM decoder to be used to generate zero-valued audio frames while scanning
-            pBufConfig->deliverZeros = 1;
-        }
-        // no action if already sync'ed
-        else if (pDevExt->syncState != SYNC_AUTO)
-            return 0;
-
-        status = DIB_FTABLE_issueChild (device, &pDevExt->bufConfig, pDevExt->autoRequestSize, 0);
-        if (status)
-            return status;
-#endif
-    }
-    else if (srcFrame->arg == PAF_SIO_REQUEST_NEWFRAME) {
+    if (srcFrame->arg == PAF_SIO_REQUEST_NEWFRAME) {
 
         // do nothing if not synced since syncing done in reclaim
         // This is executed in force modes from the first call to PAF_AST_decodeInit
@@ -410,8 +357,8 @@ Int DIB_issue (DEV2_Handle device)
 // Although interface allows for arbitrary BufConfigs we only support 1 -- so
 // we can assume the one on the fromdevice is the one we want
 
-extern int gIsrInputCnt; // GJ Debug
-extern int gIsrOutputCnt; // GJ Debug
+extern int gIsrInputCnt;
+extern int gIsrOutputCnt;
 
 Int DIB_reclaim (DEV2_Handle device)
 {
@@ -440,78 +387,9 @@ Int DIB_reclaim (DEV2_Handle device)
 
     // .........................................................................
 
-    if (dstFrame->arg == PAF_SIO_REQUEST_AUTO) {
-//GJ: PAF_SIO_REQUEST_AUTO - not supported, yet.
-#if 0
-        Log_info0("DIB: At case = PAF_SIO_REQUEST_AUTO"); // GJ Debug
-
-        // verify set up by prior DIB_issue()
-        // no action if already sync'ed
-        if (pDevExt->syncState == SYNC_NONE)
-            return DIBERR_AUTO;
-        else if (pDevExt->syncState != SYNC_AUTO)
-            return 0;
-
-        // get next block of data to scan
-        status = DIB_FTABLE_waitForData (device, &pDevExt->bufConfig, pDevExt->autoRequestSize);
-        if (status)
-            return status;
-
-        if (pDevExt->sourceSelect == PAF_SOURCE_NONE) {
-            IncrementPtr (pBufConfig, &pDevExt->bufConfig.pntr.pVoid, pDevExt->autoRequestSize);
-            return 0;
-        }
-
-        // this function updates the tail pointer; it WON'T reset to SYNC_NONE
-        status = DIB_FTABLE_syncScan (device, &pDevExt->bufConfig, &pDevExt->pcmTimeout);
-        if (status)
-            return status;
-
-        // if not yet sync'ed ...
-        if (pDevExt->syncState == SYNC_AUTO) {
-            // if timeout, harness tail of DIB_getSync()
-            if (!pDevExt->pcmTimeout) {
-
-                // checks pDevExt->zeroCount, runs DIB_reset(),
-                // updates pBufConfig->deliverZeros/sizeofElement/sizeofBuffer,
-                // sets pDevExt->sourceProgram = PAF_SOURCE_PCM/DSD?
-                //  and pDevExt->syncState = SYNC_PCM[_FORCED]
-                status = DIB_FTABLE_getSync (device, &pDevExt->bufConfig);
-                if (status)
-                    return status;
-            }
-        }
-
-        // if sync'ed to bitstream, this requests add'l input;
-        // if PCM, this "kickstarts" the input,
-        // using settings per above call to DIB_getSync()
-        if (pDevExt->syncState != SYNC_AUTO) {
-
-            status = DIB_FTABLE_initFrame (device, &pDevExt->bufConfig);
-            if (status)
-                return status;
-
-            // this situation may occur for various IEC types,
-            // w/ no matching PAF_SOURCE_ type is defined
-            // (see iecPafSource[] table for the latter mapping)
-            // most like cases are null & pause packets
-            if (pDevExt->sourceProgram == PAF_SOURCE_UNKNOWN)
-                return DIBERR_SYNC;
-
-            // request timing frame
-            status = DIB_FTABLE_requestFrame (device, &pDevExt->bufConfig);
-            if (status)
-                return status;
-        }
-
-#endif
-    } //dstFrame->arg == PAF_SIO_REQUEST_AUTO
-
-    // .........................................................................
-
     if ((pDevExt->syncState == SYNC_NONE) || (dstFrame->arg == PAF_SIO_REQUEST_SYNC)) {
 
-        Log_info0("DIB: At case: syncState == SYNC_NONE (or PAF_SIO_REQUEST_SYNC)");  // GJ Debug
+        Log_info0("DIB: At case: syncState == SYNC_NONE (or PAF_SIO_REQUEST_SYNC)");
 
         // pass in external buffer config which used to initialize the internal view
         status = DIB_FTABLE_reset (device, pBufConfig);
@@ -527,7 +405,7 @@ Int DIB_reclaim (DEV2_Handle device)
         // (i.e. no need to reset it here)
         if (pDevExt->syncState == SYNC_NONE)
         {
-            Log_info0("Returning DIBERR_SYNC after DIB_FTABLE_getSync"); // GJ Debug
+            Log_info0("Returning DIBERR_SYNC after DIB_FTABLE_getSync");
             return DIBERR_SYNC;
         }
 
@@ -536,7 +414,7 @@ Int DIB_reclaim (DEV2_Handle device)
 
         if (status)
         {
-            Log_info1("Returning %d after DIB_FTABLE_initFrame", status); // GJ Debug
+            Log_info1("Returning %d after DIB_FTABLE_initFrame", status);
             return status;
         }
 
@@ -544,7 +422,7 @@ Int DIB_reclaim (DEV2_Handle device)
         status = DIB_FTABLE_requestFrame (device, &pDevExt->bufConfig);
         if (status)
         {
-            Log_info1("Returning %d after DIB_FTABLE_requestFrame", status); // GJ Debug
+            Log_info1("Returning %d after DIB_FTABLE_requestFrame", status);
             return status;
         }
         // update external view of bufConfig. In particular for slave force PCM
@@ -559,13 +437,13 @@ Int DIB_reclaim (DEV2_Handle device)
 
     if (dstFrame->arg == PAF_SIO_REQUEST_NEWFRAME) {
 
-        Log_info0("DIB: At case = PAF_SIO_REQUEST_NEWFRAME"); // GJ Debug
+        Log_info0("DIB: At case = PAF_SIO_REQUEST_NEWFRAME");
 
         // wait for enough data to check for sync at expected location
         status = DIB_FTABLE_waitForData (device, &pDevExt->bufConfig, pDevExt->bufConfig.frameLength);
         if (status)
         {
-            Log_info2("DIB_reclaim.%d DIB_FTABLE_waitForData returned %d", __LINE__, status); // GJ Debug
+            Log_info2("DIB_reclaim.%d DIB_FTABLE_waitForData returned %d", __LINE__, status);
             //TRACE((&TR_MOD, "DIB_reclaim.%d DIB_FTABLE_waitForData returned %d\n", __LINE__, status));
             return status;
         }
@@ -598,7 +476,7 @@ Int DIB_reclaim (DEV2_Handle device)
                 status = DIB_FTABLE_syncScan (device, pBufConfig, &pDevExt->pcmTimeout);
                 if (status) {
                     pDevExt->sourceProgram = PAF_SOURCE_UNKNOWN;
-                    Log_info2("DIB_reclaim.%d DIB_FTABLE_syncScan returned %d", __LINE__, status); // GJ Debug
+                    Log_info2("DIB_reclaim.%d DIB_FTABLE_syncScan returned %d", __LINE__, status);
                     //TRACE((&TR_MOD, "DIB_reclaim.%d DIB_FTABLE_syncScan returned %d\n", __LINE__, status));
                     return status;
                 }
@@ -606,7 +484,7 @@ Int DIB_reclaim (DEV2_Handle device)
                 // if scan found something other than PCM, then exit with error
                 if (pDevExt->syncState != SYNC_PCM)
                 {
-                    Log_info1("DIB_reclaim.%d error: syncState != SYNC_PCM", __LINE__); // GJ Debug
+                    Log_info1("DIB_reclaim.%d error: syncState != SYNC_PCM", __LINE__);
                     //TRACE((&TR_MOD, "DIB_reclaim.%d error: syncState != SYNC_PCM\n", __LINE__));
                     return DIBERR_SYNC;
                 }
@@ -615,7 +493,7 @@ Int DIB_reclaim (DEV2_Handle device)
                 if ((ibMode == MODE_DEFAULT) &&
                     (pDevExt->zeroCount >= 2*pBufConfig->pBufStatus->zeroRunRestart)) {
                     // if zeroRunRestart me then reset input to unknown
-                    Log_info1("DIB_reclaim.%d error: zeroRunRestart, setting PAF_SOURCE_UNKNOWN", __LINE__); // GJ Debug
+                    Log_info1("DIB_reclaim.%d error: zeroRunRestart, setting PAF_SOURCE_UNKNOWN", __LINE__);
                     //TRACE((&TR_MOD, "DIB_reclaim.%d error: zeroRunRestart, setting PAF_SOURCE_UNKNOWN\n", __LINE__));
                     pDevExt->sourceProgram = PAF_SOURCE_UNKNOWN;
                     return DIBERR_SYNC;
@@ -646,14 +524,14 @@ Int DIB_reclaim (DEV2_Handle device)
         // since, at least for THD, it is needed by decoders.
         *pBufConfig = pDevExt->bufConfig;
         pBufConfig->lengthofData -= pDevExt->headerSize;
-        Log_info4("DIB_reclaim.%d lengthofData = %d; InISRCNT=%d; OutISRCNT=%d", __LINE__, pBufConfig->lengthofData, gIsrInputCnt, gIsrInputCnt); // GJ Debug
+        Log_info4("DIB_reclaim.%d lengthofData = %d; InISRCNT=%d; OutISRCNT=%d", __LINE__, pBufConfig->lengthofData, gIsrInputCnt, gIsrInputCnt);
         //TRACE((&TR_MOD, "DIB_reclaim.%d lengthofData = %d\n", __LINE__, pBufConfig->lengthofData));
 
         // HACK: for DSD the frameLength needs to be the number of samples to generate.
         if ((pDevExt->sourceSelect >= PAF_SOURCE_DSD1) &&
             (pDevExt->sourceSelect <= PAF_SOURCE_DSD3))
             pBufConfig->frameLength /= pBufConfig->stride;
-        Log_info2("DIB_reclaim.%d frameLength = %d", __LINE__, pBufConfig->frameLength); // GJ Debug
+        Log_info2("DIB_reclaim.%d frameLength = %d", __LINE__, pBufConfig->frameLength);
         //TRACE((&TR_MOD, "DIB_reclaim.%d frameLength = %d\n", __LINE__, pBufConfig->frameLength));
 
         // set external view to point at synch position of the frame guaranteed
@@ -676,17 +554,17 @@ Int DIB_reclaim (DEV2_Handle device)
         //       i.e. it is ok to adjust the input buffer pointers.
         // if successful then this sets
         //      pSync = address of PA (for IEC)
-        status = DIB_FTABLE_initFrame (device, &pDevExt->bufConfig);
+        status = DIB_FTABLE_initFrame (device, &pDevExt->bufConfig);  // DIB_initFrame
         if (status) {
             if (pBufConfig->pBufStatus->lastFrameMask & (1 << pDevExt->sourceProgram)) {
                 pDevExt->deferredError = status;
-                Log_info1("DIB_reclaim.%d last frame\n", __LINE__); // GJ Debug
+                Log_info1("DIB_reclaim.%d last frame\n", __LINE__);
                 //TRACE((&TR_MOD, "DIB_reclaim.%d last frame\n", __LINE__));
                 pBufConfig->pBufStatus->lastFrameFlag = 1;
                 return 0;
             }
             else {
-                Log_info1("DIB_reclaim.%d setting PAF_SOURCE_UNKNOWN", __LINE__); // GJ Debug
+                Log_info1("DIB_reclaim.%d setting PAF_SOURCE_UNKNOWN", __LINE__);
                 //TRACE((&TR_MOD, "DIB_reclaim.%d setting PAF_SOURCE_UNKNOWN\n", __LINE__));
                 pDevExt->sourceProgram = PAF_SOURCE_UNKNOWN;
                 return status;
@@ -697,7 +575,7 @@ Int DIB_reclaim (DEV2_Handle device)
 
     // .........................................................................
 
-    Log_info4("DIB_reclaim.%d exit status = %d, InISRCNT = %d OutISRCNT = %d", __LINE__, status, gIsrInputCnt, gIsrOutputCnt); // GJ Debug
+    Log_info4("DIB_reclaim.%d exit status = %d, InISRCNT = %d OutISRCNT = %d", __LINE__, status, gIsrInputCnt, gIsrOutputCnt);
     //TRACE((&TR_MOD, "DIB_reclaim.%d exit status = %d\n", __LINE__, status));
 
     return status;
@@ -976,6 +854,18 @@ Int DIB_getSync (DEV2_Handle device, PAF_InpBufConfig *pBufConfig )
             if (status)
                 return status;
 
+#if 0 // debug
+            // Shows timing of Input Rx SIO reclaim during autodet
+            // ADC 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            
 
             // get next block of data to scan
             status = DIB_FTABLE_waitForData (device, pBufConfig, syncBufSize);
@@ -996,7 +886,7 @@ Int DIB_getSync (DEV2_Handle device, PAF_InpBufConfig *pBufConfig )
             }
             else
             {
-                Log_info3("DIB: Inside DIB_getSync with syncState != SYNC_ONE. localTimeout = %d, syncBufSize  = %d, timeout = %d", localTimeout,syncBufSize, timeout); // GJ Debug
+                Log_info3("DIB: Inside DIB_getSync with syncState != SYNC_ONE. localTimeout = %d, syncBufSize  = %d, timeout = %d", localTimeout,syncBufSize, timeout);
                 localTimeout -= syncBufSize;
             }
         }
@@ -1159,11 +1049,11 @@ Int DIB_issueChild (DEV2_Handle device, PAF_InpBufConfig  *pBufConfig, int size,
                 return DIBERR_UNSPECIFIED;
 
             pBufConfig->futureHead.pVoid = endAddr[i];
-            // GJ Debug
+
             if (i==1)
             {
                gWrapCtr++;
-               Log_info4("DIB: Inside DIB_issueChild Wrap Around Point #%d, with Future Head: 0x%x, current addr: 0x%x, current size: %d", gWrapCtr, pBufConfig->futureHead.pVoid, dstFrame->addr, dstFrame->size ); // GJ Debug
+               Log_info4("DIB: Inside DIB_issueChild Wrap Around Point #%d, with Future Head: 0x%x, current addr: 0x%x, current size: %d", gWrapCtr, (xdc_IArg)pBufConfig->futureHead.pVoid, (xdc_IArg)dstFrame->addr, dstFrame->size );
 
             }
         }
@@ -1181,26 +1071,26 @@ Int DIB_reclaimChild (DEV2_Handle device, PAF_InpBufConfig *pBufConfig)
     DEV2_Frame              *srcFrame;
     int                     status, bufEnd;
 
-    //Log_info3("DIB_reclaimChild.%d: Inside DEV2_reclaim(pChild) pChild = 0x%x DEV2_reclaim = 0x%x", __LINE__, pChild, &pChild->fxns.reclaim); // GJ Debug
+    //Log_info3("DIB_reclaimChild.%d: Inside DEV2_reclaim(pChild) pChild = 0x%x DEV2_reclaim = 0x%x", __LINE__, pChild, &pChild->fxns.reclaim);
     //TRACE((&TR_MOD, "DIB_reclaimChild.%d: calling DEV2_reclaim(pChild) pChild = 0x%x DEV2_reclaim = 0x%x", __LINE__, pChild, &pChild->fxns.reclaim));
     status = DEV2_reclaim (pChild);
     if (status)
     {
-        Log_info2("DIB_reclaimChild.%d DEV2_reclaim() returned (%d) DIBERR_UNSPECIFIED", __LINE__, status); // GJ Debug
+        Log_info2("DIB_reclaimChild.%d DEV2_reclaim() returned (%d) DIBERR_UNSPECIFIED", __LINE__, status);
         //TRACE((&TR_MOD, "DIB_reclaimChild.%d DEV2_reclaim() returned (%d) DIBERR_UNSPECIFIED \n", __LINE__, status));
         return DIBERR_UNSPECIFIED;
     }
 
-    //Log_info1("DIB_reclaimChild.%d calling Queue_get()", __LINE__); // GJ Debug
+    //Log_info1("DIB_reclaimChild.%d calling Queue_get()", __LINE__);
     //TRACE((&TR_MOD, "DIB_reclaimChild.%d calling Queue_get()\n", __LINE__));
     srcFrame = Queue_get (pChild->fromdevice);
-    //Log_info2("DIB_reclaimChild.%d calling Queue_put(), srcFrame = 0x%x", __LINE__, srcFrame); // GJ Debug
+    //Log_info2("DIB_reclaimChild.%d calling Queue_put(), srcFrame = 0x%x", __LINE__, srcFrame);
     //TRACE((&TR_MOD, "DIB_reclaimChild.%d calling Queue_put(), srcFrame = 0x%x\n", __LINE__, srcFrame));
     Queue_put (Queue_handle(&((SIO2_Handle) pChild)->framelist), (Queue_Elem *)srcFrame);
 
     // Only for non-fill requests do we update ptrs
     if (srcFrame->addr != NULL) {
-        //Log_info2("DIB_reclaimChild.%d update pointers with srcFrame->size = %d", __LINE__, srcFrame->size); // GJ Debug
+        //Log_info2("DIB_reclaimChild.%d update pointers with srcFrame->size = %d", __LINE__, srcFrame->size);
         //TRACE((&TR_MOD, "DIB_reclaimChild.%d update pointers\n", __LINE__));
         pBufConfig->head.pVoid = (Ptr) ((int)srcFrame->addr + srcFrame->size);
 
@@ -1208,13 +1098,13 @@ Int DIB_reclaimChild (DEV2_Handle device, PAF_InpBufConfig *pBufConfig)
         bufEnd = (int) pBufConfig->base.pVoid + pBufConfig->sizeofBuffer;
         if( (int) pBufConfig->head.pVoid >= bufEnd )
         {
-            Log_info1("DIB_reclaimChild.%d wrap pointer", __LINE__); // GJ Debug
+            Log_info1("DIB_reclaimChild.%d wrap pointer", __LINE__);
             //TRACE((&TR_MOD, "DIB_reclaimChild.%d wrap pointer\n", __LINE__));
             pBufConfig->head.pVoid = (Ptr) ((int) pBufConfig->base.pVoid + (int) pBufConfig->head.pVoid - bufEnd);
         }
     }
 
-    Log_info2("DIB_reclaimChild.%d exit with status = %d", __LINE__, status); // GJ Debug
+    Log_info2("DIB_reclaimChild.%d exit with status = %d", __LINE__, status);
     //TRACE((&TR_MOD, "DIB_reclaimChild.%d exit with status = %d\n", __LINE__, status));
 
     return status;
@@ -1406,7 +1296,7 @@ Int DIB_syncScan (DEV2_Handle device, PAF_InpBufConfig *pBufConfig, XDAS_UInt32
     // if scratch buffer present then assume it is needed for paging
     pageSize = numLeft*pBufConfig->sizeofElement;
 
-    Log_info3("DIB: Entered DIB_syncScan with pTail = 0x%x & numLeft = %d, timeout = %d", pTail, numLeft, *pTimeout); // GJ Debug
+    Log_info3("DIB: Entered DIB_syncScan with pTail = 0x%x & numLeft = %d, timeout = %d", (xdc_IArg)pTail, numLeft, *pTimeout);
 
 
     if ((pAlgConfig->numRec > 1) && pAlgConfig->pMemRec[1].base && (pAlgConfig->pMemRec[1].size >= pageSize)) {
@@ -1416,7 +1306,7 @@ Int DIB_syncScan (DEV2_Handle device, PAF_InpBufConfig *pBufConfig, XDAS_UInt32
     }
 
     if (pBufConfig->sizeofElement == 4) {
-        Log_info0("DIB: SyncScan - Inside pBufConfig->sizeofElement == 4"); // GJ Debug
+        Log_info0("DIB: SyncScan - Inside pBufConfig->sizeofElement == 4");
         stride = 2;
         pTail += 1; // point at MSB
         pShadowTail += 1;
@@ -1432,7 +1322,7 @@ Int DIB_syncScan (DEV2_Handle device, PAF_InpBufConfig *pBufConfig, XDAS_UInt32
     scanState = pDevExt->scanState;
     pSync     = pDevExt->pSync.pMdInt;
 
-    Log_info4("DIB: Entered DIB_syncScan with zeroCount = %d & scanState = %d, stride = %d, pSync = 0x%x", zeroCount, scanState, stride, pSync); // GJ Debug
+    Log_info4("DIB: Entered DIB_syncScan with zeroCount = %d & scanState = %d, stride = %d, pSync = 0x%x", zeroCount, scanState, stride, (xdc_IArg)pSync);
 
     // scan until out of available data or a sync found
     for (i=0; i < numLeft; i++) {
@@ -1474,7 +1364,7 @@ Int DIB_syncScan (DEV2_Handle device, PAF_InpBufConfig *pBufConfig, XDAS_UInt32
             //    . the last sample was non-zero
             if (scanCount || (tail != 0x0000) || timeoutChanged)
             {
-                //Log_info3("DIB: DIB_syncScan scanCount = %d tail = %d timeoutChanged = %d", scanCount, tail, timeoutChanged); // GJ Debug
+                //Log_info3("DIB: DIB_syncScan scanCount = %d tail = %d timeoutChanged = %d", scanCount, tail, timeoutChanged);
                 scanCount += 1;
             }
 
@@ -1561,11 +1451,11 @@ Int DIB_syncScan (DEV2_Handle device, PAF_InpBufConfig *pBufConfig, XDAS_UInt32
                 if (tail == IEC_PB) {
                     scanState = SCANNED_IEC_PB;
                     scanCount += 1;
-                    Log_info0("DIB: SyncScan Inside case - SCANNED_IEC_PA - if path"); // GJ Debug
+                    Log_info0("DIB: SyncScan Inside case - SCANNED_IEC_PA - if path");
                 }
                 else
                 {
-                    Log_info0("DIB: SyncScan Inside case - SCANNED_IEC_PA - else path"); // GJ Debug
+                    Log_info0("DIB: SyncScan Inside case - SCANNED_IEC_PA - else path");
                     scanState = SCANNED_NONE;
                 }
                 break;
@@ -1597,7 +1487,7 @@ Int DIB_syncScan (DEV2_Handle device, PAF_InpBufConfig *pBufConfig, XDAS_UInt32
                 pc = *pLocalTail & 0x1F;
                 pDevExt->headerSize = IEC_HEADER_SIZE;
 
-                Log_info0("DIB: Sync Scan - Inside case: SCANNED_IEC_PC"); // GJ Debug
+                Log_info0("DIB: Sync Scan - Inside case: SCANNED_IEC_PC");
                 // Handle DTSHD subtype (LBR)
                 if (pc == 0x11) {
                     pDevExt->headerSize +=6;
@@ -1618,7 +1508,7 @@ Int DIB_syncScan (DEV2_Handle device, PAF_InpBufConfig *pBufConfig, XDAS_UInt32
                 // don't know how to support other types
                 if (pc > 22)
                 {
-                    Log_info1("DIB:  Unknown IEC type 0x%x encountered.\n", pc); // GJ Debug
+                    Log_info1("DIB:  Unknown IEC type 0x%x encountered.\n", pc);
                     return DIBERR_SYNC;
                 }
 
@@ -1626,12 +1516,12 @@ Int DIB_syncScan (DEV2_Handle device, PAF_InpBufConfig *pBufConfig, XDAS_UInt32
                 pBufConfig->pntr.pMdInt = pSync;
                 pDevExt->sourceProgram = iecPafSource[pc];
 
-                Log_info2("source is %d.  pc is %d.", iecPafSource[pc], pc); // GJ Debug 
+                Log_info2("source is %d.  pc is %d.", iecPafSource[pc], pc);
                 //TRACE((&TR_MOD, "source is %d.  pc is %d.\n", iecPafSource[pc], pc));
-
+#if 0 //No need to differentiate LBR subtype from DTSHD as DXP source program as LBR is handled inside DTSX decoder like other subtypes.
                 if (pc == 0x11 && DTSHDSubType == 3 && (PAF_ASP_sampleRateHzTable[pBufConfig->pBufStatus->sampleRateStatus][PAF_SAMPLERATEHZ_STD] <=48000.0))
                     pDevExt->sourceProgram = PAF_SOURCE_DXP;    // LBR is 23
-             
+#endif             
                 pDevExt->frameLength = pDevExt->pIECFrameLength[pc];
                 pDevExt->lengthofData = pDevExt->frameLength;
                 if (pc == 1)
@@ -1649,7 +1539,7 @@ Int DIB_syncScan (DEV2_Handle device, PAF_InpBufConfig *pBufConfig, XDAS_UInt32
     // .............................................................................
 
 syncScanExit:
-    Log_info4("DIB inside syncScanExit.  pTimeout = %d, scanCount = %d, zeroCount = %d, numLeft = %d", *pTimeout,scanCount, zeroCount, numLeft ); // GJ Debug
+    Log_info4("DIB inside syncScanExit.  pTimeout = %d, scanCount = %d, zeroCount = %d, numLeft = %d", *pTimeout,scanCount, zeroCount, numLeft );
     pDevExt->zeroCount    = zeroCount;
     pDevExt->scanState    = scanState;
     pDevExt->pSync.pMdInt = pSync;
@@ -1987,7 +1877,7 @@ Int DIB_waitForData (DEV2_Handle device, PAF_InpBufConfig *pBufConfig, XDAS_UInt
     DEV2_Handle            pChild = (DEV2_Handle) &pDevExt->child;
     Int status, lock;
 
-    Log_info2("DIB_waitForData.%d count = %d", __LINE__, count); // GJ Debug
+    Log_info2("DIB_waitForData.%d count = %d", __LINE__, count);
     //TRACE((&TR_MOD, "DIB_waitForData.%d count = %d\n", __LINE__, count));
 
     while (GetNumAvail(pBufConfig) < count) {
@@ -1998,7 +1888,7 @@ Int DIB_waitForData (DEV2_Handle device, PAF_InpBufConfig *pBufConfig, XDAS_UInt
         status = SIO2_ctrl (pChild, (Uns)PAF_SIO_CONTROL_GET_INPUT_STATUS, (Arg) &inputStatus);
         if (status)
         {
-            Log_info2("DIB_waitForData.%d SIO2_ctrl() returned %d", __LINE__, status); // GJ Debug
+            Log_info2("DIB_waitForData.%d SIO2_ctrl() returned %d", __LINE__, status);
             //TRACE((&TR_MOD, "DIB_waitForData.%d SIO2_ctrl() returned %d\n", __LINE__, status));
             return status;
         }
@@ -2006,14 +1896,14 @@ Int DIB_waitForData (DEV2_Handle device, PAF_InpBufConfig *pBufConfig, XDAS_UInt
 #ifndef IGNORE_LOCK_OVERRIDE
         if ((pBufConfig->pBufStatus->lockOverride & (XDAS_Int8)0x80) == 0)
         {
-            Log_info1("DIB_waitForData.%d lock = lockOverride\n", __LINE__); // GJ Debug
+            Log_info1("DIB_waitForData.%d lock = lockOverride\n", __LINE__);
             //TRACE((&TR_MOD, "DIB_waitForData.%d lock = lockOverride\n", __LINE__));
             lock = pBufConfig->pBufStatus->lockOverride;
         }
 #endif
         if (!lock)
         {
-            Log_info1("DIB_waitForData.%d no lock, return DIBERR_SYNC\n", __LINE__); // GJ Debug
+            Log_info1("DIB_waitForData.%d no lock, return DIBERR_SYNC\n", __LINE__);
             //TRACE((&TR_MOD, "DIB_waitForData.%d no lock, return DIBERR_SYNC\n", __LINE__));
             return DIBERR_SYNC;
         }
@@ -2022,18 +1912,18 @@ Int DIB_waitForData (DEV2_Handle device, PAF_InpBufConfig *pBufConfig, XDAS_UInt
         if (pDevExt->pDecodeStatus) {
             if (pDevExt->pDecodeStatus->sourceSelect == PAF_SOURCE_NONE)
             {
-                Log_info1("DIB_waitForData.%d sourceSelect is NONE, return DIBERR_SYNC", __LINE__); // GJ Debug
+                Log_info1("DIB_waitForData.%d sourceSelect is NONE, return DIBERR_SYNC", __LINE__);
                 //TRACE((&TR_MOD, "DIB_waitForData.%d sourceSelect is NONE, return DIBERR_SYNC\n", __LINE__));
                 return DIBERR_SYNC;
             }
         }
 
-        Log_info1("DIB_waitForData.%d calling DIB_FTABLE_reclaimChild()", __LINE__); // GJ Debug
+        Log_info1("DIB_waitForData.%d calling DIB_FTABLE_reclaimChild()", __LINE__);
         //TRACE((&TR_MOD, "DIB_waitForData.%d calling DIB_FTABLE_reclaimChild()\n", __LINE__));
         status = DIB_FTABLE_reclaimChild (device, pBufConfig);
         if(status)
         {
-            Log_info2("DIB_waitForData.%d DIB_FTABLE_reclaimChild() returned %d", __LINE__, status); // GJ Debug
+            Log_info2("DIB_waitForData.%d DIB_FTABLE_reclaimChild() returned %d", __LINE__, status);
             //TRACE((&TR_MOD, "DIB_waitForData.%d DIB_FTABLE_reclaimChild() returned %d\n", __LINE__, status));
             return status;
         }