[alsa-devel] Mixer volume/decibel mapping

Raymond Yau superquad.vortex2 at gmail.com
Tue May 25 15:51:18 CEST 2010


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

> Raymond Yau wrote:
> > 2010/5/21 Clemens Ladisch <clemens at ladisch.de>
> > > DB_LINEAR means that the mixer control value is a multiplier for the
> > > PCM sample value, as James wrote.  A DB_LINEAR mapping has
> > > 0 == -infinity dB, full scale == 0 dB, and the mapping between mixer
> > > control values and corresponding dB values it _not_ linear.
> >
> > pci/oxygen/oxygen.c:static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale,
> TLV_DB_GAIN_MUTE, 0);
> > pci/oxygen/hifier.c:static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale,
> TLV_DB_GAIN_MUTE, 0);
> >
> > Refer to AK4396 datasheet
> >
> > Output Volume
> >
> > The AK4396 includes channel independent digital output volumes (ATT) with
> > 256 levels at linear step including MUTE.
> > These volumes are in front of the DAC and can attenuate the input data
> from
> > 0dB to –48dB and mute.
> >
> > dB range is -48dB to 0dB only
> >
> > ATT7-0: Attenuation Level
> >         ATT = 20 log10 (ATT_DATA / 255) [dB]
> >         FFH : 0dB (Default)
> >         00H : Mute
>
> This is the section of the datasheet on which the above declarations are
> based.
>
> Now if you have some remark or question, you should remember to include
> it in your mail.
>
>
> Regards,
> Clemens
>

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 ,  DR and S/N
is only 120dB

ATT = 20 log10 (ATT_DATA / 255) [dB]

How can AK4396 has scale of -inf DB to 0dB in the driver code  ?

BTW , if ymf7xx (DSP) only accept 16 bit digital PCM data and output to
18-20 bit AC97 codec , how can the per stream volume control has a scale
-inf dB to 0dB ?

inf dB may occur  when  DSP accept floating point

however  the storage of Float pointing is still finite , the min dB of DSP
accept FLOAT64 should in theory lower than the min dB of those DSP accept
FLOAT32


More information about the Alsa-devel mailing list