This is a note to let you know that I've just added the patch titled ALSA: usb-audio: Disable low-latency playback for free-wheel mode to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: alsa-usb-audio-disable-low-latency-playback-for-free-wheel-mode.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From e581f1cec4f899f788f6c9477f805b1d5fef25e2 Mon Sep 17 00:00:00 2001 From: Takashi Iwai <tiwai@xxxxxxx> Date: Wed, 29 Sep 2021 10:08:39 +0200 Subject: ALSA: usb-audio: Disable low-latency playback for free-wheel mode From: Takashi Iwai <tiwai@xxxxxxx> commit e581f1cec4f899f788f6c9477f805b1d5fef25e2 upstream. The free-wheel stream operation like dmix may not update the appl_ptr appropriately, and it doesn't fit with the low-latency playback mode. Disable the low-latency playback operation when the stream is set up in such a mode. Link: https://lore.kernel.org/r/20210929080844.11583-5-tiwai@xxxxxxx Signed-off-by: Takashi Iwai <tiwai@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- sound/usb/pcm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -582,7 +582,8 @@ static int snd_usb_hw_free(struct snd_pc } /* check whether early start is needed for playback stream */ -static int lowlatency_playback_available(struct snd_usb_substream *subs) +static int lowlatency_playback_available(struct snd_pcm_runtime *runtime, + struct snd_usb_substream *subs) { struct snd_usb_audio *chip = subs->stream->chip; @@ -591,6 +592,9 @@ static int lowlatency_playback_available /* disabled via module option? */ if (!chip->lowlatency) return false; + /* free-wheeling mode? (e.g. dmix) */ + if (runtime->stop_threshold > runtime->buffer_size) + return false; /* too short periods? */ if (subs->data_endpoint->nominal_queue_size >= subs->buffer_bytes) return false; @@ -630,7 +634,7 @@ static int snd_usb_pcm_prepare(struct sn subs->period_elapsed_pending = 0; runtime->delay = 0; - subs->lowlatency_playback = lowlatency_playback_available(subs); + subs->lowlatency_playback = lowlatency_playback_available(runtime, subs); if (!subs->lowlatency_playback) ret = start_endpoints(subs); Patches currently in stable-queue which might be from tiwai@xxxxxxx are queue-5.15/alsa-usb-audio-rename-early_playback_start-flag-with-lowlatency_playback.patch queue-5.15/alsa-usb-audio-disable-low-latency-playback-for-free-wheel-mode.patch queue-5.15/alsa-usb-audio-avoid-killing-in-flight-urbs-during-draining.patch queue-5.15/alsa-usb-audio-less-restriction-for-low-latency-playback-mode.patch queue-5.15/alsa-usb-audio-improved-lowlatency-playback-support.patch queue-5.15/alsa-usb-audio-check-available-frames-for-the-next-packet-size.patch queue-5.15/alsa-usb-audio-switch-back-to-non-latency-mode-at-a-later-point.patch queue-5.15/alsa-usb-audio-fix-packet-size-calculation-regression.patch queue-5.15/alsa-usb-audio-don-t-start-stream-for-capture-at-prepare.patch queue-5.15/alsa-usb-audio-disable-low-latency-mode-for-implicit-feedback-sync.patch queue-5.15/alsa-usb-audio-add-spinlock-to-stop_urbs.patch queue-5.15/alsa-usb-audio-restrict-rates-for-the-shared-clocks.patch