alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [alsa-devel] Counting links in simple-card
@ 2019-10-08 13:03 Daniel Baluta
  2019-10-08 13:30 ` Daniel Baluta
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Baluta @ 2019-10-08 13:03 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA

Hi Morimoto-san,

In simple-card.c simple_get_dais_count function there is this comment:

     * ex1)
     * CPU0 --- Codec0
     * CPU1 --- Codec1
     * CPU2 -----/
     * CPU3 --- Codec2
     *
     *    => 5 links = 2xCPU-Codec + 2xCPU-dummy + 1xdummy-Codec
     *    => 7 DAIs  = 4xCPU + 3xCodec
     *    => 1 ccnf  = 1xdummy-Codec


So, I don't understand exactly how did you get the formula for links. AFAICT
there should be 3 x CPU-Codec + 1 x CPU-dummy.

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

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

* Re: [alsa-devel] Counting links in simple-card
  2019-10-08 13:03 [alsa-devel] Counting links in simple-card Daniel Baluta
@ 2019-10-08 13:30 ` Daniel Baluta
  2019-10-09  0:18   ` Kuninori Morimoto
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Baluta @ 2019-10-08 13:30 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA

Also, I wonder how can i use simple-card to create just a backend link
CPU-dummy + Codec :).

Is this supported?

thanks,
Daniel.

On Tue, Oct 8, 2019 at 4:03 PM Daniel Baluta <daniel.baluta@gmail.com> wrote:
>
> Hi Morimoto-san,
>
> In simple-card.c simple_get_dais_count function there is this comment:
>
>      * ex1)
>      * CPU0 --- Codec0
>      * CPU1 --- Codec1
>      * CPU2 -----/
>      * CPU3 --- Codec2
>      *
>      *    => 5 links = 2xCPU-Codec + 2xCPU-dummy + 1xdummy-Codec
>      *    => 7 DAIs  = 4xCPU + 3xCodec
>      *    => 1 ccnf  = 1xdummy-Codec
>
>
> So, I don't understand exactly how did you get the formula for links. AFAICT
> there should be 3 x CPU-Codec + 1 x CPU-dummy.
>
> thanks,
> Daniel.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [alsa-devel] Counting links in simple-card
  2019-10-08 13:30 ` Daniel Baluta
@ 2019-10-09  0:18   ` Kuninori Morimoto
  2019-10-09  8:31     ` Daniel Baluta
  2019-10-10 20:40     ` Daniel Baluta
  0 siblings, 2 replies; 8+ messages in thread
From: Kuninori Morimoto @ 2019-10-09  0:18 UTC (permalink / raw)
  To: Daniel Baluta; +Cc: Linux-ALSA


Hi Daniel

> >      * ex1)
> >      * CPU0 --- Codec0
> >      * CPU1 --- Codec1
> >      * CPU2 -----/
> >      * CPU3 --- Codec2
> >      *
> >      *    => 5 links = 2xCPU-Codec + 2xCPU-dummy + 1xdummy-Codec
> >      *    => 7 DAIs  = 4xCPU + 3xCodec
> >      *    => 1 ccnf  = 1xdummy-Codec
> >
> >
> > So, I don't understand exactly how did you get the formula for links. AFAICT
> > there should be 3 x CPU-Codec + 1 x CPU-dummy.

CPU1/CPU2 and Codec1 are using DPCM.
Thus, it is...

 2xCPU-Codec:
	CPU0 - Codec0
	CPU3 - Codec2

 2xCPU-dummy:
	CPU1 - dummy
	CPU2 - dummy

 1xdummy-Codec:
	dummy - Codec1


> Also, I wonder how can i use simple-card to create just a backend link
> CPU-dummy + Codec :).
> 
> Is this supported?

Do you mean CPU-dummy + dummy-Codec ?
But anyway, simple-card/audio-graph DPCM support is very limited.
Unfortunately it doesn't have flexibility...

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] 8+ messages in thread

* Re: [alsa-devel] Counting links in simple-card
  2019-10-09  0:18   ` Kuninori Morimoto
@ 2019-10-09  8:31     ` Daniel Baluta
  2019-10-09 23:37       ` Kuninori Morimoto
  2019-10-10 20:40     ` Daniel Baluta
  1 sibling, 1 reply; 8+ messages in thread
From: Daniel Baluta @ 2019-10-09  8:31 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA

On Wed, Oct 9, 2019 at 3:18 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
>
>
> Hi Daniel
>
> > >      * ex1)
> > >      * CPU0 --- Codec0
> > >      * CPU1 --- Codec1
> > >      * CPU2 -----/
> > >      * CPU3 --- Codec2
> > >      *
> > >      *    => 5 links = 2xCPU-Codec + 2xCPU-dummy + 1xdummy-Codec
> > >      *    => 7 DAIs  = 4xCPU + 3xCodec
> > >      *    => 1 ccnf  = 1xdummy-Codec
> > >
> > >
> > > So, I don't understand exactly how did you get the formula for links. AFAICT
> > > there should be 3 x CPU-Codec + 1 x CPU-dummy.
>
> CPU1/CPU2 and Codec1 are using DPCM.
> Thus, it is...
>
>  2xCPU-Codec:
>         CPU0 - Codec0
>         CPU3 - Codec2
>
>  2xCPU-dummy:
>         CPU1 - dummy
>         CPU2 - dummy
>
>  1xdummy-Codec:
>         dummy - Codec1
>
>
> > Also, I wonder how can i use simple-card to create just a backend link
> > CPU-dummy + Codec :).
> >
> > Is this supported?
>
> Do you mean CPU-dummy + dummy-Codec ?
> But anyway, simple-card/audio-graph DPCM support is very limited.
> Unfortunately it doesn't have flexibility...


Yes, exactly. I need 1 DAI link with 1 FE + 1 BE for DSP / SOF  usecase.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [alsa-devel] Counting links in simple-card
  2019-10-09  8:31     ` Daniel Baluta
@ 2019-10-09 23:37       ` Kuninori Morimoto
  2019-10-10 14:46         ` Daniel Baluta
  0 siblings, 1 reply; 8+ messages in thread
From: Kuninori Morimoto @ 2019-10-09 23:37 UTC (permalink / raw)
  To: Daniel Baluta; +Cc: Linux-ALSA


Hi Daniel

> > Do you mean CPU-dummy + dummy-Codec ?
> > But anyway, simple-card/audio-graph DPCM support is very limited.
> > Unfortunately it doesn't have flexibility...
> 
> Yes, exactly. I need 1 DAI link with 1 FE + 1 BE for DSP / SOF  usecase.

simple-card support it
if it needs convert-rate or convert-channels.
Please check below

	static simple_for_each_link(xxx)
	{
		...
		for_each_child_of_node(node, np) {
			/*
			 * It is DPCM
			 * if it has many CPUs,
			 * or has convert-xxx property
			 */
(1)			if (dpcm_selectable &&
(2)			    (num > 2 ||
(3)			     adata.convert_rate || adata.convert_channels))
				ret = func_dpcm(priv, np, codec, li, is_top);
			...

(1) : using simple-scu-audio-card
(2) : 2 nodes or more
(3) : has convert-xxx property

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] 8+ messages in thread

* Re: [alsa-devel] Counting links in simple-card
  2019-10-09 23:37       ` Kuninori Morimoto
@ 2019-10-10 14:46         ` Daniel Baluta
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Baluta @ 2019-10-10 14:46 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Linux-ALSA, S.j. Wang, Pierre-Louis Bossart, Liam Girdwood,
	Jerome Laclavere, Guido Roncarolo

Thanks for your answer. See my comments inline

On Thu, Oct 10, 2019 at 2:37 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
>
>
> Hi Daniel
>
> > > Do you mean CPU-dummy + dummy-Codec ?
> > > But anyway, simple-card/audio-graph DPCM support is very limited.
> > > Unfortunately it doesn't have flexibility...
> >
> > Yes, exactly. I need 1 DAI link with 1 FE + 1 BE for DSP / SOF  usecase.
>
> simple-card support it
> if it needs convert-rate or convert-channels.

Yes, but this is needed for ASRC-like components. I don't think I can abuse
this usage for my usecase.

> Please check below
>
>         static simple_for_each_link(xxx)
>         {
>                 ...
>                 for_each_child_of_node(node, np) {
>                         /*
>                          * It is DPCM
>                          * if it has many CPUs,
>                          * or has convert-xxx property
>                          */
> (1)                     if (dpcm_selectable &&
> (2)                         (num > 2 ||
> (3)                          adata.convert_rate || adata.convert_channels))
>                                 ret = func_dpcm(priv, np, codec, li, is_top);
>                         ...
>
> (1) : using simple-scu-audio-card
> (2) : 2 nodes or more
> (3) : has convert-xxx property
>

In fact I just need 1 BE DAI link. My use case is with SOF where the
FE will be added by topology.

I think I can modify simple-card to do this. Just let me know if you
see something obviously wrong
on making the simple-card / simple-scu-card handling this case with
creating just 1 BE DAI link.

Maybe add a property like "dpcm".
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [alsa-devel] Counting links in simple-card
  2019-10-09  0:18   ` Kuninori Morimoto
  2019-10-09  8:31     ` Daniel Baluta
@ 2019-10-10 20:40     ` Daniel Baluta
  2019-10-11  0:41       ` Kuninori Morimoto
  1 sibling, 1 reply; 8+ messages in thread
From: Daniel Baluta @ 2019-10-10 20:40 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA

On Wed, Oct 9, 2019 at 3:18 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
>
>
> Hi Daniel
>
> > >      * ex1)
> > >      * CPU0 --- Codec0
> > >      * CPU1 --- Codec1
> > >      * CPU2 -----/
> > >      * CPU3 --- Codec2
> > >      *
> > >      *    => 5 links = 2xCPU-Codec + 2xCPU-dummy + 1xdummy-Codec
> > >      *    => 7 DAIs  = 4xCPU + 3xCodec
> > >      *    => 1 ccnf  = 1xdummy-Codec
> > >
> > >
> > > So, I don't understand exactly how did you get the formula for links. AFAICT
> > > there should be 3 x CPU-Codec + 1 x CPU-dummy.
>
> CPU1/CPU2 and Codec1 are using DPCM.
> Thus, it is...
>
>  2xCPU-Codec:
>         CPU0 - Codec0
>         CPU3 - Codec2
>
>  2xCPU-dummy:
>         CPU1 - dummy
>         CPU2 - dummy
>
>  1xdummy-Codec:
>         dummy - Codec1

One more question: How would you describe in the DTS this scenario. Is
this, correct?

machine_drv {
        compatible = "simple-card";

        simple-audio-card,dai-link@0 {
           cpu {
                  sound-dai=<&cpu0>;
           }
           codec {
                 sound-dai=<&Codec0>;
           }
       }

simple-audio-card,dai-link@1 {
           cpu {
                  sound-dai=<&cpu3>;
           }
           codec {
                 sound-dai=<&Codec2>;
           }
       }


simple-audio-card,dai-link@2 {
           cpu {
                  sound-dai=<&cpu1>;
           }
       }



simple-audio-card,dai-link@3 {
           cpu {
                  sound-dai=<&cpu2>;
           }
       }

simple-audio-card,dai-link@4{
           cpu {
                  sound-dai=<&Codec1>;
           }
       }
};
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [alsa-devel] Counting links in simple-card
  2019-10-10 20:40     ` Daniel Baluta
@ 2019-10-11  0:41       ` Kuninori Morimoto
  0 siblings, 0 replies; 8+ messages in thread
From: Kuninori Morimoto @ 2019-10-11  0:41 UTC (permalink / raw)
  To: Daniel Baluta; +Cc: Linux-ALSA


Hi Daniel

Thank you for your email

> I think I can modify simple-card to do this. Just let me know if you
> see something obviously wrong
> on making the simple-card / simple-scu-card handling this case with
> creating just 1 BE DAI link.

Current DPCM support is used for "TDM-Split mode",
"MIXer", "Sampling rate convert" for now.

But, of course I have no objection if you can add new feature.

> simple-audio-card,dai-link@2 {
>            cpu {
>                   sound-dai=<&cpu1>;
>            }
>        }

It looks FE, but is this for BE ?

> Maybe add a property like "dpcm".

I think property "dpcm" is very ALSA-SoC naming, DT guy don't like it (?).
"simple-xxx-card" (1) or new node (2) can be acceptable ?
I'm not sure...

	machine_drv {
(1)	        compatible = "simple-xxx-card";
		...

		simple-audio-card,dai-link@2 {
(2)			dpcm-fe {
				sound-dai=<&cpu1>;
				...

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] 8+ messages in thread

end of thread, other threads:[~2019-10-11  0:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-08 13:03 [alsa-devel] Counting links in simple-card Daniel Baluta
2019-10-08 13:30 ` Daniel Baluta
2019-10-09  0:18   ` Kuninori Morimoto
2019-10-09  8:31     ` Daniel Baluta
2019-10-09 23:37       ` Kuninori Morimoto
2019-10-10 14:46         ` Daniel Baluta
2019-10-10 20:40     ` Daniel Baluta
2019-10-11  0:41       ` 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).