Skip to contentSkip to conversation

ALSA: scarlett2: Add Vocaster speaker/headphone mute controls

PATCH In review Geoffrey D. Bennett 2 participants 5 messages Sep 4, 2025 – Sep 6, 2025

Subsystems (2)
lore
Share & tools
lore

Geoffrey D. Bennett

author maintainer
#0 lore raw

PATCH 1/1 ALSA: scarlett2: Add Vocaster speaker/headphone mute controls

Add support for the speaker and headphone mute controls on Focusrite Vocaster interfaces. Unlike other Focusrite interfaces, these mute controls are per-output, not per-channel.

---
 sound/usb/mixer_scarlett2.c | 97 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 96 insertions(+), 1 deletion(-)
sound/usb/mixer_scarlett2.c +96 -1
index e762d6110b1a..f2446bf3982c 100644
@@ -10,8 +10,9 @@
  *   - Solo/2i2/4i4 Gen 4
  *   - Clarett 2Pre/4Pre/8Pre USB
  *   - Clarett+ 2Pre/4Pre/8Pre
+ *   - Vocaster One/Two
  *
- *   Copyright (c) 2018-2024 by Geoffrey D. Bennett <g at b4.vu>
+ *   Copyright (c) 2018-2025 by Geoffrey D. Bennett <g at b4.vu>
  *   Copyright (c) 2020-2021 by Vladimir Sadovnikov <[email protected]>
  *   Copyright (c) 2022 by Christian Colglazier <[email protected]>
  *
@@ -75,6 +76,9 @@
  * to many LinuxMusicians people and to Focusrite for hardware
  * donations).
  *
+ * Support for Vocaster One and Two added in Mar 2024 (thanks to many
+ * LinuxMusicians people and to Focusrite for hardware donations).
+ *
  * This ALSA mixer gives access to (model-dependent):
  *  - input, output, mixer-matrix muxes
  *  - mixer-matrix gain stages
@@ -364,6 +368,21 @@ static const char *const scarlett2_dim_mute_names[SCARLETT2_DIM_MUTE_COUNT] = {
 	"Mute Playback Switch", "Dim Playback Switch"
 };
 
+/* Vocaster One speaker/headphone mute names */
+static const char *const vocaster_one_sp_hp_mute_names[] = {
+	"Speaker Mute Playback Switch",
+	"Headphones Mute Playback Switch",
+	NULL
+};
+
+/* Vocaster Two speaker/headphone mute names */
+static const char *const vocaster_two_sp_hp_mute_names[] = {
+	"Speaker Mute Playback Switch",
+	"Headphones 1 Mute Playback Switch",
+	"Headphones 2 Mute Playback Switch",
+	NULL
+};
+
 /* The autogain_status is set based on the autogain_switch and
  * raw_autogain_status values.
  *
@@ -547,6 +566,7 @@ enum {
 	SCARLETT2_CONFIG_DIRECT_MONITOR_GAIN,
 	SCARLETT2_CONFIG_BLUETOOTH_VOLUME,
 	SCARLETT2_CONFIG_SPDIF_MODE,
+	SCARLETT2_CONFIG_SP_HP_MUTE,
 	SCARLETT2_CONFIG_COUNT
 };
 
@@ -814,6 +834,9 @@ static const struct scarlett2_config_set scarlett2_config_set_vocaster = {
 
 		[SCARLETT2_CONFIG_BLUETOOTH_VOLUME] = {
 			.offset = 0xbf, .size = 8, .activate = 28 },
+
+		[SCARLETT2_CONFIG_SP_HP_MUTE] = {
+			.offset = 0xab, .size = 8, .activate = 10 },
 	}
 };
 
@@ -1177,6 +1200,9 @@ struct scarlett2_device_info {
 	/* additional description for the line out volume controls */
 	const char * const line_out_descrs[SCARLETT2_ANALOGUE_MAX];
 
+	/* Vocaster speaker/headphone mute control names */
+	const char * const *sp_hp_mute_names;
+
 	/* number of sources/destinations of each port type */
 	const int port_count[SCARLETT2_PORT_TYPE_COUNT][SCARLETT2_PORT_DIRNS];
 
@@ -1249,6 +1275,7 @@ struct scarlett2_data {
 	u8 level_switch[SCARLETT2_LEVEL_SWITCH_MAX];
 	u8 pad_switch[SCARLETT2_PAD_SWITCH_MAX];
 	u8 dim_mute[SCARLETT2_DIM_MUTE_COUNT];
+	u8 sp_hp_mute;
 	u8 air_switch[SCARLETT2_AIR_SWITCH_MAX];
 	u8 dsp_switch[SCARLETT2_DSP_SWITCH_MAX];
 	s32 compressor_values[SCARLETT2_COMPRESSOR_CTLS_MAX];
@@ -1791,6 +1818,7 @@ static const struct scarlett2_device_info vocaster_one_info = {
 	.peq_flt_total_count = 4,
 	.mute_input_count = 1,
 	.gain_input_count = 1,
+	.sp_hp_mute_names = vocaster_one_sp_hp_mute_names,
 
 	.port_count = {
 		[SCARLETT2_PORT_TYPE_NONE]     = { 1,  0 },
@@ -1835,6 +1863,7 @@ static const struct scarlett2_device_info vocaster_two_info = {
 	.mute_input_count = 2,
 	.gain_input_count = 2,
 	.has_bluetooth = 1,
+	.sp_hp_mute_names = vocaster_two_sp_hp_mute_names,
 
 	.port_count = {
 		[SCARLETT2_PORT_TYPE_NONE]     = {  1,  0 },
@@ -6293,6 +6322,61 @@ static const struct snd_kcontrol_new scarlett2_dim_mute_ctl = {
 	.put  = scarlett2_dim_mute_ctl_put
 };
 
+/*** Vocaster Speaker/Headphone Mute Controls ***/
+
+static int scarlett2_sp_hp_mute_ctl_get(struct snd_kcontrol *kctl,
+					struct snd_ctl_elem_value *ucontrol)
+{
+	struct usb_mixer_elem_info *elem = kctl->private_data;
+	struct scarlett2_data *private = elem->head.mixer->private_data;
+
+	ucontrol->value.integer.value[0] =
+		!!(private->sp_hp_mute & (1 << elem->control));
+
+	return 0;
+}
+
+static int scarlett2_sp_hp_mute_ctl_put(struct snd_kcontrol *kctl,
+					struct snd_ctl_elem_value *ucontrol)
+{
+	struct usb_mixer_elem_info *elem = kctl->private_data;
+	struct usb_mixer_interface *mixer = elem->head.mixer;
+	struct scarlett2_data *private = mixer->private_data;
+	int index = elem->control;
+	int val, err;
+
+	guard(mutex)(&private->data_mutex);
+
+	if (private->hwdep_in_use)
+		return -EBUSY;
+
+	val = private->sp_hp_mute;
+
+	if (ucontrol->value.integer.value[0])
+		val |= (1 << index);
+	else
+		val &= ~(1 << index);
+
+	if (val == private->sp_hp_mute)
+		return 0;
+
+	private->sp_hp_mute = val;
+
+	/* Send change to the device */
+	err = scarlett2_usb_set_config(mixer, SCARLETT2_CONFIG_SP_HP_MUTE,
+				       0, val);
+
+	return err < 0 ? err : 1;
+}
+
+static const struct snd_kcontrol_new scarlett2_sp_hp_mute_ctl = {
+	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+	.name = "",
+	.info = snd_ctl_boolean_mono_info,
+	.get  = scarlett2_sp_hp_mute_ctl_get,
+	.put  = scarlett2_sp_hp_mute_ctl_put
+};
+
 /*** Create the analogue output controls ***/
 
 static int scarlett2_add_line_out_ctls(struct usb_mixer_interface *mixer)
@@ -6325,6 +6409,17 @@ static int scarlett2_add_line_out_ctls(struct usb_mixer_interface *mixer)
 			return err;
 	}
 
+	/* Add Vocaster speaker/headphone mute controls */
+	if (private->info->sp_hp_mute_names)
+		for (i = 0; private->info->sp_hp_mute_names[i]; i++) {
+			err = scarlett2_add_new_ctl(
+				mixer, &scarlett2_sp_hp_mute_ctl,
+				i, 1, private->info->sp_hp_mute_names[i],
+				NULL);
+			if (err < 0)
+				return err;
+		}
+
 	/* Remaining controls are only applicable if the device
 	 * has per-channel line-out volume controls.
 	 */
Signature · 1 line
2.45.0
#1 lore raw
Quoted 36 lines · Geoffrey D. Bennett

Add support for the speaker and headphone mute controls on Focusrite Vocaster interfaces. Unlike other Focusrite interfaces, these mute controls are per-output, not per-channel.

---
 sound/usb/mixer_scarlett2.c | 97 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 96 insertions(+), 1 deletion(-)
sound/usb/mixer_scarlett2.c +5 -1
index e762d6110b1a..f2446bf3982c 100644
@@ -10,8 +10,9 @@
  *   - Solo/2i2/4i4 Gen 4
  *   - Clarett 2Pre/4Pre/8Pre USB
  *   - Clarett+ 2Pre/4Pre/8Pre
+ *   - Vocaster One/Two
  *
- *   Copyright (c) 2018-2024 by Geoffrey D. Bennett <g at b4.vu>
+ *   Copyright (c) 2018-2025 by Geoffrey D. Bennett <g at b4.vu>
  *   Copyright (c) 2020-2021 by Vladimir Sadovnikov <[email protected]>
  *   Copyright (c) 2022 by Christian Colglazier <[email protected]>
  *
@@ -75,6 +76,9 @@
  * to many LinuxMusicians people and to Focusrite for hardware
  * donations).
  *
+ * Support for Vocaster One and Two added in Mar 2024 (thanks to many
+ * LinuxMusicians people and to Focusrite for hardware donations).
+ *
  * This ALSA mixer gives access to (model-dependent):
  *  - input, output, mixer-matrix muxes
  *  - mixer-matrix gain stages

sound/usb/mixer_scarlett2.c static const char *const scarlett2_dim_mute_names[SCARLETT2_DIM_MUTE_COUNT] = { · line 374

Quoted 7 lines
sound/usb/mixer_scarlett2.c +4 -0
@@ -364,6 +368,21 @@ static const char *const scarlett2_dim_mute_names[SCARLETT2_DIM_MUTE_COUNT] = {
 	"Mute Playback Switch", "Dim Playback Switch"
 };
 
+/* Vocaster One speaker/headphone mute names */
+static const char *const vocaster_one_sp_hp_mute_names[] = {
+	"Speaker Mute Playback Switch",
+	"Headphones Mute Playback Switch",

Usually "XXX Playback Switch" indicates that it's a switch for mute/unmute, hence we don't put "Mute" here.

Actually, having a "mute" switch makes difficult to judge how it
behaves: when the mixer switch is "on", is it muted, i.e. the sound goes off? It's a contradiction to other mixer controls.

thanks,

Takashi

author maintainer
#2 lore raw
Quoted 49 lines · Takashi Iwai
Quoted 36 lines · Geoffrey D. Bennett

Add support for the speaker and headphone mute controls on Focusrite Vocaster interfaces. Unlike other Focusrite interfaces, these mute controls are per-output, not per-channel.

---
 sound/usb/mixer_scarlett2.c | 97 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 96 insertions(+), 1 deletion(-)
sound/usb/mixer_scarlett2.c +5 -1
index e762d6110b1a..f2446bf3982c 100644
@@ -10,8 +10,9 @@
  *   - Solo/2i2/4i4 Gen 4
  *   - Clarett 2Pre/4Pre/8Pre USB
  *   - Clarett+ 2Pre/4Pre/8Pre
+ *   - Vocaster One/Two
  *
- *   Copyright (c) 2018-2024 by Geoffrey D. Bennett <g at b4.vu>
+ *   Copyright (c) 2018-2025 by Geoffrey D. Bennett <g at b4.vu>
  *   Copyright (c) 2020-2021 by Vladimir Sadovnikov <[email protected]>
  *   Copyright (c) 2022 by Christian Colglazier <[email protected]>
  *
@@ -75,6 +76,9 @@
  * to many LinuxMusicians people and to Focusrite for hardware
  * donations).
  *
+ * Support for Vocaster One and Two added in Mar 2024 (thanks to many
+ * LinuxMusicians people and to Focusrite for hardware donations).
+ *
  * This ALSA mixer gives access to (model-dependent):
  *  - input, output, mixer-matrix muxes
  *  - mixer-matrix gain stages

sound/usb/mixer_scarlett2.c static const char *const scarlett2_dim_mute_names[SCARLETT2_DIM_MUTE_COUNT] = { · line 374

Quoted 7 lines
sound/usb/mixer_scarlett2.c +4 -0
@@ -364,6 +368,21 @@ static const char *const scarlett2_dim_mute_names[SCARLETT2_DIM_MUTE_COUNT] = {
 	"Mute Playback Switch", "Dim Playback Switch"
 };
 
+/* Vocaster One speaker/headphone mute names */
+static const char *const vocaster_one_sp_hp_mute_names[] = {
+	"Speaker Mute Playback Switch",
+	"Headphones Mute Playback Switch",

Usually "XXX Playback Switch" indicates that it's a switch for mute/unmute, hence we don't put "Mute" here.

Quoted 8 lines

Actually, having a "mute" switch makes difficult to judge how it
behaves: when the mixer switch is "on", is it muted, i.e. the sound goes off? It's a contradiction to other mixer controls.

thanks,

Takashi

Hi Takashi,

Calling it "XXX Mute Playback Switch" distinguishes it from the other "XXX Playback Switch" controls created by the scarlett2 driver which are not mute controls, and it also follows the existing pattern for the other switch controls in the scarlett2 driver.

Some examples:

$ grep 'Playback Switch' *.state
...
[actual mutes:]
Clarett Plus 2Pre.state:                name 'Line 01 Mute Playback Switch'
Clarett Plus 2Pre.state:                name 'Line 02 Mute Playback Switch'
Clarett Plus 2Pre.state:                name 'Line 03 Mute Playback Switch'
Clarett Plus 2Pre.state:                name 'Line 04 Mute Playback Switch'
Clarett Plus 2Pre.state:                name 'Mute Playback Switch'
...
[other boolean controls, not mutes:]
Clarett Plus 2Pre.state:                name 'Dim Playback Switch'
Scarlett Gen 3 Solo.state:              name 'Direct Monitor Playback Switch'
Scarlett Gen 3 18i20.state:             name 'Talkback Mix A Playback Switch'
...
Scarlett Gen 3 18i20.state:             name 'Talkback Mix L Playback Switch'
Scarlett Gen 4 16i16.state:             name 'Speaker Switching Playback Switch'
Scarlett Gen 4 16i16.state:             name 'Speaker Switching Alt Playback Switch'

I have been consistent since I first added mute support in 0c88f9db1910 ("ALSA: usb-audio: scarlett2: Add mute support") in the use of the terminology "XXX Mute Playback Switch" and the clear logic of:
- mute on means that it's muted (no sound).
- mute off means that it's not muted.

I think usually "XXX Playback Switch" in other drivers is more of an "enable audio" boolean rather than a "mute" boolean, so there it makes sense that off = muted, on = not muted.

On the capture side in the scarlett2 driver, it is similar:

$ grep Switch V*
Vocaster One.state:             name 'MSD Mode Switch'
Vocaster One.state:             name 'Line In 1 DSP Capture Switch'
Vocaster One.state:             name 'Line In 1 Mute Capture Switch'
Vocaster One.state:             name 'Line In 1 Phantom Power Capture Switch'
Vocaster One.state:             name 'Line In 1 Autogain Capture Switch'
Vocaster Two.state:             name 'MSD Mode Switch'
Vocaster Two.state:             name 'Line In 1 DSP Capture Switch'
Vocaster Two.state:             name 'Line In 2 DSP Capture Switch'
Vocaster Two.state:             name 'Line In 1 Mute Capture Switch'
Vocaster Two.state:             name 'Line In 2 Mute Capture Switch'
Vocaster Two.state:             name 'Line In 1 Phantom Power Capture Switch'
Vocaster Two.state:             name 'Line In 2 Phantom Power Capture Switch'
Vocaster Two.state:             name 'Line In 1 Autogain Capture Switch'
Vocaster Two.state:             name 'Line In 2 Autogain Capture Switch'

alsamixer removes "Switch" and "Capture" from the name and displays e.g.:
- Line In 1 DSP
- Line In 1 Mute
- Line In 1 Phantom Power

For each of those, off means function disabled and on means function enabled, so the naming in my patch maintains consistency with all the existing device controls. It also reflects the hardware where they are called mute controls, and 0 = not muted, 1 = muted.

Does this address your concerns? The alternative would be to rename to "XXX Playback Switch" and make off = mute. I think that would make it more consistent with other drivers, but less consistent with the existing device controls.

Regards,
Geoffrey.

#3 lore raw
Quoted 127 lines · Geoffrey D. Bennett
Quoted 49 lines · Takashi Iwai
Quoted 36 lines · Geoffrey D. Bennett

Add support for the speaker and headphone mute controls on Focusrite Vocaster interfaces. Unlike other Focusrite interfaces, these mute controls are per-output, not per-channel.

---
 sound/usb/mixer_scarlett2.c | 97 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 96 insertions(+), 1 deletion(-)
sound/usb/mixer_scarlett2.c +5 -1
index e762d6110b1a..f2446bf3982c 100644
@@ -10,8 +10,9 @@
  *   - Solo/2i2/4i4 Gen 4
  *   - Clarett 2Pre/4Pre/8Pre USB
  *   - Clarett+ 2Pre/4Pre/8Pre
+ *   - Vocaster One/Two
  *
- *   Copyright (c) 2018-2024 by Geoffrey D. Bennett <g at b4.vu>
+ *   Copyright (c) 2018-2025 by Geoffrey D. Bennett <g at b4.vu>
  *   Copyright (c) 2020-2021 by Vladimir Sadovnikov <[email protected]>
  *   Copyright (c) 2022 by Christian Colglazier <[email protected]>
  *
@@ -75,6 +76,9 @@
  * to many LinuxMusicians people and to Focusrite for hardware
  * donations).
  *
+ * Support for Vocaster One and Two added in Mar 2024 (thanks to many
+ * LinuxMusicians people and to Focusrite for hardware donations).
+ *
  * This ALSA mixer gives access to (model-dependent):
  *  - input, output, mixer-matrix muxes
  *  - mixer-matrix gain stages

sound/usb/mixer_scarlett2.c static const char *const scarlett2_dim_mute_names[SCARLETT2_DIM_MUTE_COUNT] = { · line 374

Quoted 7 lines
sound/usb/mixer_scarlett2.c +4 -0
@@ -364,6 +368,21 @@ static const char *const scarlett2_dim_mute_names[SCARLETT2_DIM_MUTE_COUNT] = {
 	"Mute Playback Switch", "Dim Playback Switch"
 };
 
+/* Vocaster One speaker/headphone mute names */
+static const char *const vocaster_one_sp_hp_mute_names[] = {
+	"Speaker Mute Playback Switch",
+	"Headphones Mute Playback Switch",

Usually "XXX Playback Switch" indicates that it's a switch for mute/unmute, hence we don't put "Mute" here.

Quoted 8 lines

Actually, having a "mute" switch makes difficult to judge how it
behaves: when the mixer switch is "on", is it muted, i.e. the sound goes off? It's a contradiction to other mixer controls.

thanks,

Takashi

Hi Takashi,

Calling it "XXX Mute Playback Switch" distinguishes it from the other "XXX Playback Switch" controls created by the scarlett2 driver which are not mute controls, and it also follows the existing pattern for the other switch controls in the scarlett2 driver.

Some examples:

$ grep 'Playback Switch' *.state
...
[actual mutes:]
Clarett Plus 2Pre.state:                name 'Line 01 Mute Playback Switch'
Clarett Plus 2Pre.state:                name 'Line 02 Mute Playback Switch'
Clarett Plus 2Pre.state:                name 'Line 03 Mute Playback Switch'
Clarett Plus 2Pre.state:                name 'Line 04 Mute Playback Switch'
Clarett Plus 2Pre.state:                name 'Mute Playback Switch'
...
[other boolean controls, not mutes:]
Clarett Plus 2Pre.state:                name 'Dim Playback Switch'
Scarlett Gen 3 Solo.state:              name 'Direct Monitor Playback Switch'
Scarlett Gen 3 18i20.state:             name 'Talkback Mix A Playback Switch'
...
Scarlett Gen 3 18i20.state:             name 'Talkback Mix L Playback Switch'
Scarlett Gen 4 16i16.state:             name 'Speaker Switching Playback Switch'
Scarlett Gen 4 16i16.state:             name 'Speaker Switching Alt Playback Switch'

I have been consistent since I first added mute support in 0c88f9db1910 ("ALSA: usb-audio: scarlett2: Add mute support") in the use of the terminology "XXX Mute Playback Switch" and the clear logic of:
- mute on means that it's muted (no sound).
- mute off means that it's not muted.

I think usually "XXX Playback Switch" in other drivers is more of an "enable audio" boolean rather than a "mute" boolean, so there it makes sense that off = muted, on = not muted.

On the capture side in the scarlett2 driver, it is similar:

$ grep Switch V*
Vocaster One.state:             name 'MSD Mode Switch'
Vocaster One.state:             name 'Line In 1 DSP Capture Switch'
Vocaster One.state:             name 'Line In 1 Mute Capture Switch'
Vocaster One.state:             name 'Line In 1 Phantom Power Capture Switch'
Vocaster One.state:             name 'Line In 1 Autogain Capture Switch'
Vocaster Two.state:             name 'MSD Mode Switch'
Vocaster Two.state:             name 'Line In 1 DSP Capture Switch'
Vocaster Two.state:             name 'Line In 2 DSP Capture Switch'
Vocaster Two.state:             name 'Line In 1 Mute Capture Switch'
Vocaster Two.state:             name 'Line In 2 Mute Capture Switch'
Vocaster Two.state:             name 'Line In 1 Phantom Power Capture Switch'
Vocaster Two.state:             name 'Line In 2 Phantom Power Capture Switch'
Vocaster Two.state:             name 'Line In 1 Autogain Capture Switch'
Vocaster Two.state:             name 'Line In 2 Autogain Capture Switch'

alsamixer removes "Switch" and "Capture" from the name and displays e.g.:
- Line In 1 DSP
- Line In 1 Mute
- Line In 1 Phantom Power

For each of those, off means function disabled and on means function enabled, so the naming in my patch maintains consistency with all the existing device controls. It also reflects the hardware where they are called mute controls, and 0 = not muted, 1 = muted.

Quoted 4 lines

Does this address your concerns? The alternative would be to rename to "XXX Playback Switch" and make off = mute. I think that would make it more consistent with other drivers, but less consistent with the existing device controls.

Hm, so it was no right choice to accept the changes in the past. The negative switch is always confusing. But maybe we should accept again once after a similar stuff was already merged; otherwise it'll lead to more inconsistency.

Takashi

#4 lore raw
Quoted 135 lines · Takashi Iwai
Quoted 127 lines · Geoffrey D. Bennett
Quoted 49 lines · Takashi Iwai
Quoted 36 lines · Geoffrey D. Bennett

Add support for the speaker and headphone mute controls on Focusrite Vocaster interfaces. Unlike other Focusrite interfaces, these mute controls are per-output, not per-channel.

---
 sound/usb/mixer_scarlett2.c | 97 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 96 insertions(+), 1 deletion(-)
sound/usb/mixer_scarlett2.c +5 -1
index e762d6110b1a..f2446bf3982c 100644
@@ -10,8 +10,9 @@
  *   - Solo/2i2/4i4 Gen 4
  *   - Clarett 2Pre/4Pre/8Pre USB
  *   - Clarett+ 2Pre/4Pre/8Pre
+ *   - Vocaster One/Two
  *
- *   Copyright (c) 2018-2024 by Geoffrey D. Bennett <g at b4.vu>
+ *   Copyright (c) 2018-2025 by Geoffrey D. Bennett <g at b4.vu>
  *   Copyright (c) 2020-2021 by Vladimir Sadovnikov <[email protected]>
  *   Copyright (c) 2022 by Christian Colglazier <[email protected]>
  *
@@ -75,6 +76,9 @@
  * to many LinuxMusicians people and to Focusrite for hardware
  * donations).
  *
+ * Support for Vocaster One and Two added in Mar 2024 (thanks to many
+ * LinuxMusicians people and to Focusrite for hardware donations).
+ *
  * This ALSA mixer gives access to (model-dependent):
  *  - input, output, mixer-matrix muxes
  *  - mixer-matrix gain stages

sound/usb/mixer_scarlett2.c static const char *const scarlett2_dim_mute_names[SCARLETT2_DIM_MUTE_COUNT] = { · line 374

Quoted 7 lines
sound/usb/mixer_scarlett2.c +4 -0
@@ -364,6 +368,21 @@ static const char *const scarlett2_dim_mute_names[SCARLETT2_DIM_MUTE_COUNT] = {
 	"Mute Playback Switch", "Dim Playback Switch"
 };
 
+/* Vocaster One speaker/headphone mute names */
+static const char *const vocaster_one_sp_hp_mute_names[] = {
+	"Speaker Mute Playback Switch",
+	"Headphones Mute Playback Switch",

Usually "XXX Playback Switch" indicates that it's a switch for mute/unmute, hence we don't put "Mute" here.

Quoted 8 lines

Actually, having a "mute" switch makes difficult to judge how it
behaves: when the mixer switch is "on", is it muted, i.e. the sound goes off? It's a contradiction to other mixer controls.

thanks,

Takashi

Hi Takashi,

Calling it "XXX Mute Playback Switch" distinguishes it from the other "XXX Playback Switch" controls created by the scarlett2 driver which are not mute controls, and it also follows the existing pattern for the other switch controls in the scarlett2 driver.

Some examples:

$ grep 'Playback Switch' *.state
...
[actual mutes:]
Clarett Plus 2Pre.state:                name 'Line 01 Mute Playback Switch'
Clarett Plus 2Pre.state:                name 'Line 02 Mute Playback Switch'
Clarett Plus 2Pre.state:                name 'Line 03 Mute Playback Switch'
Clarett Plus 2Pre.state:                name 'Line 04 Mute Playback Switch'
Clarett Plus 2Pre.state:                name 'Mute Playback Switch'
...
[other boolean controls, not mutes:]
Clarett Plus 2Pre.state:                name 'Dim Playback Switch'
Scarlett Gen 3 Solo.state:              name 'Direct Monitor Playback Switch'
Scarlett Gen 3 18i20.state:             name 'Talkback Mix A Playback Switch'
...
Scarlett Gen 3 18i20.state:             name 'Talkback Mix L Playback Switch'
Scarlett Gen 4 16i16.state:             name 'Speaker Switching Playback Switch'
Scarlett Gen 4 16i16.state:             name 'Speaker Switching Alt Playback Switch'

I have been consistent since I first added mute support in 0c88f9db1910 ("ALSA: usb-audio: scarlett2: Add mute support") in the use of the terminology "XXX Mute Playback Switch" and the clear logic of:
- mute on means that it's muted (no sound).
- mute off means that it's not muted.

I think usually "XXX Playback Switch" in other drivers is more of an "enable audio" boolean rather than a "mute" boolean, so there it makes sense that off = muted, on = not muted.

On the capture side in the scarlett2 driver, it is similar:

$ grep Switch V*
Vocaster One.state:             name 'MSD Mode Switch'
Vocaster One.state:             name 'Line In 1 DSP Capture Switch'
Vocaster One.state:             name 'Line In 1 Mute Capture Switch'
Vocaster One.state:             name 'Line In 1 Phantom Power Capture Switch'
Vocaster One.state:             name 'Line In 1 Autogain Capture Switch'
Vocaster Two.state:             name 'MSD Mode Switch'
Vocaster Two.state:             name 'Line In 1 DSP Capture Switch'
Vocaster Two.state:             name 'Line In 2 DSP Capture Switch'
Vocaster Two.state:             name 'Line In 1 Mute Capture Switch'
Vocaster Two.state:             name 'Line In 2 Mute Capture Switch'
Vocaster Two.state:             name 'Line In 1 Phantom Power Capture Switch'
Vocaster Two.state:             name 'Line In 2 Phantom Power Capture Switch'
Vocaster Two.state:             name 'Line In 1 Autogain Capture Switch'
Vocaster Two.state:             name 'Line In 2 Autogain Capture Switch'

alsamixer removes "Switch" and "Capture" from the name and displays e.g.:
- Line In 1 DSP
- Line In 1 Mute
- Line In 1 Phantom Power

For each of those, off means function disabled and on means function enabled, so the naming in my patch maintains consistency with all the existing device controls. It also reflects the hardware where they are called mute controls, and 0 = not muted, 1 = muted.

Quoted 4 lines

Does this address your concerns? The alternative would be to rename to "XXX Playback Switch" and make off = mute. I think that would make it more consistent with other drivers, but less consistent with the existing device controls.

Quoted 4 lines

Hm, so it was no right choice to accept the changes in the past. The negative switch is always confusing. But maybe we should accept again once after a similar stuff was already merged; otherwise it'll lead to more inconsistency.

So I took the patch for now as is.

thanks,

Takashi