linux-sound.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ALSA: usb-audio: Add module param mixer_min_mute
@ 2025-08-29  5:10 Cryolitia PukNgae via B4 Relay
  2025-08-29  5:10 ` [PATCH 1/2] " Cryolitia PukNgae via B4 Relay
  2025-08-29  5:11 ` [PATCH 2/2] ALSA: docs: Add documents for recently changes in snd-usb-audio Cryolitia PukNgae via B4 Relay
  0 siblings, 2 replies; 6+ messages in thread
From: Cryolitia PukNgae via B4 Relay @ 2025-08-29  5:10 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jonathan Corbet
  Cc: linux-sound, linux-kernel, Mingcong Bai, Kexy Biscuit, Wang Yuli,
	Guan Wentao, Nie Cheng, Zhan Jun, Celeste Liu, Guoli An,
	linux-doc, Cryolitia PukNgae

Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com>
---
Cryolitia PukNgae (2):
      ALSA: usb-audio: Add module param mixer_min_mute
      ALSA: docs: Add documents for recently changes in snd-usb-audio

 Documentation/sound/alsa-configuration.rst | 35 ++++++++++++++++++++++++++----
 sound/usb/card.c                           |  7 ++++++
 2 files changed, 38 insertions(+), 4 deletions(-)
---
base-commit: 0c77ec32c041fec76268d46a1ae2628bafaa6a2d
change-id: 20250827-sound-param-f3dcf4afdfa2

Best regards,
-- 
Cryolitia PukNgae <cryolitia@uniontech.com>



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

* [PATCH 1/2] ALSA: usb-audio: Add module param mixer_min_mute
  2025-08-29  5:10 [PATCH 0/2] ALSA: usb-audio: Add module param mixer_min_mute Cryolitia PukNgae via B4 Relay
@ 2025-08-29  5:10 ` Cryolitia PukNgae via B4 Relay
  2025-08-29  7:55   ` Takashi Iwai
  2025-08-29  5:11 ` [PATCH 2/2] ALSA: docs: Add documents for recently changes in snd-usb-audio Cryolitia PukNgae via B4 Relay
  1 sibling, 1 reply; 6+ messages in thread
From: Cryolitia PukNgae via B4 Relay @ 2025-08-29  5:10 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jonathan Corbet
  Cc: linux-sound, linux-kernel, Mingcong Bai, Kexy Biscuit, Wang Yuli,
	Guan Wentao, Nie Cheng, Zhan Jun, Celeste Liu, Guoli An,
	linux-doc, Cryolitia PukNgae

From: Cryolitia PukNgae <cryolitia@uniontech.com>

As already discussed[1], a module parameter called mixer_min_mute is
added to make it easier for end users to debug the widespread problem
without recompiling the kernel, where USB audio devices are muted when
the volume is set to the minimum value.

1.
https://lore.kernel.org/all/20250827-sound-quirk-min-mute-v1-1-4717aa8a4f6a@uniontech.com/

Tested-by: Guoli An <anguoli@uniontech.com>
Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com>
---
 sound/usb/card.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sound/usb/card.c b/sound/usb/card.c
index 0265206a8e8cf31133e8463c98fe0497d8ace89e..bf65727ad213f2897d735c1f3c55bfc3f85971cf 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -74,6 +74,7 @@ static char *quirk_alias[SNDRV_CARDS];
 static char *delayed_register[SNDRV_CARDS];
 static bool implicit_fb[SNDRV_CARDS];
 static unsigned int quirk_flags[SNDRV_CARDS];
+static bool mixer_min_mute;
 
 bool snd_usb_use_vmalloc = true;
 bool snd_usb_skip_validation;
@@ -109,6 +110,9 @@ module_param_named(use_vmalloc, snd_usb_use_vmalloc, bool, 0444);
 MODULE_PARM_DESC(use_vmalloc, "Use vmalloc for PCM intermediate buffers (default: yes).");
 module_param_named(skip_validation, snd_usb_skip_validation, bool, 0444);
 MODULE_PARM_DESC(skip_validation, "Skip unit descriptor validation (default: no).");
+module_param(mixer_min_mute, bool, 0444);
+MODULE_PARM_DESC(mixer_min_mute,
+		 "Set minimum volume control value as mute (default: no).");
 
 /*
  * we keep the snd_usb_audio_t instances by ourselves for merging
@@ -959,6 +963,9 @@ static int usb_audio_probe(struct usb_interface *intf,
 	if (ignore_ctl_error)
 		chip->quirk_flags |= QUIRK_FLAG_IGNORE_CTL_ERROR;
 
+	if (mixer_min_mute)
+		chip->quirk_flags |= QUIRK_FLAG_MIXER_MIN_MUTE;
+
 	if (chip->quirk_flags & QUIRK_FLAG_DISABLE_AUTOSUSPEND)
 		usb_disable_autosuspend(interface_to_usbdev(intf));
 

-- 
2.51.0



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

* [PATCH 2/2] ALSA: docs: Add documents for recently changes in snd-usb-audio
  2025-08-29  5:10 [PATCH 0/2] ALSA: usb-audio: Add module param mixer_min_mute Cryolitia PukNgae via B4 Relay
  2025-08-29  5:10 ` [PATCH 1/2] " Cryolitia PukNgae via B4 Relay
@ 2025-08-29  5:11 ` Cryolitia PukNgae via B4 Relay
  2025-08-29  7:56   ` Takashi Iwai
  1 sibling, 1 reply; 6+ messages in thread
From: Cryolitia PukNgae via B4 Relay @ 2025-08-29  5:11 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jonathan Corbet
  Cc: linux-sound, linux-kernel, Mingcong Bai, Kexy Biscuit, Wang Yuli,
	Guan Wentao, Nie Cheng, Zhan Jun, Celeste Liu, Guoli An,
	linux-doc, Cryolitia PukNgae

From: Cryolitia PukNgae <cryolitia@uniontech.com>

Changed:
  - ignore_ctl_error
  - lowlatency
  - skip_validation
  - mixer_min_mute
  - quirk_flags[19:24]

Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com>
---
 Documentation/sound/alsa-configuration.rst | 35 ++++++++++++++++++++++++++----
 1 file changed, 31 insertions(+), 4 deletions(-)

diff --git a/Documentation/sound/alsa-configuration.rst b/Documentation/sound/alsa-configuration.rst
index a45174d165ebdeadd89de5f556483465c5f6e808..35b288a22e2e6d869f79ba12914b4ee6b538a6c6 100644
--- a/Documentation/sound/alsa-configuration.rst
+++ b/Documentation/sound/alsa-configuration.rst
@@ -2253,8 +2253,15 @@ device_setup
     Default: 0x0000 
 ignore_ctl_error
     Ignore any USB-controller regarding mixer interface (default: no)
+    ``ignore_ctl_error=1`` may help when you get an error at accessing
+    the mixer element such as URB error -22.  This happens on some
+    buggy USB device or the controller.  This workaround corresponds to
+    the ``quirk_flags`` bit 14, too.
 autoclock
     Enable auto-clock selection for UAC2 devices (default: yes)
+lowlatency
+    Enable low latency playback mode (default: yes).
+    Could disable it to switch back to the old mode if face a regression.
 quirk_alias
     Quirk alias list, pass strings like ``0123abcd:5678beef``, which
     applies the existing quirk for the device 5678:beef to a new
@@ -2284,6 +2291,17 @@ delayed_register
     The driver prints a message like "Found post-registration device
     assignment: 1234abcd:04" for such a device, so that user can
     notice the need.
+skip_validation
+    Skip unit descriptor validation (default: no).
+    The option is used to ignores the validation errors with the hexdump
+    of the unit descriptor instead of a driver probe error, so that we
+    can check its details.
+mixer_min_mute
+    Treat the minimum volume control value as mute (default: no).
+    ``mixer_min_mute=1`` may help when you find the audio mutes when
+    the volume is below a certain threshold.  This happens commonly with
+    USB audio devices.  This workaround corresponds to the ``quirk_flags``
+    bit 24, too.
 quirk_flags
     Contains the bit flags for various device specific workarounds.
     Applied to the corresponding card index.
@@ -2307,6 +2325,16 @@ quirk_flags
         * bit 16: Set up the interface at first like UAC1
         * bit 17: Apply the generic implicit feedback sync mode
         * bit 18: Don't apply implicit feedback sync mode
+        * bit 19: Don't closed interface during setting sample rate
+        * bit 20: Force an interface reset whenever stopping & restarting
+          a stream
+        * bit 21: Do not set PCM rate (frequency) when only one rate is
+          available for the given endpoint.
+        * bit 22: Set the fixed resolution 16 for Mic Capture Volume
+        * bit 23: Set the fixed resolution 384 for Mic Capture Volume
+        * bit 24: Set minimum volume control value as mute for devices
+          where the lowest playback value represents muted state instead
+          of minimum audible volume
 
 This module supports multiple devices, autoprobe and hotplugging.
 
@@ -2314,10 +2342,9 @@ NB: ``nrpacks`` parameter can be modified dynamically via sysfs.
 Don't put the value over 20.  Changing via sysfs has no sanity
 check.
 
-NB: ``ignore_ctl_error=1`` may help when you get an error at accessing
-the mixer element such as URB error -22.  This happens on some
-buggy USB device or the controller.  This workaround corresponds to
-the ``quirk_flags`` bit 14, too.
+NB: ``ignore_ctl_error=1`` and ``mixer_min_mute=1`` just provides A
+quick way to work around the issues.  If you have a buggy device that
+requires these quirks, please report it to the upstream.
 
 NB: ``quirk_alias`` option is provided only for testing / development.
 If you want to have a proper support, contact to upstream for

-- 
2.51.0



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

* Re: [PATCH 1/2] ALSA: usb-audio: Add module param mixer_min_mute
  2025-08-29  5:10 ` [PATCH 1/2] " Cryolitia PukNgae via B4 Relay
@ 2025-08-29  7:55   ` Takashi Iwai
  0 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2025-08-29  7:55 UTC (permalink / raw)
  To: cryolitia
  Cc: Jaroslav Kysela, Takashi Iwai, Jonathan Corbet, linux-sound,
	linux-kernel, Mingcong Bai, Kexy Biscuit, Wang Yuli, Guan Wentao,
	Nie Cheng, Zhan Jun, Celeste Liu, Guoli An, linux-doc

On Fri, 29 Aug 2025 07:10:59 +0200,
Cryolitia PukNgae via B4 Relay wrote:
> 
> From: Cryolitia PukNgae <cryolitia@uniontech.com>
> 
> As already discussed[1], a module parameter called mixer_min_mute is
> added to make it easier for end users to debug the widespread problem
> without recompiling the kernel, where USB audio devices are muted when
> the volume is set to the minimum value.
> 
> 1.
> https://lore.kernel.org/all/20250827-sound-quirk-min-mute-v1-1-4717aa8a4f6a@uniontech.com/
> 
> Tested-by: Guoli An <anguoli@uniontech.com>
> Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com>

Err, maybe I misunderstood your suggestion in the previous patch.
I didn't mean to add a new option, but only about adding the quirk
bit.

Honestly speaking, I don't want to add yet new option for a specific
quirk behavior.  Once when we add, it's sticking almost forever and we
can't delete it any longer.  Also, this option will apply to all USB
connected USB-audio devices, which may have ill effect, too.

What I had in mind instead is to extend the syntax of quirk option.
e.g. it can accept a string like "mixer_min_mute" not only the integer
value.  Or it may have a form like "$vendor:$value" so that it can be
applied no matter which slot it's assigned.


thanks,

Takashi

> ---
>  sound/usb/card.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/sound/usb/card.c b/sound/usb/card.c
> index 0265206a8e8cf31133e8463c98fe0497d8ace89e..bf65727ad213f2897d735c1f3c55bfc3f85971cf 100644
> --- a/sound/usb/card.c
> +++ b/sound/usb/card.c
> @@ -74,6 +74,7 @@ static char *quirk_alias[SNDRV_CARDS];
>  static char *delayed_register[SNDRV_CARDS];
>  static bool implicit_fb[SNDRV_CARDS];
>  static unsigned int quirk_flags[SNDRV_CARDS];
> +static bool mixer_min_mute;
>  
>  bool snd_usb_use_vmalloc = true;
>  bool snd_usb_skip_validation;
> @@ -109,6 +110,9 @@ module_param_named(use_vmalloc, snd_usb_use_vmalloc, bool, 0444);
>  MODULE_PARM_DESC(use_vmalloc, "Use vmalloc for PCM intermediate buffers (default: yes).");
>  module_param_named(skip_validation, snd_usb_skip_validation, bool, 0444);
>  MODULE_PARM_DESC(skip_validation, "Skip unit descriptor validation (default: no).");
> +module_param(mixer_min_mute, bool, 0444);
> +MODULE_PARM_DESC(mixer_min_mute,
> +		 "Set minimum volume control value as mute (default: no).");
>  
>  /*
>   * we keep the snd_usb_audio_t instances by ourselves for merging
> @@ -959,6 +963,9 @@ static int usb_audio_probe(struct usb_interface *intf,
>  	if (ignore_ctl_error)
>  		chip->quirk_flags |= QUIRK_FLAG_IGNORE_CTL_ERROR;
>  
> +	if (mixer_min_mute)
> +		chip->quirk_flags |= QUIRK_FLAG_MIXER_MIN_MUTE;
> +
>  	if (chip->quirk_flags & QUIRK_FLAG_DISABLE_AUTOSUSPEND)
>  		usb_disable_autosuspend(interface_to_usbdev(intf));
>  
> 
> -- 
> 2.51.0
> 
> 

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

* Re: [PATCH 2/2] ALSA: docs: Add documents for recently changes in snd-usb-audio
  2025-08-29  5:11 ` [PATCH 2/2] ALSA: docs: Add documents for recently changes in snd-usb-audio Cryolitia PukNgae via B4 Relay
@ 2025-08-29  7:56   ` Takashi Iwai
  2025-08-29  8:22     ` Cryolitia PukNgae
  0 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2025-08-29  7:56 UTC (permalink / raw)
  To: cryolitia
  Cc: Jaroslav Kysela, Takashi Iwai, Jonathan Corbet, linux-sound,
	linux-kernel, Mingcong Bai, Kexy Biscuit, Wang Yuli, Guan Wentao,
	Nie Cheng, Zhan Jun, Celeste Liu, Guoli An, linux-doc

On Fri, 29 Aug 2025 07:11:00 +0200,
Cryolitia PukNgae via B4 Relay wrote:
> 
> From: Cryolitia PukNgae <cryolitia@uniontech.com>
> 
> Changed:
>   - ignore_ctl_error
>   - lowlatency
>   - skip_validation
>   - mixer_min_mute
>   - quirk_flags[19:24]

While I'm not going to take mixer_min_mute option addition, the others
in this patch look good.  Could you resubmit only for those?


thanks,

Takashi

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

* Re: [PATCH 2/2] ALSA: docs: Add documents for recently changes in snd-usb-audio
  2025-08-29  7:56   ` Takashi Iwai
@ 2025-08-29  8:22     ` Cryolitia PukNgae
  0 siblings, 0 replies; 6+ messages in thread
From: Cryolitia PukNgae @ 2025-08-29  8:22 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Jaroslav Kysela, Takashi Iwai, Jonathan Corbet, linux-sound,
	linux-kernel, Mingcong Bai, Kexy Biscuit, Wang Yuli, Guan Wentao,
	Nie Cheng, Zhan Jun, Celeste Liu, Guoli An, linux-doc


On 29/08/2025 15.56, Takashi Iwai wrote:
> On Fri, 29 Aug 2025 07:11:00 +0200,
> Cryolitia PukNgae via B4 Relay wrote:
>> From: Cryolitia PukNgae <cryolitia@uniontech.com>
>>
>> Changed:
>>   - ignore_ctl_error
>>   - lowlatency
>>   - skip_validation
>>   - mixer_min_mute
>>   - quirk_flags[19:24]
> While I'm not going to take mixer_min_mute option addition, the others
> in this patch look good.  Could you resubmit only for those?
>
Ok. I'll quickly send a patch to complement the already existed codes.
And then we could discuss how to design it gracefully.

Thx for your review.
> thanks,
>
> Takashi
>

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

end of thread, other threads:[~2025-08-29  8:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-29  5:10 [PATCH 0/2] ALSA: usb-audio: Add module param mixer_min_mute Cryolitia PukNgae via B4 Relay
2025-08-29  5:10 ` [PATCH 1/2] " Cryolitia PukNgae via B4 Relay
2025-08-29  7:55   ` Takashi Iwai
2025-08-29  5:11 ` [PATCH 2/2] ALSA: docs: Add documents for recently changes in snd-usb-audio Cryolitia PukNgae via B4 Relay
2025-08-29  7:56   ` Takashi Iwai
2025-08-29  8:22     ` Cryolitia PukNgae

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).