]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ALSA: usb-audio: move mixer_quirks' min_mute into common quirk
authorCryolitia PukNgae <cryolitia@uniontech.com>
Wed, 27 Aug 2025 03:29:02 +0000 (11:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Oct 2025 11:40:36 +0000 (13:40 +0200)
[ Upstream commit 2c3ca8cc55a3afc7a4fa99ed8f5f5d05dd2e65b3 ]

We have found more and more devices that have the same problem, that
the mixer's minimum value is muted. Accroding to pipewire's MR[1]
and Arch Linux wiki[2], this should be a very common problem in USB
audio devices. Move the quirk into common quirk,as a preparation of
more devices' quirk's patch coming on the road[3].

1. https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/2514
2. https://wiki.archlinux.org/index.php?title=PipeWire&oldid=804138#No_sound_from_USB_DAC_until_30%_volume
3. On the road, in the physical sense. We have been buying ton of
   these devices for testing the problem.

Tested-by: Guoli An <anguoli@uniontech.com>
Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com>
Link: https://patch.msgid.link/20250827-sound-quirk-min-mute-v1-1-4717aa8a4f6a@uniontech.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/usb/mixer_quirks.c
sound/usb/quirks.c
sound/usb/usbaudio.h

index 8c0b8383abe1ea355d71de13db4be5dde9427637..270a0be672b7ec80e4a19dd66b1a024d05a4cd4d 100644 (file)
@@ -3899,16 +3899,12 @@ void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer,
                if (unitid == 7 && cval->control == UAC_FU_VOLUME)
                        snd_dragonfly_quirk_db_scale(mixer, cval, kctl);
                break;
+       }
+
        /* lowest playback value is muted on some devices */
-       case USB_ID(0x0572, 0x1b09): /* Conexant Systems (Rockwell), Inc. */
-       case USB_ID(0x0d8c, 0x000c): /* C-Media */
-       case USB_ID(0x0d8c, 0x0014): /* C-Media */
-       case USB_ID(0x19f7, 0x0003): /* RODE NT-USB */
-       case USB_ID(0x2d99, 0x0026): /* HECATE G2 GAMING HEADSET */
+       if (mixer->chip->quirk_flags & QUIRK_FLAG_MIXER_MIN_MUTE)
                if (strstr(kctl->id.name, "Playback"))
                        cval->min_mute = 1;
-               break;
-       }
 
        /* ALSA-ify some Plantronics headset control names */
        if (USB_ID_VENDOR(mixer->chip->usb_id) == 0x047f &&
index d4f4466b028c8dfca57eb275c28c5fe3b0ff82b7..5b1aa5c4189992d1efd528b64f7b18e0022c896e 100644 (file)
@@ -2094,6 +2094,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
                   QUIRK_FLAG_SET_IFACE_FIRST),
        DEVICE_FLG(0x0556, 0x0014, /* Phoenix Audio TMX320VC */
                   QUIRK_FLAG_GET_SAMPLE_RATE),
+       DEVICE_FLG(0x0572, 0x1b09, /* Conexant Systems (Rockwell), Inc. */
+                  QUIRK_FLAG_MIXER_MIN_MUTE),
        DEVICE_FLG(0x05a3, 0x9420, /* ELP HD USB Camera */
                   QUIRK_FLAG_GET_SAMPLE_RATE),
        DEVICE_FLG(0x05a7, 0x1020, /* Bose Companion 5 */
@@ -2140,8 +2142,10 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
                   QUIRK_FLAG_GET_SAMPLE_RATE),
        DEVICE_FLG(0x0c45, 0x636b, /* Microdia JP001 USB Camera */
                   QUIRK_FLAG_GET_SAMPLE_RATE),
-       DEVICE_FLG(0x0d8c, 0x0014, /* USB Audio Device */
-                  QUIRK_FLAG_CTL_MSG_DELAY_1M),
+       DEVICE_FLG(0x0d8c, 0x000c, /* C-Media */
+                  QUIRK_FLAG_MIXER_MIN_MUTE),
+       DEVICE_FLG(0x0d8c, 0x0014, /* C-Media */
+                  QUIRK_FLAG_CTL_MSG_DELAY_1M | QUIRK_FLAG_MIXER_MIN_MUTE),
        DEVICE_FLG(0x0ecb, 0x205c, /* JBL Quantum610 Wireless */
                   QUIRK_FLAG_FIXED_RATE),
        DEVICE_FLG(0x0ecb, 0x2069, /* JBL Quantum810 Wireless */
@@ -2188,6 +2192,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
                   QUIRK_FLAG_ITF_USB_DSD_DAC | QUIRK_FLAG_CTL_MSG_DELAY),
        DEVICE_FLG(0x1901, 0x0191, /* GE B850V3 CP2114 audio interface */
                   QUIRK_FLAG_GET_SAMPLE_RATE),
+       DEVICE_FLG(0x19f7, 0x0003, /* RODE NT-USB */
+                  QUIRK_FLAG_MIXER_MIN_MUTE),
        DEVICE_FLG(0x19f7, 0x0035, /* RODE NT-USB+ */
                   QUIRK_FLAG_GET_SAMPLE_RATE),
        DEVICE_FLG(0x1bcf, 0x2281, /* HD Webcam */
@@ -2248,6 +2254,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
                   QUIRK_FLAG_CTL_MSG_DELAY_1M),
        DEVICE_FLG(0x2d95, 0x8021, /* VIVO USB-C-XE710 HEADSET */
                   QUIRK_FLAG_CTL_MSG_DELAY_1M),
+       DEVICE_FLG(0x2d99, 0x0026, /* HECATE G2 GAMING HEADSET */
+                  QUIRK_FLAG_MIXER_MIN_MUTE),
        DEVICE_FLG(0x2fc6, 0xf0b7, /* iBasso DC07 Pro */
                   QUIRK_FLAG_CTL_MSG_DELAY_1M),
        DEVICE_FLG(0x30be, 0x0101, /* Schiit Hel */
index 65dcb1a02e97636d0299eeb2ed511ddb10017258..17db6a7f3a844430244059a177642b9192a1af5f 100644 (file)
@@ -180,6 +180,9 @@ extern bool snd_usb_skip_validation;
  *  for the given endpoint.
  * QUIRK_FLAG_MIC_RES_16 and QUIRK_FLAG_MIC_RES_384
  *  Set the fixed resolution for Mic Capture Volume (mostly for webcams)
+ * QUIRK_FLAG_MIXER_MIN_MUTE
+ *  Set minimum volume control value as mute for devices where the lowest
+ *  playback value represents muted state instead of minimum audible volume
  */
 
 #define QUIRK_FLAG_GET_SAMPLE_RATE     (1U << 0)
@@ -206,5 +209,6 @@ extern bool snd_usb_skip_validation;
 #define QUIRK_FLAG_FIXED_RATE          (1U << 21)
 #define QUIRK_FLAG_MIC_RES_16          (1U << 22)
 #define QUIRK_FLAG_MIC_RES_384         (1U << 23)
+#define QUIRK_FLAG_MIXER_MIN_MUTE      (1U << 24)
 
 #endif /* __USBAUDIO_H */