Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Mark Brown <broonie@kernel.org>,
	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: Fri, 26 Apr 2024 00:24:18 +0000	[thread overview]
Message-ID: <87v845gee1.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <bdf31350-1f99-4588-8d6d-f4b9c8bad96f@linux.intel.com>


Hi Pierre-Louis

Thank you for your feedback and report

> On some Chromebooks, we tag a dailink as supporting capture for echo
> reference, but that echo reference is generated by the Intel firmware.
> The amplifiers only support playback.
> 
> see https://github.com/thesofproject/linux/pull/4937 for details, I
> added a clear log:
> 
> [  807.304740] kernel:  SSP1-Codec: CPU dai SSP1 Pin supports capture
> but codec DAI rt1011-aif does not
> 
> So I think for now we probably want to avoid this stricter criterion and
> only check the supported direction with the cpu-dais. Or we add an
> escape mechanism to let the core know that the capture support was
> intentional.

I think my patch have escape mechanism, but it was for BE Codec.
If my understand was correct, above is FE Codec ?

One question is that is it just a mistake (no one noticed) ? or is there
some reasons it can't support capture (but use it ?). If it was just a
mistake, is it possible to update driver during the grace time ?
Or do you think we need "escape mechanism" permanently ?

> 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).
(snip)
> 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.

Thanks.
It seems the code was just complicated, and we have been missing
important check. Let's break out my patch-set into small pieces,
and go more slowly.

I think it will be like below. Can you agree about this ?

Step1
	dpcm_xxx flag will be "option flag" instead of "mandatory flag"
	for a while to keep compatibility and avoide confusion.
	But it will be removed in Step3. To indicate such things,
	it will have dev_warn() if dpcm_xxx flag was used. like below

	if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) {
		has_playback = /* at least one of CPU DAI supports playback */
		has_capture  = ...

		if (!playback && rtd->dai_link->dpcm_playback) {
			dev_warn(dev, "Playback is requested, but CPU doesn't support it\n")
			has_playback = 1;
		}
		...

Step2 (In case of "escape mechanism" is not needed)

	Current DPCM is checking CPU side only. Indicate warning until
	Step4 if Codec is not match . warning only, not error for a while.
	
	if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) {
		...

		if (has_playback && /* no Codec DAI supports playback */)
			dev_warn(dev, "Playback is requested, but Codec doesn't support it\n")
		...

Step3

	Step1 deadline
	remove dpcm_xxx flag

Step4
	Step2 deadline
	CPU / Codec mismatch will be error.
	It will be "at least one of CPU/Codec pair supports playback/capture"

Step5

	There is no big diff between DPCM / non-DPCM check.
	Merge these, and clean-up code (soc_get_playback_capture())


Thank you for your help !!

Best regards
---
Renesas Electronics
Ph.D. Kuninori Morimoto

  reply	other threads:[~2024-04-26  0:24 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
2024-04-25 21:59                   ` Pierre-Louis Bossart
2024-04-26  0:24                     ` Kuninori Morimoto [this message]
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=87v845gee1.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    /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