ALSA: usb-audio: add quirk QUIRK_FLAG_MIXER_CAPTURE_MIN_MUTE

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@uniontech.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250903-sound-v1-2-d4ca777b8512@uniontech.com
This commit is contained in:
Cryolitia PukNgae 2025-09-03 13:09:46 +08:00 committed by Takashi Iwai
parent ace1817ab4
commit 759b5ce3e6
3 changed files with 11 additions and 0 deletions

View file

@ -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.

View file

@ -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))

View file

@ -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 */