Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
To: Bard Liao <yung-chuan.liao@linux.intel.com>,
	broonie@kernel.org, tiwai@suse.de, linux-sound@vger.kernel.org,
	vkoul@kernel.org
Cc: vinod.koul@linaro.org, linux-kernel@vger.kernel.org, bard.liao@intel.com
Subject: Re: [PATCH 00/15] ASoC/soundwire: Realtek codecs: wait codec init in hw_params
Date: Thu, 26 Jun 2025 14:19:18 +0200	[thread overview]
Message-ID: <f95f6777-7445-46dc-be53-b3ae5594bf39@linux.dev> (raw)
In-Reply-To: <20250626115625.536423-1-yung-chuan.liao@linux.intel.com>

Hi Bard,

> The current code waits for the codec initialization in the resume
> callback. It could cause the resume takes a long time while waiting for
> the codec being attached and initialized. Move the waiting to the
> hw_params callback when the driver really needs it and shorten the
> resume time.
> The change is mainly on the ASoC tree. Let's go through the ASoC tree.

While I certainly understand the desire to make the resume time lower, is this approach desirable in all cases?

My main worry is this: not all functionality in a codec is related to the hw_params. One counter example would be register settings related to jack detection. You would want the regmap settings to be correctly applied in hardware registers even in the absence of any streaming request, no?

The other weird thing is that historically the codec initialization was never on the critical path, it was several orders of magnitude faster than the controller. It wouldn't hurt to provide broad-brush information on what a 'long' time means for a codec resume, so that we can really see the pros/cons of moving all the regmap initialization.

Another open is that SDCA defines the notion of 'blind writes' which would typically be done during a resume if context was lost. If we start moving some parts of the initialization to the hw_params and others remain in the resume flow, that will quickly lead to complexity in managing configuration.

The last point is that this is a change for Realtek codecs only, would other drivers for other vendors require this change? And if I may ask is there any merit in speeding-up resume times even for 'legacy' non-sdca parts?

> Bard Liao (15):
>   soundwire: add sdw_slave_wait_for_initialization helper
>   ASoC: rt722: wait codec init in hw_params
>   ASoC: rt712: wait codec init in hw_params
>   ASoC: rt1320: wait codec init in hw_params
>   ASoC: rt721: wait codec init in hw_params
>   ASoC: rt715-sdca: wait codec init in hw_params
>   ASoC: rt711-sdca: wait codec init in hw_params
>   ASoC: rt711: wait codec init in hw_params
>   ASoC: rt715: wait codec init in hw_params
>   ASoC: rt700: wait codec init in hw_params
>   ASoC: rt1316: wait codec init in hw_params
>   ASoC: rt1318: wait codec init in hw_params
>   ASoC: rt1308: wait codec init in hw_params
>   ASoC: rt5682: wait codec init in hw_params
>   ASoC: rt1017: wait codec init in hw_params
> 
>  drivers/soundwire/slave.c          | 17 ++++++++++++++
>  include/linux/soundwire/sdw.h      |  1 +
>  sound/soc/codecs/rt1017-sdca-sdw.c | 32 ++++++++++++++++----------
>  sound/soc/codecs/rt1308-sdw.c      | 32 ++++++++++++++++----------
>  sound/soc/codecs/rt1316-sdw.c      | 32 ++++++++++++++++----------
>  sound/soc/codecs/rt1318-sdw.c      | 30 ++++++++++++++++--------
>  sound/soc/codecs/rt1320-sdw.c      | 32 ++++++++++++++++++--------
>  sound/soc/codecs/rt5682-sdw.c      | 29 +++++++++++++++--------
>  sound/soc/codecs/rt700-sdw.c       | 27 ++++++++++++----------
>  sound/soc/codecs/rt700.c           |  6 +++++
>  sound/soc/codecs/rt711-sdca-sdw.c  | 28 ++++++++++++----------
>  sound/soc/codecs/rt711-sdca.c      |  6 +++++
>  sound/soc/codecs/rt711-sdw.c       | 26 +++++++++++++--------
>  sound/soc/codecs/rt711.c           |  6 +++++
>  sound/soc/codecs/rt712-sdca-sdw.c  | 28 ++++++++++++----------
>  sound/soc/codecs/rt712-sdca.c      |  6 +++++
>  sound/soc/codecs/rt715-sdca-sdw.c  | 37 ++++++++++++++++++++----------
>  sound/soc/codecs/rt715-sdca.c      |  6 +++++
>  sound/soc/codecs/rt715-sdw.c       | 27 ++++++++++++----------
>  sound/soc/codecs/rt715.c           |  6 +++++
>  sound/soc/codecs/rt721-sdca-sdw.c  | 29 ++++++++++++-----------
>  sound/soc/codecs/rt721-sdca.c      |  6 +++++
>  sound/soc/codecs/rt722-sdca-sdw.c  | 26 +++++++++++----------
>  sound/soc/codecs/rt722-sdca.c      |  6 +++++
>  24 files changed, 320 insertions(+), 161 deletions(-)
> 


  parent reply	other threads:[~2025-06-26 12:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-26 11:56 [PATCH 00/15] ASoC/soundwire: Realtek codecs: wait codec init in hw_params Bard Liao
2025-06-26 11:56 ` [PATCH 01/15] soundwire: add sdw_slave_wait_for_initialization helper Bard Liao
2025-06-26 11:56 ` [PATCH 02/15] ASoC: rt722: wait codec init in hw_params Bard Liao
2025-06-26 11:56 ` [PATCH 03/15] ASoC: rt712: " Bard Liao
2025-06-26 11:56 ` [PATCH 04/15] ASoC: rt1320: " Bard Liao
2025-06-26 11:56 ` [PATCH 05/15] ASoC: rt721: " Bard Liao
2025-06-26 11:56 ` [PATCH 06/15] ASoC: rt715-sdca: " Bard Liao
2025-06-26 11:56 ` [PATCH 07/15] ASoC: rt711-sdca: " Bard Liao
2025-06-26 11:56 ` [PATCH 08/15] ASoC: rt711: " Bard Liao
2025-06-26 11:56 ` [PATCH 09/15] ASoC: rt715: " Bard Liao
2025-06-26 11:56 ` [PATCH 10/15] ASoC: rt700: " Bard Liao
2025-06-26 11:56 ` [PATCH 11/15] ASoC: rt1316: " Bard Liao
2025-06-26 11:56 ` [PATCH 12/15] ASoC: rt1318: " Bard Liao
2025-06-26 11:56 ` [PATCH 13/15] ASoC: rt1308: " Bard Liao
2025-06-26 11:56 ` [PATCH 14/15] ASoC: rt5682: " Bard Liao
2025-06-26 11:56 ` [PATCH 15/15] ASoC: rt1017: " Bard Liao
2025-06-26 12:19 ` Pierre-Louis Bossart [this message]
2025-06-27  6:53   ` [PATCH 00/15] ASoC/soundwire: Realtek codecs: " Liao, Bard
2025-07-01 10:13     ` Pierre-Louis Bossart
2025-07-01 10:33       ` Pierre-Louis Bossart
2025-07-01 11:42         ` Liao, Bard

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=f95f6777-7445-46dc-be53-b3ae5594bf39@linux.dev \
    --to=pierre-louis.bossart@linux.dev \
    --cc=bard.liao@intel.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=tiwai@suse.de \
    --cc=vinod.koul@linaro.org \
    --cc=vkoul@kernel.org \
    --cc=yung-chuan.liao@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