public inbox for linux-sound@vger.kernel.org
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srini@kernel.org>
To: Tobias Heider <tobias.heider@canonical.com>,
	Srinivas Kandagatla <srini@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>
Cc: linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org, Johan Hovold <johan@kernel.org>
Subject: Re: [PATCH v2] ASoC: qcom: x1e80100: limit speaker volumes
Date: Wed, 22 Apr 2026 14:00:05 +0000	[thread overview]
Message-ID: <10c61642-da1c-4811-841e-ca5061d93032@kernel.org> (raw)
In-Reply-To: <20260422-x1e80100-audio-limit-v2-1-333258b97697@canonical.com>



On 4/22/26 1:30 PM, Tobias Heider wrote:
> Limit the digital gain and PA volumes to a combined -3 dB in the machine
> driver to reduce the risk of speaker damage until we have active speaker
> protection in place (or higher safe levels have been established).
> 
> Based on commit c481016bb4f8 ("ASoC: qcom: sc8280xp: limit speaker
> volumes") which addressed the same issue on the sc8280x SoC with some
> minor changes as explained below.
> 
> The Digital Volume behaves almost identical to sc8280x since both use
> the same lpass-wsa-macro, but x1e80100 has two sets of controls prefixed
> with WSA and WSA2.
> For PA x1e80100 machines use wsa884x amplifiers which expose a linear
> scale from -9 dB to 9 dB with a 1.5 dB step size giving us
> 0 dB = -9 dB + 6 * 1.5 dB.
> 
> On x1e80100 there are two different speaker topologies we need to handle:
>   2-Speakers: SpkrLeft, Spkr Right
>   4-Speakers: WooferLeft, WooferRight, TweeterLeft, TweeterRight
> 
> Signed-off-by: Tobias Heider <tobias.heider@canonical.com>

Thanks Tobias for doing this, this has been long pending.

Bits required for Speaker Protection are also getting tested, hopefully
we can soon send it out.


Tested it on T14s and Dell Latitude 7455

Tested-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>




--srini
> ---
> On x1e80100 laptops like the Lenovo T14s Gen 6 most of the audio
> enablement work has landed upstream at this point meaning it works
> out of the box on any Linux system.
> One unresolved problem is that there isn't a solution for active
> speaker protection yet and the current default seems to be unsafe.
> 
> With the current defaults it is trivial to crank up the volume to
> a point where the T14s will hit what I believe is a hardware
> protection that shuts down the speakers entirely until the next
> reboot. I am worried that this means there is also a risk cause
> permanent hardware damage with the default settings.
> 
> This patch adopts the same limits we currently use for sc8280x to
> x1e80100. With this applied I can't trigger the same shutoff I
> described above.
> ---
> Changes in v2:
> - Adjusted Digital Volume names as suggested by Mark Brown
> - Link to v1: https://lore.kernel.org/r/20260421-x1e80100-audio-limit-v1-1-98bac8cee2ee@canonical.com
> ---
>  sound/soc/qcom/x1e80100.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/sound/soc/qcom/x1e80100.c b/sound/soc/qcom/x1e80100.c
> index a3f4785c4bbe62e7e027deb6d810e0a0275d81c2..c81df41ace8839cf912a55514518f1d8cd3e58c1 100644
> --- a/sound/soc/qcom/x1e80100.c
> +++ b/sound/soc/qcom/x1e80100.c
> @@ -27,10 +27,29 @@ static int x1e80100_snd_init(struct snd_soc_pcm_runtime *rtd)
>  {
>  	struct x1e80100_snd_data *data = snd_soc_card_get_drvdata(rtd->card);
>  	struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
> +	struct snd_soc_card *card = rtd->card;
>  	struct snd_soc_jack *dp_jack = NULL;
>  	int dp_pcm_id = 0;
>  
>  	switch (cpu_dai->id) {
> +	case WSA_CODEC_DMA_RX_0:
> +	case WSA_CODEC_DMA_RX_1:
> +		/*
> +		 * Set limit of -3 dB on Digital Volume and 0 dB on PA Volume
> +		 * to reduce the risk of speaker damage until we have active
> +		 * speaker protection in place.
> +		 */
> +		snd_soc_limit_volume(card, "WSA WSA_RX0 Digital Volume", 81);
> +		snd_soc_limit_volume(card, "WSA WSA_RX1 Digital Volume", 81);
> +		snd_soc_limit_volume(card, "WSA2 WSA_RX0 Digital Volume", 81);
> +		snd_soc_limit_volume(card, "WSA2 WSA_RX1 Digital Volume", 81);
> +		snd_soc_limit_volume(card, "SpkrLeft PA Volume", 6);
> +		snd_soc_limit_volume(card, "SpkrRight PA Volume", 6);
> +		snd_soc_limit_volume(card, "WooferLeft PA Volume", 6);
> +		snd_soc_limit_volume(card, "TweeterLeft PA Volume", 6);
> +		snd_soc_limit_volume(card, "WooferRight PA Volume", 6);
> +		snd_soc_limit_volume(card, "TweeterRight PA Volume", 6);
> +		break;
>  	case DISPLAY_PORT_RX_0:
>  		dp_pcm_id = 0;
>  		dp_jack = &data->dp_jack[dp_pcm_id];
> 
> ---
> base-commit: b4e07588e743c989499ca24d49e752c074924a9a
> change-id: 20260421-x1e80100-audio-limit-f6e75e0ad422
> 
> Best regards,


  reply	other threads:[~2026-04-22 14:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-22 13:30 [PATCH v2] ASoC: qcom: x1e80100: limit speaker volumes Tobias Heider
2026-04-22 14:00 ` Srinivas Kandagatla [this message]
2026-04-22 14:44 ` Mark Brown

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=10c61642-da1c-4811-841e-ca5061d93032@kernel.org \
    --to=srini@kernel.org \
    --cc=broonie@kernel.org \
    --cc=johan@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=tobias.heider@canonical.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