From: sashiko-bot@kernel.org
To: "Brian Harring" <ferringb@gmail.com>
Cc: linux-sound@vger.kernel.org
Subject: Re: [PATCH 2/2] ALSA: usb-audio: Add ES9219 speaker volume for ASRock X870E Taichi
Date: Sun, 08 Nov 2026 19:12:55 +0000 [thread overview]
Message-ID: <sashiko-outbox-203925@kernel.org> (raw)
In-Reply-To: <20261108-alc4082-taichi-v1-2-942558088157@gmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] ALSA: usb-audio: premature private_value update in
taichi_es9219_vol_put()
- [Low] ALSA: usb-audio: wrong feature unit ID in taichi_es9219 comment
--
commit 67dc6589a98098f31e87c384d4ca4f8074ecf8d0
Author: Brian Harring <ferringb@gmail.com>
ALSA: usb-audio: Add ES9219 speaker volume for ASRock X870E Taichi
This commit adds a Speaker Playback Volume mixer control for the ASRock
X870E Taichi and Taichi Lite onboard audio by accessing the ESS ES9219
DAC over the ALC4082 codec's I2C bridge.
> diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
> index 4c7d68311f204..075fb5847030f 100644
> --- a/sound/usb/mixer_quirks.c
> +++ b/sound/usb/mixer_quirks.c
> @@ -4656,6 +4656,159 @@ static int snd_xiisound_init_fu_pins(struct usb_mixer_interface *mixer)
> return 0;
> }
>
> +/*
> + * ASRock X870E Taichi (ALC4082): the rear line exposes only mute (feature
> + * unit 19), but there is an ESS ES9219 DAC behind it that is usable for
> + * volume control.
> + */
[Severity: Low]
This isn't a bug, but should this comment say feature unit 29 rather than
19? In sound/usb/mixer_maps.c, alc408x_map maps unit 29 to "Speaker
Playback" for USB_ID(0x26ce, 0x0a0b).
[ ... ]
> +static int taichi_es9219_vol_put(struct snd_kcontrol *kctl,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + struct usb_mixer_elem_list *list = snd_kcontrol_chip(kctl);
> + long l = ucontrol->value.integer.value[0];
> + long r = ucontrol->value.integer.value[1];
> + unsigned long pv;
> + int err;
> +
> + if (l < 0 || l > TAICHI_ES9219_VOL_MAX ||
> + r < 0 || r > TAICHI_ES9219_VOL_MAX)
> + return -EINVAL;
> +
> + pv = l | (r << 8);
> + if (pv == kctl->private_value)
> + return 0;
> +
> + kctl->private_value = pv;
> + err = taichi_es9219_vol_update(list->mixer, pv);
> + return err < 0 ? err : 1;
> +}
[Severity: Medium]
Should kctl->private_value be updated only after taichi_es9219_vol_update()
succeeds?
If taichi_es9219_vol_update() fails, kctl->private_value retains the
unwritten volume. taichi_es9219_vol_get() then reports the wrong value to
userspace, and retrying the same volume in taichi_es9219_vol_put() hits the
pv == kctl->private_value check and returns 0 without writing to the DAC.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261108-alc4082-taichi-v1-0-942558088157@gmail.com?part=2
prev parent reply other threads:[~2026-11-08 19:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-08 18:58 [PATCH 0/2] Subject: [PATCH 0/2] ALSA: usb-audio: Mixer quirks for ASRock X870E Taichi Brian Harring via B4 Relay
2026-11-08 18:58 ` [PATCH 1/2] ALSA: usb-audio: Use ALC4080 mixer map " Brian Harring via B4 Relay
2026-11-08 18:58 ` [PATCH 2/2] ALSA: usb-audio: Add ES9219 speaker volume " Brian Harring via B4 Relay
2026-11-08 19:12 ` sashiko-bot [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=sashiko-outbox-203925@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=ferringb@gmail.com \
--cc=linux-sound@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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