This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C5535 Connected audio framework I2S as master



Hello,

I am working on project using ezdpsC5535 and Connected audio framework 02.00.02.04.

My goal is to stream audio to I2S0 port acting as master. Unfortunately when

i2sTxConfig.i2sMode  and  i2sRxConfig.i2sMode  are switched from SLAVE to MASTER

bout Windows and Ubuntu PC stop recognizing C5535 as valid USB audio device (it is detected

but can not be used for audio in or out).

I2S0 CLK and FS are outputted as expected but there is no tx audio data.

Thanks in advance for your replay.

Best regards,

Predrag Milicevic.

  • Hi,

    It is been assigned to right experts and it will be addressed soon.

    Thanks & regards,

    Sivaraj K

  • Hi,

    Please find below a few points of concern in your description.

    1. Audio data streaming from AIC3204 audio codec is hardwired on-board the C5535 ezdsp to work with C5535 I2S2. If the idea was to stream AIC3204 data over to I2S0, it won't work.

    2. The Connected Audio Framework setup involves-
    i) while recording: the audio streamed in via J3, taken to the codec, then to the C5535 over I2S2, and over USB to the Host PC,and
    ii) when playing back: the playback stream collected over usb from the Host, taken to the codec again over I2S2, to be streamed out via headphone jack J4.
    Here, the C5535 is an I2S slave, in both the record and playback modes, not a master. The codec is the I2S master.

    3. When streaming audio to C5535, one would require the I2S interface to be configured as a slave. So the intention behind configuring I2S as a master is not completely clear.

    Best Regards.

  • Hello,

    We are trying to test following configuration in our effort to build custom codec.

    PC <- USB Audio -> C5535 <- I2S -> C5535 <- USB Audio -> PC

    For this operation I need that one of two I2s interfaces to be configured as master. For me it does not make any
    difference using I2S2(as AIC3204 is disabled) or I2S0.

    Best regards.

  • Are there two C5535 ezdsp's involved?

    PC1 - USB Audio - C5535_1 - I2S - C5535_2 - USB Audio - PC2?

    Best Regards.

  • Hi,

    Yes, sorry for misunderstanding. Slave is working without problem (using Connected audio framework, without AIC3204). I am only having problems with master ezdspC5535.

    PC1 - USB Audio - C5535_1_master - I2S - C5535_2_slave - USB Audio - PC2

    Best Regards.

     

  • The CAF setup firmware assumes AIC is involved. Hence the I2S is configured as a slave in both record and playback modes. Now, in your case, you require the record path I2S to be master and I2S0. Then there need to be modifications in the code w.r.t the record-path-master-end I2S configuration as well as the hardware connections such as:

    1.  i2sInitPrms.i2sRec = PSP_I2S_RX_INST_ID. PSP_I2S_RX_INST_ID needs to be defined as PSP_I2S_0 in i2s_sample.h. For the same, comment out #define USE_I2S2_REC /* define to use I2S2 */ and uncomment  //#define USE_I2S0_REC /* define to use I2S0 */

    2. In i2s_sample.c, i2sRxConfig.i2sMode = PSP_I2S_SLAVE; needs to be changed to PSP_I2S_MASTER

    3. The Edge Connector P2 pins 45,47,49,51 need to be connected to 23,25,27,29.

    And similarly, ensure that every other record-path I2S parameter is configured to be in-line with your setup.

    Best Regards.

  • Correction.

    Please make the above modifications in the playback path, not the recrd path. In your case, the Pc_1 - USB Audio - C5535 I2S master is similar to the CAF playback path (PC - USB Audio - C5535 I2S - AIC codec- J4) , and C5535 I2_Slave - USB Audio -PC2 is similar to the CAF record path (J3 - AIC codec- C5535 I2S - USB Audio - PC). Hence the changes should be along the lines of:

    1.  i2sInitPrms.i2sPb = PSP_I2S_TX_INST_ID. PSP_I2S_TX_INST_ID needs to be defined as PSP_I2S_0 in i2s_sample.h. For the same, comment out #define USE_I2S2_PB /* define to use I2S2 */ and uncomment  //#define USE_I2S0_PB /* define to use I2S0 */

    2. In i2s_sample.c, i2sTxConfig.i2sMode = PSP_I2S_SLAVE; needs to be changed to PSP_I2S_MASTER

    Best Regards.

  • Hi,

    Unfortunately this didn't solve my problem.

    I tried, as You suggested, to make changes only to the  playback path,but there is no CLK, and FS singnals on I2S0 lines. This is solved with changes in csl_usb_iso_fullspeed_example.c

      //pcgcr_value |= CSL_FMKT(SYS_PCGCR1_I2S0CG, DISABLED);
        pcgcr_value |= CSL_FMKT(SYS_PCGCR1_I2S1CG, DISABLED);
        pcgcr_value |= CSL_FMKT(SYS_PCGCR1_I2S2CG, DISABLED);
        pcgcr_value |= CSL_FMKT(SYS_PCGCR1_I2S3CG, DISABLED);

    When pcgcr values are configured as stated, CLK, and FS singnals appear but, ezDSP is not recognized   "USB Device Not Recognized" error is generated.

    These are the same results I get with

    i2s_sample.h

    /* Playback I2S selection */
    #define USE_I2S0_PB /* define to use I2S0 */
    //#define USE_I2S1_PB /* define to use I2S1 */
    //#define USE_I2S2_PB /* define to use I2S2 */
    //#define USE_I2S3_PB /* define to use I2S3 */

    /* Record I2S selection */
    #define USE_I2S0_REC /* define to use I2S0 */
    //#define USE_I2S1_REC /* define to use I2S1 */
    //#define USE_I2S2_REC /* define to use I2S2 */
    //#define USE_I2S3_REC /* define to use I2S3 */

    i2s_sample.c

    i2sTxConfig.i2sMode     = PSP_I2S_MASTER;
    i2sRxConfig.i2sMode      = PSP_I2S_MASTER;

    Best regards.

  • 1. Only I2S0 clk is being enabled. So you intend to use I2S0 interface on both C5535 devices.

    2.  Then i2s_sample.c should have the following modification

    on ezdsp1:   i2sTxConfig.i2sMode     = PSP_I2S_MASTER;
    on ezdsp2:   i2sRxConfig.i2sMode      = PSP_I2S_SLAVE;

    3. For the usb dev not getting recognized issue, check whether your code is setting the usb bit in PCGCR2 register thereby gating usbclk.

    4. Hope you're not making all these changes on the code running on both c5535 ezdsps and you're not using the same code on both ezdsps. The playback c5535 ezdsp1 should be having it's I2S0 configured for the playback path as a master and the record c5535 ezdsp2 should be having it's I2S0 configured as a slave for the record path. You may even disable record on C5535ezdsp1 and playback on ezdsp2.

     On ezdsp1 (playback path):

    i2sInitPrms.enablePlayback = TRUE;
    ...
    ...
    i2sInitPrms.enableRecord = FALSE;

    i2s_sample.h

    /* Playback I2S selection */
    #define USE_I2S0_PB /* define to use I2S0 */
    //#define USE_I2S1_PB /* define to use I2S1 */
    //#define USE_I2S2_PB /* define to use I2S2 */
    //#define USE_I2S3_PB /* define to use I2S3 */

    /* Record I2S selection */
    //#define USE_I2S0_REC /* define to use I2S0 */
    //#define USE_I2S1_REC /* define to use I2S1 */
    //#define USE_I2S2_REC /* define to use I2S2 */
    //#define USE_I2S3_REC /* define to use I2S3 */

    On ezdsp2 (record path):

    i2sInitPrms.enablePlayback = FALSE;
    ...
    ...
    i2sInitPrms.enableRecord = TRUE;

    i2s_sample.h

    /* Playback I2S selection */
    //#define USE_I2S0_PB /* define to use I2S0 */
    //#define USE_I2S1_PB /* define to use I2S1 */
    //#define USE_I2S2_PB /* define to use I2S2 */
    //#define USE_I2S3_PB /* define to use I2S3 */

    /* Record I2S selection */
    #define USE_I2S0_REC /* define to use I2S0 */
    //#define USE_I2S1_REC /* define to use I2S1 */
    //#define USE_I2S2_REC /* define to use I2S2 */
    //#define USE_I2S3_REC /* define to use I2S3 */

    Best Regards.

  • After a month of unplanned delay, I returned project regarding c5535 ezdsp. I am sad to say that the same problem still exists. I have once again tried everything you have suggested without any results.

    Once again just to be clear I want both ezdsp kits to sand and record audio data at the same

    i2s_sample.h

    /* Playback I2S selection */
    #define USE_I2S0_PB /* define to use I2S0 */
    //#define USE_I2S1_PB /* define to use I2S1 */
    //#define USE_I2S2_PB /* define to use I2S2 */
    //#define USE_I2S3_PB /* define to use I2S3 */

    /* Record I2S selection */
    #define USE_I2S0_REC /* define to use I2S0 */
    //#define USE_I2S1_REC /* define to use I2S1 */
    //#define USE_I2S2_REC /* define to use I2S2 */
    //#define USE_I2S3_REC /* define to use I2S3 */

    i2s_sample.c

    i2sTxConfig.i2sMode     = PSP_I2S_MASTER;

    ...

    i2sRxConfig.i2sMode      = PSP_I2S_MASTER;

     

    csl_usb_iso_fullspeed_example.c

    /* Initialize audio module */
      //result = AIC3254_init();
       result = 0;

    i2sInitPrms.enablePlayback = TRUE;
    i2sInitPrms.enableRecord = TRUE;

    // clock gating unused I2S (I2S 1, 2, 3)
    //pcgcr_value |= CSL_FMKT(SYS_PCGCR1_I2S0CG, DISABLED);
    pcgcr_value |= CSL_FMKT(SYS_PCGCR1_I2S1CG, DISABLED);
    pcgcr_value |= CSL_FMKT(SYS_PCGCR1_I2S2CG, DISABLED);
    pcgcr_value |= CSL_FMKT(SYS_PCGCR1_I2S3CG, DISABLED);

     

    I have tried your suggestion to use one dsp ezdsp1 as playback device and another ezdsp2 only as a record device with same results. USB device both on Windows7 and Ubuntu12.04 is not properly recognized (all audio programs ex Audacity starts to break) on master side. Slave ezdsp is working properly.

    If there is a reason why you suggester to me to use only one direction on one dsp please state it out?

    I am thinking that problem is in DMA interrupts but I can't figure it out.

    Best regards.

     

  • For changing the I2S to master mode, you should also change the settings of AIC codec to slave mode. 

    HW codec configurations are available in the file 'codec_aic3254.c' Change the value of register 27 of page 0 to '0x1' instead of 0xd for making BCLK and WCLK as input to codec. 

    Search for the below comment to find the place where codec master mode configuration is done in codec_aic3254.c

     // BCLK and WCLK is set as op to AIC3254(Master)

     

    - Pratap.

  • Pratap,

    Thank You very much for your reply. I have tried what you have suggested but with same results as before. All tests of I2S without CAF pass flawlessly in master and slave mode, but master mode in CAF does not work for me. I detect Fsync and clk signals as expected but no tx data. Also using aic3204 is not exactly what I would like to achieve, but it is a great test never the less. My main goal is to achieve this settup

    PC <- USB Audio -> C5535 <- I2S -> C5535 <- USB Audio -> PC

    Connected audio framework is used as I need for my device be connected to PC as audio card.