0 Replies Latest reply on Sep 27, 2017 9:56 PM by priyanob

    I2S Auto or Manual

    priyanob

      If I want to use USB audio mono out with CX3, what is the best method among below

       

      a) Auto DMA USB endpoint to I2S Left channel alone, I2S right channel uninitialized.

      b) Manual DMA USB endpoint to CPU and from CPU to I2S Left channel alone, I2S right channel uninitialized.

       

      I have tried (a), with I2S continuous mode as below.

          /* Configure the I2S interface. */

          CyU3PMemSet ((uint8_t *)&i2sCfg, 0, sizeof (i2sCfg));

          i2sCfg.isMono = CyTrue;

          i2sCfg.isLsbFirst = CyFalse;

          i2sCfg.isDma = CyTrue;

          i2sCfg.padMode = CY_U3P_I2S_PAD_MODE_CONTINUOUS;

          i2sCfg.sampleRate = CY_U3P_I2S_SAMPLE_RATE_44_1KHz;

          i2sCfg.sampleWidth = CY_U3P_I2S_WIDTH_16_BIT;

          status = CyU3PI2sSetConfig (&i2sCfg, NULL);

          .

          .

          .

          .

          .

          /* Create a DMA Auto channel between two sockets of the

           * U port and the L and R I2S sockets. DMA size is set

           * based on the USB speed. */

          dmaCfg.size = size;

          dmaCfg.count = 4;

          dmaCfg.prodSckId = SOCKET_ID_CX3_UAC_SPK_PRODUCER;

          dmaCfg.consSckId = CY_U3P_LPP_SOCKET_I2S_LEFT;

          dmaCfg.dmaMode = CY_U3P_DMA_MODE_BYTE;

          dmaCfg.notification = 0;

          dmaCfg.cb = NULL;

          dmaCfg.prodHeader = 0;

          dmaCfg.prodFooter = 0;

          dmaCfg.consHeader = 0;

          dmaCfg.prodAvailCount = 0;

          status = CyU3PDmaChannelCreate (&glCX3_UAC_I2sLeftCh,

                  CY_U3P_DMA_TYPE_AUTO, &dmaCfg);

          if (status != CY_U3P_SUCCESS)

          {

              CyU3PDebugPrint (4, "CyU3PDmaChannelCreate failed, Error code = %d\n", status);

              CyFxAppErrorHandler(status);

          }

       

      When I stream audio from the host (Android/Linux/Windows), I am hearing a tick noise every 1 second. This can be removed by changing the 'i2sCfg.padMode = CY_U3P_I2S_PAD_MODE_CONTINUOUS; ' as 'i2sCfg.padMode =

      CY_U3P_I2S_PAD_MODE_NORMAL; '. But, then there a small background noise along with audio comes.

       

      My descriptors advertise it as 44.1kHZ, 16 bit per sample mono audio device with bInterval=4. Cannot share the project.

       

      1) What can be the source of such periodic 'tick' noise?

      2) What shall be the suggested I2S padMode for I2S setting?

      3) Manual DMA or Auto DMA best method people use for USB audio out applications?

      4) Any reference code for a working prototype of USB audio out?