Commit 38c32206 authored by Geoffrey D. Bennett's avatar Geoffrey D. Bennett Committed by Takashi Iwai
Browse files

ALSA: usb-audio: Add QUIRK_FLAG_SKIP_IFACE_SETUP



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: 16f1f838 ("Revert "ALSA: usb-audio: Drop superfluous interface setup at parsing"")
Signed-off-by: default avatarGeoffrey D. Bennett <g@b4.vu>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/65a7909b15f9feb76c2a6f4f8814c240ddc50737.1771594828.git.g@b4.vu
parent a8cc55bf
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2424,7 +2424,7 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
	VENDOR_FLG(0x07fd, /* MOTU */
		   QUIRK_FLAG_VALIDATE_RATES),
	VENDOR_FLG(0x1235, /* Focusrite Novation */
		   0),
		   QUIRK_FLAG_SKIP_IFACE_SETUP),
	VENDOR_FLG(0x1511, /* AURALiC */
		   QUIRK_FLAG_DSD_RAW),
	VENDOR_FLG(0x152a, /* Thesycon devices */
@@ -2506,6 +2506,7 @@ static const char *const snd_usb_audio_quirk_flag_names[] = {
	QUIRK_STRING_ENTRY(MIC_RES_384),
	QUIRK_STRING_ENTRY(MIXER_PLAYBACK_MIN_MUTE),
	QUIRK_STRING_ENTRY(MIXER_CAPTURE_MIN_MUTE),
	QUIRK_STRING_ENTRY(SKIP_IFACE_SETUP),
	NULL
};

+3 −0
Original line number Diff line number Diff line
@@ -1259,6 +1259,9 @@ static int __snd_usb_parse_audio_interface(struct snd_usb_audio *chip,
			set_iface_first = true;

		/* try to set the interface... */
		if (chip->quirk_flags & QUIRK_FLAG_SKIP_IFACE_SETUP)
			continue;

		usb_set_interface(chip->dev, iface_no, 0);
		if (set_iface_first)
			usb_set_interface(chip->dev, iface_no, altno);
+6 −0
Original line number Diff line number Diff line
@@ -224,6 +224,10 @@ extern bool snd_usb_skip_validation;
 *  playback value represents muted state instead of minimum audible volume
 * QUIRK_FLAG_MIXER_CAPTURE_MIN_MUTE
 *  Similar to QUIRK_FLAG_MIXER_PLAYBACK_MIN_MUTE, but for capture streams
 * QUIRK_FLAG_SKIP_IFACE_SETUP
 *  Skip the probe-time interface setup (usb_set_interface,
 *  init_pitch, init_sample_rate); redundant with
 *  snd_usb_endpoint_prepare() at stream-open time
 */

enum {
@@ -253,6 +257,7 @@ enum {
	QUIRK_TYPE_MIC_RES_384			= 23,
	QUIRK_TYPE_MIXER_PLAYBACK_MIN_MUTE	= 24,
	QUIRK_TYPE_MIXER_CAPTURE_MIN_MUTE	= 25,
	QUIRK_TYPE_SKIP_IFACE_SETUP		= 26,
/* Please also edit snd_usb_audio_quirk_flag_names */
};

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

#endif /* __USBAUDIO_H */