Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Zhang Heng <zhangheng@kylinos.cn>
Cc: perex@perex.cz, tiwai@suse.com, kees@kernel.org,
	chengordon326@gmail.com, jussi@sonarnerd.net, hulianqin@vivo.com,
	i@rong.moe, g@b4.vu, cryolitia@uniontech.com, pav@iki.fi,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] ALSA: usb-audio: Fix boot-time audio stuttering for USB Audio device
Date: Tue, 28 Jul 2026 18:32:50 +0200	[thread overview]
Message-ID: <87zezb5b2l.wl-tiwai@suse.de> (raw)
In-Reply-To: <20260728111309.1271834-1-zhangheng@kylinos.cn>

On Tue, 28 Jul 2026 13:13:09 +0200,
Zhang Heng wrote:
> 
> This USB Audio device (0x1e0b:0xd01e) exhibits audio stuttering
> during boot when playing audio. Once the system is fully booted,
> playback is normal.
> 
> The device reports its isochronous endpoints with the Asynchronous
> sync type (bmAttributes = 0x03), which causes the driver to
> calculate nurbs = min(max_urbs, ...) = 3, providing only ~16ms
> of buffering. During boot, the higher system scheduling jitter
> (e.g., from init scripts, device enumeration, and driver probing)
> can exceed this buffer depth, causing audible stuttering.
> 
> This patch adds a device-specific quirk (QUIRK_FLAG_PLAYBACK_URB_FIXUP)
> that applies two changes for this device:
> 1. Forces nurbs to MAX_URBS (12), providing sufficient buffering
> 2. Sets URB_ISO_ASAP flag for more consistent xHCI scheduling
> 
> Both changes are required together for stable boot-time playback:
> - The larger buffer absorbs scheduling jitter during boot
> - URB_ISO_ASAP ensures consistent URB submission timing, preventing
>   the xHCI scheduler from introducing variable delays
> 
> Test methodology:
> - Without patch: reboot and play audio → stuttering audible in all
>   tests (reproduced consistently across multiple attempts)
> - With nurbs=8 only: occasional minor stuttering observed after
>   multiple tests (insufficient buffer depth)
> - With full patch (nurbs=12 + URB_ISO_ASAP): reboot and play audio
>   → no stuttering observed (tested in 10+ reboot cycles without
>   reproducing the issue)
> 
> Signed-off-by: Zhang Heng <zhangheng@kylinos.cn>

Looks a bit like voodoo, but better than vanilla, as it seems.
Applied to for-next branch now.


thanks,

Takashi


      reply	other threads:[~2026-07-28 16:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-28 11:13 [PATCH v3] ALSA: usb-audio: Fix boot-time audio stuttering for USB Audio device Zhang Heng
2026-07-28 16:32 ` Takashi Iwai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zezb5b2l.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=chengordon326@gmail.com \
    --cc=cryolitia@uniontech.com \
    --cc=g@b4.vu \
    --cc=hulianqin@vivo.com \
    --cc=i@rong.moe \
    --cc=jussi@sonarnerd.net \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=pav@iki.fi \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=zhangheng@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox