Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org
Subject: Re: [PATCH v3 01/23] ASoC: soc-pcm: cleanup soc_get_playback_capture()
Date: Thu, 25 Apr 2024 10:20:43 -0500	[thread overview]
Message-ID: <f65efc7b-d268-4b39-8665-5c4fe8e3ca1a@linux.intel.com> (raw)
In-Reply-To: <87plueovm1.wl-kuninori.morimoto.gx@renesas.com>




> Because Japanese will dive into long vacation since next week,
> I want to post mail before that. I will back at 7th May.

Enjoy!

>>>> (B) commit 1e9de42f4324b91ce2e9da0939cab8fc6ae93893
>>>> ("Explicitly set BE DAI link supported stream directions") force use to
>>>> dpcm_xxx flag
>>>>
>>>> 	if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) {
>>>> 		playback = rtd->dai_link->dpcm_playback;
>>>> 		capture = rtd->dai_link->dpcm_capture;
>>>
>>> The reason for this (B) addition is very clear from the commit message
>>>
>>> "
>>> Some BE DAIs can be "dummy" (when the DSP is controlling the DAI) and as
>>> such wont have set a minimum number of playback or capture channels
>>> required for BE DAI registration (to establish supported stream directions).
>>> "
>>
>> I'm still not yet 100% understand around this "dummy" DAI, but is it
>> *not* soc-utils.c :: dummy_dai, but some original dummy DAI is used
>> somewhere ?
>>
>> I know ${LINUX}/sound/soc/codecs/hda.c :: card_binder_dai is one of
>> the DAI which is used but doesn't have channels_min.
>> I think it is used as BE "Codec", but code is checking "CPU" side.
>>
>> Do you know what does this "BE dummy DAI" specifically means here?
> 
> 	(A) : checked CPU capabilities
> 	(B) : uses dpcm_xxx flag
> 	(C) : checks both dpcm_xxx and capabilities
> 	...
> 
> In my understanding, in summary, this dpcm_xxx flag was added to rescue
> dummy DAI which is used on DCPM BE as CPU at (B), because some of them
> might not have channels_min (This "dummy DAI" is not same as soc-utils's
> dummy DAI). Let's name it as "no_chan_DAI" here.
> In this patch, it was added as "mandatory flag", not "option flag",
> thus all DPCM needed to use this dpcm_xxx flag.
> 
> After that (C) was added, but it was contradiction, because
> it checks both dpcm_xxx and channels_min.
> If my understanding was correct, original "no_chan_DAI" was supposed to
> stop working, because it doesn't have channels_min. But there is no
> such report after (C), during this 4 years.
> We don't know which DAI is the "no_chan_DAI" (?)
> 
> Possibilities are as follows
> 	- No one is using "no_chan_DAI"
> 	- "no_chan_DAI" is no longer exist : it was removed ?
> 	- "no_chan_DAI" is no longer exist : it has channels_min ?
> 
> If my expectation was correct, we don't need dpcm_xxx anymore.

I agree with your analysis. We don't have a clear memory/understanding
of which "no_chan_DAI" platforms (B) was supposed to handle, and why no
one reported them as broken by (C).

> But because we have been used dpcm_xxx for 10 years since (B),
> I understand to feel anxious to suddenly remove dpcm_xxx.

Indeed we err on the side of paranoia with such changes!

> I think it should be removed anyway, but want to have grace time ?
> If so, the idea is that we can use it as "option flag" instead of
> "mandatory flag" for a while, like below
> 
> 	if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) {
> 		playback = (cpu_dai->driver->playback.channels_min > 0) ||
> 			   rtd->dai_link->dpcm_playback;
> 		capture  = (cpu_dai->driver->capture.channels_min  > 0) ||
> 			   rtd->dai_link->dpcm_capture;
> 
> * maybe we want to indicate message like "place re-check the flag and
>   remove it" via dev_info() if dpcm_xxx flag was used ?
> 
> I think +2 kernel version or so is enough for grace time ?
> After that, we can remove dpcm_xxx flag.

I am good with that plan, but I'll need to investigate first why we had
a failure with one of the Chromebooks on this v3 patchset. That may give
us some insights on "special" uses of those flags.

> When we consider it very detail, above code can't 100% keep compatibility
> if the user have been used this dpcm_xxx flag to limit availability,
> for example in case of DAI can use both playback/capture, but it had
> dpcm_playback flag only. But it can use playback_only flag, instead.
> But it is very difficult to find such DAI. Each user need to check.
> 
> I personally think that remove dpcm_xxx directly is no ploblem, but what
> do you think ? I'm happy to hear any opinion, and happy to create
> grace time code if someone want, but if there was no comment during
> Japanese long vacation, I will create patch to remove dpcm_xxx directly.
> 
> 
> BTW, I would like to know detail things around this topic. I'm happy if
> someone knows it.
> 
> * Why dummy DAI doesn't/can't have channels_min ?
> 
> * Why it checks CPU side channels_min only when DPCM ?
>   I think it should check both CPU and Codec.
>   I could understand if it checks FE:CPU and BE:Codec (it is assuming
>   other side was dummy), but both (FE/BE) check CPU side only...

  reply	other threads:[~2024-04-25 15:20 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-18  4:11 [PATCH v3 00/23] ASoC: Replace dpcm_playback/capture to playback/capture_assertion Kuninori Morimoto
2024-04-18  4:12 ` [PATCH v3 01/23] ASoC: soc-pcm: cleanup soc_get_playback_capture() Kuninori Morimoto
2024-04-18 16:20   ` Pierre-Louis Bossart
2024-04-19  1:09     ` Kuninori Morimoto
2024-04-19 13:17       ` Pierre-Louis Bossart
2024-04-22  4:46         ` Kuninori Morimoto
2024-04-22 20:12           ` Pierre-Louis Bossart
2024-04-23  4:56             ` Kuninori Morimoto
2024-04-25  5:32               ` Kuninori Morimoto
2024-04-25 15:20                 ` Pierre-Louis Bossart [this message]
2024-04-25 21:59                   ` Pierre-Louis Bossart
2024-04-26  0:24                     ` Kuninori Morimoto
2024-04-26  4:00                       ` Kuninori Morimoto
2024-04-18  4:12 ` [PATCH v3 02/23] ASoC: soc-pcm: indicate warning if DPCM BE Codec has no settings Kuninori Morimoto
2024-04-18  4:12 ` [PATCH v3 03/23] ASoC: soc-dai: remove snd_soc_dai_link_set_capabilities() Kuninori Morimoto
2024-04-18  4:12 ` [PATCH v3 04/23] ASoC: amd: Replace dpcm_playback/capture to playback/capture_assertion Kuninori Morimoto
2024-04-18  4:13 ` [PATCH v3 05/23] ASoC: fsl: " Kuninori Morimoto
2024-04-18  4:13 ` [PATCH v3 06/23] ASoC: sof: " Kuninori Morimoto
2024-04-18  4:13 ` [PATCH v3 07/23] ASoC: meson: " Kuninori Morimoto
2024-04-18  4:13 ` [PATCH v3 08/23] ASoC: Intel: " Kuninori Morimoto
2024-04-18  4:13 ` [PATCH v3 09/23] ASoC: mediatek: " Kuninori Morimoto
2024-04-18  4:13 ` [PATCH v3 10/23] ASoC: soc-core: " Kuninori Morimoto
2024-04-18  4:14 ` [PATCH v3 11/23] ASoC: soc-topology: " Kuninori Morimoto
2024-04-18  4:14 ` [PATCH v3 12/23] ASoC: soc-compress: " Kuninori Morimoto
2024-04-18  4:14 ` [PATCH v3 13/23] ASoC: Intel: avs: boards: " Kuninori Morimoto
2024-04-18  4:14 ` [PATCH v3 14/23] ASoC: ti: Replace playback/capture_only " Kuninori Morimoto
2024-04-18  4:14 ` [PATCH v3 15/23] ASoC: amd: " Kuninori Morimoto
2024-04-18  4:14 ` [PATCH v3 16/23] ASoC: fsl: " Kuninori Morimoto
2024-04-18  4:14 ` [PATCH v3 17/23] ASoC: mxs: " Kuninori Morimoto
2024-04-18  4:15 ` [PATCH v3 18/23] ASoC: atmel: " Kuninori Morimoto
2024-04-18  4:15 ` [PATCH v3 19/23] ASoC: Intel: " Kuninori Morimoto
2024-04-18 11:19   ` Amadeusz Sławiński
2024-04-18 16:26     ` Pierre-Louis Bossart
2024-04-19  7:31       ` Amadeusz Sławiński
2024-04-18  4:15 ` [PATCH v3 20/23] ASoC: samsung: " Kuninori Morimoto
2024-04-18  4:15 ` [PATCH v3 21/23] ASoC: generic: " Kuninori Morimoto
2024-04-18  4:15 ` [PATCH v3 22/23] ASoC: soc-pcm: remove dpcm_playback/capture and playback/capture_only Kuninori Morimoto
2024-04-18  4:15 ` [PATCH v3 23/23] ASoC: doc: Replace dpcm_playback/capture to playback/capture_assertion Kuninori Morimoto
2024-04-22 21:10 ` [PATCH v3 00/23] ASoC: " Pierre-Louis Bossart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f65efc7b-d268-4b39-8665-5c4fe8e3ca1a@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-sound@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox