]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ALSA: usb: Increase volume range that triggers a warning
authorArun Raghavan <arunr@valvesoftware.com>
Fri, 16 Jan 2026 22:58:04 +0000 (14:58 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Jan 2026 09:27:36 +0000 (10:27 +0100)
[ Upstream commit 6b971191fcfc9e3c2c0143eea22534f1f48dbb62 ]

On at least the HyperX Cloud III, the range is 18944 (-18944 -> 0 in
steps of 1), so the original check for 255 steps is definitely obsolete.
Let's give ourselves a little more headroom before we emit a warning.

Fixes: 80acefff3bc7 ("ALSA: usb-audio - Add volume range check and warn if it too big")
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: linux-sound@vger.kernel.org
Signed-off-by: Arun Raghavan <arunr@valvesoftware.com>
Link: https://patch.msgid.link/20260116225804.3845935-1-arunr@valvesoftware.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/usb/mixer.c

index e19d962fab870ba07720ac6a0f7ef3bc60aa25ee..76aac42c3c805ee602dc9489f757835f1d2d6977 100644 (file)
@@ -1807,11 +1807,10 @@ static void __build_feature_ctl(struct usb_mixer_interface *mixer,
 
        range = (cval->max - cval->min) / cval->res;
        /*
-        * 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.
+        * There are definitely devices with a range of ~20,000, so let's be
+        * conservative and allow for a bit more.
         */
-       if (range > 384) {
+       if (range > 65535) {
                usb_audio_warn(mixer->chip,
                               "Warning! Unlikely big volume range (=%u), cval->res is probably wrong.",
                               range);