Skip to content

Commit 38b6519

Browse files
committed
ALSA: usb-audio - Fix missing mixer dB information
The recent fix for testing dB range at the mixer creation time seems to cause regressions in some devices. In such devices, reading the dB info at probing time gives an error, thus both dBmin and dBmax are still zero, and TLV flag isn't set although the later read of dB info succeeds. This patch adds a workaround for such a case by assuming that the later read will succeed. In future, a similar test should be performed in a case where a wrong dB range is seen even in the later read. Signed-off-by: Takashi Iwai <tiwai@suse.de> Cc: <stable@kernel.org>
1 parent 3fe45ae commit 38b6519

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎sound/usb/mixer.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ static inline void check_mapped_dB(const struct usbmix_name_map *p,
152152
if (p && p->dB) {
153153
cval->dBmin = p->dB->min;
154154
cval->dBmax = p->dB->max;
155+
cval->initialized = 1;
155156
}
156157
}
157158

@@ -1092,7 +1093,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
10921093
" Switch" : " Volume");
10931094
if (control == UAC_FU_VOLUME) {
10941095
check_mapped_dB(map, cval);
1095-
if (cval->dBmin < cval->dBmax) {
1096+
if (cval->dBmin < cval->dBmax || !cval->initialized) {
10961097
kctl->tlv.c = mixer_vol_tlv;
10971098
kctl->vd[0].access |=
10981099
SNDRV_CTL_ELEM_ACCESS_TLV_READ |

0 commit comments

Comments
 (0)