[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250903-sound-v1-2-d4ca777b8512@uniontech.com>
Date: Wed, 03 Sep 2025 13:09:46 +0800
From: Cryolitia PukNgae via B4 Relay <devnull+cryolitia.uniontech.com@...nel.org>
To: Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
Jonathan Corbet <corbet@....net>
Cc: linux-sound@...r.kernel.org, linux-kernel@...r.kernel.org,
Mingcong Bai <jeffbai@...c.io>, Kexy Biscuit <kexybiscuit@...c.io>,
Nie Cheng <niecheng1@...ontech.com>, Zhan Jun <zhanjun@...ontech.com>,
Feng Yuan <fengyuan@...ontech.com>, Celeste Liu <uwu@...lacanthus.name>,
qaqland <anguoli@...ontech.com>, linux-doc@...r.kernel.org,
Cryolitia PukNgae <cryolitia@...ontech.com>
Subject: [PATCH 2/4] ALSA: usb-audio: add quirk
QUIRK_FLAG_MIXER_CAPTURE_MIN_MUTE
From: Cryolitia PukNgae <cryolitia@...ontech.com>
The same hardware problem to QUIRK_FLAG_MIXER_PLAYBACK_MIN_MUTE also
occurs on the capture streams on some USB devices. Add a new flag for
processing the quirk.
Link: https://lore.kernel.org/all/C22C1A172EBB9BD9+eccc2e4a-d21e-4a7d-848c-bbf3982feb94@uniontech.com/
Signed-off-by: Cryolitia PukNgae <cryolitia@...ontech.com>
---
Documentation/sound/alsa-configuration.rst | 1 +
sound/usb/mixer_quirks.c | 7 +++++++
sound/usb/usbaudio.h | 3 +++
3 files changed, 11 insertions(+)
diff --git a/Documentation/sound/alsa-configuration.rst b/Documentation/sound/alsa-configuration.rst
index 062b86522e4d9cc7ec19e978e0efc934dae9ab1b..bf45df1558bbc361ca165abaf9c5d83bfe3188e2 100644
--- a/Documentation/sound/alsa-configuration.rst
+++ b/Documentation/sound/alsa-configuration.rst
@@ -2329,6 +2329,7 @@ quirk_flags
* bit 24: Set minimum volume control value as mute for devices
where the lowest playback value represents muted state instead
of minimum audible volume
+ * bit 25: Be similar to bit 24 but for capture streams
This module supports multiple devices, autoprobe and hotplugging.
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
index 2a1abc24dbfc0c6b69d64529eda01bc25f1a6dd1..828af3095b86ee0aa8f2d248d8e714b5d3ae20eb 100644
--- a/sound/usb/mixer_quirks.c
+++ b/sound/usb/mixer_quirks.c
@@ -4550,6 +4550,13 @@ void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer,
cval->min_mute = 1;
}
+ /* lowest capture value is muted on some devices */
+ if (mixer->chip->quirk_flags & QUIRK_FLAG_MIXER_CAPTURE_MIN_MUTE)
+ if (strstr(kctl->id.name, "Capture")) {
+ usb_audio_info(mixer->chip,
+ "applying capture min mute quirk\n");
+ cval->min_mute = 1;
+ }
/* ALSA-ify some Plantronics headset control names */
if (USB_ID_VENDOR(mixer->chip->usb_id) == 0x047f &&
(cval->control == UAC_FU_MUTE || cval->control == UAC_FU_VOLUME))
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index 707b3037b1b3a3d2997157154cf78d71455bfe4b..30b5102e3caed01eeb86d0075c41338104c58950 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -222,6 +222,8 @@ extern bool snd_usb_skip_validation;
* QUIRK_FLAG_MIXER_PLAYBACK_MIN_MUTE
* Set minimum volume control value as mute for devices where the lowest
* playback value represents muted state instead of minimum audible volume
+ * QUIRK_FLAG_MIXER_CAPTURE_MIN_MUTE
+ * Similar to QUIRK_FLAG_MIXER_PLAYBACK_MIN_MUTE, but for capture streams
*/
#define QUIRK_FLAG_GET_SAMPLE_RATE (1U << 0)
@@ -249,5 +251,6 @@ extern bool snd_usb_skip_validation;
#define QUIRK_FLAG_MIC_RES_16 (1U << 22)
#define QUIRK_FLAG_MIC_RES_384 (1U << 23)
#define QUIRK_FLAG_MIXER_PLAYBACK_MIN_MUTE (1U << 24)
+#define QUIRK_FLAG_MIXER_CAPTURE_MIN_MUTE (1U << 25)
#endif /* __USBAUDIO_H */
--
2.51.0
Powered by blists - more mailing lists