[alsa-devel] simple card, asymetrical configuration

Michael Walle michael at walle.cc
Tue Dec 3 02:22:26 CET 2019


Hi Kuninori,

Am 2019-12-03 01:54, schrieb Kuninori Morimoto:
> Hi Michael
> 
>> sound {
>> 	compatible = "simple-audio-card";
>> 	simple-audio-card,format = "i2s";
>> [snip]
>> 	simple-audio-card,bitclock-master = <&dailink0_master>;
>> 	simple-audio-card,frame-master = <&dailink0_master>;
>> 
>> 	simple-audio-card,cpu at 0 {
>> 		sound-dai = <&sai6>;
>> 	};
>> 
>> 	simple-audio-card,cpu at 1 {
>> 		sound-dai = <&sai5>;
>> 	};
>> 
>> 	dailink0_master: simple-audio-card,codec {
>> 		sound-dai = <&wm8904>;
>> 	};
>> };
>> 
>> Just for the background, I have hardware with the LS1028A which only
>> have unidirectional SAIs. But two of those SAIs (one for playback and
>> one for capture) are connected to one codec (with a shared bit and
>> frame clock).
>> 
>> So I thought the example in the simple-card bindings makes sense for
>> my case. Although I don't really know what "(Mixing)" means.
>> 
>> Nevertheless, using the fragment above, the kernel oopses or fails to
>> probe the hardware. I've traced that back to the following:
>>  - the count is correct: the kernel reports "link 2, dais 3, ccnf
>> 0". please note the 3 dais here.
>>  - but simple_dai_link_of() will always "allocate" two dais from the
>> pool:
>> 
>>         cpu_dai                 =
>>         dai_props->cpu_dai      = &priv->dais[li->dais++];
>>         codec_dai               =
>>         dai_props->codec_dai    = &priv->dais[li->dais++];
>> 
>> While this still works for the first link, the second one will fail
>> because codec_dai will not be valid.
>> 
>> Btw, converting that to two explicit dai-link nodes, the dai count
>> will be 4 and it will work.
>> 
>> Is my use case correct or should I use the two explicit dai-link
>> nodes? But in any case there seems to be a bug in simple-card.
> 
> I guess you want to use "simple-scu-audio-card"
> instead of "simple-audio-card" in this case ?
> 
> 	sound {
> -		compatible = "simple-audio-card";
> +		compatible = "simple-scu-audio-card";

Thanks, I'll try that tomorrow.

But nevertheless, shouldn't there be a check for a misconfiguration? At 
least the bindings document should mention that this configuration is 
only valid for for the "scu" case. Oh and I've just had a look, the 
compatible string of this configuration is "simple-audio-card" in 
Documentation/devicetree/bindings/sound/simple-card.txt.

-michael


More information about the Alsa-devel mailing list