public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/8] Revert "ALSA: usb: Increase volume range that triggers a warning"
       [not found] <20260302185900.427415-1-i@rong.moe>
@ 2026-03-02 18:58 ` Rong Zhang
  2026-03-02 20:53   ` [External Mail] " Arun Raghavan
  0 siblings, 1 reply; 2+ messages in thread
From: Rong Zhang @ 2026-03-02 18:58 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai
  Cc: Rong Zhang, Jonathan Corbet, Shuah Khan, Cryolitia PukNgae,
	Arun Raghavan, linux-sound, linux-doc, linux-kernel,
	Icenowy Zheng, stable

UAC uses 2 bytes to store volume values, so the maximum volume range is
0xFFFF (65535, val = -32768/32767/1).

The reverted commit bumpped the range of triggering the warning to >
65535, effectively making the range check a no-op. It didn't fix
anything but covered any potential problems and deviated from the
original intention of the range check.

This reverts commit 6b971191fcfc9e3c2c0143eea22534f1f48dbb62.

Fixes: 6b971191fcfc ("ALSA: usb: Increase volume range that triggers a warning")
Cc: stable@vger.kernel.org
Signed-off-by: Rong Zhang <i@rong.moe>
---
 sound/usb/mixer.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index ac8c71ba94834..df0d3df9c7ece 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -1813,10 +1813,11 @@ static void __build_feature_ctl(struct usb_mixer_interface *mixer,
 
 	range = (cval->max - cval->min) / cval->res;
 	/*
-	 * There are definitely devices with a range of ~20,000, so let's be
-	 * conservative and allow for a bit more.
+	 * Are there devices with volume range more than 255? I use a bit more
+	 * to be sure. 384 is a resolution magic number found on Logitech
+	 * devices. It will definitively catch all buggy Logitech devices.
 	 */
-	if (range > 65535) {
+	if (range > 384) {
 		usb_audio_warn(mixer->chip,
 			       "Warning! Unlikely big volume range (=%u), cval->res is probably wrong.",
 			       range);
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [External Mail] [PATCH v2 1/8] Revert "ALSA: usb: Increase volume range that triggers a warning"
  2026-03-02 18:58 ` [PATCH v2 1/8] Revert "ALSA: usb: Increase volume range that triggers a warning" Rong Zhang
@ 2026-03-02 20:53   ` Arun Raghavan
  0 siblings, 0 replies; 2+ messages in thread
From: Arun Raghavan @ 2026-03-02 20:53 UTC (permalink / raw)
  To: Rong Zhang, Jaroslav Kysela, Takashi Iwai
  Cc: Jonathan Corbet, Shuah Khan, Cryolitia PukNgae, Arun Raghavan,
	linux-sound, linux-doc, linux-kernel, Icenowy Zheng, stable

On Mon Mar 2, 2026 at 10:58 AM PST, Rong Zhang wrote:
> UAC uses 2 bytes to store volume values, so the maximum volume range is
> 0xFFFF (65535, val = -32768/32767/1).
>
> The reverted commit bumpped the range of triggering the warning to >
> 65535, effectively making the range check a no-op. It didn't fix
> anything but covered any potential problems and deviated from the
> original intention of the range check.
>
> This reverts commit 6b971191fcfc9e3c2c0143eea22534f1f48dbb62.
>
> Fixes: 6b971191fcfc ("ALSA: usb: Increase volume range that triggers a warning")
> Cc: stable@vger.kernel.org
> Signed-off-by: Rong Zhang <i@rong.moe>

Thanks for catching and fixing this.

Acked-by: Arun Raghavan <arunr@valvesoftware.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-02 20:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260302185900.427415-1-i@rong.moe>
2026-03-02 18:58 ` [PATCH v2 1/8] Revert "ALSA: usb: Increase volume range that triggers a warning" Rong Zhang
2026-03-02 20:53   ` [External Mail] " Arun Raghavan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox