[alsa-devel] "Negative" volume settings in a kcontrol

Mike Looijmans mike.looijmans at topic.nl
Thu May 2 16:13:00 CEST 2013

Some codec registers need negative values. For example,
sound/soc/codecs/tlv320aic32x4.c specifies this:

  75 static DECLARE_TLV_DB_SCALE(tlv_step_0_5, 0, 50, 0);

  78         SOC_DOUBLE_R_TLV("PCM Playback Volume", AIC32X4_LDACVOL,
  79                         AIC32X4_RDACVOL, 0, 0x30, 0, tlv_step_0_5),

It's incomplete. The actual range is from -63.5dB to +24dB in 0.5 dB 
steps. The 8-bit value is interpreted as a signed 8-bit integer, so to 
get -3dB the register value must be -6 or 0xFA.

For some reason, the author seemed to think that no one would ever want 
to lower the volume of the output, so he just limited the range to 
0..24dB. Or, more likely, like me he did not have a clue how to 
configure this.

There are quite a few more registers like this, usually the range is 
limited in both negative and positive ranges.

How do I explain that to Alsa?

(and on a side note "amixer" doesn't accept negative values either)

More information about the Alsa-devel mailing list