Skip to content

Commit 0599313

Browse files
committed
ALSA: usb-audio: Make sure to stop endpoints before closing EPs
At the PCM hw params, we may re-configure the endpoints and it's done by a temporary EP close followed by re-open. A potential problem there is that the EP might be already running internally at the PCM prepare stage; it's seen typically in the playback stream with the implicit feedback sync. As this stream start isn't tracked by the core PCM layer, we'd need to stop it explicitly, and that's the missing piece. This patch adds the stop_endpoints() call at snd_usb_hw_params() to assure the stream stop before closing the EPs. Fixes: bf6313a ("ALSA: usb-audio: Refactor endpoint management") Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent a575193 commit 0599313

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sound/usb/pcm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,8 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream,
525525
if (snd_usb_endpoint_compatible(chip, subs->data_endpoint,
526526
fmt, hw_params))
527527
goto unlock;
528+
if (stop_endpoints(subs, false))
529+
sync_pending_stops(subs);
528530
close_endpoints(chip, subs);
529531
}
530532

0 commit comments

Comments
 (0)