[alsa-devel] Lost dB volumes on USB headset between 2.6.38 and 3.0
Hmm, I and Colin Guthrie have found a regression between kernels 2.6.38 and 3.0.
When running "amixer -D hw:handset" for this device under 2.6.38, the attached file is returned. Under 3.0, the dB information is missing. This can't be intentional, can it?
David Henningsson wrote:
Hmm, I and Colin Guthrie have found a regression between kernels 2.6.38 and 3.0.
When running "amixer -D hw:handset" for this device under 2.6.38, the attached file is returned. Under 3.0, the dB information is missing. This can't be intentional, can it?
There are patches that might have introduced bugs, but these two patches do remove dB information intentionally:
ALSA: usb-audio - Don't expose broken dB ranges: http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff;h=59bb7f0eebe6 ALSA: usb-audio - Add volume range check and warn if it too big: http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff;h=80acefff3bc7
Are there any messages in the system log when loading the driver? What are the controls' dB ranges (see "amixer contents")?
Regards, Clemens
On 2011-08-09 12:39, Clemens Ladisch wrote:
David Henningsson wrote:
Hmm, I and Colin Guthrie have found a regression between kernels 2.6.38 and 3.0.
When running "amixer -D hw:handset" for this device under 2.6.38, the attached file is returned. Under 3.0, the dB information is missing. This can't be intentional, can it?
There are patches that might have introduced bugs, but these two patches do remove dB information intentionally:
ALSA: usb-audio - Don't expose broken dB ranges: http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff;h=59bb7f0eebe6 ALSA: usb-audio - Add volume range check and warn if it too big: http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff;h=80acefff3bc7
Are there any messages in the system log when loading the driver? What are the controls' dB ranges (see "amixer contents")?
I'm attaching "amixer contents" from 2.6.38. Colin will attach some interesting dmesg output from 3.0 shortly.
'Twas brillig, and Clemens Ladisch at 09/08/11 12:39 did gyre and gimble:
David Henningsson wrote:
Hmm, I and Colin Guthrie have found a regression between kernels 2.6.38 and 3.0.
When running "amixer -D hw:handset" for this device under 2.6.38, the attached file is returned. Under 3.0, the dB information is missing. This can't be intentional, can it?
There are patches that might have introduced bugs, but these two patches do remove dB information intentionally:
ALSA: usb-audio - Don't expose broken dB ranges: http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff;h=59bb7f0eebe6 ALSA: usb-audio - Add volume range check and warn if it too big: http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff;h=80acefff3bc7
Are there any messages in the system log when loading the driver? What are the controls' dB ranges (see "amixer contents")?
Interesting thanks fpr the hints.
I get this when plugging in the device David mentioned previously.
usb 3-1: USB disconnect, device number 2 usbcore: deregistering interface driver snd-usb-audio usb 2-1: new full speed USB device number 7 using uhci_hcd usb 2-1: New USB device found, idVendor=1885, idProduct=0501 usb 2-1: New USB device strings: Mfr=2, Product=1, SerialNumber=0 usb 2-1: Product: BT Agile handset usb 2-1: Manufacturer: Ascalade input: Ascalade BT Agile handset as /devices/pci0000:00/0000:00:1d.1/usb2/2-1/2-1:1.3/input/input14 generic-usb 0003:1885:0501.0006: input,hidraw0: USB HID v1.00 Device [Ascalade BT Agile handset] on usb-0000:00:1d.1-1/input3 13:0: cannot get min/max values for control 2 (id 13) 14:0: cannot get min/max values for control 2 (id 14) 9:0: cannot get min/max values for control 2 (id 9) 10:0: cannot get min/max values for control 2 (id 10) 11:0: cannot get min/max values for control 2 (id 11) 9:0: cannot get min/max values for control 2 (id 9) 14:0: cannot get min/max values for control 2 (id 14) 11:0: cannot get min/max values for control 2 (id 11) 13:0: cannot get min/max values for control 2 (id 13) 10:0: cannot get min/max values for control 2 (id 10) 9:0: cannot get min/max values for control 2 (id 9) usbcore: registered new interface driver snd-usb-audio
At Tue, 09 Aug 2011 13:19:37 +0200, Colin Guthrie wrote:
'Twas brillig, and Clemens Ladisch at 09/08/11 12:39 did gyre and gimble:
David Henningsson wrote:
Hmm, I and Colin Guthrie have found a regression between kernels 2.6.38 and 3.0.
When running "amixer -D hw:handset" for this device under 2.6.38, the attached file is returned. Under 3.0, the dB information is missing. This can't be intentional, can it?
There are patches that might have introduced bugs, but these two patches do remove dB information intentionally:
ALSA: usb-audio - Don't expose broken dB ranges: http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff;h=59bb7f0eebe6 ALSA: usb-audio - Add volume range check and warn if it too big: http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff;h=80acefff3bc7
Are there any messages in the system log when loading the driver? What are the controls' dB ranges (see "amixer contents")?
Interesting thanks fpr the hints.
I get this when plugging in the device David mentioned previously.
usb 3-1: USB disconnect, device number 2 usbcore: deregistering interface driver snd-usb-audio usb 2-1: new full speed USB device number 7 using uhci_hcd usb 2-1: New USB device found, idVendor=1885, idProduct=0501 usb 2-1: New USB device strings: Mfr=2, Product=1, SerialNumber=0 usb 2-1: Product: BT Agile handset usb 2-1: Manufacturer: Ascalade input: Ascalade BT Agile handset as /devices/pci0000:00/0000:00:1d.1/usb2/2-1/2-1:1.3/input/input14 generic-usb 0003:1885:0501.0006: input,hidraw0: USB HID v1.00 Device [Ascalade BT Agile handset] on usb-0000:00:1d.1-1/input3 13:0: cannot get min/max values for control 2 (id 13) 14:0: cannot get min/max values for control 2 (id 14) 9:0: cannot get min/max values for control 2 (id 9) 10:0: cannot get min/max values for control 2 (id 10) 11:0: cannot get min/max values for control 2 (id 11) 9:0: cannot get min/max values for control 2 (id 9) 14:0: cannot get min/max values for control 2 (id 14) 11:0: cannot get min/max values for control 2 (id 11) 13:0: cannot get min/max values for control 2 (id 13) 10:0: cannot get min/max values for control 2 (id 10) 9:0: cannot get min/max values for control 2 (id 9)
So the problem is that the driver can't extract the dB values. If the problem is seen only at the beginning of driver initialization, the patch below may work.
Also, could you give "lsusb -v" output, too?
Takashi
--- diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index c04d7c7..cdd19d7 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -152,6 +152,7 @@ static inline void check_mapped_dB(const struct usbmix_name_map *p, if (p && p->dB) { cval->dBmin = p->dB->min; cval->dBmax = p->dB->max; + cval->initialized = 1; } }
@@ -1092,7 +1093,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc, " Switch" : " Volume"); if (control == UAC_FU_VOLUME) { check_mapped_dB(map, cval); - if (cval->dBmin < cval->dBmax) { + if (cval->dBmin < cval->dBmax || !cval->initialized) { kctl->tlv.c = mixer_vol_tlv; kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ |
'Twas brillig, and Takashi Iwai at 09/08/11 13:40 did gyre and gimble:
At Tue, 09 Aug 2011 13:19:37 +0200, Colin Guthrie wrote:
'Twas brillig, and Clemens Ladisch at 09/08/11 12:39 did gyre and gimble:
David Henningsson wrote:
Hmm, I and Colin Guthrie have found a regression between kernels 2.6.38 and 3.0.
When running "amixer -D hw:handset" for this device under 2.6.38, the attached file is returned. Under 3.0, the dB information is missing. This can't be intentional, can it?
There are patches that might have introduced bugs, but these two patches do remove dB information intentionally:
ALSA: usb-audio - Don't expose broken dB ranges: http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff;h=59bb7f0eebe6 ALSA: usb-audio - Add volume range check and warn if it too big: http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff;h=80acefff3bc7
Are there any messages in the system log when loading the driver? What are the controls' dB ranges (see "amixer contents")?
Interesting thanks fpr the hints.
I get this when plugging in the device David mentioned previously.
usb 3-1: USB disconnect, device number 2 usbcore: deregistering interface driver snd-usb-audio usb 2-1: new full speed USB device number 7 using uhci_hcd usb 2-1: New USB device found, idVendor=1885, idProduct=0501 usb 2-1: New USB device strings: Mfr=2, Product=1, SerialNumber=0 usb 2-1: Product: BT Agile handset usb 2-1: Manufacturer: Ascalade input: Ascalade BT Agile handset as /devices/pci0000:00/0000:00:1d.1/usb2/2-1/2-1:1.3/input/input14 generic-usb 0003:1885:0501.0006: input,hidraw0: USB HID v1.00 Device [Ascalade BT Agile handset] on usb-0000:00:1d.1-1/input3 13:0: cannot get min/max values for control 2 (id 13) 14:0: cannot get min/max values for control 2 (id 14) 9:0: cannot get min/max values for control 2 (id 9) 10:0: cannot get min/max values for control 2 (id 10) 11:0: cannot get min/max values for control 2 (id 11) 9:0: cannot get min/max values for control 2 (id 9) 14:0: cannot get min/max values for control 2 (id 14) 11:0: cannot get min/max values for control 2 (id 11) 13:0: cannot get min/max values for control 2 (id 13) 10:0: cannot get min/max values for control 2 (id 10) 9:0: cannot get min/max values for control 2 (id 9)
So the problem is that the driver can't extract the dB values. If the problem is seen only at the beginning of driver initialization, the patch below may work.
Also, could you give "lsusb -v" output, too?
Sure here it is. I actually have two USB cards plugged in here, both of which have now lost their dB info. The one above is here and the new one is the Yamaha one.
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index c04d7c7..cdd19d7 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -152,6 +152,7 @@ static inline void check_mapped_dB(const struct usbmix_name_map *p, if (p && p->dB) { cval->dBmin = p->dB->min; cval->dBmax = p->dB->max;
}cval->initialized = 1;
}
@@ -1092,7 +1093,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc, " Switch" : " Volume"); if (control == UAC_FU_VOLUME) { check_mapped_dB(map, cval);
if (cval->dBmin < cval->dBmax) {
if (cval->dBmin < cval->dBmax || !cval->initialized) { kctl->tlv.c = mixer_vol_tlv; kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ |
Not had a chance to test this yet but I will when I get a moment.
Col
On 08/16/2011 02:31 PM, Colin Guthrie wrote:
'Twas brillig, and Takashi Iwai at 09/08/11 13:40 did gyre and gimble:
At Tue, 09 Aug 2011 13:19:37 +0200, Colin Guthrie wrote:
'Twas brillig, and Clemens Ladisch at 09/08/11 12:39 did gyre and gimble:
David Henningsson wrote:
Hmm, I and Colin Guthrie have found a regression between kernels 2.6.38 and 3.0.
When running "amixer -D hw:handset" for this device under 2.6.38, the attached file is returned. Under 3.0, the dB information is missing. This can't be intentional, can it?
There are patches that might have introduced bugs, but these two patches do remove dB information intentionally:
ALSA: usb-audio - Don't expose broken dB ranges: http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff;h=59bb7f0eebe6 ALSA: usb-audio - Add volume range check and warn if it too big: http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff;h=80acefff3bc7
Are there any messages in the system log when loading the driver? What are the controls' dB ranges (see "amixer contents")?
Interesting thanks fpr the hints.
I get this when plugging in the device David mentioned previously.
usb 3-1: USB disconnect, device number 2 usbcore: deregistering interface driver snd-usb-audio usb 2-1: new full speed USB device number 7 using uhci_hcd usb 2-1: New USB device found, idVendor=1885, idProduct=0501 usb 2-1: New USB device strings: Mfr=2, Product=1, SerialNumber=0 usb 2-1: Product: BT Agile handset usb 2-1: Manufacturer: Ascalade input: Ascalade BT Agile handset as /devices/pci0000:00/0000:00:1d.1/usb2/2-1/2-1:1.3/input/input14 generic-usb 0003:1885:0501.0006: input,hidraw0: USB HID v1.00 Device [Ascalade BT Agile handset] on usb-0000:00:1d.1-1/input3 13:0: cannot get min/max values for control 2 (id 13) 14:0: cannot get min/max values for control 2 (id 14) 9:0: cannot get min/max values for control 2 (id 9) 10:0: cannot get min/max values for control 2 (id 10) 11:0: cannot get min/max values for control 2 (id 11) 9:0: cannot get min/max values for control 2 (id 9) 14:0: cannot get min/max values for control 2 (id 14) 11:0: cannot get min/max values for control 2 (id 11) 13:0: cannot get min/max values for control 2 (id 13) 10:0: cannot get min/max values for control 2 (id 10) 9:0: cannot get min/max values for control 2 (id 9)
So the problem is that the driver can't extract the dB values. If the problem is seen only at the beginning of driver initialization, the patch below may work.
Also, could you give "lsusb -v" output, too?
Sure here it is. I actually have two USB cards plugged in here, both of which have now lost their dB info. The one above is here and the new one is the Yamaha one.
Never saw that attachment (did you forget to attach it?) but here's a third one which lacks dB volumes in 3.0 (but had in 2.6.38).
2011/8/16 Colin Guthrie gmane@colin.guthr.ie:
'Twas brillig, and Takashi Iwai at 09/08/11 13:40 did gyre and gimble:
At Tue, 09 Aug 2011 13:19:37 +0200, Colin Guthrie wrote:
There are patches that might have introduced bugs, but these two patches do remove dB information intentionally:
ALSA: usb-audio - Don't expose broken dB ranges: http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff;h=59bb7f0eebe6
Revert this patch fix the problem for my logitech webcam since dBmin and dBmax are still zero
ALSA endpoint.c:450: 2:3:1: add audio endpoint 0x86 dBMin 0 dBMax 0 min 0 max 1 control 1 UAC_FU_VOLUME 2 ALSA mixer.c:1186: [5] FU [Mic Capture Switch] ch = 1, val = 0/1/1 ALSA mixer.c:805: 5:2: cannot get min/max values for control 2 (id 5) control 2 UAC_FU_VOLUME 2 dBmin 0 dBmax 0 ALSA mixer.c:1186: [5] FU [Mic Capture Volume] ch = 1, val = 0/1/1 ALSA mixer.c:805: 5:2: cannot get min/max values for control 2 (id 5) usbcore: registered new interface driver snd-usb-audio dBMin 1800 dBMax 3000 min 1200 max 1e00
At Tue, 16 Aug 2011 13:31:52 +0100, Colin Guthrie wrote:
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index c04d7c7..cdd19d7 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -152,6 +152,7 @@ static inline void check_mapped_dB(const struct usbmix_name_map *p, if (p && p->dB) { cval->dBmin = p->dB->min; cval->dBmax = p->dB->max;
}cval->initialized = 1;
}
@@ -1092,7 +1093,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc, " Switch" : " Volume"); if (control == UAC_FU_VOLUME) { check_mapped_dB(map, cval);
if (cval->dBmin < cval->dBmax) {
if (cval->dBmin < cval->dBmax || !cval->initialized) { kctl->tlv.c = mixer_vol_tlv; kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ |
Not had a chance to test this yet but I will when I get a moment.
Any chance to test the patch?
Takashi
2011/8/18 Takashi Iwai tiwai@suse.de:
At Tue, 16 Aug 2011 13:31:52 +0100, Colin Guthrie wrote:
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index c04d7c7..cdd19d7 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -152,6 +152,7 @@ static inline void check_mapped_dB(const struct usbmix_name_map *p, if (p && p->dB) { cval->dBmin = p->dB->min; cval->dBmax = p->dB->max;
- cval->initialized = 1;
} }
@@ -1092,7 +1093,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc, " Switch" : " Volume"); if (control == UAC_FU_VOLUME) { check_mapped_dB(map, cval);
- if (cval->dBmin < cval->dBmax) {
- if (cval->dBmin < cval->dBmax || !cval->initialized) {
kctl->tlv.c = mixer_vol_tlv; kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ |
Not had a chance to test this yet but I will when I get a moment.
Any chance to test the patch?
The patch seem fix the no dB scale problem , however the broken dB test which you added seem redundant as cval->dBmin and cval->dBmax are still zero because error in get_min_max() at build_feature_ctl() and it seem that the valid dBmin and dBMax are calculated by get_min_max() at mixer_ctl_feature_info() on my usb logitech web cam
LSA endpoint.c:450: 2:3:1: add audio endpoint 0x86 ALSA mixer.c:1182: [5] FU [Mic Capture Switch] ch = 1, val = 0/1/1 ALSA mixer.c:804: 5:2: cannot get min/max values for control 2 (id 5) ALSA mixer.c:1182: [5] FU [Mic Capture Volume] ch = 1, val = 0/1/1 ALSA mixer.c:804: 5:2: cannot get min/max values for control 2 (id 5) usbcore: registered new interface driver snd-usb-audio
At Fri, 19 Aug 2011 06:55:54 +0800, Raymond Yau wrote:
2011/8/18 Takashi Iwai tiwai@suse.de:
At Tue, 16 Aug 2011 13:31:52 +0100, Colin Guthrie wrote:
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index c04d7c7..cdd19d7 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -152,6 +152,7 @@ static inline void check_mapped_dB(const struct usbmix_name_map *p, if (p && p->dB) { cval->dBmin = p->dB->min; cval->dBmax = p->dB->max;
- cval->initialized = 1;
} }
@@ -1092,7 +1093,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc, " Switch" : " Volume"); if (control == UAC_FU_VOLUME) { check_mapped_dB(map, cval);
- if (cval->dBmin < cval->dBmax) {
- if (cval->dBmin < cval->dBmax || !cval->initialized) {
kctl->tlv.c = mixer_vol_tlv; kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ |
Not had a chance to test this yet but I will when I get a moment.
Any chance to test the patch?
The patch seem fix the no dB scale problem , however the broken dB test which you added seem redundant as cval->dBmin and cval->dBmax are still zero because error in get_min_max() at build_feature_ctl() and it seem that the valid dBmin and dBMax are calculated by get_min_max() at mixer_ctl_feature_info() on my usb logitech web cam
Yeah, that's a known problem. The dB-test is missing when reading dB failed at probing time and later it gives a wrong value.
We can add another dB-test later, and remove TLV bit from kcontrol.access on the fly. But for that, we'd need to notify via SNDRV_CTL_EVENT_MASK_INFO, too.
thanks,
Takashi
At Fri, 19 Aug 2011 07:53:44 +0200, Takashi Iwai wrote:
At Fri, 19 Aug 2011 06:55:54 +0800, Raymond Yau wrote:
2011/8/18 Takashi Iwai tiwai@suse.de:
At Tue, 16 Aug 2011 13:31:52 +0100, Colin Guthrie wrote:
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index c04d7c7..cdd19d7 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -152,6 +152,7 @@ static inline void check_mapped_dB(const struct usbmix_name_map *p, if (p && p->dB) { cval->dBmin = p->dB->min; cval->dBmax = p->dB->max;
- cval->initialized = 1;
} }
@@ -1092,7 +1093,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc, " Switch" : " Volume"); if (control == UAC_FU_VOLUME) { check_mapped_dB(map, cval);
- if (cval->dBmin < cval->dBmax) {
- if (cval->dBmin < cval->dBmax || !cval->initialized) {
kctl->tlv.c = mixer_vol_tlv; kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ |
Not had a chance to test this yet but I will when I get a moment.
Any chance to test the patch?
The patch seem fix the no dB scale problem , however the broken dB test which you added seem redundant as cval->dBmin and cval->dBmax are still zero because error in get_min_max() at build_feature_ctl() and it seem that the valid dBmin and dBMax are calculated by get_min_max() at mixer_ctl_feature_info() on my usb logitech web cam
Yeah, that's a known problem. The dB-test is missing when reading dB failed at probing time and later it gives a wrong value.
We can add another dB-test later, and remove TLV bit from kcontrol.access on the fly. But for that, we'd need to notify via SNDRV_CTL_EVENT_MASK_INFO, too.
I meant something like below.
Takashi
--- diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index cdd19d7..78a5abd 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -881,8 +881,17 @@ static int mixer_ctl_feature_info(struct snd_kcontrol *kcontrol, struct snd_ctl_ uinfo->value.integer.min = 0; uinfo->value.integer.max = 1; } else { - if (! cval->initialized) - get_min_max(cval, 0); + if (!cval->initialized) { + get_min_max(cval, 0); + if (cval->initialized && cval->dBmin >= cval->dBmax) { + kcontrol->vd[0].access &= + ~(SNDRV_CTL_ELEM_ACCESS_TLV_READ | + SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK); + snd_ctl_notify(cval->mixer->chip->card, + SNDRV_CTL_EVENT_MASK_INFO, + &kcontrol->id); + } + } uinfo->value.integer.min = 0; uinfo->value.integer.max = (cval->max - cval->min + cval->res - 1) / cval->res;
2011/8/19 Takashi Iwai tiwai@suse.de:
At Fri, 19 Aug 2011 07:53:44 +0200, Takashi Iwai wrote:
Yeah, that's a known problem. The dB-test is missing when reading dB failed at probing time and later it gives a wrong value.
We can add another dB-test later, and remove TLV bit from kcontrol.access on the fly. But for that, we'd need to notify via SNDRV_CTL_EVENT_MASK_INFO, too.
I meant something like below.
Takashi
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index cdd19d7..78a5abd 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -881,8 +881,17 @@ static int mixer_ctl_feature_info(struct snd_kcontrol *kcontrol, struct snd_ctl_ uinfo->value.integer.min = 0; uinfo->value.integer.max = 1; } else {
- if (! cval->initialized)
- get_min_max(cval, 0);
- if (!cval->initialized) {
- get_min_max(cval, 0);
- if (cval->initialized && cval->dBmin >= cval->dBmax) {
- kcontrol->vd[0].access &=
- ~(SNDRV_CTL_ELEM_ACCESS_TLV_READ |
- SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK);
- snd_ctl_notify(cval->mixer->chip->card,
- SNDRV_CTL_EVENT_MASK_INFO,
- &kcontrol->id);
- }
- }
uinfo->value.integer.min = 0; uinfo->value.integer.max = (cval->max - cval->min + cval->res - 1) / cval->res;
I have doubt about this removal of tlv is enough since values of dB scale are calculated from min and max of the control , as dBmin >= dBmax imply min >= max and the control already has a invalid range and unusable
Hi,
Sorry I only just got around to looking at kernel stuff today, but when I checked with my 3.0.4 kernel which is now installed it seems fixed!
Cheers!
Col
'Twas brillig, and Takashi Iwai at 18/08/11 17:18 did gyre and gimble:
At Tue, 16 Aug 2011 13:31:52 +0100, Colin Guthrie wrote:
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index c04d7c7..cdd19d7 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -152,6 +152,7 @@ static inline void check_mapped_dB(const struct usbmix_name_map *p, if (p && p->dB) { cval->dBmin = p->dB->min; cval->dBmax = p->dB->max;
}cval->initialized = 1;
}
@@ -1092,7 +1093,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc, " Switch" : " Volume"); if (control == UAC_FU_VOLUME) { check_mapped_dB(map, cval);
if (cval->dBmin < cval->dBmax) {
if (cval->dBmin < cval->dBmax || !cval->initialized) { kctl->tlv.c = mixer_vol_tlv; kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ |
Not had a chance to test this yet but I will when I get a moment.
Any chance to test the patch?
Takashi
participants (5)
-
Clemens Ladisch
-
Colin Guthrie
-
David Henningsson
-
Raymond Yau
-
Takashi Iwai