* [PATCH 0/2] prescript
@ 2011-03-10 13:53 Alexey Fisher
2011-03-10 13:53 ` [PATCH 1/2] Add volume range check and warn if it too big Alexey Fisher
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Alexey Fisher @ 2011-03-10 13:53 UTC (permalink / raw)
To: Takashi Iwai, alsa-devel@alsa-project.org; +Cc: Alexey Fisher
Hall all,
here is small patchset for usb devices with wrong volume resolution.
First one add warning if too big resolution is found.
Second adds quirk for one more webcam.
For more info see patch a5c7d797dcce3be5e77cd6ea62cc4920ededc32b
> Author: Alexey Fisher <bug-track@fisher-privat.net>
> Date: Wed Jun 23 14:17:09 2010 +0200
> ALSA: usb-audio - Add volume resolution quirk for some Logitech webcams
....
Regards,
Alexey
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] Add volume range check and warn if it too big
2011-03-10 13:53 [PATCH 0/2] prescript Alexey Fisher
@ 2011-03-10 13:53 ` Alexey Fisher
2011-03-10 13:53 ` [PATCH 2/2] Add "cval->res = 384" quirk for Logitech Webcam C600 Alexey Fisher
2011-03-10 15:49 ` [PATCH 0/2] prescript Takashi Iwai
2 siblings, 0 replies; 5+ messages in thread
From: Alexey Fisher @ 2011-03-10 13:53 UTC (permalink / raw)
To: Takashi Iwai, alsa-devel@alsa-project.org; +Cc: Alexey Fisher
Se comment in patch: a5c7d797dcce3be5e77cd6ea62cc4920ededc32b
ALSA: usb-audio - Add volume resolution quirk for some Logitech webcams
Signed-off-by: Alexey Fisher <bug-track@fisher-privat.net>
---
sound/usb/mixer.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 85af605..eba8ae8 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -987,6 +987,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
struct snd_kcontrol *kctl;
struct usb_mixer_elem_info *cval;
const struct usbmix_name_map *map;
+ unsigned int range;
control++; /* change from zero-based to 1-based value */
@@ -1136,6 +1137,20 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
}
+ range = (cval->max - cval->min) / cval->res;
+ /* Are there devices with volume range more than 255? I use a bit more
+ * to be sure. 384 is a resolution magick nuber found on Logitech
+ * devices. It will definitively catch all buggy Logitech devices. */
+ if (range > 384) {
+ snd_printk(KERN_WARNING "usb_audio: Warning! Unlikely big "
+ "volume range (=%u), cval->res is probably wrong.",
+ range);
+ snd_printk(KERN_WARNING "usb_audio: [%d] FU [%s] ch = %d, "
+ "val = %d/%d/%d", cval->id,
+ kctl->id.name, cval->channels,
+ cval->min, cval->max, cval->res);
+ }
+
snd_printdd(KERN_INFO "[%d] FU [%s] ch = %d, val = %d/%d/%d\n",
cval->id, kctl->id.name, cval->channels, cval->min, cval->max, cval->res);
add_control_to_empty(state, kctl);
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] Add "cval->res = 384" quirk for Logitech Webcam C600
2011-03-10 13:53 [PATCH 0/2] prescript Alexey Fisher
2011-03-10 13:53 ` [PATCH 1/2] Add volume range check and warn if it too big Alexey Fisher
@ 2011-03-10 13:53 ` Alexey Fisher
2011-03-12 1:04 ` Raymond Yau
2011-03-10 15:49 ` [PATCH 0/2] prescript Takashi Iwai
2 siblings, 1 reply; 5+ messages in thread
From: Alexey Fisher @ 2011-03-10 13:53 UTC (permalink / raw)
To: Takashi Iwai, alsa-devel@alsa-project.org; +Cc: Alexey Fisher
One more affected devices: Logitech Webcam C600 (046d:0808)
Volume range before quirk is 6400, after (also real) is 16.
Signed-off-by: Alexey Fisher <bug-track@fisher-privat.net>
---
sound/usb/mixer.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index eba8ae8..c549522 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -1122,6 +1122,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
}
break;
+ case USB_ID(0x046d, 0x0808):
case USB_ID(0x046d, 0x0809):
case USB_ID(0x046d, 0x0991):
/* Most audio usb devices lie about volume resolution.
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] prescript
2011-03-10 13:53 [PATCH 0/2] prescript Alexey Fisher
2011-03-10 13:53 ` [PATCH 1/2] Add volume range check and warn if it too big Alexey Fisher
2011-03-10 13:53 ` [PATCH 2/2] Add "cval->res = 384" quirk for Logitech Webcam C600 Alexey Fisher
@ 2011-03-10 15:49 ` Takashi Iwai
2 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2011-03-10 15:49 UTC (permalink / raw)
To: Alexey Fisher; +Cc: alsa-devel@alsa-project.org
At Thu, 10 Mar 2011 14:53:37 +0100,
Alexey Fisher wrote:
>
> Hall all,
>
> here is small patchset for usb devices with wrong volume resolution.
> First one add warning if too big resolution is found.
> Second adds quirk for one more webcam.
>
> For more info see patch a5c7d797dcce3be5e77cd6ea62cc4920ededc32b
> > Author: Alexey Fisher <bug-track@fisher-privat.net>
> > Date: Wed Jun 23 14:17:09 2010 +0200
> > ALSA: usb-audio - Add volume resolution quirk for some Logitech webcams
> ....
Thanks. Applied both patches now (with typo fixes).
Takashi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] Add "cval->res = 384" quirk for Logitech Webcam C600
2011-03-10 13:53 ` [PATCH 2/2] Add "cval->res = 384" quirk for Logitech Webcam C600 Alexey Fisher
@ 2011-03-12 1:04 ` Raymond Yau
0 siblings, 0 replies; 5+ messages in thread
From: Raymond Yau @ 2011-03-12 1:04 UTC (permalink / raw)
To: ALSA Development Mailing List
2011/3/10 Alexey Fisher <bug-track@fisher-privat.net>
> One more affected devices: Logitech Webcam C600 (046d:0808)
>
> Volume range before quirk is 6400, after (also real) is 16.
>
> Signed-off-by: Alexey Fisher <bug-track@fisher-privat.net>
> ---
> sound/usb/mixer.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
> index eba8ae8..c549522 100644
> --- a/sound/usb/mixer.c
> +++ b/sound/usb/mixer.c
> @@ -1122,6 +1122,7 @@ static void build_feature_ctl(struct mixer_build
> *state, void *raw_desc,
> }
> break;
>
> + case USB_ID(0x046d, 0x0808):
> case USB_ID(0x046d, 0x0809):
> case USB_ID(0x046d, 0x0991):
> /* Most audio usb devices lie about volume resolution.
> --
> 1.7.1
>
>
It is because each step of usb audio is 1/256dB , so 384 step is 1.5dB
Is there any way to verify the resolution is 1.5dB ?
since alsamixertest does not check the capture volume (only check the
playback volume)
And mindB +18dB and maxdB +30dB , It can still record sound using audacity
at +18dB , so it seem break the pulseaudio developer 's assumption that 0%
is -infinite dB
state.U0x46d0x992 {
control.1 {
iface MIXER
name 'Mic Capture Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.2 {
iface MIXER
name 'Mic Capture Volume'
value 3072
comment {
access 'read write'
type INTEGER
count 1
range '0 - 3072'
dbmin 1800
dbmax 3000
dbvalue.0 3000
}
}
}
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-03-12 1:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-10 13:53 [PATCH 0/2] prescript Alexey Fisher
2011-03-10 13:53 ` [PATCH 1/2] Add volume range check and warn if it too big Alexey Fisher
2011-03-10 13:53 ` [PATCH 2/2] Add "cval->res = 384" quirk for Logitech Webcam C600 Alexey Fisher
2011-03-12 1:04 ` Raymond Yau
2011-03-10 15:49 ` [PATCH 0/2] prescript Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).