[alsa-devel] Mixer volume/decibel mapping

Raymond Yau superquad.vortex2 at gmail.com
Fri May 28 15:04:34 CEST 2010


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

> Raymond Yau wrote:
> > I have doubt about DECLARE_TLV_DB_LINEAR(ak4396_db_scale,
> TLV_DB_GAIN_MUTE, 0);
> >
> > since the datasheet mention that dB range is only -48dB to 0dB
> >
> > ATT = 20 log10 (ATT_DATA / 255) [dB]
> >
> > How can AK4396 has scale of -inf DB to 0dB in the driver code  ?
>
> When ATT_DATA = 0, there is no output, which is an attenuation of -inf.
> The next value, ATT_DATA = 1, results in ATT = -48 dB.
>



refer to ice1712/prodigy_hifi.c , why the comment is -64dB to 0dB  ?


/*
 * ak4396 mixers
*/


/*
 * DAC volume attenuation mixer control (-64dB to 0dB)
*/


static int ak4396_dac_vol_info(struct snd_kcontrol *kcontrol, struct
snd_ctl_elem_info *uinfo)
{
        uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
        uinfo->count = 2;
        uinfo->value.integer.min = 0;   /* mute */
        uinfo->value.integer.max = 0xFF; /* linear */
       return 0;
}



This is true regardless of the precision of the multiplier.  Even a one-
> bit factor behaves like this; in fact, this would describe a mute switch.
>
>
>
This mean that the dB range should be calculated from the next step above
the min_dB and max_dB when min_dB regarded as a mute switch


More information about the Alsa-devel mailing list