All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] question regarding codec DAI ops
@ 2014-06-20 14:07 Arnaud Pouliquen
  2014-06-21 10:26 ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Arnaud Pouliquen @ 2014-06-20 14:07 UTC (permalink / raw)
  To: alsa-devel; +Cc: broonie, lgirdwood

Hello,

I have a platform with several audio IOs (DAC , HDMI...) and I2S In/out 
connectors.
I'm using my codec driver but for this I2S output i used dummy codec 
driver with the snd-soc-dummy-dai dai.

On platform side I have several instances of CPU DAI, and  i'm using 
helpers function like snd_soc_dai_set_tdm_slot to configure associated 
codec DAIs.

My issue is that these functions return error for my I2S output because 
ops functions are not implemented in dummy driver.

I see 3 solutions:
- implement ops in dummy drivers ( soc-utils)
- return 0 instead of error when ops is not implemented ( soc-core)
- Add a test  in my driver on ops before calling it.

First one seems the best compromise to avoid to accumulate tests in 
platform drivers.

 From your point of view, what should be best solution?

BR

Arnaud

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

* Re: [RFC] question regarding codec DAI ops
  2014-06-20 14:07 [RFC] question regarding codec DAI ops Arnaud Pouliquen
@ 2014-06-21 10:26 ` Mark Brown
  2014-06-23  7:30   ` Arnaud Pouliquen
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2014-06-21 10:26 UTC (permalink / raw)
  To: Arnaud Pouliquen; +Cc: alsa-devel, lgirdwood


[-- Attachment #1.1: Type: text/plain, Size: 557 bytes --]

On Fri, Jun 20, 2014 at 04:07:03PM +0200, Arnaud Pouliquen wrote:

> I have a platform with several audio IOs (DAC , HDMI...) and I2S In/out
> connectors.
> I'm using my codec driver but for this I2S output i used dummy codec driver
> with the snd-soc-dummy-dai dai.

Why are you using the dummy driver?  This is intended to stub things out
in some DPCM situations rather than as something that should be used in
normal code.

> From your point of view, what should be best solution?

I think we need to take a step back and work out what the goal is here.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: [RFC] question regarding codec DAI ops
  2014-06-21 10:26 ` Mark Brown
@ 2014-06-23  7:30   ` Arnaud Pouliquen
  2014-06-30 10:31     ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Arnaud Pouliquen @ 2014-06-23  7:30 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown, lgirdwood


On 06/21/2014 12:26 PM, Mark Brown wrote:
> On Fri, Jun 20, 2014 at 04:07:03PM +0200, Arnaud Pouliquen wrote:
>
>> I have a platform with several audio IOs (DAC , HDMI...) and I2S In/out
>> connectors.
>> I'm using my codec driver but for this I2S output i used dummy codec driver
>> with the snd-soc-dummy-dai dai.
> Why are you using the dummy driver?  This is intended to stub things out
> in some DPCM situations rather than as something that should be used in
> normal code.
My platform is a base for several projects and customers. In this 
context some extra I2S bus are available for extensions.
I have  two use cases to support.
- Possibility to test I2S bus without audio codec associated.
- Support client that does not use ASOC for audio codec ( a.e one 
manage  HDMI in his display driver...)
To be able to support these use cases i use device tree to construct the 
alsa card.  if no asoc codec present, i connect dummy one.
If customer want to use another codec they have just  to change device 
tree.
Here is an example of my device tree declaration.
     sound {
         compatible = "st,snd-soc-sti";
         st,card-name = "audio";
         st,audio-routing =
             /* Analog out route */
             "Analog out","DAC",
             "DAC","dac_p";

         st,asoc-platform = <&sti_asoc_platform>;
         backend-name  = "HDMI_out", "PCM_out",
                     "Analog_out", "spdif",
                     "HDMI_in", "PCM_in";
         backend-cpu-dai = <&snd_uni_player0 &snd_uni_player1
                     &snd_uni_player2 &snd_uni_player3
                     &snd_uni_reader0 &snd_uni_reader1 >;
         backend-codec = <&sti_sasg_codec 0
                     &sti_sasg_codec &sti_sasg_codec
                     0 0>;
         backend-codec-dai = "sas-dai-hdmi-out", "snd-soc-dummy-dai",
                     "sas-dai-dac", "sas-dai-spdif-out",
                     "snd-soc-dummy-dai","snd-soc-dummy-dai";
     };

backend-codec  specify the codec driver. If 0 dummy codec is used.
>
>>  From your point of view, what should be best solution?
> I think we need to take a step back and work out what the goal is here.

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

* Re: [RFC] question regarding codec DAI ops
  2014-06-23  7:30   ` Arnaud Pouliquen
@ 2014-06-30 10:31     ` Mark Brown
  2014-07-01  9:28       ` Arnaud Pouliquen
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2014-06-30 10:31 UTC (permalink / raw)
  To: Arnaud Pouliquen; +Cc: alsa-devel, lgirdwood


[-- Attachment #1.1: Type: text/plain, Size: 2556 bytes --]

On Mon, Jun 23, 2014 at 09:30:19AM +0200, Arnaud Pouliquen wrote:
> On 06/21/2014 12:26 PM, Mark Brown wrote:
> >On Fri, Jun 20, 2014 at 04:07:03PM +0200, Arnaud Pouliquen wrote:

> >>I have a platform with several audio IOs (DAC , HDMI...) and I2S In/out
> >>connectors.
> >>I'm using my codec driver but for this I2S output i used dummy codec driver
> >>with the snd-soc-dummy-dai dai.

> >Why are you using the dummy driver?  This is intended to stub things out
> >in some DPCM situations rather than as something that should be used in
> >normal code.

> My platform is a base for several projects and customers. In this context
> some extra I2S bus are available for extensions.
> I have  two use cases to support.
> - Possibility to test I2S bus without audio codec associated.
> - Support client that does not use ASOC for audio codec ( a.e one manage
> HDMI in his display driver...)

> To be able to support these use cases i use device tree to construct the
> alsa card.  if no asoc codec present, i connect dummy one.

No, this is is not at all sensible - don't do that.  Think about it for
a minute - if this were something we wanted to do it's going to apply
just as much to any other I2S controller so we should be doing it in the
core.  If the user really wants to look at the signals with a scope they
are probably capable of providing a suitable driver for their purposes.

> If customer want to use another codec they have just  to change device tree.
> Here is an example of my device tree declaration.

>     sound {
>         compatible = "st,snd-soc-sti";
>         st,card-name = "audio";
>         st,audio-routing =
>             /* Analog out route */
>             "Analog out","DAC",
>             "DAC","dac_p";
> 
>         st,asoc-platform = <&sti_asoc_platform>;
>         backend-name  = "HDMI_out", "PCM_out",
>                     "Analog_out", "spdif",
>                     "HDMI_in", "PCM_in";
>         backend-cpu-dai = <&snd_uni_player0 &snd_uni_player1
>                     &snd_uni_player2 &snd_uni_player3
>                     &snd_uni_reader0 &snd_uni_reader1 >;
>         backend-codec = <&sti_sasg_codec 0
>                     &sti_sasg_codec &sti_sasg_codec
>                     0 0>;
>         backend-codec-dai = "sas-dai-hdmi-out", "snd-soc-dummy-dai",
>                     "sas-dai-dac", "sas-dai-spdif-out",
>                     "snd-soc-dummy-dai","snd-soc-dummy-dai";
>     };

This looks a lot like you're trying to reinvent simple-card.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: [RFC] question regarding codec DAI ops
  2014-06-30 10:31     ` Mark Brown
@ 2014-07-01  9:28       ` Arnaud Pouliquen
  2014-07-01 10:14         ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Arnaud Pouliquen @ 2014-07-01  9:28 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, lgirdwood


On 06/30/2014 12:31 PM, Mark Brown wrote:
> On Mon, Jun 23, 2014 at 09:30:19AM +0200, Arnaud Pouliquen wrote:
>> On 06/21/2014 12:26 PM, Mark Brown wrote:
>>> On Fri, Jun 20, 2014 at 04:07:03PM +0200, Arnaud Pouliquen wrote:
>>>> I have a platform with several audio IOs (DAC , HDMI...) and I2S In/out
>>>> connectors.
>>>> I'm using my codec driver but for this I2S output i used dummy codec driver
>>>> with the snd-soc-dummy-dai dai.
>>> Why are you using the dummy driver?  This is intended to stub things out
>>> in some DPCM situations rather than as something that should be used in
>>> normal code.
>> My platform is a base for several projects and customers. In this context
>> some extra I2S bus are available for extensions.
>> I have  two use cases to support.
>> - Possibility to test I2S bus without audio codec associated.
>> - Support client that does not use ASOC for audio codec ( a.e one manage
>> HDMI in his display driver...)
>> To be able to support these use cases i use device tree to construct the
>> alsa card.  if no asoc codec present, i connect dummy one.
> No, this is is not at all sensible - don't do that.  Think about it for
> a minute - if this were something we wanted to do it's going to apply
> just as much to any other I2S controller so we should be doing it in the
> core.
In fact what i really need is a dummy codec driver.
But, perhaps, may i the only one to see advantages of using a dummy codec.
if it is the case i will implement a dummy DAI in my codec driver.
Otherwise tell me if you are interested in a generic dummy codec drivers.

>   If the user really wants to look at the signals with a scope they
> are probably capable of providing a suitable driver for their purposes.
Unfortunately, my experience tells me otherwise.
>
>> If customer want to use another codec they have just  to change device tree.
>> Here is an example of my device tree declaration.
>>      sound {
>>          compatible = "st,snd-soc-sti";
>>          st,card-name = "audio";
>>          st,audio-routing =
>>              /* Analog out route */
>>              "Analog out","DAC",
>>              "DAC","dac_p";
>>
>>          st,asoc-platform = <&sti_asoc_platform>;
>>          backend-name  = "HDMI_out", "PCM_out",
>>                      "Analog_out", "spdif",
>>                      "HDMI_in", "PCM_in";
>>          backend-cpu-dai = <&snd_uni_player0 &snd_uni_player1
>>                      &snd_uni_player2 &snd_uni_player3
>>                      &snd_uni_reader0 &snd_uni_reader1 >;
>>          backend-codec = <&sti_sasg_codec 0
>>                      &sti_sasg_codec &sti_sasg_codec
>>                      0 0>;
>>          backend-codec-dai = "sas-dai-hdmi-out", "snd-soc-dummy-dai",
>>                      "sas-dai-dac", "sas-dai-spdif-out",
>>                      "snd-soc-dummy-dai","snd-soc-dummy-dai";
>>      };
> This looks a lot like you're trying to reinvent simple-card.
Ok , not see that last versions of simple card manage multi DAI links.
i will check if compatible with my design to reuse it instead of my 
machine driver.
Thanks for the remarks.

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

* Re: [RFC] question regarding codec DAI ops
  2014-07-01  9:28       ` Arnaud Pouliquen
@ 2014-07-01 10:14         ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2014-07-01 10:14 UTC (permalink / raw)
  To: Arnaud Pouliquen; +Cc: alsa-devel, lgirdwood


[-- Attachment #1.1: Type: text/plain, Size: 863 bytes --]

On Tue, Jul 01, 2014 at 11:28:44AM +0200, Arnaud Pouliquen wrote:
> On 06/30/2014 12:31 PM, Mark Brown wrote:

> >No, this is is not at all sensible - don't do that.  Think about it for
> >a minute - if this were something we wanted to do it's going to apply
> >just as much to any other I2S controller so we should be doing it in the
> >core.

> In fact what i really need is a dummy codec driver.
> But, perhaps, may i the only one to see advantages of using a dummy codec.
> if it is the case i will implement a dummy DAI in my codec driver.
> Otherwise tell me if you are interested in a generic dummy codec drivers.

This does not seem like a good idea, but then the only use case you've
articulated is running with no CODEC connected which doesn't seem
terribly useful and certainly doesn't seem like something we should be
open coding in a machine driver.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

end of thread, other threads:[~2014-07-01 10:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-20 14:07 [RFC] question regarding codec DAI ops Arnaud Pouliquen
2014-06-21 10:26 ` Mark Brown
2014-06-23  7:30   ` Arnaud Pouliquen
2014-06-30 10:31     ` Mark Brown
2014-07-01  9:28       ` Arnaud Pouliquen
2014-07-01 10:14         ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.