All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: usb-audio: Fix forgotten conversion of control query functions
@ 2018-04-23  7:06 Takashi Iwai
  2018-04-23 10:28 ` Andrew Chant
  2018-04-23 10:58 ` Nazar Mokrynskyi
  0 siblings, 2 replies; 4+ messages in thread
From: Takashi Iwai @ 2018-04-23  7:06 UTC (permalink / raw)
  To: alsa-devel; +Cc: Andrew Chant, Nazar Mokrynskyi

The recent code refactoring made the argument for some helper
functions to be the explicit UAC_CS_* and UAC2_CS_* value instead of
0-based offset.  However, there was one place left forgotten, and it
caused a regression on some devices appearing as the inconsistent
mixer setup.

This patch corrects the forgotten conversion.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199449
Fixes: 21e9b3e931f7 ("ALSA: usb-audio: fix uac control query argument")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/usb/mixer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 301ad61ed426..3387483310b1 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -1776,7 +1776,8 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid,
 				build_feature_ctl(state, _ftr, ch_bits, control,
 						  &iterm, unitid, ch_read_only);
 			if (uac_v2v3_control_is_readable(master_bits, control))
-				build_feature_ctl(state, _ftr, 0, i, &iterm, unitid,
+				build_feature_ctl(state, _ftr, 0, control,
+						  &iterm, unitid,
 						  !uac_v2v3_control_is_writeable(master_bits,
 										 control));
 		}
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ALSA: usb-audio: Fix forgotten conversion of control query functions
  2018-04-23  7:06 [PATCH] ALSA: usb-audio: Fix forgotten conversion of control query functions Takashi Iwai
@ 2018-04-23 10:28 ` Andrew Chant
  2018-04-23 10:30   ` Takashi Iwai
  2018-04-23 10:58 ` Nazar Mokrynskyi
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Chant @ 2018-04-23 10:28 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, Nazar Mokrynskyi

On Mon, Apr 23, 2018 at 3:06 PM, Takashi Iwai <tiwai@suse.de> wrote:
> The recent code refactoring made the argument for some helper
> functions to be the explicit UAC_CS_* and UAC2_CS_* value instead of
> 0-based offset.  However, there was one place left forgotten, and it
> caused a regression on some devices appearing as the inconsistent
> mixer setup.
>
> This patch corrects the forgotten conversion.
>
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199449
> Fixes: 21e9b3e931f7 ("ALSA: usb-audio: fix uac control query argument")
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
>  sound/usb/mixer.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
> index 301ad61ed426..3387483310b1 100644
> --- a/sound/usb/mixer.c
> +++ b/sound/usb/mixer.c
> @@ -1776,7 +1776,8 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid,
>                                 build_feature_ctl(state, _ftr, ch_bits, control,
>                                                   &iterm, unitid, ch_read_only);
>                         if (uac_v2v3_control_is_readable(master_bits, control))
> -                               build_feature_ctl(state, _ftr, 0, i, &iterm, unitid,
> +                               build_feature_ctl(state, _ftr, 0, control,
> +                                                 &iterm, unitid,
>                                                   !uac_v2v3_control_is_writeable(master_bits,
>                                                                                  control));
>                 }
> --
> 2.16.3
>

Thanks for the fix, looks correct to me.
UAC2 jack detection still works correctly on my device with this patch.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ALSA: usb-audio: Fix forgotten conversion of control query functions
  2018-04-23 10:28 ` Andrew Chant
@ 2018-04-23 10:30   ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2018-04-23 10:30 UTC (permalink / raw)
  To: Andrew Chant; +Cc: alsa-devel, Nazar Mokrynskyi

On Mon, 23 Apr 2018 12:28:27 +0200,
Andrew Chant wrote:
> 
> On Mon, Apr 23, 2018 at 3:06 PM, Takashi Iwai <tiwai@suse.de> wrote:
> > The recent code refactoring made the argument for some helper
> > functions to be the explicit UAC_CS_* and UAC2_CS_* value instead of
> > 0-based offset.  However, there was one place left forgotten, and it
> > caused a regression on some devices appearing as the inconsistent
> > mixer setup.
> >
> > This patch corrects the forgotten conversion.
> >
> > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199449
> > Fixes: 21e9b3e931f7 ("ALSA: usb-audio: fix uac control query argument")
> > Signed-off-by: Takashi Iwai <tiwai@suse.de>
> > ---
> >  sound/usb/mixer.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
> > index 301ad61ed426..3387483310b1 100644
> > --- a/sound/usb/mixer.c
> > +++ b/sound/usb/mixer.c
> > @@ -1776,7 +1776,8 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid,
> >                                 build_feature_ctl(state, _ftr, ch_bits, control,
> >                                                   &iterm, unitid, ch_read_only);
> >                         if (uac_v2v3_control_is_readable(master_bits, control))
> > -                               build_feature_ctl(state, _ftr, 0, i, &iterm, unitid,
> > +                               build_feature_ctl(state, _ftr, 0, control,
> > +                                                 &iterm, unitid,
> >                                                   !uac_v2v3_control_is_writeable(master_bits,
> >                                                                                  control));
> >                 }
> > --
> > 2.16.3
> >
> 
> Thanks for the fix, looks correct to me.
> UAC2 jack detection still works correctly on my device with this patch.

Thanks, feel free to give your reviewed-by and/or tested-by tags, too
:)


Takashi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ALSA: usb-audio: Fix forgotten conversion of control query functions
  2018-04-23  7:06 [PATCH] ALSA: usb-audio: Fix forgotten conversion of control query functions Takashi Iwai
  2018-04-23 10:28 ` Andrew Chant
@ 2018-04-23 10:58 ` Nazar Mokrynskyi
  1 sibling, 0 replies; 4+ messages in thread
From: Nazar Mokrynskyi @ 2018-04-23 10:58 UTC (permalink / raw)
  To: Takashi Iwai, alsa-devel; +Cc: Andrew Chant

Successfully tested with configuration described in bug report, thanks!

Tested-by: Nazar Mokrynskyi <nazar@mokrynskyi.com>

Sincerely, Nazar Mokrynskyi
github.com/nazar-pc

23.04.18 10:06, Takashi Iwai пише:
> The recent code refactoring made the argument for some helper
> functions to be the explicit UAC_CS_* and UAC2_CS_* value instead of
> 0-based offset.  However, there was one place left forgotten, and it
> caused a regression on some devices appearing as the inconsistent
> mixer setup.
>
> This patch corrects the forgotten conversion.
>
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199449
> Fixes: 21e9b3e931f7 ("ALSA: usb-audio: fix uac control query argument")
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
>  sound/usb/mixer.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
> index 301ad61ed426..3387483310b1 100644
> --- a/sound/usb/mixer.c
> +++ b/sound/usb/mixer.c
> @@ -1776,7 +1776,8 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid,
>  				build_feature_ctl(state, _ftr, ch_bits, control,
>  						  &iterm, unitid, ch_read_only);
>  			if (uac_v2v3_control_is_readable(master_bits, control))
> -				build_feature_ctl(state, _ftr, 0, i, &iterm, unitid,
> +				build_feature_ctl(state, _ftr, 0, control,
> +						  &iterm, unitid,
>  						  !uac_v2v3_control_is_writeable(master_bits,
>  										 control));
>  		}
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-23 10:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-23  7:06 [PATCH] ALSA: usb-audio: Fix forgotten conversion of control query functions Takashi Iwai
2018-04-23 10:28 ` Andrew Chant
2018-04-23 10:30   ` Takashi Iwai
2018-04-23 10:58 ` Nazar Mokrynskyi

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.