mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ALSA: usb-audio: Rate-limit URB submission error at stream start
@ 2026-10-25 23:18 Denis Kulikov
  2026-10-26  8:03 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Denis Kulikov @ 2026-10-25 23:18 UTC (permalink / raw)
  To: Takashi Iwai, Jaroslav Kysela; +Cc: linux-sound, linux-kernel, Denis Kulikov

When two USB audio devices share a USB 2.0 hub (here a headset and a
microphone), there may not be enough isochronous bandwidth to start the
second stream, and usb_submit_urb() fails with -ENOSPC. PipeWire keeps
retrying to start the stream every ~20 ms, and every attempt logs

  usb 2-1.1: cannot submit urb 0, error -28: not enough bandwidth

On my desktop this was printed up to 94 times per second and flooded
the kernel log.

Use usb_audio_err_ratelimited() for this message, as commit
2db2be5607c4 ("ALSA: usb-audio: Rate limit usb_set_interface error
reporting") already did for a neighbouring message in the same file.

Tested on that desktop (X79, Linux 7.3) with the headset and the
microphone on one hub, starting playback and capture on both for 20
seconds: the stock snd-usb-audio module printed the message 580 times,
the patched one printed it 50 times and suppressed the rest.

Signed-off-by: Denis Kulikov <dar1knessx@gmail.com>
---
 sound/usb/endpoint.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index 9c844c55a..8dd0b3525 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -1642,9 +1642,9 @@ int snd_usb_endpoint_start(struct snd_usb_endpoint *ep)
 			err = -ENODEV;
 		if (err < 0) {
 			if (!atomic_read(&ep->chip->shutdown))
-				usb_audio_err(ep->chip,
-					      "cannot submit urb %d, error %d: %s\n",
-					      i, err, usb_error_string(err));
+				usb_audio_err_ratelimited(ep->chip,
+							  "cannot submit urb %d, error %d: %s\n",
+							  i, err, usb_error_string(err));
 			goto __error;
 		}
 		set_bit(i, &ep->active_mask);
-- 
2.56.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ALSA: usb-audio: Rate-limit URB submission error at stream start
  2026-10-25 23:18 [PATCH] ALSA: usb-audio: Rate-limit URB submission error at stream start Denis Kulikov
@ 2026-10-26  8:03 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2026-10-26  8:03 UTC (permalink / raw)
  To: Denis Kulikov; +Cc: Takashi Iwai, Jaroslav Kysela, linux-sound, linux-kernel

On Mon, 26 Oct 2026 00:18:49 +0100,
Denis Kulikov wrote:
> 
> When two USB audio devices share a USB 2.0 hub (here a headset and a
> microphone), there may not be enough isochronous bandwidth to start the
> second stream, and usb_submit_urb() fails with -ENOSPC. PipeWire keeps
> retrying to start the stream every ~20 ms, and every attempt logs
> 
>   usb 2-1.1: cannot submit urb 0, error -28: not enough bandwidth
> 
> On my desktop this was printed up to 94 times per second and flooded
> the kernel log.
> 
> Use usb_audio_err_ratelimited() for this message, as commit
> 2db2be5607c4 ("ALSA: usb-audio: Rate limit usb_set_interface error
> reporting") already did for a neighbouring message in the same file.
> 
> Tested on that desktop (X79, Linux 7.3) with the headset and the
> microphone on one hub, starting playback and capture on both for 20
> seconds: the stock snd-usb-audio module printed the message 580 times,
> the patched one printed it 50 times and suppressed the rest.
> 
> Signed-off-by: Denis Kulikov <dar1knessx@gmail.com>

Applied now.  Thanks.


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-26  8:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-25 23:18 [PATCH] ALSA: usb-audio: Rate-limit URB submission error at stream start Denis Kulikov
2026-10-26  8:03 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®