From: Cryolitia PukNgae cryolitia@uniontech.com
[ Upstream commit a73349c5dd27bc544b048e2e2c8ef6394f05b793 ]
It reports a MIN value -15360 for volume control, but will mute when setting it less than -14208
Tested-by: Guoli An anguoli@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-4-d4ca777b8512@uniontech.com Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
YES
- What it fixes - The device reports a minimum volume of -15360 (in 1/256 dB units), but actually hard-mutes for values below -14208. The quirk clamps the minimum to -14208 so users can’t set into the “mute” region by mistake. This is a clear, user-visible bugfix for a specific device.
- Change scope and exact code - Adds a device-specific case in `volume_control_quirks()` for MOONDROP Quark2 that adjusts only the minimum volume: - `sound/usb/mixer.c:1185` adds `case USB_ID(0x3302, 0x12db): /* MOONDROP Quark2 */` - `sound/usb/mixer.c:1186` matches only the “PCM Playback Volume” control name - `sound/usb/mixer.c:1189` sets `cval->min = -14208; /* Mute under it */` - The quirk function is the standard place for device-specific mixer adjustments: - Function definition: `sound/usb/mixer.c:1074` - It’s invoked during control initialization so the bounds are fixed before dB TLVs are computed and exposed: - Call site: `sound/usb/mixer.c:1303` - dB computation follows immediately and will reflect the corrected range: `sound/usb/mixer.c:1308` - If reading the current value fails, ALSA initializes to `cval->min`; this change therefore also makes the default safe for this device: - Default fallback to min: `sound/usb/mixer.c:1210`
- Precedent and pattern consistency - This is consistent with existing per-device volume quirks in the same function, e.g.: - CM102-A+/102S+ sets only `min`: `sound/usb/mixer.c:1142` and `sound/usb/mixer.c:1146` - QuickCam E3500 adjusts min/max/res: `sound/usb/mixer.c:1167`–`sound/usb/mixer.c:1173` - UDA1321/N101 adjusts only `max` under a condition: `sound/usb/mixer.c:1150`–`sound/usb/mixer.c:1165` - ESS Asus DAC adjusts min/max/res for certain control names: `sound/usb/mixer.c:1177`–`sound/usb/mixer.c:1183` - Using control-name matching (“PCM Playback Volume”) plus a USB VID:PID gate is a well-established, low-risk approach for usb-audio quirks.
- Risk assessment - Minimal footprint: a few lines, isolated to `sound/usb/mixer.c` and gated by exact USB ID and control name. - No architectural changes; affects only mixer bounds for this one device. - Does not alter `cval->max` or `cval->res`, limiting behavioral change solely to the lower bound. - Ensures users cannot select values that lead to unexpected hard mute. Improves UX and correctness.
- Stable backport criteria - Fixes a real-world, user-visible malfunction on a shipping device. - Small, contained, and consistent with existing quirk patterns. - Very low regression risk due to strict USB ID and control-name filtering. - While there’s no explicit “Cc: stable” tag, usb-audio quirk fixes of this form are routinely backported.
Conclusion: This is a textbook stable-worthy quirk fix. It should be backported to supported stable trees that contain `volume_control_quirks()` in `sound/usb/mixer.c`.
sound/usb/mixer.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 63b300bc67ba9..cf296decefefc 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -1191,6 +1191,13 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval, cval->res = 1; } break; + case USB_ID(0x3302, 0x12db): /* MOONDROP Quark2 */ + if (!strcmp(kctl->id.name, "PCM Playback Volume")) { + usb_audio_info(chip, + "set volume quirk for MOONDROP Quark2\n"); + cval->min = -14208; /* Mute under it */ + } + break; } }