Post Go back to editing

Daisy Chaining two AD1938 codecs - ALSA System on Chip driver

Hi there,

we are trying to extend our audio system by daisy chaining two AD1938 audio codecs. From the datasheet I got the information that both codecs are configured equally (512 fs DACs / 256 fs ADCs / single line TDM mode). So, of course, both codecs appear as one codec to the platform DAI. I think it should work, if both codecs are configured equally in series via regmap in the codec driver. For example:

static int ad193x_hw_params(...){

   ...

   regmap_update_bits(ad193x_0->regmap, AD193X_PLL_CLK_CTRL0, AD193X_PLL_INPUT_MASK, master_rate);

   regmap_update_bits(ad193x_1->regmap, AD193X_PLL_CLK_CTRL0, AD193X_PLL_INPUT_MASK, master_rate);

   ...

}

Does anybody know, how to pass two regmap configs to the driver, so that I can configure both codecs in the same way? Or any other idea how to get two daisy chained codecs working with ALSA?

Thanks!

Parents
  • Hello henrix,

    You have to clock both parts with the exact same master clock. You cannot use two different crystals. They will never run at the same rate and you need exactly 256 MCLK transitions per frame otherwise you will get clicks, pops or nothing out.

    I would look into using a clock/oscillator module instead of a crystal. Then feed that into one MCLK input and take the MCLK output to feed to other codec's MCLK input.

    Dave T

Reply
  • Hello henrix,

    You have to clock both parts with the exact same master clock. You cannot use two different crystals. They will never run at the same rate and you need exactly 256 MCLK transitions per frame otherwise you will get clicks, pops or nothing out.

    I would look into using a clock/oscillator module instead of a crystal. Then feed that into one MCLK input and take the MCLK output to feed to other codec's MCLK input.

    Dave T

Children
No Data