OSDN Git Service

alsactl: correctly restore dB values of controls with changed range
authorClemens Ladisch <clemens@ladisch.de>
Wed, 26 May 2010 08:27:25 +0000 (10:27 +0200)
committerClemens Ladisch <clemens@ladisch.de>
Wed, 26 May 2010 08:27:25 +0000 (10:27 +0200)
commit4f29877d54f9132219261218c2357e2b6e8910f4
tree17e67c7e5c78caf504ff500ab10817e9ff584d3b
parent224c12238e484ec795ace29bf5ff712dbae21633
alsactl: correctly restore dB values of controls with changed range

When the range of a control has changed between driver versions, it is a
good idea to restore the same dB value of the control.  However,
computing the dB value by interpolating betweem the min/max dB values
duplicates alsa-lib's TLV functions and does not even work for controls
with a linear dB range.

A simple conversion to dB and back can be done if we add the dB value(s)
to the saved state.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
alsactl/state.c