alsa-project / alsa-lib

The Advanced Linux Sound Architecture (ALSA) - library
GNU Lesser General Public License v2.1
360 stars 177 forks source link

mixer: simple: Support dB TLVs for CTL_SINGLE controls #358

Closed marcan closed 11 months ago

marcan commented 11 months ago

dB mappings do not work for controls not named "* Volume", since we do not fall back to CTL_SINGLE in get_selem_ctl. Add that branch to make it work.

Fixes dB ranges for e.g. controls named "* Gain".

marcan commented 11 months ago

For reference, there are around 96 kctls in the kernel that do not end in Volume yet have TLVs:

grep -E 'SOC_SINGLE_TLV' sound/**/*.c | cut -d'"' -f2 | grep -Ev 'Volume|Switch' | wc -l
96

So none of those are usable in dB mode in alsa-lib right now.