public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ALSA: usb-audio: Refactor mixer checks and add check for sticky mixers
@ 2026-04-10 17:49 Rong Zhang
  2026-04-10 17:49 ` [PATCH 1/3] ALSA: usb-audio: Add error checks against get_min_max*() Rong Zhang
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Rong Zhang @ 2026-04-10 17:49 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai
  Cc: Icenowy Zheng, linux-sound, linux-kernel, Rong Zhang,
	Takashi Iwai

All callers of get_min_max*() ignore the latter's return code
completely. This means to ignore temporary errors at the probe time.
However, it is not optimal and leads to some maintenance burdens.
Besides, get_min_max_with_quirks() is too lengthy and hard to read.

Some devices' mixers are sticky, which accept SET_CUR but do absolutely
nothing. Registering these mixers confuses userspace and results in
ineffective volume control.

Patch 1 makes get_min_max*() return -EAGAIN for temporary errors, and
check against it in the callers of get_min_max*(). If any other error
occurs, bail out of the caller early.

Patch 2 moves the volume control resolution check code into a function
as it's relatively self-contained.

Patch 3 checks if a mixer is sticky by setting the volume to the maximum
or minimum value and checking for effectiveness afterward, and prevents
the mixer from being registered if it turns out to be sticky.

Quirky device sample:

  usb 7-1: New USB device found, idVendor=0e0b, idProduct=fa01, bcdDevice= 1.00
  usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
  usb 7-1: Product: Feaulle Rainbow
  usb 7-1: Manufacturer: Generic
  usb 7-1: SerialNumber: 20210726905926
  (Mic Capture Volume)

This series is separated from https://lore.kernel.org/r/20260409-feaulle-rainbow-v1-2-09179e09000d@rong.moe

Signed-off-by: Rong Zhang <i@rong.moe>
---
Rong Zhang (3):
      ALSA: usb-audio: Add error checks against get_min_max*()
      ALSA: usb-audio: Move volume control resolution check into a function
      ALSA: usb-audio: Do not expose sticky mixers

 sound/usb/mixer.c | 138 ++++++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 103 insertions(+), 35 deletions(-)
---
base-commit: 5a5fea9a0d663da182e04f4a4c7a35bd935a14c2
change-id: 20260409-uac-sticky-mixer-627528939d83

Thanks,
Rong


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-04-11  8:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-10 17:49 [PATCH 0/3] ALSA: usb-audio: Refactor mixer checks and add check for sticky mixers Rong Zhang
2026-04-10 17:49 ` [PATCH 1/3] ALSA: usb-audio: Add error checks against get_min_max*() Rong Zhang
2026-04-10 17:49 ` [PATCH 2/3] ALSA: usb-audio: Move volume control resolution check into a function Rong Zhang
2026-04-10 17:49 ` [PATCH 3/3] ALSA: usb-audio: Do not expose sticky mixers Rong Zhang
2026-04-11  8:03 ` [PATCH 0/3] ALSA: usb-audio: Refactor mixer checks and add check for " Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox