AnsweredAssumed Answered

How Configure ad1939 both as Both a Frame and Bit Clk slave to BF537

Question asked by svacca@valcom.com on Jan 19, 2018

BF537, uClinux 2011R1, ad1939 CODEC, ALSA.

 

I am currently using an ad1939 CODEC as both a Frame and Bit Clk Master to a BF537, successfully.
I want to experiment with using the ad1939 CODEC as both a Frame and Bit Clk Slave to the BF537.

When I modify the Alsa driver, to do this, it gives an error.


When the ad1939 is specified as a both Frame and Bit Clk Master,
it is set as the following, in sound/soc/blackfin/bf5xx-ad193x.c, and is successful:

 

   /* set cpu DAI configuration */
   ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_A |
           SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_CBM_CFM);     //CODEC is clk & FRM master.
   if (ret < 0)
     return ret;

 

   /* set codec DAI configuration */
   ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_DSP_A |     //CODEC is clk & FRM master.
           SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_CBM_CFM);
    if (ret < 0)
      return ret;

 


But, when it is specified as a both Frame and Bit Clk Slave,
it is set as the following, and fails:

 

   /* set cpu DAI configuration */
   ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_A |
           SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_CBS_CFS);     //CODEC is clk & FRM slave.
    if (ret < 0)
      return ret;

 

  /* set codec DAI configuration */
  ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_DSP_A |
          SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_CBS_CFS);     //CODEC is clk & FRM slave.
   if (ret < 0)
     return ret;


The failure msg is: 'asoc machine hw_params failed'.

Three of the 4 possible Master/Slave combinations fail, with only the ad1939, as both Masters, succeeding.

Outcomes