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

Clemens Ladisch clemens at ladisch.de
Sat Jun 13 12:29:35 CEST 2015


Sergej Sawazki wrote:
> On Sat, 13 Jun 2015 09:15:49 +0200, Takashi Iwai wrote:
>> Clemens Ladisch wrote:
>>> 0.125 dB is too small for the 0.01 dB resolution of DECLARE_TLV_DB_SCALE,
>>> so you have to use DB_MINMAX instead:  TLV_DB_MINMAX_MUTE_ITEM(-128, 0)
>>
>> And you need to implement the ctl get/put callback to revert the value
>> as (0x3ff - raw value).  An decrement value isn't supposed to work.

If you're using one of the SOC_xxx_TLV macros, you would set the 'invert'
parameter.

> I am getting the expected dB scaling with:
> DECLARE_TLV_DB_MINMAX_MUTE(vol_tlv, -12800, 0)
> does it make sense?

Yes.  (-128 would have been -1.28 dB.)


Regards,
Clemens


More information about the Alsa-devel mailing list