From: Takashi Iwai <tiwai@suse.de>
To: Kailang <kailang@realtek.com>
Cc: " (alsa-devel@alsa-project.org)" <alsa-devel@alsa-project.org>
Subject: Re: Dell USB audio driver workaround
Date: Tue, 12 Apr 2016 11:26:29 +0200 [thread overview]
Message-ID: <s5hlh4j18l6.wl-tiwai@suse.de> (raw)
In-Reply-To: <6FAB7C47BCF00940BB0999A99BE3547A17A332FD@RTITMBSV09.realtek.com.tw>
On Tue, 12 Apr 2016 05:02:08 +0200,
Kailang wrote:
>
>
> Hi Takashi,
>
> Attach is new patch witch follow your method.
> Many Thanks for you. ^^
OK, I applied it with a few modification / correction in the comments
and the changelog. Also added Cc to stable.
thanks,
Takashi
>
> BR,
> Kailang
>
> > -----Original Message-----
> > From: Takashi Iwai [mailto:tiwai@suse.de]
> > Sent: Thursday, April 07, 2016 6:18 PM
> > To: Kailang
> > Cc: (alsa-devel@alsa-project.org)
> > Subject: Re: Dell USB audio driver workaround
> >
> > On Thu, 07 Apr 2016 12:07:25 +0200,
> > Kailang wrote:
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Takashi Iwai [mailto:tiwai@suse.de]
> > > > Sent: Thursday, April 07, 2016 5:27 PM
> > > > To: Kailang
> > > > Cc: (alsa-devel@alsa-project.org)
> > > > Subject: Re: Dell USB audio driver workaround
> > > >
> > > > On Thu, 07 Apr 2016 09:05:52 +0200,
> > > > Kailang wrote:
> > > > >
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Takashi Iwai [mailto:tiwai@suse.de]
> > > > > > Sent: Wednesday, April 06, 2016 5:37 PM
> > > > > > To: Kailang
> > > > > > Cc: (alsa-devel@alsa-project.org)
> > > > > > Subject: Re: Dell USB audio driver workaround
> > > > > >
> > > > > > On Wed, 06 Apr 2016 11:22:43 +0200, Kailang wrote:
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > -----Original Message-----
> > > > > > > > From: Takashi Iwai [mailto:tiwai@suse.de]
> > > > > > > > Sent: Wednesday, April 06, 2016 4:57 PM
> > > > > > > > To: Kailang
> > > > > > > > Cc: (alsa-devel@alsa-project.org)
> > > > > > > > Subject: Re: Dell USB audio driver workaround
> > > > > > > >
> > > > > > > > On Wed, 06 Apr 2016 08:29:12 +0200, Kailang wrote:
> > > > > > > > >
> > > > > > > > > Hi Takashi,
> > > > > > > > >
> > > > > > > > > Dell had USB dock.
> > > > > > > > > Maybe firmware issue, the master volume always
> > keep at 0x57.
> > > > > > > > > Attach patch will fix it to keep at Max volume.
> > > > > > > > >
> > > > > > > > > Could you help us to update it?
> > > > > > > >
> > > > > > > > Well, I don't get how this patch works..
> > > > > > > >
> > > > > > > > > diff --git a/sound/usb/mixer.c
> > b/sound/usb/mixer.c index
> > > > > > > > > 4f85757..84d9a4e 100644
> > > > > > > > > --- a/sound/usb/mixer.c
> > > > > > > > > +++ b/sound/usb/mixer.c
> > > > > > > > > @@ -846,6 +846,12 @@ static void
> > > > volume_control_quirks(struct
> > > > > > > > > usb_mixer_elem_info *cval, {
> > > > > > > > > struct snd_usb_audio *chip =
> > cval->head.mixer->chip;
> > > > > > > > > switch (chip->usb_id) {
> > > > > > > > > + case USB_ID(0x0bda, 0x4014): /* Dell
> > workaround */
> > > > > > > > > + if (strstr(kctl->id.name, "Playback
> > > > > > Volume") != NULL) {
> > > > > > > > > + cval->min = 0x0000;
> > > > > > > > > + cval->max = 0x0000;
> > > > > > > > > + }
> > > > > > > > > + break;
> > > > > > > >
> > > > > > > > So, this means that this value has to be fixed to 0?
> > > > > > > > If yes, can't we simply remove this volume instead?
> > > > > > >
> > > > > > > Yes, but it need to set Max volume to 0. This is test
> > > > on my site.
> > > > > > > Because it will rewrite 0x57 value to codec register when
> > > > > > driver is loaded.
> > > > > > > And keep 0x57 volume value all the time. So, Master volume
> > > > > > will lower than windows machine.
> > > > > > > This case which driver fail to build the alsa mixer(This is
> > > > > > firmware cause it). So, no hardware volume control on this.
> > > > > > > If the Max volume value is 0, system will not set default
> > > > > > value 0x57 for first time loading driver.
> > > > > >
> > > > > > Which values (min/max) does this FU take and which values
> > > > are buggy?
> > > > > Max value.
> > > >
> > > > Sorry, my question wasn't clear. "What" min and max are they?
> > > > min=0 and max=0x57?
> > >
> > > Oh! Sorry. It's my wrong. I forgot.
> > >
> > > Unit: 16
> > > Control: name="PCM Playback Volume", index=0
> > > Info: id=16, control=2, cmask=0x3, channels=2, type="S16"
> > > Volume: min=-16256, max=0, dBmin=-6350, dBmax=0
> > >
> > > 0x0 (codec reg) = (-16256) (USB vloume level) 0x57(codec reg) =
> > > 0xEC00(USB vloume level) 0x7F(codec reg) = 0x0000 (USB vloume level)
> > >
> > > >
> > > > And, your patch changes both min and max to be 0. That is, it
> > > > accepts only 0. Does it mean that this FU isn't any
> > proper volume
> > > > control?
> > >
> > > cval->max original is 0.
> > > cval->min => I set it to 0. It will be not rewrite 0x57
> > value to codec.
> >
> > OK, now it's clear, thanks.
> >
> > Though, I still don't like to set min = max. It basically
> > makes this control useless, and then there is no reason to
> > keep this exposed.
> >
> > Can we just skip parsing this control, then? You can create
> > an own usbmix_name_map[] to indicate the ID to skip building
> > a control by passing NULL to its name. That is, a patch like
> > below. (You need to fill the right ID number in the patch,
> > of course.)
> >
> >
> > Takashi
> >
> > ---
> > diff --git a/sound/usb/mixer_maps.c b/sound/usb/mixer_maps.c
> > --- a/sound/usb/mixer_maps.c
> > +++ b/sound/usb/mixer_maps.c
> > @@ -349,6 +349,16 @@ static struct usbmix_name_map
> > bose_companion5_map[] = { };
> >
> > /*
> > + * Dell XXX with ALC4020 codec had a firmware problem where it got
> > + * screwed up when zero volume is passed; just skip it as a
> > workaround
> > +*/ static const struct usbmix_name_map dell_alc4020_map[] = {
> > + { 10 /* XXX fill this right ID XXX */, NULL },
> > + { 0 }
> > +};
> > +
> > +
> > +/*
> > * Control map entries
> > */
> >
> > @@ -423,6 +433,10 @@ static struct usbmix_ctl_map
> > usbmix_ctl_maps[] = {
> > .map = maya44_map,
> > },
> > {
> > + .id = USB_ID(0x0bda, 0x4014),
> > + .map = dell_alc4020_map,
> > + },
> > + {
> > .id = USB_ID(0x0c45, 0x1158),
> > .map = justlink_map,
> > },
> >
> > ------Please consider the environment before printing this e-mail.
> >
> [2 0001-Dell-usb-dock-vloume-issue.patch <application/octet-stream (base64)>]
>
next prev parent reply other threads:[~2016-04-12 9:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <6FAB7C47BCF00940BB0999A99BE3547A17A32FFC@RTITMBSV09.realtek.com.tw>
2016-04-06 8:56 ` Dell USB audio driver workaround Takashi Iwai
2016-04-06 9:22 ` Kailang
2016-04-06 9:36 ` Takashi Iwai
2016-04-07 7:05 ` Kailang
2016-04-07 9:26 ` Takashi Iwai
2016-04-07 9:45 ` Kailang
2016-04-07 9:53 ` Takashi Iwai
2016-04-07 10:13 ` Kailang
2016-04-07 10:07 ` Kailang
2016-04-07 10:18 ` Takashi Iwai
[not found] ` <6FAB7C47BCF00940BB0999A99BE3547A17A332FD@RTITMBSV09.realtek.com.tw>
2016-04-12 9:26 ` Takashi Iwai [this message]
2017-06-14 2:29 ` Hui Wang
2017-06-14 15:50 ` Takashi Iwai
2017-06-15 9:40 ` Hui Wang
2017-06-20 14:19 ` Tanu Kaskinen
2017-06-21 0:05 ` Hui Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hlh4j18l6.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=kailang@realtek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox