Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH v25 00/16] ALSA: virtio: serialize PCM recovery and preserve capture and playback progress
@ 2026-11-11  2:56 Joonho Lee
  2026-11-11  2:56 ` [PATCH v25 01/16] ALSA: pcm: mark stop-threshold accesses for capture policy sampling Joonho Lee
                   ` (15 more replies)
  0 siblings, 16 replies; 21+ messages in thread
From: Joonho Lee @ 2026-11-11  2:56 UTC (permalink / raw)
  To: linux-sound
  Cc: tiwai, perex, anton.yakovlev, mst, virtualization, linux-kernel,
	corbet, skhan, rdunlap, linux-doc

This series updates ALSA PCM recovery and virtio-snd request ownership.
Capture receives into request-owned buffers so valid short completions
can be appended to the ALSA ring without leaving a gap.

This replaces v24 in full. Apply all sixteen patches to the base commit
below. The previous version is at:

https://lore.kernel.org/linux-sound/20261111000543.28550-1-mynameisjune111@gmail.com/T/

Changes since v24:

Capture DRAINING keeps a full buffer readable and reports progress
beyond capacity as XRUN. The read loop refreshes availability after an
unlocked copy so a tail published during that copy is included before
EOF. Playback drain completion is unchanged.

ACK checks the core buffer-access gate before entering the transfer
path. The existing PCM lock barriers in prepare, RESET, hw_params and
hw_free wait for ACKs already admitted before the gate closes. Internal
RESET pointer observation retains its separate bypass.

Playback period work checks for new progress or a latched error under
the PCM stream lock. This prevents work queued before a paused RESET
from publishing a duplicate period after resume. Prepare and RESET clear
both the cached device latency and runtime delay.

The capture allocation and copy description now lives in the ALSA
configuration guide. On MMU systems, per-period page rounding can make
additional memory exceed the ALSA ring size; the request buffers remain
allocated from hw_params until hw_free. Pause documentation now
describes STOP/RELEASE followed by PREPARE/START. The ACK
error-propagation and teardown wait patches carry Fixes tags. Patch
descriptions state their changes against the pinned base.

Validation:

The pinned v24 baseline was rebuilt with the saved KASAN and lockdep
configuration and the same builder. Fresh cumulative W=1 builds cover
stages 2, 12 and 16. Each passed with no new warning lines in the
changed audio builds. The full baseline build retains 517 warnings in
unchanged ARM64 files; other intermediate stages were not rebuilt.

Matched synthetic ALSA PCM tests compared baseline and integrated
candidate. The candidate preserved and read all 8192 frames in a full
capture buffer, returned EOF on the next read, reported 8193 unread
frames as XRUN, and returned both a 1024-frame prefix and the 512-frame
tail published during an unlocked read before reaching EOF. Playback
drain still completes. These fixtures exercise PCM core behavior, not
virtio transport or physical device DMA.

ACK probes on baseline, isolated candidate and integrated candidate
verified the baseline admitted a gated ACK and queued TX; both
candidates rejected ACK with -EBADFD and queued no TX. All three also
verified completion of a pre-gate ACK before linked prepare crossed its
lock barrier, and the internal RESET bypass. The integrated playback
probes verified stale work across PAUSED RESET/resume and clearing of a
synthetic 256-frame device delay after RESET and PREPARE. Clean
integrated RW and MMAP capture runs each lasted 70 seconds; all seven
segments totaling 7,104,000 frames matched the unchanged independent
oracle. These QEMU runs reported no KASAN or lockdep diagnostics. KCSAN
was not run.

The default RX path adds request-owned memory and an IRQ-path copy.
Packed status and RELEASE/reprepare pause are opt-in and disabled by
default. CPU and worst-case IRQ lock-hold time remain unqualified. The
playback queue cap reduces buffering tolerance, especially with two
periods. This revision has no new physical VZ or KCSAN qualification.
Uncertain control timeouts can still require device reset or reprobe.
The deterministic review fixtures are local and have not been published.

base-commit: a4311e9447bbb219044db38897f95be112f46a8a

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

end of thread, other threads:[~2026-11-11  7:06 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-11  2:56 [PATCH v25 00/16] ALSA: virtio: serialize PCM recovery and preserve capture and playback progress Joonho Lee
2026-11-11  2:56 ` [PATCH v25 01/16] ALSA: pcm: mark stop-threshold accesses for capture policy sampling Joonho Lee
2026-11-11  2:56 ` [PATCH v25 02/16] ALSA: pcm: report partial progress under the stream lock Joonho Lee
2026-11-11  2:56 ` [PATCH v25 03/16] ALSA: pcm: add an optional reset operation " Joonho Lee
2026-11-11  2:56 ` [PATCH v25 04/16] ALSA: pcm: notify drivers after linked prepare completes Joonho Lee
2026-11-11  4:00   ` sashiko-bot
2026-11-11  2:56 ` [PATCH v25 05/16] ALSA: pcm: serialize linked buffer actions Joonho Lee
2026-11-11  2:56 ` [PATCH v25 06/16] ALSA: virtio: propagate playback send failures through ACK Joonho Lee
2026-11-11  2:56 ` [PATCH v25 07/16] ALSA: virtio: Recover PCM state after a failed start Joonho Lee
2026-11-11  2:56 ` [PATCH v25 08/16] ALSA: virtio: Retain queued messages through device reset Joonho Lee
2026-11-11  2:56 ` [PATCH v25 09/16] ALSA: virtio: bound PCM transfers and retain DMA buffers Joonho Lee
2026-11-11  5:34   ` sashiko-bot
2026-11-11  2:56 ` [PATCH v25 10/16] ALSA: virtio: Keep control payloads alive through DMA completion Joonho Lee
2026-11-11  2:56 ` [PATCH v25 11/16] ALSA: virtio: wait through signals for PCM teardown Joonho Lee
2026-11-11  2:56 ` [PATCH v25 12/16] ALSA: virtio: use request-owned capture and serialize recovery Joonho Lee
2026-11-11  2:56 ` [PATCH v25 13/16] ALSA: virtio: prioritize capture period work Joonho Lee
2026-11-11  2:56 ` [PATCH v25 14/16] docs: describe virtio-sound capture options Joonho Lee
2026-11-11  6:26   ` sashiko-bot
2026-11-11  2:56 ` [PATCH v25 15/16] ALSA: virtio: reject invalid playback completions Joonho Lee
2026-11-11  2:56 ` [PATCH v25 16/16] ALSA: virtio: preserve playback progress across pause Joonho Lee
2026-11-11  7:06   ` sashiko-bot

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