From: Zipdox <zipdox@zipdox.net>
To: Takashi Iwai <tiwai@suse.de>
Cc: linux-sound@vger.kernel.org, perex@perex.cz,
linux-kernel@vger.kernel.org, tiwai@suse.com
Subject: Re: [PATCH] USB Audio Class 2 Mixer unit support for GET_CUR, SET_CUR and RANGE
Date: Thu, 17 Sep 2026 16:23:41 +0200 [thread overview]
Message-ID: <895b9e3d-bc81-4688-8513-8aa42d40e4fa@zipdox.net> (raw)
In-Reply-To: <87y0d1hx9y.wl-tiwai@suse.de>
On 9/16/26 8:22 PM, Takashi Iwai wrote:
>
> ... or maybe a less cryptic version like below.
>
>
> Takashi
>
> -- 8< --
> diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
> index 33a6a1281410..c6639a45fb24 100644
> --- a/sound/usb/mixer.c
> +++ b/sound/usb/mixer.c
> @@ -335,6 +335,16 @@ static int get_ctl_value_v1(struct usb_mixer_elem_info *cval, int request,
> return -EINVAL;
> }
>
> +/* convert the given UAC1 wValue (ICN+1|OCN+1) to UAC2 MCN */
> +static unsigned int to_mcn(const struct usb_mixer_elem_info *cval,
> + unsigned int validx)
> +{
> + unsigned char m = (validx >> 8) & 0xff;
> + unsigned char v = validx & 0xff;
> +
> + return (m - 1) * cval->num_outputs * (v - 1);
> +}
You used multiplication instead of addition for the last part. I assume
this is a mistake? Also you should probably also bitwise and that with
0xFF to make sure it's not more than one byte. The product of the number
of input and output channels must be no greater than 256 according to
the spec. I don't know if this is checked elsewhere. Other than that it
looks good for a patch to get it working. I'll try it out and send a
follow-up email shortly.
next prev parent reply other threads:[~2026-09-17 14:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 8:54 Zipdox
2026-09-15 11:08 ` Takashi Iwai
2026-09-15 12:54 ` Zipdox
2026-09-15 14:19 ` Takashi Iwai
2026-09-16 7:43 ` Zipdox
2026-09-16 15:40 ` Takashi Iwai
2026-09-16 16:58 ` Takashi Iwai
2026-09-16 18:22 ` Takashi Iwai
2026-09-17 14:23 ` Zipdox [this message]
2026-09-17 14:49 ` Takashi Iwai
2026-09-17 14:54 ` Zipdox
2026-09-17 16:15 ` Takashi Iwai
2026-09-17 16:33 ` Zipdox
2026-09-17 16:40 ` Takashi Iwai
2026-09-18 8:35 ` Zipdox
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=895b9e3d-bc81-4688-8513-8aa42d40e4fa@zipdox.net \
--to=zipdox@zipdox.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
--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
all inboxes | Powered by JetHome®