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

Takashi Iwai tiwai at suse.de
Fri Mar 30 13:44:43 CEST 2012


At Fri, 30 Mar 2012 12:41:44 +0200 (CEST),
Benoît Thébaudeau wrote:
> 
> Clemens Ladisch wrote:
> > Benoît Thébaudeau wrote:
> > > In case of a TLV dB range with all items having raw value ranges
> > > strictly within
> > > the main raw value range reported by the driver,
> > > snd_tlv_convert_from_dB()
> > > returned one of the main raw range boundaries, which was outside
> > > all dB range
> > > items.
> >
> > But the main raw range boundaries _are_ valid values.
> 
> Not always. For instance, if a codec register has the following volume values:
> 0x00 to 0x20: prohibited
> 0x21 to 0x40: some dB values
> 0x41 to 0x60: prohibited
> 0x61 to 0xff: some dB values

You can't prohibit the values that are exposed as accessible.
The driver may return an error -EINVAL or such, but it doesn't mean
that it's allowed to give a hole in the TLV dB definition.


Takashi


More information about the Alsa-devel mailing list