[alsa-devel] [PATCH] alsa-lib/tlv: fix handling of raw value ranges

Benoît Thébaudeau benoit.thebaudeau at advansee.com
Sat Jun 2 14:26:02 CEST 2012

Hi James,

On 2 June 2012 10:09, James Courtier-Dutton <james.dutton at gmail.com> wrote:
> In the userspace to kernel interface. A mixer control must have
> min/max values.
> When writing the value, all values within the range of min to max
> must
> be valid values.
> There are just too many user land tools that rely on this fact.
> Think of the use case or "Next step louder please". If the currently
> written value is 0x40, the current user land mixer apps would try to
> write 0x41, without even bothering to look at the dB tables.
> If you instead change the driver to map:
> 0x21 to 0x40 -> 0x00 to 0x1f
> 0x61 to 0xff -> 0x20 to 0xBE
> and set min to 0, and max to 0xbe
> The user space tools will then work fine.
> The dB conversion tables are just a friendly way of displaying a
> slightly more useful figure to the user than a percentage.
> If you have hardware with gaps like the above, the kernel driver will
> have to be fixed to remove the prohibited ranges in the kernel to
> userspace API.
> This sort of conversion is done in many other alsa kernel drivers.

Thanks for the details. I'll do that.


More information about the Alsa-devel mailing list