Skip to contentSkip to conversation

ALSA: usb-audio: Configure sync endpoints before data

PATCH In review Takashi Iwai 2 participants 2 messages May 24, 2022 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: usb-audio: Configure sync endpoints before data

From: Craig McLure <[email protected]>

Devices such as the TC-Helicon GoXLR require the sync endpoint to be configured in advance of the data endpoint in order for sound output to work.

This patch simply changes the ordering of EP configuration to resolve this.

Fixes bf6313a0ff76 ("ALSA: usb-audio: Refactor endpoint management")
---
 sound/usb/pcm.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
sound/usb/pcm.c +11 -6
index 6d699065e81a..b470404a5376 100644
@@ -439,16 +439,21 @@ static int configure_endpoints(struct snd_usb_audio *chip,
 		/* stop any running stream beforehand */
 		if (stop_endpoints(subs, false))
 			sync_pending_stops(subs);
+		if (subs->sync_endpoint) {
+			err = snd_usb_endpoint_configure(chip, subs->sync_endpoint);
+			if (err < 0)
+				return err;
+		}
 		err = snd_usb_endpoint_configure(chip, subs->data_endpoint);
 		if (err < 0)
 			return err;
 		snd_usb_set_format_quirk(subs, subs->cur_audiofmt);
-	}
-
-	if (subs->sync_endpoint) {
-		err = snd_usb_endpoint_configure(chip, subs->sync_endpoint);
-		if (err < 0)
-			return err;
+	} else {
+		if (subs->sync_endpoint) {
+			err = snd_usb_endpoint_configure(chip, subs->sync_endpoint);
+			if (err < 0)
+				return err;
+		}
 	}
 
 	return 0;
Signature · 1 line
2.35.3
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Takashi Iwai

From: Craig McLure <[email protected]>

Devices such as the TC-Helicon GoXLR require the sync endpoint to be configured in advance of the data endpoint in order for sound output to work.

Quoted 8 lines

This patch simply changes the ordering of EP configuration to resolve this.

Fixes bf6313a0ff76 ("ALSA: usb-audio: Refactor endpoint management")
Quoted 36 lines
---
  sound/usb/pcm.c | 17 +++++++++++------
  1 file changed, 11 insertions(+), 6 deletions(-)
sound/usb/pcm.c +11 -6
index 6d699065e81a..b470404a5376 100644
@@ -439,16 +439,21 @@ static int configure_endpoints(struct snd_usb_audio *chip,
  		/* stop any running stream beforehand */
  		if (stop_endpoints(subs, false))
  			sync_pending_stops(subs);
+		if (subs->sync_endpoint) {
+			err = snd_usb_endpoint_configure(chip, subs->sync_endpoint);
+			if (err < 0)
+				return err;
+		}
  		err = snd_usb_endpoint_configure(chip, subs->data_endpoint);
  		if (err < 0)
  			return err;
  		snd_usb_set_format_quirk(subs, subs->cur_audiofmt);
-	}
-
-	if (subs->sync_endpoint) {
-		err = snd_usb_endpoint_configure(chip, subs->sync_endpoint);
-		if (err < 0)
-			return err;
+	} else {
+		if (subs->sync_endpoint) {
+			err = snd_usb_endpoint_configure(chip, subs->sync_endpoint);
+			if (err < 0)
+				return err;
+		}
  	}
 
  	return 0;
Signature · 2 lines
Jaroslav Kysela <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.