Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH] ALSA: usb-audio: Initialize Audient iD14 MkII monitor mix at unity gain
@ 2026-11-26 12:01 Никита Тарасов
  2026-11-28 15:41 ` Christian Ruppert
  0 siblings, 1 reply; 2+ messages in thread
From: Никита Тарасов @ 2026-11-26 12:01 UTC (permalink / raw)
  To: linux-sound; +Cc: tiwai, mrwillporter, arc, drabik.p

[-- Attachment #1: Type: text/plain, Size: 4373 bytes --]

The Audient iD14 MkII (2708:0008) feeds its main monitor outputs from a
four-channel volume feature unit (FU 12).  The unit's attenuation is
asymmetric in the device firmware: the left main channel ignores its
volume value while the right main channel applies it, so any value
below 0 dB unbalances the main stereo pair.  Commit 9c0564fcc21a
("ALSA: usb-audio: Rename the Audient iD14 monitor mix volume
control") renamed the control so that userspace does not adopt it as a
master volume, but nothing brings the unit to a known-good state.

In addition, the firmware silently drops volume SET_CUR requests that
arrive while the driver is probing the device after a USB reset: the
request is ACKed but ignored, and a GET_CUR issued immediately
afterwards echoes the last payload instead of the actual state (the
same shared-response-buffer behaviour reported for the iD14 MkI in the
"ALSA: usb-audio: Audient iD14 MkI vendor controls" RFC series).
Writes issued after probe has settled are applied reliably.

Schedule a delayed work that writes 0 dB to all four channels of FU 12
three seconds after the mixer is created, mirroring the startup state
of the Audient desktop application, and cancel it on disconnect via
private_free.

Tested on linux 7.3.6 with an iD14 MkII: with FU 12 left at -25 dB,
reconnecting the device now restores unity gain automatically.

Signed-off-by: Nikita Tarasov <nik@tarasov.top>
---
 sound/usb/mixer_quirks.c | 65 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
index 01210cc..2672f6f 100644
--- a/sound/usb/mixer_quirks.c
+++ b/sound/usb/mixer_quirks.c
@@ -4419,6 +4419,67 @@ static int snd_djm_controls_create(struct usb_mixer_interface *mixer,
 	return 0;
 }
 
+struct audient_mix_init {
+	struct usb_mixer_interface *mixer;
+	struct delayed_work work;
+};
+
+static void audient_monitor_mix_work(struct work_struct *work)
+{
+	struct audient_mix_init *d =
+		container_of(work, struct audient_mix_init, work.work);
+	struct snd_usb_audio *chip = d->mixer->chip;
+	/* 0 dB on all four channels (main L/R, cue L/R) */
+	const u8 target[2] = { 0x00, 0x00 };
+	u8 ch;
+
+	for (ch = 1; ch <= 4; ch++)
+		snd_usb_ctl_msg(chip->dev, usb_sndctrlpipe(chip->dev, 0),
+			UAC_SET_CUR,
+			USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_OUT,
+			(UAC_FU_VOLUME << 8) | ch,
+			snd_usb_ctrl_intf(d->mixer->hostif) | (12 << 8),
+			(void *)target, sizeof(target));
+}
+
+static void audient_monitor_mix_free(struct usb_mixer_interface *mixer)
+{
+	struct audient_mix_init *d = mixer->private_data;
+
+	cancel_delayed_work_sync(&d->work);
+	kfree(d);
+	mixer->private_data = NULL;
+	mixer->private_free = NULL;
+}
+
+/*
+ * The Audient iD14 MkII main monitor outputs are fed by a four-channel
+ * volume feature unit (FU 12) whose attenuation is asymmetric in the
+ * firmware: the left main channel ignores its volume value while the
+ * right one applies it, so any value below 0 dB unbalances the stereo
+ * pair.  Ensure the unit starts at unity gain, like the Audient desktop
+ * application does.
+ *
+ * The firmware silently drops volume writes that arrive while the
+ * driver is still probing the device after a USB reset (the request is
+ * ACKed but ignored), so apply them from a delayed work once probe has
+ * settled.
+ */
+static int audient_monitor_mix_init(struct usb_mixer_interface *mixer)
+{
+	struct audient_mix_init *d;
+
+	d = kzalloc_obj(*d);
+	if (!d)
+		return -ENOMEM;
+	d->mixer = mixer;
+	INIT_DELAYED_WORK(&d->work, audient_monitor_mix_work);
+	queue_delayed_work(system_percpu_wq, &d->work, msecs_to_jiffies(3000));
+	mixer->private_data = d;
+	mixer->private_free = audient_monitor_mix_free;
+	return 0;
+}
+
 int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
 {
 	int err = 0;
@@ -4557,6 +4618,10 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
 		err = dell_dock_mixer_create(mixer);
 		break;
 
+	case USB_ID(0x2708, 0x0008): /* Audient iD14 MkII */
+		err = audient_monitor_mix_init(mixer);
+		break;
+
 	case USB_ID(0x2a39, 0x3fd2): /* RME ADI-2 Pro */
 	case USB_ID(0x2a39, 0x3fd3): /* RME ADI-2 DAC */
 	case USB_ID(0x2a39, 0x3fd4): /* RME */
-- 
2.56.1

[-- Attachment #2: audient-id14-mkii-unity.patch --]
[-- Type: application/octet-stream, Size: 4622 bytes --]

From b3823b4b23f4034b6b435b1a7d584be81946273d Mon Sep 17 00:00:00 2001
From: Nikita Tarasov <nik@tarasov.top>
Date: Thu, 26 Nov 2026 16:14:56 +0500
Subject: [PATCH] ALSA: usb-audio: Initialize Audient iD14 MkII monitor mix at
 unity gain

The Audient iD14 MkII (2708:0008) feeds its main monitor outputs from a
four-channel volume feature unit (FU 12).  The unit's attenuation is
asymmetric in the device firmware: the left main channel ignores its
volume value while the right main channel applies it, so any value
below 0 dB unbalances the main stereo pair.  Commit 9c0564fcc21a
("ALSA: usb-audio: Rename the Audient iD14 monitor mix volume
control") renamed the control so that userspace does not adopt it as a
master volume, but nothing brings the unit to a known-good state.

In addition, the firmware silently drops volume SET_CUR requests that
arrive while the driver is probing the device after a USB reset: the
request is ACKed but ignored, and a GET_CUR issued immediately
afterwards echoes the last payload instead of the actual state (the
same shared-response-buffer behaviour reported for the iD14 MkI in the
"ALSA: usb-audio: Audient iD14 MkI vendor controls" RFC series).
Writes issued after probe has settled are applied reliably.

Schedule a delayed work that writes 0 dB to all four channels of FU 12
three seconds after the mixer is created, mirroring the startup state
of the Audient desktop application, and cancel it on disconnect via
private_free.

Tested on linux 7.3.6 with an iD14 MkII: with FU 12 left at -25 dB,
reconnecting the device now restores unity gain automatically.

Signed-off-by: Nikita Tarasov <nik@tarasov.top>
---
 sound/usb/mixer_quirks.c | 65 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
index 01210cc..2672f6f 100644
--- a/sound/usb/mixer_quirks.c
+++ b/sound/usb/mixer_quirks.c
@@ -4419,6 +4419,67 @@ static int snd_djm_controls_create(struct usb_mixer_interface *mixer,
 	return 0;
 }
 
+struct audient_mix_init {
+	struct usb_mixer_interface *mixer;
+	struct delayed_work work;
+};
+
+static void audient_monitor_mix_work(struct work_struct *work)
+{
+	struct audient_mix_init *d =
+		container_of(work, struct audient_mix_init, work.work);
+	struct snd_usb_audio *chip = d->mixer->chip;
+	/* 0 dB on all four channels (main L/R, cue L/R) */
+	const u8 target[2] = { 0x00, 0x00 };
+	u8 ch;
+
+	for (ch = 1; ch <= 4; ch++)
+		snd_usb_ctl_msg(chip->dev, usb_sndctrlpipe(chip->dev, 0),
+			UAC_SET_CUR,
+			USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_OUT,
+			(UAC_FU_VOLUME << 8) | ch,
+			snd_usb_ctrl_intf(d->mixer->hostif) | (12 << 8),
+			(void *)target, sizeof(target));
+}
+
+static void audient_monitor_mix_free(struct usb_mixer_interface *mixer)
+{
+	struct audient_mix_init *d = mixer->private_data;
+
+	cancel_delayed_work_sync(&d->work);
+	kfree(d);
+	mixer->private_data = NULL;
+	mixer->private_free = NULL;
+}
+
+/*
+ * The Audient iD14 MkII main monitor outputs are fed by a four-channel
+ * volume feature unit (FU 12) whose attenuation is asymmetric in the
+ * firmware: the left main channel ignores its volume value while the
+ * right one applies it, so any value below 0 dB unbalances the stereo
+ * pair.  Ensure the unit starts at unity gain, like the Audient desktop
+ * application does.
+ *
+ * The firmware silently drops volume writes that arrive while the
+ * driver is still probing the device after a USB reset (the request is
+ * ACKed but ignored), so apply them from a delayed work once probe has
+ * settled.
+ */
+static int audient_monitor_mix_init(struct usb_mixer_interface *mixer)
+{
+	struct audient_mix_init *d;
+
+	d = kzalloc_obj(*d);
+	if (!d)
+		return -ENOMEM;
+	d->mixer = mixer;
+	INIT_DELAYED_WORK(&d->work, audient_monitor_mix_work);
+	queue_delayed_work(system_percpu_wq, &d->work, msecs_to_jiffies(3000));
+	mixer->private_data = d;
+	mixer->private_free = audient_monitor_mix_free;
+	return 0;
+}
+
 int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
 {
 	int err = 0;
@@ -4557,6 +4618,10 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
 		err = dell_dock_mixer_create(mixer);
 		break;
 
+	case USB_ID(0x2708, 0x0008): /* Audient iD14 MkII */
+		err = audient_monitor_mix_init(mixer);
+		break;
+
 	case USB_ID(0x2a39, 0x3fd2): /* RME ADI-2 Pro */
 	case USB_ID(0x2a39, 0x3fd3): /* RME ADI-2 DAC */
 	case USB_ID(0x2a39, 0x3fd4): /* RME */
-- 
2.56.1


[-- Attachment #3: Type: text/plain, Size: 2 bytes --]




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

end of thread, other threads:[~2026-11-28 15:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 12:01 [PATCH] ALSA: usb-audio: Initialize Audient iD14 MkII monitor mix at unity gain Никита Тарасов
2026-11-28 15:41 ` Christian Ruppert

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