[alsa-devel] "Negative" volume settings in a kcontrol
clemens at ladisch.de
Mon May 6 15:22:45 CEST 2013
Mike Looijmans wrote:
> Some codec registers need negative values. For example,
> sound/soc/codecs/tlv320aic32x4.c specifies this:
> 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.
> How do I explain that to Alsa?
There are some ASoC helper macros that handle signed register fields, such
as SOC_DOUBLE_S8_TLV and SOC_SINGLE_XR_SX. If those don't do what you want,
you have to write your own.
> (and on a side note "amixer" doesn't accept negative values either)
A workaround would be to set the control value first to 0 and then to
the desired negative value ... but this bug needs fixing.
More information about the Alsa-devel