ASoC: soc-core: Set dpcm_playback / dpcm_capture
diff mbox series

Message ID 20191204151333.26625-1-daniel.baluta@nxp.com
State Accepted
Commit 218fe9b7ec7f32c10a07539365488d80af7b0084
Headers show
Series
  • ASoC: soc-core: Set dpcm_playback / dpcm_capture
Related show

Commit Message

Daniel Baluta Dec. 4, 2019, 3:13 p.m. UTC
When converting a normal link to a DPCM link we need
to set dpcm_playback / dpcm_capture otherwise playback/capture
streams will not be created resulting in errors like this:

[   36.039111]  sai1-wm8960-hifi: ASoC: no backend playback stream

Fixes: a655de808cbde ("ASoC: core: Allow topology to override machine driver FE DAI link config")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
---
 sound/soc/soc-core.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Sridharan, Ranjani Dec. 4, 2019, 11:29 p.m. UTC | #1
On Wed, Dec 4, 2019 at 7:16 AM Daniel Baluta <daniel.baluta@nxp.com> wrote:

> When converting a normal link to a DPCM link we need
> to set dpcm_playback / dpcm_capture otherwise playback/capture
> streams will not be created resulting in errors like this:
>
> [   36.039111]  sai1-wm8960-hifi: ASoC: no backend playback stream
>
> Fixes: a655de808cbde ("ASoC: core: Allow topology to override machine
> driver FE DAI link config")
> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
> ---
>  sound/soc/soc-core.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index 977a7bfad519..f89cf9d0860c 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -1872,6 +1872,8 @@ static void soc_check_tplg_fes(struct snd_soc_card
> *card)
>
>                         /* convert non BE into BE */
>                         dai_link->no_pcm = 1;
> +                       dai_link->dpcm_playback = 1;
> +                       dai_link->dpcm_capture = 1;
>
Hi Daniel,

Typically, for Intel platforms, this information comes from the machine
driver and there are some DAI links that have either playback or capture
set. But this change would set both for all DAI links.
Not sure if this is the right thing to do.

Thanks,
Ranjani

>
>                         /* override any BE fixups */
>                         dai_link->be_hw_params_fixup =
> --
> 2.17.1
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
Pierre-Louis Bossart Dec. 5, 2019, 4:01 a.m. UTC | #2
On 12/4/19 5:29 PM, Sridharan, Ranjani wrote:
> On Wed, Dec 4, 2019 at 7:16 AM Daniel Baluta <daniel.baluta@nxp.com> wrote:
> 
>> When converting a normal link to a DPCM link we need
>> to set dpcm_playback / dpcm_capture otherwise playback/capture
>> streams will not be created resulting in errors like this:
>>
>> [   36.039111]  sai1-wm8960-hifi: ASoC: no backend playback stream
>>
>> Fixes: a655de808cbde ("ASoC: core: Allow topology to override machine
>> driver FE DAI link config")
>> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
>> ---
>>   sound/soc/soc-core.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
>> index 977a7bfad519..f89cf9d0860c 100644
>> --- a/sound/soc/soc-core.c
>> +++ b/sound/soc/soc-core.c
>> @@ -1872,6 +1872,8 @@ static void soc_check_tplg_fes(struct snd_soc_card
>> *card)
>>
>>                          /* convert non BE into BE */
>>                          dai_link->no_pcm = 1;
>> +                       dai_link->dpcm_playback = 1;
>> +                       dai_link->dpcm_capture = 1;
>>
> Hi Daniel,
> 
> Typically, for Intel platforms, this information comes from the machine
> driver and there are some DAI links that have either playback or capture
> set. But this change would set both for all DAI links.
> Not sure if this is the right thing to do.

I am with Ranjani, I don't get why we'd set the full-duplex mode by 
default. but to be honest I never quite understood what this code is 
supposed to do...
Daniel Baluta Dec. 5, 2019, 9:18 a.m. UTC | #3
On Thu, Dec 5, 2019 at 6:11 AM Pierre-Louis Bossart
<pierre-louis.bossart@linux.intel.com> wrote:
>
>
>
> On 12/4/19 5:29 PM, Sridharan, Ranjani wrote:
> > On Wed, Dec 4, 2019 at 7:16 AM Daniel Baluta <daniel.baluta@nxp.com> wrote:
> >
> >> When converting a normal link to a DPCM link we need
> >> to set dpcm_playback / dpcm_capture otherwise playback/capture
> >> streams will not be created resulting in errors like this:
> >>
> >> [   36.039111]  sai1-wm8960-hifi: ASoC: no backend playback stream
> >>
> >> Fixes: a655de808cbde ("ASoC: core: Allow topology to override machine
> >> driver FE DAI link config")
> >> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
> >> ---
> >>   sound/soc/soc-core.c | 2 ++
> >>   1 file changed, 2 insertions(+)
> >>
> >> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> >> index 977a7bfad519..f89cf9d0860c 100644
> >> --- a/sound/soc/soc-core.c
> >> +++ b/sound/soc/soc-core.c
> >> @@ -1872,6 +1872,8 @@ static void soc_check_tplg_fes(struct snd_soc_card
> >> *card)
> >>
> >>                          /* convert non BE into BE */
> >>                          dai_link->no_pcm = 1;
> >> +                       dai_link->dpcm_playback = 1;
> >> +                       dai_link->dpcm_capture = 1;
> >>
> > Hi Daniel,
> >
> > Typically, for Intel platforms, this information comes from the machine
> > driver and there are some DAI links that have either playback or capture
> > set. But this change would set both for all DAI links.
> > Not sure if this is the right thing to do.
>
> I am with Ranjani, I don't get why we'd set the full-duplex mode by
> default. but to be honest I never quite understood what this code is
> supposed to do...

Indeed I need to figure out when exactly to enable playback/capture. I
was hoping
Liam will chime in, as this was in the original patch he sent months ago.

Patch
diff mbox series

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 977a7bfad519..f89cf9d0860c 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1872,6 +1872,8 @@  static void soc_check_tplg_fes(struct snd_soc_card *card)
 
 			/* convert non BE into BE */
 			dai_link->no_pcm = 1;
+			dai_link->dpcm_playback = 1;
+			dai_link->dpcm_capture = 1;
 
 			/* override any BE fixups */
 			dai_link->be_hw_params_fixup =