From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1C2B1C47DAF for ; Fri, 19 Jan 2024 15:27:54 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1B7D3825; Fri, 19 Jan 2024 16:27:42 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1B7D3825 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1705678072; bh=X/xd67Fr3PvF8lGpTMnDOMiobvUDHSVg02IBNzMqNGw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=QtO7pVbTzMY3YTntqpYmD/QxnLIigWC1uIYht6VO27/j97N1sYVRBTXkLW5P8USNj vSOOlsIaUzx7B3THw+BBIpsIq1PKPdFZBOFxG9I82a7ObKvsPzliHDWsjL6OBCknxE 2Na7coh4RZfPbfsCW6Qt4uK0hPDQRa4mRzJ3Qxf8= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8A973F8058C; Fri, 19 Jan 2024 16:27:18 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 0CB4AF80587; Fri, 19 Jan 2024 16:27:18 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9775EF800C1; Fri, 19 Jan 2024 16:27:13 +0100 (CET) Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 00495F800C1 for ; Fri, 19 Jan 2024 16:26:59 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 00495F800C1 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=Smz9BHF+ Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 4F7E4CE21FC; Fri, 19 Jan 2024 15:26:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CD31C43394; Fri, 19 Jan 2024 15:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705678011; bh=X/xd67Fr3PvF8lGpTMnDOMiobvUDHSVg02IBNzMqNGw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Smz9BHF+haNafasg95JGgtPJYBBHgYlY+/gV8naiOscTv4jh4wJ879u65MnftYq6a HAUOFwKH1cDjAP5MHxOW36tw5KQInht3bZQ1BFVITR9Yzm9vXVmKVdow6S4SYtSqgK 5P9fluDHo1/AH/VYLojyr6pEutOZvF53QmF8Xmc9bryktDxd8fom/RgoGR4lzDD5cG FPvOP3M7jePnZwQt9kQ2nPtv/mNf/zvOtRaTKCxC8PanmTYg2fMFrtE0YKiXhr1Y2l +80VKww/UwvBAfTpHO80c6pItmi8s1lvnZOvi9cprM9bVTGTVr9tUZgiS4FYb1QGtl TxW5g3tXcywrw== Received: from johan by xi.lan with local (Exim 4.96.2) (envelope-from ) id 1rQqlo-0004QS-00; Fri, 19 Jan 2024 16:27:00 +0100 Date: Fri, 19 Jan 2024 16:26:59 +0100 From: Johan Hovold To: Johan Hovold Cc: Mark Brown , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v4 2/4] ASoC: qcom: sc8280xp: limit speaker volumes Message-ID: References: <20240119112420.7446-1-johan+linaro@kernel.org> <20240119112420.7446-3-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240119112420.7446-3-johan+linaro@kernel.org> Message-ID-Hash: SDA5KEAW56ZP2AQOZDZBM2HAII5SMVHH X-Message-ID-Hash: SDA5KEAW56ZP2AQOZDZBM2HAII5SMVHH X-MailFrom: johan@kernel.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Fri, Jan 19, 2024 at 12:24:18PM +0100, Johan Hovold wrote: > The UCM configuration for the Lenovo ThinkPad X13s has up until now > been setting the speaker PA volume to the minimum -3 dB when enabling > the speakers, but this does not prevent the user from increasing the > volume further. > > 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). > > Note that the PA volume limit cannot be set lower than 0 dB or > PulseAudio gets confused when the first 16 levels all map to -3 dB. I tracked the down the root cause for this, which appears to be a bug (feature) in pulseaudio that causes it to reject the dB range if the maximum is negative: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/447 This happened to work with v3 which limited the PA volume to the single lowest setting, but would similarly break if anyone wants to set a -1.5 dB limit. Johan