ALSA: emu10k1: enable bit-exact playback, part 2: voice attenuation
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>
Sun, 14 May 2023 17:03:23 +0000 (19:03 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 16 May 2023 09:11:04 +0000 (11:11 +0200)
commitbcdbd3b7888e1db89b7b2f7c78237c9ed5c2ebb1
tree28e01cac493ddac6d65e345e5bf07dd20219477d
parent1298bc978afba0a507cedd0a91e53267ca152804
ALSA: emu10k1: enable bit-exact playback, part 2: voice attenuation

The voice volume is a raw fractional multiplier that can't actually
represent 1.0. To still enable real pass-through, we now set the volume
to 0.5 (which results in no loss of precision, as the FX bus provides
fractional values) and scale up the samples in DSP code.

To maintain backwards compatibility with existing configuration files,
we rescale the values in the mixer controls. The range is extended
upwards from 0xffff to 0x1fffd, which actually introduces the
possibility of specifying an amplification.

There is still a minor incompatibility with user space, namely if
someone loaded custom DSP code. They'll just get half the volume, so
this doesn't seem like a big deal.

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Link: https://lore.kernel.org/r/20230514170323.3408834-8-oswald.buddenhagen@gmx.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Documentation/sound/cards/audigy-mixer.rst
Documentation/sound/cards/sb-live-mixer.rst
include/sound/emu10k1.h
sound/pci/emu10k1/emufx.c
sound/pci/emu10k1/emumixer.c
sound/pci/emu10k1/emupcm.c