Skip to content

Commit 2bf8407

Browse files
geoffreybennettSasha Levin
authored andcommitted
ALSA: usb-audio: Add QUIRK_FLAG_SKIP_IFACE_SETUP
[ Upstream commit 38c3220 ] Add a quirk flag to skip the usb_set_interface(), snd_usb_init_pitch(), and snd_usb_init_sample_rate() calls in __snd_usb_parse_audio_interface(). These are redundant with snd_usb_endpoint_prepare() at stream-open time. Enable the quirk for Focusrite devices, as init_sample_rate(rate_max) sets 192kHz during probing, which disables the internal mixer and Air and Safe modes. Fixes: 16f1f83 ("Revert "ALSA: usb-audio: Drop superfluous interface setup at parsing"") Signed-off-by: Geoffrey D. Bennett <g@b4.vu> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/65a7909b15f9feb76c2a6f4f8814c240ddc50737.1771594828.git.g@b4.vu Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 7ffad4e commit 2bf8407

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

sound/usb/quirks.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2422,7 +2422,7 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
24222422
VENDOR_FLG(0x07fd, /* MOTU */
24232423
QUIRK_FLAG_VALIDATE_RATES),
24242424
VENDOR_FLG(0x1235, /* Focusrite Novation */
2425-
0),
2425+
QUIRK_FLAG_SKIP_IFACE_SETUP),
24262426
VENDOR_FLG(0x1511, /* AURALiC */
24272427
QUIRK_FLAG_DSD_RAW),
24282428
VENDOR_FLG(0x152a, /* Thesycon devices */
@@ -2504,6 +2504,7 @@ static const char *const snd_usb_audio_quirk_flag_names[] = {
25042504
QUIRK_STRING_ENTRY(MIC_RES_384),
25052505
QUIRK_STRING_ENTRY(MIXER_PLAYBACK_MIN_MUTE),
25062506
QUIRK_STRING_ENTRY(MIXER_CAPTURE_MIN_MUTE),
2507+
QUIRK_STRING_ENTRY(SKIP_IFACE_SETUP),
25072508
NULL
25082509
};
25092510

sound/usb/stream.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,9 @@ static int __snd_usb_parse_audio_interface(struct snd_usb_audio *chip,
12591259
set_iface_first = true;
12601260

12611261
/* try to set the interface... */
1262+
if (chip->quirk_flags & QUIRK_FLAG_SKIP_IFACE_SETUP)
1263+
continue;
1264+
12621265
usb_set_interface(chip->dev, iface_no, 0);
12631266
if (set_iface_first)
12641267
usb_set_interface(chip->dev, iface_no, altno);

sound/usb/usbaudio.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@ extern bool snd_usb_skip_validation;
224224
* playback value represents muted state instead of minimum audible volume
225225
* QUIRK_FLAG_MIXER_CAPTURE_MIN_MUTE
226226
* Similar to QUIRK_FLAG_MIXER_PLAYBACK_MIN_MUTE, but for capture streams
227+
* QUIRK_FLAG_SKIP_IFACE_SETUP
228+
* Skip the probe-time interface setup (usb_set_interface,
229+
* init_pitch, init_sample_rate); redundant with
230+
* snd_usb_endpoint_prepare() at stream-open time
227231
*/
228232

229233
enum {
@@ -253,6 +257,7 @@ enum {
253257
QUIRK_TYPE_MIC_RES_384 = 23,
254258
QUIRK_TYPE_MIXER_PLAYBACK_MIN_MUTE = 24,
255259
QUIRK_TYPE_MIXER_CAPTURE_MIN_MUTE = 25,
260+
QUIRK_TYPE_SKIP_IFACE_SETUP = 26,
256261
/* Please also edit snd_usb_audio_quirk_flag_names */
257262
};
258263

@@ -284,5 +289,6 @@ enum {
284289
#define QUIRK_FLAG_MIC_RES_384 QUIRK_FLAG(MIC_RES_384)
285290
#define QUIRK_FLAG_MIXER_PLAYBACK_MIN_MUTE QUIRK_FLAG(MIXER_PLAYBACK_MIN_MUTE)
286291
#define QUIRK_FLAG_MIXER_CAPTURE_MIN_MUTE QUIRK_FLAG(MIXER_CAPTURE_MIN_MUTE)
292+
#define QUIRK_FLAG_SKIP_IFACE_SETUP QUIRK_FLAG(SKIP_IFACE_SETUP)
287293

288294
#endif /* __USBAUDIO_H */

0 commit comments

Comments
 (0)