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.

how to feed external clock to McASP for an ALSA audio codec driver?

My question is:

How to feed external clock to McASP for an audio codec connected to it?

In following wiki Link from TI site, http://processors.wiki.ti.com/index.php/Processor_SDK_Linux_Audio , comments for setting DAI clock (ret = snd_soc_dai_set_sysclk(cpu_dai, 0, sysclk, SND_SOC_CLOCK_OUT);) states:

" ALSA knows that we will be using the internal 24 MHz clock as sysclk for the McASP rather than using an external oscillator as is the case with many Sitara EVMs."

Is anyone can point me to a Sitara EVM that uses external oscillator to feed McASP and ALSA and the corresponding audio driver? I am looking for a reference to do the same with my Sitara-based target HW.

My external clock is actually coming from the Codec (Codec Bit and Frame Clock Master).

I am using Linux based TI-SDK version 7.0 for am335x.

  • Hi,

    I will ask the SW team to look at this. As for hardware, there are no TI AM335X EVMs with external oscillator for audio.
  • Hi,

    In order to make alsa aware that it will be using an external sys clock, you need to change the last parameter passed to snd_soc_dai_set_sysclk()
    SND_SOC_CLOCK_OUT - internal clock is used as sysclock
    SND_SOC_CLOCK_IN - external clock is used as sysclock

    So you need to use:
    ret = snd_soc_dai_set_sysclk(cpu_dai, 0, sysclk, SND_SOC_CLOCK_IN);

    Hope this helps.

    Best Regards,
    Yordan
  • I think the AM335x EVM is a similar set up to what you want:

    processors.wiki.ti.com/.../Sitara_Linux_Audio_Hardware_Overview

    As you can see from the diagram, the codec is bit clock and frame sync master (so it is supplying clocks to McASP, except for Master Clock, which is not needed).

    Notice in the davinci-evm.c file how the GP EVM is set up for CBM CFM (codec is bit clock and frame sync master).

    static struct snd_soc_dai_link evm_dai_tlv320aic3x = {
    588	
    	.name		= "TLV320AIC3X",
    589	
    	.stream_name	= "AIC3X",
    590	
    	.codec_dai_name	= "tlv320aic3x-hifi",
    591	
    	.ops            = &evm_ops,
    592	
    	.init           = evm_aic3x_init,
    593	
    	.dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBM_CFM |
    594	
    		   SND_SOC_DAIFMT_IB_NF,
    595	
    };