Linux Sound subsystem development
 help / color / mirror / Atom feed
* Re: [PATCH] ALSA: usb-audio: Babyface Pro: keep the mixer value out of the index bits
       [not found] <179607388314.299107.6947794007730497348@ismailbahloul.com>
@ 2026-12-01  6:34 ` Takashi Iwai
  0 siblings, 0 replies; only message in thread
From: Takashi Iwai @ 2026-12-01  6:34 UTC (permalink / raw)
  To: ismail; +Cc: Takashi Iwai, Jaroslav Kysela, linux-sound, Stefan Stistrup,
	stable

On Mon, 30 Nov 2026 22:24:43 +0100,
Ismaïl Bahloul wrote:
> 
> [yBewdd] The Babyface Pro mixer controls keep their register index and their
> value in private_value as idx | (val << SND_BBFPRO_MIXER_VAL_SHIFT).
> Commit e9606148a671 added the main outs at index 992 and widened
> SND_BBFPRO_MIXER_IDX_MASK from 0x1ff to 0x3ff, but left the value
> shifted by 9, so bit 0 of the value now lands on bit 9 of the index.

Some strange suffix at the beginning?

> Writing an odd value to a crosspoint (index below 512) therefore sets
> bit 9 of its index: every later write to that control goes to register
> idx + 512 instead, and the control reads back as value | 1, until the
> module is reloaded. alsactl restore of a saved odd value does this at
> every boot. The main outs already have bit 9 set, so they always read
> back odd (an unwritten one reads 1) but keep their register.
> 
> Shift the value by 10 bits. The 18-bit value still fits.
> 
> Seen on a Babyface Pro FS in class-compliant mode, on 7.3.6, writing 1
> then 32768 to "PCM-AN1-ADAT3 Playback Volume" (index 168). Without
> this patch the second write goes out with wIndex 0x02a8 (index 680)
> and reads back 32769. With it, every write goes to index 168 and
> reads back exactly.
> 
> Note for users: a state saved by alsactl on an affected kernel holds
> 1 for any main out that was never written. The old kernel skipped
> restoring it, since the control already read 1. With this fix the
> write goes through and sets that main out to 1/65536 (about -96 dB),
> so those outputs come up nearly silent until the level is set again.
> 
> Fixes: e9606148a671 ("ALSA: usb-audio: Add input gain and master output mixer
> elements for RME Babyface Pro")

Don't fold, a Fixes tag should be a single line.

> Cc: stable@vger.kernel.org
> Signed-off-by: Ismaïl Bahloul

Please give the mail address to Signed-off-by line.

> ---
> sound/usb/mixer_quirks.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
> --- a/sound/usb/mixer_quirks.c
> +++ b/sound/usb/mixer_quirks.c
> @@ -2920,7 +2920,7 @@
> #define SND_BBFPRO_MIXER_MAIN_OUT_CH_OFFSET 992
> #define SND_BBFPRO_MIXER_IDX_MASK 0x3ff
> #define SND_BBFPRO_MIXER_VAL_MASK 0x3ffff
> -#define SND_BBFPRO_MIXER_VAL_SHIFT 9
> +#define SND_BBFPRO_MIXER_VAL_SHIFT 10
> #define SND_BBFPRO_MIXER_VAL_MIN 0 // -inf
> #define SND_BBFPRO_MIXER_VAL_MAX 65536 // +6dB

The patch can't be applied cleanly because the mailer broke
spaces/tabs.

Could you correct the above and resubmit?


thanks,

Takashi

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-12-01  6:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <179607388314.299107.6947794007730497348@ismailbahloul.com>
2026-12-01  6:34 ` [PATCH] ALSA: usb-audio: Babyface Pro: keep the mixer value out of the index bits Takashi Iwai

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