[alsa-devel] Mixer volume/decibel mapping

Raymond Yau superquad.vortex2 at gmail.com
Sat May 22 11:24:58 CEST 2010


2010/5/21 Clemens Ladisch <clemens at ladisch.de>

> James Courtier-Dutton wrote:
> > I believe it could be extended to support a continuous range.
> > For example, some hardware uses a 32bit value to control the gain.
> > The mix operation is simply "the_sample" * "the_control_value".
> > So in this case the hardware has a linear control that can be
> > considered continuous for our purposes.
>
> Such controls already exist:
>
> $ grep -rl DB_LINEAR sound/
> sound/i2c/other/ak4xxx-adda.c
> sound/pci/oxygen/hifier.c
> sound/pci/oxygen/oxygen.c
> sound/pci/ymfpci/ymfpci_main.c
> sound/soc/codecs/stac9766.c
> sound/soc/codecs/wm8350.c
> sound/soc/codecs/wm8400.c
> sound/soc/codecs/wm8990.c
>

why is STAC9766 different from other AC97 2.3 codec ?

static const DECLARE_TLV_DB_LINEAR(master_tlv, -4600, 0);
static const DECLARE_TLV_DB_LINEAR(record_tlv, 0, 2250);
static const DECLARE_TLV_DB_LINEAR(beep_tlv, -4500, 0);
static const DECLARE_TLV_DB_LINEAR(mix_tlv, -3450, 1200);

static const struct snd_kcontrol_new stac9766_snd_ac97_controls[] = {


More information about the Alsa-devel mailing list