Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Christian Ruppert <arc@gmx.li>
To: "Никита Тарасов" <nik@tarasov.top>
Cc: linux-sound@vger.kernel.org, tiwai@suse.de,
	mrwillporter@gmail.com, drabik.p@gmail.com
Subject: Re: [PATCH] ALSA: usb-audio: Initialize Audient iD14 MkII monitor mix at unity gain
Date: Sat, 28 Nov 2026 16:41:42 +0100	[thread overview]
Message-ID: <awr2FXUok_k34MRc@khmer.arcnet> (raw)
In-Reply-To: <781FF3DB-B352-4B18-A42D-40AAB3A46C51@tarasov.top>

Hi Никита,

It looks like your patch is partially covered by a series of patches for
much broader iD14 support which is currently being prepared by Will, see
https://lore.kernel.org/linux-sound/20261115214336.17917-1-arc@gmx.li/ for
the latest patch series proposal (which will be close to the final one).

Could you please check which aspects of your patch are covered by these
patches (I suspect Will's patches concerning FU12 are the most relevant)
and rebase the remainder on top of it?

Thanks,
  Christian

On Thu, Nov 26, 2026 at 05:01:17PM +0500, Никита Тарасов wrote:
> 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

      reply	other threads:[~2026-11-28 15:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=awr2FXUok_k34MRc@khmer.arcnet \
    --to=arc@gmx.li \
    --cc=drabik.p@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=mrwillporter@gmail.com \
    --cc=nik@tarasov.top \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox