Skip to contentSkip to conversation

ALSA: usb-audio: Fix forgotten conversion of control query functions

PATCH In review Takashi Iwai 3 participants 4 messages Apr 23, 2018 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: usb-audio: Fix forgotten conversion of control query functions

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")
---
 sound/usb/mixer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
sound/usb/mixer.c +2 -1
index 301ad61ed426..3387483310b1 100644
@@ -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));
 		}
Signature · 1 line
2.16.3
#1 lore raw
Quoted 30 lines · 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")
---
 sound/usb/mixer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
sound/usb/mixer.c +2 -2
index 301ad61ed426..3387483310b1 100644
@@ -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));
                }
--
Quoted 2 lines

2.16.3

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

#2 lore raw
Quoted 29 lines · Andrew Chant
Quoted 27 lines · 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")
---
 sound/usb/mixer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
sound/usb/mixer.c +2 -1
index 301ad61ed426..3387483310b1 100644
@@ -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,
Quoted 8 lines
Quoted 5 lines
sound/usb/mixer.c +0 -1
                                                                                 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

Tested-by on v1 1/1
#3 lore raw
In reply to Takashi Iwai

Successfully tested with configuration described in bug report, thanks!

Sincerely, Nazar Mokrynskyi
github.com/nazar-pc

23.04.18 10:06, Takashi Iwai пише:

Quoted 20 lines

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")
---
 sound/usb/mixer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
sound/usb/mixer.c +0 -0
index 301ad61ed426..3387483310b1 100644

sound/usb/mixer.c static int parse_audio_feature_unit(struct mixer_build *state, int unitid, · line 1783

Quoted 9 lines
sound/usb/mixer.c +2 -1
@@ -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
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel