]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/commitdiff
Replaced hard coded OUTPUT_STRIDE with configured stride = num_serializer*num_channel.
authorJianzhong Xu <a0869574@ti.com>
Mon, 26 Mar 2018 19:58:02 +0000 (15:58 -0400)
committerJianzhong Xu <a0869574@ti.com>
Mon, 26 Mar 2018 19:58:02 +0000 (15:58 -0400)
McASP Tx clock is hard coded for DDP 48kHz. DDP 48kHz streaming works
fine. To run PCM streaming, neeed to change McASP Tx clock aclkxctl.

pasdk/test_dsp/application/itopo/evmk2g/mcasp_cfg.c
pasdk/test_dsp/framework/audioStreamInpProcNewIO.c
pasdk/test_dsp/framework/audioStreamOutIo.c
pasdk/test_dsp/framework/audioStreamOutProc.h
pasdk/test_dsp/io/ioConfig.h

index ac16b5adfea1fc65b158b96dc24dcc9e25919a87..7457e4a7996dd3acea4e29bdee29139f09ae9d8d 100644 (file)
@@ -143,8 +143,8 @@ Mcasp_HwSetupData mcaspXmtSetupDAC = {
         /* .xstat    = */ 0x000001FF, /* reset any existing status bits       */
         /* .xevtctl  = */ 0x00000000, /* DMA request is enabled or disabled   */
         {
-//             /* .aclkxctl  = */ 0X000000E1,  // Transmit bit clock divide ratio = 2
-             /* .aclkxctl  = */ 0X000000E7,  // Transmit bit clock divide ratio = 8
+//             /* .aclkxctl  = */ 0X000000E1,  // Transmit bit clock divide ratio = 2 --> works for 48khz PCM but not for DDP
+             /* .aclkxctl  = */ 0X000000E7,  // Transmit bit clock divide ratio = 8 --> working for DDP 48khz but not for PCM
              /* .ahclkxctl = */ 0x00004000,
              /* .xclkchk   = */ 0x00000000
         },
@@ -192,7 +192,7 @@ Mcasp_ChanParams  mcaspRxChanParamADC =
     Mcasp_WordLength_32,      /* wordWidth                  */
     NULL,                     /* void * userLoopJobBuffer   */
     0,                        /* userLoopJobLength          */
-    NULL,                   /* edmaHandle                 */
+    NULL,                     /* edmaHandle                 */
     GblErr,
     2,                        /* number of TDM channels      */
     Mcasp_BufferFormat_MULTISER_MULTISLOT_SEMI_INTERLEAVED_1,
index 67f902fa010c19879a58f6687ad8a2e1817855d9..68c90266de84d3ff29e6a806602b1995a539c5ff 100644 (file)
@@ -1139,7 +1139,7 @@ Int asitSelectDevices(const PAF_ASIT_Patchs *pQ, PAF_AST_Config *pAstCfg, PAF_AS
 
     pInp->pRxParams = pQ->devinp->x[interface];
     pInp->hMcaspChan = lldCfg->hMcaspChan;
-    pInp->stride     = lldCfg->mcaspChanParams->noOfSerRequested * 2;  // 2 for stereo
+    pInp->stride     = lldCfg->mcaspChanParams->noOfSerRequested * lldCfg->mcaspChanParams->noOfChannels;
 
     /* Set flag to swap HDMI data if it is 4xI2S and word length is 16 */
     if(   (lldCfg->mcaspChanParams->wordWidth == Mcasp_WordLength_16)
@@ -1506,7 +1506,7 @@ Int asitUpdateIoComps(const PAF_ASIT_Params *pP, PAF_AST_Config *pAstCfg,
     return ASIT_NO_ERR;
 } /* asitUpdateIoComps */
 
-
+#if 0
 #ifndef IO_LOOPBACK_TEST
 #if OUTPUT_FRAME_LENGTH == INPUT_FRAME_LENGTH
 U8 pcmbuf[OUTPUT_FRAME_SIZE];
@@ -1558,6 +1558,8 @@ Int rxDecodePlayZero(PAF_AST_IoInp  *pInp)
 }
 #endif
 
+#endif
+
 Int asitEvtErrCheck(UInt actualEvents, UInt expectedEvents)
 {
     TRACE_VERBOSE2("ASIT events error: actual events are: %d, expected events are: %d.",
index c70438c9c7860528d7599f8726f7054bdb733e1d..2a92966baf005aa697de0a1efa954a7c2b1e6a20 100644 (file)
@@ -85,6 +85,7 @@ Int asopSelectDevices(void *pConfig, PAF_AST_IoOut *pOut)
         }
 
         pOut->hMcaspChan = mcaspChanHandle;
+        pOut->stride = lldCfg->mcaspChanParams->noOfSerRequested * lldCfg->mcaspChanParams->noOfChannels;
     }
 
     return 0;
@@ -328,7 +329,7 @@ Int asopStartOutput(
 
 #if 1 // FL, New IO: add similar thing to be figured out
             // Update framework Phy transfer size
-            pOut[z].phyXferSize = pAstCfg->xOut[z].outBufConfig.lengthofFrame * OUTPUT_STRIDE * WORD_SIZE_PCM;
+            pOut[z].phyXferSize = pAstCfg->xOut[z].outBufConfig.lengthofFrame * pOut[z].stride * WORD_SIZE_PCM;
             // Update IO Phy transfer size            
             ioPhyCtl.code = IOPHY_CTL_FRAME_SIZE;
             ioPhyCtl.params.xferFrameSize = pOut[z].phyXferSize;
@@ -530,14 +531,14 @@ Int asopIoCompsInit(
     ioBuffParams.base         = pOutBuf->outBufConfig.base.pVoid;
     ioBuffParams.size         = pOutBuf->outBufConfig.allocation/STRIDE_WORST_CASE*STRIDE_WORST_CASE;
     ioBuffParams.sync         = IOBUff_READ_SYNC;
-    ioBuffParams.nominalDelay = OUTPUT_FRAME_SIZE * (NUM_PRIME_XFERS+1);
+    ioBuffParams.nominalDelay = NUM_CYCLE_PER_FRAME_DEF * pOutIo->stride * WORD_SIZE_PCM * (NUM_PRIME_XFERS+1);
     if(ioBuffInit(pOutIo->hIoBuff, &ioBuffParams) != IOBUFF_NOERR) 
     {
         return -1;   // to remove magic number
     }
 
     ioPhyParams.ioBuffHandle    = pOutIo->hIoBuff;
-    ioPhyParams.xferFrameSize   = OUTPUT_FRAME_SIZE;
+    ioPhyParams.xferFrameSize   = NUM_CYCLE_PER_FRAME_DEF * pOutIo->stride * WORD_SIZE_PCM;
     ioPhyParams.mcaspChanHandle = pOutIo->hMcaspChan;
     ioPhyParams.ioBuffOp        = IOPHY_IOBUFFOP_READ;
     if(ioPhyInit(pOutIo->hIoPhy, &ioPhyParams) != IOPHY_NOERR) 
@@ -595,7 +596,7 @@ Int asopInitOutBufConfig(
     pOutBufCfg = &pOutBuf->outBufConfig;
     hIoBuff = pOutIo->hIoBuff;
     
-    pOutBufCfg->stride = OUTPUT_STRIDE;
+    pOutBufCfg->stride = pOutIo->stride;
     pOutBufCfg->sizeofElement = WORD_SIZE_PCM;
     pOutBufCfg->precision = 24;
     
@@ -627,7 +628,7 @@ Int asopUpdateOutBufConfig(
 
     // FL, New IO: original code can change these values in every DOB issue
     //  Need to determine if this is required or not.
-    pOutBufCfg->stride = OUTPUT_STRIDE;
+    pOutBufCfg->stride = pOutIo->stride;
     pOutBufCfg->sizeofElement = WORD_SIZE_PCM;
     pOutBufCfg->precision = 24;
     
index 4a909bc37a3de888a7d9a102aebf174a455f43cc..88d5483b60ab7f819292f3cc1c9d7e75f66abbd3 100644 (file)
@@ -185,6 +185,7 @@ typedef struct PAF_AST_OutIO {
     ioBuffHandle_t       hIoBuff;    /* handle to I/O buffer management */
     Ptr                  hMcaspChan; /* handle to McASP LLD channel for output */
     uint32_t             phyXferSize;
+    uint32_t             stride;
 
     void     *mcaspTxBuf1;
     void     *mcaspTxBuf2;
index e43bcfb14760b4e3862d6d462a438a08a38b1e55..2a2a6dbb6a5cc88d8a1a44dea628b999dc29a52a 100644 (file)
@@ -8,11 +8,13 @@
 //#define PCM_LOOPBACK_TEST       // define this to run DSP-only PCM loopback test in PASDK framework
 
 //#define INPUT_HDMI_4xI2S        // HDMI, 4 Rx serializers
-#define INPUT_HDMI_STEREO       // HDMI, 1 Rx serializer
+//#define INPUT_HDMI_STEREO       // HDMI, 1 Rx serializer
 //#define INPUT_SPDIF             // S/PDIF, 1 Rx serializer
 
 //#define INPUT_PCM_ONLY        // debugging, input fixed to PCM
 
+#define TX_MCASP_USE_MULT_SER   // This is the normal operation. Undefine this for debugging and loopback
+
 #ifdef INPUT_PCM_ONLY
 #define SWAP_INPUT_DATA        FALSE
 #else
@@ -21,7 +23,6 @@
 
 #ifdef INPUT_HDMI_4xI2S
 #define RX_MCASP_USE_MULT_SER
-#define TX_MCASP_USE_MULT_SER   // This is the normal operation. Undefine this for debugging and loopback
 #define IO_HW_INTERFACE          2
 //#define ASIP_ELEMENT_SIZE      2
 //#define ASIP_STRIDE            8    // 4 lane, stereo