From nobody Tue Jun 16 05:08:26 2026 Received: from mail-dl1-f47.google.com (mail-dl1-f47.google.com [74.125.82.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C5673B777F for ; Thu, 16 Apr 2026 13:25:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776345915; cv=none; b=cEX92HmPhhMQLU1OnFNHAmu8pi2QctU7O2x66oq+ccJs/Sh6UBZh/mmZV7o/KNZNtJUPRb8ankkLJ9A18hxmtXoEKc26xAdC/cK4ebil7JVJktxgaK31skKjH/LPfsoHIL7qdhyzlUVbdoY0DdJ7PvNr26fyAhDdpr3P00yRNnk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776345915; c=relaxed/simple; bh=IXGjDwTvh4h4KuOXx81DSKXrmdElgn4WOT2+I/2WUvQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=qIzXTd+gA9arIU6EvCG4IPqLgfplCiXioDtLxW53+39adJvgSCIKZmnDwByLjEaUQ31p6txsEh1sK8ctGS9G9vOEux2SN7j0+8AvtxbbrCg6Vd8SRHyFJ6/oREOA31UFJy1i7G2oII2r9XklJbFtAtiJy71r4HYW8EtcjfzsuOI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=rzDgFWqb; arc=none smtp.client-ip=74.125.82.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rzDgFWqb" Received: by mail-dl1-f47.google.com with SMTP id a92af1059eb24-128b9b7e3edso7664028c88.0 for ; Thu, 16 Apr 2026 06:25:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776345912; x=1776950712; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=jX6Ogp1BShOzt1WRlynqsHqsr7PXv7guMEAzRV9ZzCM=; b=rzDgFWqb3YKNeToVr2U3tK2mRUnj9bqSR+DoCTmvTRUCeP6T8Rtbfp1Bm0gABu6sVi NzxaOEj6X8BYN9ELPdVaIOP2MuhxE4ymUCSPX6hFNSSPtLvgWfjpL/34mZCgkkvUcyXa sPn5rpvPVtS4/Cq6219cIy0xx1lMtti+xOyTcRuhlORzkb7r/qnoIZqkpBr44lcz+yKI HvBvKRT4iLuzhjMvavw5//F1IJ7ztQXeELQkbFc7eyILuWVtR6nZ1jSpn3mVNbs0MMLs BlwwCRY89LQEuXCQdSw875BiG6/TI3ckQDtnkC0Up8Yg8whJR2F6Kfc9R4lrg1yFb7/l 0JCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776345912; x=1776950712; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jX6Ogp1BShOzt1WRlynqsHqsr7PXv7guMEAzRV9ZzCM=; b=LnODDkpbawJja1UljaXGEoT3Bld4RGXCcDSLRCnPzyUhsDiIOXLfaqj5B00hX//US8 IgMbV3L66kVJ0ADNUpZl8/qD1C7t51xY3tI+bZkGTQfRUDuXqrlvXYfIKbNVBDRko32h rzET1xd5Vow7uK9FqwVaivrkoKROsAm78Hk9d6++SPlTqmHJFV28IuBguG+JoSMad7iS moXrW75NGEGZHejKQ6h4EEgW1TTaF4g/E9xEdiFrWigHhUud9CHbEiqisbsmRihDmS9B 0WcK1fh2v4RGJ49jVEz4YVgxbSJ3W9CeSJoIyAkhnT0RNfj9PxDzs/CrkHBRSUrXX6ff mUkw== X-Forwarded-Encrypted: i=1; AFNElJ90FE6K9VqI8lhqDLSUYH60Ic63Go5TgTRjOtna3MkNR78ZDOHkpHBYE4XIw4i1ucCrE7rmrftQhskXQik=@vger.kernel.org X-Gm-Message-State: AOJu0YyZbF7U4kmgYuHUX8KrovILdddU5SGfY62vjvN0WBbynMg8/S7B u0sbhBoTyH+w1oqc8vC+lAdDpOF12VtUI7wBKA2C+Zj0OUHpmZ7s2WtR X-Gm-Gg: AeBDiesyAtdJdS4z/pTj8Y4syMgaijazC4dTekvzYnZurmUZmhi06sA9+Zc0n3YIYDP nanfLM9eMd4fXykaSoKvpzRgl0+qvoGEbJtM3ONZkZkyCxqGaSNlz/e773BdJGTImW4zFPX+0SQ HOe3S7DC2t6FT93J8pvXSOIc885b357ZqP9zTQZzo8TY9PV9eqpG1zD1Tl0W1X1e8qapb/yLTeV ldR8krta5YhVqYJN5sYBfU5dnUYX9yEmQ5EgtQvNUS1iRoINYYt9fJruwqO0XVsbYIepn0MrwwB bQCN6WPkjfItgWh1tuNX9O9STuFjCO1mK4IAYbw3jexTZBDBbsY/VbdSVELQPsQskGNNSnoo1x1 bYGUEcZcefHO7rurIQNCC7iGXvEEo2u2OGALmm6R7NyJB05BArnoMxuDNsNE/wUe/k9/wzo1RqT FqFnJs2lzlzzEri5EtuDpX9yeTgmuUCtI8WTuVuNw5e7zwWq1jvvd9SXaXkGL8mXi0lIcYEUnWK GKeO1dLwfdCdZU= X-Received: by 2002:a05:7301:6788:b0:2c0:cc90:a71 with SMTP id 5a478bee46e88-2d5873b3c6amr16502650eec.8.1776345912315; Thu, 16 Apr 2026 06:25:12 -0700 (PDT) Received: from [192.168.1.18] (177-4-160-195.user3p.v-tal.net.br. [177.4.160.195]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2de8c50cee8sm7689556eec.7.2026.04.16.06.25.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Apr 2026 06:25:11 -0700 (PDT) From: =?utf-8?q?C=C3=A1ssio_Gabriel?= Date: Thu, 16 Apr 2026 10:24:40 -0300 Subject: [PATCH] ALSA: 6fire: Fix input volume change detection Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260416-alsa-6fire-input-volume-change-detection-v1-1-ec78299168df@gmail.com> X-B4-Tracking: v=1; b=H4sIAAAAAAAC/y2NwQ6CMBBEf4Xs2U1Kg5X4K8ZDga2uwUK6LTEh/ LsreJuXmbxZQSgxCVyrFRItLDxFhfpUQf/08UHIgzJYY51paod+FI8ucNImziXjMo3lTfhfD5S pzyrRdDZdG8he2gCqmxMF/uxXt/vBUrqXrn9+2LYvJfMkoIwAAAA= X-Change-ID: 20260416-alsa-6fire-input-volume-change-detection-de50b8fe278f To: Takashi Iwai , Jaroslav Kysela , Torsten Schenk Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, =?utf-8?q?C=C3=A1ssio_Gabriel?= X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2021; i=cassiogabrielcontato@gmail.com; h=from:subject:message-id; bh=IXGjDwTvh4h4KuOXx81DSKXrmdElgn4WOT2+I/2WUvQ=; b=owGbwMvMwCV2IdZeKur/u2bG02pJDJkPHptwq97XNttRcaBmudR/ebY3/9R0Xn44s1mUSe0Ou 822ziPvOkpZGMS4GGTFFFlWJy2y3NP14Gp93AoPmDmsTCBDGLg4BWAiNjsZ/tn1Pjl7f9Yh2xhD s90Ge3NcFN3XTFE9tTgunWVvZ+uxhV8Y/nsbahhHWj2Zks2l4rfM+GXMtnCNycIey76oOSzZ8nZ dNhsA X-Developer-Key: i=cassiogabrielcontato@gmail.com; a=openpgp; fpr=AB62A239BC8AE0D57F5EA848D05D3F1A5AFFEE83 usb6fire_control_input_vol_put() stores the analog capture volume as a signed offset in rt->input_vol[] (-15..+15), but it compares the cached value against the user-visible mixer value (0..30) before subtracting 15. This mixes two domains in the change detection path. Since the runtime is zero-initialized, the visible default is 15; writing 0 right after probe is ignored, while writing 15 is reported as a change even though the cached value remains 0. Normalize the user value before comparing it with the cached offset. Fixes: 06bb4e743501 ("ALSA: snd-usb-6fire: add analog input volume control") Cc: stable@vger.kernel.org Signed-off-by: C=C3=A1ssio Gabriel --- sound/usb/6fire/control.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sound/usb/6fire/control.c b/sound/usb/6fire/control.c index dd25a6407b63..c77a21a9acd7 100644 --- a/sound/usb/6fire/control.c +++ b/sound/usb/6fire/control.c @@ -290,15 +290,17 @@ static int usb6fire_control_input_vol_put(struct snd_= kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct control_runtime *rt =3D snd_kcontrol_chip(kcontrol); + int vol0 =3D ucontrol->value.integer.value[0] - 15; + int vol1 =3D ucontrol->value.integer.value[1] - 15; int changed =3D 0; =20 - if (rt->input_vol[0] !=3D ucontrol->value.integer.value[0]) { - rt->input_vol[0] =3D ucontrol->value.integer.value[0] - 15; + if (rt->input_vol[0] !=3D vol0) { + rt->input_vol[0] =3D vol0; rt->ivol_updated &=3D ~(1 << 0); changed =3D 1; } - if (rt->input_vol[1] !=3D ucontrol->value.integer.value[1]) { - rt->input_vol[1] =3D ucontrol->value.integer.value[1] - 15; + if (rt->input_vol[1] !=3D vol1) { + rt->input_vol[1] =3D vol1; rt->ivol_updated &=3D ~(1 << 1); changed =3D 1; } --- base-commit: 10cdf5ba267d89b7fc5d9f693c65a6e4af3f8e13 change-id: 20260416-alsa-6fire-input-volume-change-detection-de50b8fe278f Best regards, -- =20 C=C3=A1ssio Gabriel