aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/endpoint.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2021-09-29 10:08:44 +0200
committerTakashi Iwai <tiwai@suse.de>2021-09-30 13:55:26 +0200
commit813a17cab9b708bbb1e0db8902e19857b57196ec (patch)
treef91282e2fbb445a1d96d873bce133dd75b8043a1 /sound/usb/endpoint.h
parentALSA: usb-audio: Improved lowlatency playback support (diff)
downloadlinux-dev-813a17cab9b708bbb1e0db8902e19857b57196ec.tar.xz
linux-dev-813a17cab9b708bbb1e0db8902e19857b57196ec.zip
ALSA: usb-audio: Avoid killing in-flight URBs during draining
While draining a stream, ALSA PCM core stops the stream by issuing snd_pcm_stop() after all data has been sent out. And, at PCM trigger stop, currently USB-audio driver kills the in-flight URBs explicitly, then at sync-stop ops, sync with the finish of all remaining URBs. This might result in a drop of the drained samples as most of USB-audio devices / hosts allow relatively long in-flight samples (as a sort of FIFO). For avoiding the trimming, this patch changes the stream-stop behavior during PCM draining state. Under that condition, the pending URBs won't be killed. The leftover in-flight URBs are caught by the sync-stop operation that shall be performed after the trigger-stop operation. Link: https://lore.kernel.org/r/20210929080844.11583-10-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/endpoint.h')
-rw-r--r--sound/usb/endpoint.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/usb/endpoint.h b/sound/usb/endpoint.h
index 6895d50d14d1..6a9af04cf175 100644
--- a/sound/usb/endpoint.h
+++ b/sound/usb/endpoint.h
@@ -38,7 +38,7 @@ void snd_usb_endpoint_set_callback(struct snd_usb_endpoint *ep,
struct snd_usb_substream *data_subs);
int snd_usb_endpoint_start(struct snd_usb_endpoint *ep);
-void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep);
+void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep, bool keep_pending);
void snd_usb_endpoint_sync_pending_stop(struct snd_usb_endpoint *ep);
void snd_usb_endpoint_suspend(struct snd_usb_endpoint *ep);
int snd_usb_endpoint_activate(struct snd_usb_endpoint *ep);