[PATCH v2 1/8] Revert "ALSA: usb: Increase volume range that triggers a warning"

Rong Zhang posted 8 patches 8 hours ago
[PATCH v2 1/8] Revert "ALSA: usb: Increase volume range that triggers a warning"
Posted by Rong Zhang 8 hours ago
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
Re: [External Mail] [PATCH v2 1/8] Revert "ALSA: usb: Increase volume range that triggers a warning"
Posted by Arun Raghavan 6 hours ago
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>