ALSA: usb-audio - Don't expose broken dB ranges
Some crappy USB-audio devices give broken dB ranges, e.g. both min and max are 0dB. This confuses the volume control that prefers dB expression such as alsactl or PulseAudio. In such a case, it's much better not to expose the broken dB information. Signed-off-by: Takashi Iwai <tiwai@suse.de>hifive-unleashed-5.1
parent
13eb4ab8ca
commit
59bb7f0eeb
|
@ -1097,11 +1097,13 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
|
||||||
append_ctl_name(kctl, control == UAC_FU_MUTE ?
|
append_ctl_name(kctl, control == UAC_FU_MUTE ?
|
||||||
" Switch" : " Volume");
|
" Switch" : " Volume");
|
||||||
if (control == UAC_FU_VOLUME) {
|
if (control == UAC_FU_VOLUME) {
|
||||||
kctl->tlv.c = mixer_vol_tlv;
|
|
||||||
kctl->vd[0].access |=
|
|
||||||
SNDRV_CTL_ELEM_ACCESS_TLV_READ |
|
|
||||||
SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK;
|
|
||||||
check_mapped_dB(map, cval);
|
check_mapped_dB(map, cval);
|
||||||
|
if (cval->dBmin < cval->dBmax) {
|
||||||
|
kctl->tlv.c = mixer_vol_tlv;
|
||||||
|
kctl->vd[0].access |=
|
||||||
|
SNDRV_CTL_ELEM_ACCESS_TLV_READ |
|
||||||
|
SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue