[alsa-devel] ASoC: multicodec: How to specify one codec as master and all others as slave

Caleb Crome caleb at crome.org
Wed Jan 13 00:24:05 CET 2016


Hi there,
   With a multi-codec setup, what's the 'correct' way to tell one
codec to be master (i.e. send bit/word clock) and all the others to be
slave?

For example, I've got 8 stereo codecs (4x aic34), labeled, say aic_a,
aic_b, aic_c, aic_d, aic_e, aic_f, aic_g, aic_h, and I want

aic_a:
SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_DSP_A

and all others to see
SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_DSP_A

Is there an elegant way to do that?

I see in soc-core.c:snd_soc_runtime_set_dai_fmt(rtd, dai_fmt) that it
sets all codecs to the same format, then flips the polarity for the
CPU.

It seems this is not really correct behavior in multicodec mode when
the codec is master, right?  Should there be some way to mark one of
the many possibilities as the master?

My current thinking is to not set snd_soc_dai_link.dai_fmt to prevent
snd_soc_runtime_set_dai_fmt from doing the wrong thing, then call each
individual snd_soc_dai_set_fmt from the init function.

Thanks,
  --Caleb


More information about the Alsa-devel mailing list