* Quirk to disable master volume control in PCM2702
[not found] <861213340911161513n53c8b303i67ac2f07db87cddc@mail.gmail.com>
@ 2009-11-16 23:17 ` Javier Kohen
2009-11-17 9:04 ` Clemens Ladisch
0 siblings, 1 reply; 6+ messages in thread
From: Javier Kohen @ 2009-11-16 23:17 UTC (permalink / raw)
To: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 2148 bytes --]
[Alan Stern on BCC]
Hi ALSA developers,
I've written the attached patch to disable the master volume control
in this chipset. The datasheet [1] documents two independent channel
volume controls, one master mute control and one master volume
control. However, at least on my device (a Fubar USB DAC), the master
volume control always returns USB stalls when queried for any of its
parameters (min/max/res/cur). All other controls work as expected,
both at the protocol and at the application levels.
Read on for the gory details. Otherwise please take the patch at face
value. I'm ready to make changes if necessary to make it more fitting
to the rest of the code. It would be very appreciated if this can go
into 2.6.32, or in a stable patch shortly after.
Normally I wouldn't give this problem a second thought, since in the
worst case a non-functional control appears in the mixer. Only that
Alan Stern submitted a patch to the USB subsystem during the
development of kernel 2.6.31 that enables the sending of the
Clear-TT-Buffer request to USB hubs on stalls from devices. For some
reason upon receiving the Clear-TT-Buffer the audio goes mute, even
though the kernel keeps sending the audio stream to the device. There
is an ongoing thread on the linux-usb ML where Alan argues that
sending the request is the correct behavior and it shouldn't have the
effect I'm seeing. Since I lack any knowledge of the USB protocol, I
take his word. However, it seems that either the USB specs are wrong,
or my USB hub or the card are buggy.
In the meantime I'm trying to get another hub to compare.
Unfortunately I have to rely on the hub, because the PCM2702 and my
motherboard don't interact well. After a while the sound is degraded,
first into a hiss, then into pure noise. Other users have complained
on different forums; one of the wrote to alsa-user a month ago. I
haven't been able to make any progress to track this issue with usbmon
and ALSA verbose debug messages, to nobody's surprise, since I'm a
complete layman in that area. Any help with this would be appreciated
as well.
[1] http://focus.ti.com/docs/prod/folders/print/pcm2702.html
[-- Attachment #2: pcm2702-quirks.diff --]
[-- Type: application/octet-stream, Size: 723 bytes --]
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index 9efcfd0..406315e 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -1071,6 +1071,16 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, unsig
channels = (ftr[0] - 7) / csize - 1;
master_bits = snd_usb_combine_bytes(ftr + 6, csize);
+ /* master configuration quirks */
+ switch (state->chip->usb_id) {
+ case USB_ID(0x08bb, 0x2702):
+ snd_printk(KERN_INFO
+ "master volume quirk for PCM2702 chip\n");
+ /* disable non-functional volume control */
+ master_bits &= ~(1 << (USB_FEATURE_VOLUME - 1));
+ break;
+
+ }
if (channels > 0)
first_ch_bits = snd_usb_combine_bytes(ftr + 6 + csize, csize);
else
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: Quirk to disable master volume control in PCM2702
2009-11-16 23:17 ` Quirk to disable master volume control in PCM2702 Javier Kohen
@ 2009-11-17 9:04 ` Clemens Ladisch
2009-11-17 10:59 ` Javier Kohen
0 siblings, 1 reply; 6+ messages in thread
From: Clemens Ladisch @ 2009-11-17 9:04 UTC (permalink / raw)
To: Javier Kohen; +Cc: alsa-devel
Javier Kohen wrote:
> I've written the attached patch to disable the master volume control
> in this chipset. The datasheet [1] documents two independent channel
> volume controls, one master mute control and one master volume
> control. However, at least on my device (a Fubar USB DAC), the master
> volume control always returns USB stalls when queried for any of its
> parameters (min/max/res/cur).
I'd guess that Windows ignores the master volume when it finds
channel volume controls, so this function was never actually tested.
> However, it seems that either the USB specs are wrong,
They are abominations written by committees.
> or my USB hub or the card are buggy.
Your hub is certainly buggy ...
> the PCM2702 and my motherboard don't interact well. After a while the
> sound is degraded, first into a hiss, then into pure noise.
... the card too.
Your patch looks good; please provide a log message and a Signed-off-by
tag.
Best regards,
Clemens
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Quirk to disable master volume control in PCM2702
2009-11-17 9:04 ` Clemens Ladisch
@ 2009-11-17 10:59 ` Javier Kohen
2009-11-17 11:03 ` Takashi Iwai
0 siblings, 1 reply; 6+ messages in thread
From: Javier Kohen @ 2009-11-17 10:59 UTC (permalink / raw)
To: Clemens Ladisch; +Cc: alsa-devel
Clemens,
On Tue, Nov 17, 2009 at 10:04, Clemens Ladisch <clemens@ladisch.de> wrote:
>
> Javier Kohen wrote:
> > I've written the attached patch to disable the master volume control
> > in this chipset. The datasheet [1] documents two independent channel
> > volume controls, one master mute control and one master volume
> > control. However, at least on my device (a Fubar USB DAC), the master
> > volume control always returns USB stalls when queried for any of its
> > parameters (min/max/res/cur).
>
> I'd guess that Windows ignores the master volume when it finds
> channel volume controls, so this function was never actually tested.
>
> > However, it seems that either the USB specs are wrong,
>
> They are abominations written by committees.
>
> > or my USB hub or the card are buggy.
>
> Your hub is certainly buggy ...
>
> > the PCM2702 and my motherboard don't interact well. After a while the
> > sound is degraded, first into a hiss, then into pure noise.
>
> ... the card too.
>
>
> Your patch looks good; please provide a log message and a Signed-off-by
> tag.
Thanks for the prompt review!
Disable the master volume control in the PCM2702 chipset.
The datasheet documents two independent channel volume controls, one
master mute control and one master volume control. All controls are
fully functional except for the master volume control, which returns
USB stalls on all GET requests.
Signed-off-by: Javier Kohen <jkohen@users.sourceforge.net>
---
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index 9efcfd0..406315e 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -1071,6 +1071,16 @@ static int parse_audio_feature_unit(struct
mixer_build *state, int unitid, unsig
channels = (ftr[0] - 7) / csize - 1;
master_bits = snd_usb_combine_bytes(ftr + 6, csize);
+ /* master configuration quirks */
+ switch (state->chip->usb_id) {
+ case USB_ID(0x08bb, 0x2702):
+ snd_printk(KERN_INFO
+ "master volume quirk for PCM2702 chip\n");
+ /* disable non-functional volume control */
+ master_bits &= ~(1 << (USB_FEATURE_VOLUME - 1));
+ break;
+
+ }
if (channels > 0)
first_ch_bits = snd_usb_combine_bytes(ftr + 6 + csize, csize);
else
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: Quirk to disable master volume control in PCM2702
2009-11-17 10:59 ` Javier Kohen
@ 2009-11-17 11:03 ` Takashi Iwai
2009-11-17 14:36 ` Javier Kohen
0 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2009-11-17 11:03 UTC (permalink / raw)
To: Javier Kohen; +Cc: alsa-devel, Clemens Ladisch
At Tue, 17 Nov 2009 11:59:36 +0100,
Javier Kohen wrote:
>
> Clemens,
>
> On Tue, Nov 17, 2009 at 10:04, Clemens Ladisch <clemens@ladisch.de> wrote:
> >
> > Javier Kohen wrote:
> > > I've written the attached patch to disable the master volume control
> > > in this chipset. The datasheet [1] documents two independent channel
> > > volume controls, one master mute control and one master volume
> > > control. However, at least on my device (a Fubar USB DAC), the master
> > > volume control always returns USB stalls when queried for any of its
> > > parameters (min/max/res/cur).
> >
> > I'd guess that Windows ignores the master volume when it finds
> > channel volume controls, so this function was never actually tested.
> >
> > > However, it seems that either the USB specs are wrong,
> >
> > They are abominations written by committees.
> >
> > > or my USB hub or the card are buggy.
> >
> > Your hub is certainly buggy ...
> >
> > > the PCM2702 and my motherboard don't interact well. After a while the
> > > sound is degraded, first into a hiss, then into pure noise.
> >
> > ... the card too.
> >
> >
> > Your patch looks good; please provide a log message and a Signed-off-by
> > tag.
>
> Thanks for the prompt review!
>
> Disable the master volume control in the PCM2702 chipset.
>
> The datasheet documents two independent channel volume controls, one
> master mute control and one master volume control. All controls are
> fully functional except for the master volume control, which returns
> USB stalls on all GET requests.
>
> Signed-off-by: Javier Kohen <jkohen@users.sourceforge.net>
> ---
> diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
> index 9efcfd0..406315e 100644
> --- a/sound/usb/usbmixer.c
> +++ b/sound/usb/usbmixer.c
> @@ -1071,6 +1071,16 @@ static int parse_audio_feature_unit(struct
> mixer_build *state, int unitid, unsig
> channels = (ftr[0] - 7) / csize - 1;
>
> master_bits = snd_usb_combine_bytes(ftr + 6, csize);
> + /* master configuration quirks */
> + switch (state->chip->usb_id) {
> + case USB_ID(0x08bb, 0x2702):
> + snd_printk(KERN_INFO
> + "master volume quirk for PCM2702 chip\n");
Better to put a prefix like "usbmixer: master volume ..." since
snd_printk() can be turned to the normal printk() depending on the
kernel config.
thanks,
Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Quirk to disable master volume control in PCM2702
2009-11-17 11:03 ` Takashi Iwai
@ 2009-11-17 14:36 ` Javier Kohen
2009-11-17 14:50 ` Takashi Iwai
0 siblings, 1 reply; 6+ messages in thread
From: Javier Kohen @ 2009-11-17 14:36 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, Clemens Ladisch
Takashi,
On Tue, Nov 17, 2009 at 12:03, Takashi Iwai <tiwai@suse.de> wrote:
> At Tue, 17 Nov 2009 11:59:36 +0100,
> Javier Kohen wrote:
>>
>> Clemens,
>>
>> On Tue, Nov 17, 2009 at 10:04, Clemens Ladisch <clemens@ladisch.de> wrote:
>> >
>> > Javier Kohen wrote:
>> > > I've written the attached patch to disable the master volume control
>> > > in this chipset. The datasheet [1] documents two independent channel
>> > > volume controls, one master mute control and one master volume
>> > > control. However, at least on my device (a Fubar USB DAC), the master
>> > > volume control always returns USB stalls when queried for any of its
>> > > parameters (min/max/res/cur).
>> >
>> > I'd guess that Windows ignores the master volume when it finds
>> > channel volume controls, so this function was never actually tested.
>> >
>> > > However, it seems that either the USB specs are wrong,
>> >
>> > They are abominations written by committees.
>> >
>> > > or my USB hub or the card are buggy.
>> >
>> > Your hub is certainly buggy ...
>> >
>> > > the PCM2702 and my motherboard don't interact well. After a while the
>> > > sound is degraded, first into a hiss, then into pure noise.
>> >
>> > ... the card too.
>> >
>> >
>> > Your patch looks good; please provide a log message and a Signed-off-by
>> > tag.
>>
>> Thanks for the prompt review!
>>
> Better to put a prefix like "usbmixer: master volume ..." since
> snd_printk() can be turned to the normal printk() depending on the
> kernel config.
I don't know if the comment was for me or for whoever will submit
this, but here you go just in case:
Disable the master volume control in the PCM2702 chipset.
The datasheet documents two independent channel volume controls, one
master mute control and one master volume control. All controls are
fully functional except for the master volume control, which returns
USB stalls on all GET requests.
Signed-off-by: Javier Kohen <jkohen@users.sourceforge.net>
---
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index 9efcfd0..406315e 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -1071,6 +1071,16 @@ static int parse_audio_feature_unit(struct
mixer_build *state, int unitid, unsig
channels = (ftr[0] - 7) / csize - 1;
master_bits = snd_usb_combine_bytes(ftr + 6, csize);
+ /* master configuration quirks */
+ switch (state->chip->usb_id) {
+ case USB_ID(0x08bb, 0x2702):
+ snd_printk(KERN_INFO
+ "usbmixer: master volume quirk for PCM2702 chip\n");
+ /* disable non-functional volume control */
+ master_bits &= ~(1 << (USB_FEATURE_VOLUME - 1));
+ break;
+
+ }
if (channels > 0)
first_ch_bits = snd_usb_combine_bytes(ftr + 6 + csize, csize);
else
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: Quirk to disable master volume control in PCM2702
2009-11-17 14:36 ` Javier Kohen
@ 2009-11-17 14:50 ` Takashi Iwai
0 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2009-11-17 14:50 UTC (permalink / raw)
To: Javier Kohen; +Cc: alsa-devel, Clemens Ladisch
At Tue, 17 Nov 2009 15:36:13 +0100,
Javier Kohen wrote:
>
> Takashi,
>
> On Tue, Nov 17, 2009 at 12:03, Takashi Iwai <tiwai@suse.de> wrote:
> > At Tue, 17 Nov 2009 11:59:36 +0100,
> > Javier Kohen wrote:
> >>
> >> Clemens,
> >>
> >> On Tue, Nov 17, 2009 at 10:04, Clemens Ladisch <clemens@ladisch.de> wrote:
> >> >
> >> > Javier Kohen wrote:
> >> > > I've written the attached patch to disable the master volume control
> >> > > in this chipset. The datasheet [1] documents two independent channel
> >> > > volume controls, one master mute control and one master volume
> >> > > control. However, at least on my device (a Fubar USB DAC), the master
> >> > > volume control always returns USB stalls when queried for any of its
> >> > > parameters (min/max/res/cur).
> >> >
> >> > I'd guess that Windows ignores the master volume when it finds
> >> > channel volume controls, so this function was never actually tested.
> >> >
> >> > > However, it seems that either the USB specs are wrong,
> >> >
> >> > They are abominations written by committees.
> >> >
> >> > > or my USB hub or the card are buggy.
> >> >
> >> > Your hub is certainly buggy ...
> >> >
> >> > > the PCM2702 and my motherboard don't interact well. After a while the
> >> > > sound is degraded, first into a hiss, then into pure noise.
> >> >
> >> > ... the card too.
> >> >
> >> >
> >> > Your patch looks good; please provide a log message and a Signed-off-by
> >> > tag.
> >>
> >> Thanks for the prompt review!
> >>
> > Better to put a prefix like "usbmixer: master volume ..." since
> > snd_printk() can be turned to the normal printk() depending on the
> > kernel config.
>
> I don't know if the comment was for me or for whoever will submit
> this, but here you go just in case:
Yes, it was asked to you as the original author :)
> Disable the master volume control in the PCM2702 chipset.
>
> The datasheet documents two independent channel volume controls, one
> master mute control and one master volume control. All controls are
> fully functional except for the master volume control, which returns
> USB stalls on all GET requests.
>
> Signed-off-by: Javier Kohen <jkohen@users.sourceforge.net>
Thanks, applied now to sound git tree.
I'll include it to the next pull request for 2.6.32-final.
Takashi
> ---
> diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
> index 9efcfd0..406315e 100644
> --- a/sound/usb/usbmixer.c
> +++ b/sound/usb/usbmixer.c
> @@ -1071,6 +1071,16 @@ static int parse_audio_feature_unit(struct
> mixer_build *state, int unitid, unsig
> channels = (ftr[0] - 7) / csize - 1;
>
> master_bits = snd_usb_combine_bytes(ftr + 6, csize);
> + /* master configuration quirks */
> + switch (state->chip->usb_id) {
> + case USB_ID(0x08bb, 0x2702):
> + snd_printk(KERN_INFO
> + "usbmixer: master volume quirk for PCM2702 chip\n");
> + /* disable non-functional volume control */
> + master_bits &= ~(1 << (USB_FEATURE_VOLUME - 1));
> + break;
> +
> + }
> if (channels > 0)
> first_ch_bits = snd_usb_combine_bytes(ftr + 6 + csize, csize);
> else
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-11-17 14:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <861213340911161513n53c8b303i67ac2f07db87cddc@mail.gmail.com>
2009-11-16 23:17 ` Quirk to disable master volume control in PCM2702 Javier Kohen
2009-11-17 9:04 ` Clemens Ladisch
2009-11-17 10:59 ` Javier Kohen
2009-11-17 11:03 ` Takashi Iwai
2009-11-17 14:36 ` Javier Kohen
2009-11-17 14:50 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.