[alsa-devel] ASoC: How to declare volume TLV dB scale?

Sergej Sawazki ce3a at gmx.de
Fri Jun 12 21:26:24 CEST 2015


On Fri, 12 Jun 2015 18:28:54 +0200, Clemens Ladisch wrote:
> Sergej Sawazki wrote:
>> could someone please help me to understand the mixer controls TLV scale?
>> What would be the DECLARE_TLV_DB_SCALE values for the following example?
>>
>> reg. value:  0    ..  0x3ff
>> phys. value: 0dB  .. -128dB
>> volume:      100% ..  0%(mute)
>
> 0% volume would be -∞ dB.
>
> And how are the register values mapped between the min/max values?
> Does 0x200 correspond to -64 dB, or 50 % of the sample value, or
> 50 % of the volume?
>

The output of the DAC can be attenuated in 0.125dB steps, so 0x200
would be -64dB.

register value | attenuation level (dB) | volume (%)
---------------+------------------------+-----------
   0x000        |     0.0                |  100
   0x001        |    -0.125              |
    ...         |    ...                 |  ...
   0x200        |   -64.0                |
    ...         |    ...                 |  ...
   0x3fe        |  -127.75               |
   0x3ff        |    -∞ (mute)           |    0

Thanks,
Sergej


More information about the Alsa-devel mailing list