alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [alsa-devel] simple card, asymetrical configuration
@ 2019-12-02 13:25 Michael Walle
  2019-12-03  0:54 ` Kuninori Morimoto
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Walle @ 2019-12-02 13:25 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: alsa-devel

Hi Kuninori,

there seems to be a problem in the simple-card using the following 
device tree fragment:

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@0 {
		sound-dai = <&sai6>;
	};

	simple-audio-card,cpu@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.

-michael
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [alsa-devel] simple card, asymetrical configuration
  2019-12-02 13:25 [alsa-devel] simple card, asymetrical configuration Michael Walle
@ 2019-12-03  0:54 ` Kuninori Morimoto
  2019-12-03  1:22   ` Michael Walle
  0 siblings, 1 reply; 4+ messages in thread
From: Kuninori Morimoto @ 2019-12-03  0:54 UTC (permalink / raw)
  To: Michael Walle; +Cc: alsa-devel


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@0 {
> 		sound-dai = <&sai6>;
> 	};
> 
> 	simple-audio-card,cpu@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";


Thank you for your help !!
Best regards
---
Kuninori Morimoto
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [alsa-devel] simple card, asymetrical configuration
  2019-12-03  0:54 ` Kuninori Morimoto
@ 2019-12-03  1:22   ` Michael Walle
  2019-12-03  4:49     ` Kuninori Morimoto
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Walle @ 2019-12-03  1:22 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: alsa-devel

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@0 {
>> 		sound-dai = <&sai6>;
>> 	};
>> 
>> 	simple-audio-card,cpu@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
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [alsa-devel] simple card, asymetrical configuration
  2019-12-03  1:22   ` Michael Walle
@ 2019-12-03  4:49     ` Kuninori Morimoto
  0 siblings, 0 replies; 4+ messages in thread
From: Kuninori Morimoto @ 2019-12-03  4:49 UTC (permalink / raw)
  To: Michael Walle; +Cc: alsa-devel


Hi Michael

> But nevertheless, shouldn't there be a check for a misconfiguration?

Yeah, maybe.

> 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.

Between ourselves, historically, "scu" user was only me, and was used locally.
At one point, "simple-audio-card" had been handled both, but noticed that
it is impossible or will be super very complex.
Because I was the only user of "scu", it is separated.

"scu" is for DPCM, but is covering only one part.
It is not enough for generic use case...

Thank you for your help !!
Best regards
---
Kuninori Morimoto
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-03  4:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-02 13:25 [alsa-devel] simple card, asymetrical configuration Michael Walle
2019-12-03  0:54 ` Kuninori Morimoto
2019-12-03  1:22   ` Michael Walle
2019-12-03  4:49     ` Kuninori Morimoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).