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.

Audio codec settings for AIC3254

Other Parts Discussed in Thread: TLV320AIC3254, CC3200SDK

Hello,

I am using the default Wifi Audio App example as provided in the latest SDK.

This example samples audio in 16bit, stereo with an sample rate of 16000.

How can i change the sample rate to: 8bit, mono and a sample rate of 8000.

Is there any documentation about how to set the audio codec registers?

Best regards,

Maurice

  • Hi, Maurice,

    The TLV320AIC3254 doesn't support 8-bit word length. It supports 16, 20, 24 and 32. Regarding the sample rate configuration, I would recommend to take a look at the link below:

    www.ti.com/.../slaa404c.pdf

    For more information, please consult the technical documents of this device:

    www.ti.com/.../technicaldocuments

    Please let me know if you have more questions or comments.

    Best regards,
    Luis Fernando Rodríguez S.
  • Hello Luis,

    I'm sorry, but i really can't figure it out.
    Could you help me with the correct register settings for 16bit at a sample rate of 8000 and mono sound?

    Best Regards,
    Maurice
  • Hi, Maurice,

    Could you give more details about the codec configuration that you are looking for? Which are the clock frequencies that you are using (BCLK, WCLK and MCLK)? Which are the inputs/output that you are going to use?

    Thank you.

    Best regards,
    Luis Fernando Rodríguez S.
  • Hello Luis,

    The codec configuration I am looking for is:

    16 bit, 8000 sample rate and mono recording. This is a clock frequencie of: 16*8000*1 = 128.000 (if I am right).

    I don't know which inputs/outputs i am going to use, i use the wifi_audio_app example in the cc3200SDK.

    Thank you for your help.

    Best regards,

    Maurice

  • Hi, Maurice,

    The clock frequency seems to be too low. Could you verify if the codec uses a MCLK? Additionally, is it possible to provide the actual configuration at 16bit, stereo with an sample rate of 16000? Do you have a register map to verify the information?

    Thank you.

    Best regards,
    Luis Fernando Rodríguez S.
  • Hello Luis,

    I don't know if it uses a MCLK. How can i verify that?

    This is my actual configuration:

    AudioCodecPageSelect(TI3254_PAGE_0);
    
    			AudioCodecRegWrite(TI3254_CLK_MUX_REG, 0x03);// PLL Clock is CODEC_CLKIN
    			AudioCodecRegWrite(TI3254_CLK_PLL_P_R_REG, 0x94);// PLL is powered up, P=1, R=4
    			AudioCodecRegWrite(TI3254_CLK_PLL_J_REG, 0x2A);		// J=42
    			AudioCodecRegWrite(TI3254_CLK_PLL_D_MSB_REG, 0x00);	// D = 0
    
    			AudioCodecRegWrite(TI3254_CLK_NDAC_REG, 0x8E);// NDAC divider powered up, NDAC = 14
    			AudioCodecRegWrite(TI3254_CLK_MDAC_REG, 0x81);// MDAC divider powered up, MDAC = 1
    			AudioCodecRegWrite(TI3254_DAC_OSR_MSB_REG, 0x01);// DOSR = 0x0180 = 384
    			AudioCodecRegWrite(TI3254_DAC_OSR_LSB_REG, 0x80);// DOSR = 0x0180 = 384
    
    			AudioCodecRegWrite(TI3254_CLK_NADC_REG, 0x95); // NADC divider powered up, NADC = 21
    			AudioCodecRegWrite(TI3254_CLK_MADC_REG, 0x82); // MADC divider powered up, MADC = 2
    			AudioCodecRegWrite(TI3254_ADC_OSR_REG, 0x80); // AOSR = 128 ((Use with PRB_R1 to PRB_R6, ADC Filter Type A)

    And this is the audioCaptureRenderConfiguration? (Settings MCLK AND BCLK, not sure about this)?

    if (dma)
    	{
    		if (bitClk == 512000)
    		{
    			MAP_PRCMI2SClockFreqSet(512000);
    			MAP_I2SConfigSetExpClk(I2S_BASE, 512000, bitClk,
    			I2S_SLOT_SIZE_16 |
    			I2S_PORT_DMA);
    		}

    Best Regards,

    Maurice

  • Hi, Maurice,

    Based on the PLL coefficients and dividers, the system seems to be using a PLL_CLKIN = 512 KHz. So, in order to get a sampling rate of 8000, I would recommend to modify the following lines:

    AudioCodecRegWrite(TI3254_CLK_MDAC_REG, 0x82);// MDAC divider powered up, MDAC = 2

    AudioCodecRegWrite(TI3254_CLK_MADC_REG, 0x84); // MADC divider powered up, MADC = 4

    Please let me know if you have questions or comments.

    Best regards,
    Luis Fernando Rodríguez S.

  • Hello Luis,

    This is working great, but how can I play the audio in mono sound?

    This is how I call the AudioCodec:

     

    AudioCodecConfig(AUDIO_CODEC_TI_3254, AUDIO_CODEC_16_BIT, 8000,
    	AUDIO_CODEC_STEREO, AUDIO_CODEC_SPEAKER_ALL,
    	AUDIO_CODEC_MIC_LINE_IN);

    Change that in:

    	AudioCodecConfig(AUDIO_CODEC_TI_3254, AUDIO_CODEC_16_BIT, 8000,
    	AUDIO_CODEC_MONO, AUDIO_CODEC_SPEAKER_ALL,
    	AUDIO_CODEC_MIC_LINE_IN);

    And

    	AudioCaptureRendererConfigure(AUDIO_CODEC_16_BIT, 8000, AUDIO_CODEC_STEREO,
    			RecordPlay, 1);

    Change that in:

    AudioCaptureRendererConfigure(AUDIO_CODEC_16_BIT, 8000, AUDIO_CODEC_MONO,
    			RecordPlay, 1);

    the audio plays good, but the network usage is still at 256.000kb/s.

    And if i am right:

    The following calculation makes it at 128.000kb/s

    16 * 8000 * 1 = 128.000 Clock speed, which can be translated to network usage.

    Thank you in advance,
    Best regards,
    Maurice