[alsa-devel] Mixer volume/decibel mapping

Clemens Ladisch clemens at ladisch.de
Fri May 21 08:35:31 CEST 2010


James Courtier-Dutton wrote:
> I believe it could be extended to support a continuous range.
> For example, some hardware uses a 32bit value to control the gain.
> The mix operation is simply "the_sample" * "the_control_value".
> So in this case the hardware has a linear control that can be
> considered continuous for our purposes.

Such controls already exist:

$ grep -rl DB_LINEAR sound/
sound/i2c/other/ak4xxx-adda.c
sound/pci/oxygen/hifier.c
sound/pci/oxygen/oxygen.c
sound/pci/ymfpci/ymfpci_main.c
sound/soc/codecs/stac9766.c
sound/soc/codecs/wm8350.c
sound/soc/codecs/wm8400.c
sound/soc/codecs/wm8990.c

> The conversion from the control value to a usable value would have to
> include a user land log operation.
> It was never implemented due to lack of demand.

It is implemented.

> For the cards that do have this 32bit linear value, a simple lookup
> table is used in the kernel code to convert it to 256 step values.

Which driver is this?  It should be changed to use the full range.


Regards,
Clemens


More information about the Alsa-devel mailing list