From: Joonho Lee <mynameisjune111@gmail.com>
To: linux-sound@vger.kernel.org
Cc: tiwai@suse.com, perex@perex.cz, anton.yakovlev@opensynergy.com,
mst@redhat.com, virtualization@lists.linux.dev,
linux-kernel@vger.kernel.org, corbet@lwn.net,
skhan@linuxfoundation.org, rdunlap@infradead.org,
linux-doc@vger.kernel.org
Subject: [PATCH v27 00/17] ALSA: virtio: preserve PCM progress
Date: Thu, 12 Nov 2026 09:46:47 +0900 [thread overview]
Message-ID: <20261112004704.49758-1-mynameisjune111@gmail.com> (raw)
This replaces v25 in full. Apply all seventeen patches directly to the
pinned base commit below. The previous public version is at:
https://lore.kernel.org/linux-sound/20261111025655.63951-1-mynameisjune111@gmail.com/T/
Changes since v25:
Patch 4 handles linked prepare revoked by a concurrent disconnect or
suspend. It invalidates affected opted-in members to SETUP while
preserving terminal DISCONNECTED and SUSPENDED states.
Patch 9 adds the missing Fixes tag for the original virtio-snd control
and I/O message handling. Patch 14 documents both default-off capture
compatibility parameters and their behavior in the ALSA configuration
guide.
The capture path receives into request-owned buffers, appends valid
short completions contiguously, preserves a valid STOP tail, and reports
overflow through XRUN. PCM lifecycle, request ownership, and recovery
are serialized across prepare, reset, stop, and teardown.
Patch 16 adds an explicit application-pointer form of the ALSA indirect
playback transfer helper while retaining the existing wrapper. Patch 17
preserves playback progress across pause and lets the pointer callback
refill already committed data while buffer-access admission is closed.
The playback queue remains bounded below one physical ring; this reduces
queued buffering by one period. A missing ALSA control page follows the
common playback validation and XRUN error path.
The final candidate was tested on ARM64 QEMU with KASAN and lockdep. RW
and MMAP passed boundary PAUSE/RELEASE, HWSYNC/poll, DROP, and reopen
with two-period and eight-period rings. RW and MMAP also passed accepted
RESET from PREPARED followed by DRAIN and reopen, and accepted RESET
while RUNNING after ALSA reported the full 2,048-frame buffer available.
A separate paired gate fixture compared baseline and candidate in RW and
MMAP. The generic ALSA indirect helper invokes ACK for each pointer
callback, but masks its internal `-EBADFD`; once `hw_ptr == hw_io` with
no completion outstanding, virtio period-work progress suppresses
further callbacks, leaving no ACK to retry the refill. Baseline stopped
after 3,072 completed bytes with 1,024 bytes in `sw_ready`. The
candidate drained `sw_ready` and completed 4,096 bytes without any
further client ACK. A hostile test-only hook changed `appl_ptr` to 2,560
while only 2,048 frames were committed; the candidate refilled only
committed data. ARM64 control-page mmap is unsupported, so this
injection used a test-only kernel hook absent from production source.
A separate strict KCSAN build of the final source passed eight QEMU
workloads covering RW/MMAP playback pause, pointer queries, DROP/reopen,
PREPARED and RUNNING RESET, and capture. Default and enhanced sampling
were used for playback; enhanced sampling was used for RESET and
capture. No KCSAN or lockdep report appeared in the qualified workloads.
An isolated deliberate reader/writer race confirmed that KCSAN reports
worked. RW/MMAP capture, paused RESET and reopen data matched the
backend sequence oracle across 7,104,000 frames.
On macOS VZ, Scarlett 2i2 capture passed two VM boots, 24 captures and
20 reopens with capture_packed_status=1. This included a five-minute RW
capture and 70-second RW/MMAP captures. Repeating the same matrix with
the recorder stopped and Scarlett used only by the test VM also passed.
Each matrix captured 27,360,000 frames over 570 seconds without recovery
or KASAN/lockdep reports. No physical PCM recordings were retained.
Physical tests checked signal and delivery rather than a known sample
sequence. VZ exposed capture only, and the guests used poweroff -f;
orderly SIGTERM shutdown was not qualified. The default-off
compatibility setting was not requalified. KCSAN is sampled, and these
finite workloads do not establish full-series qualification. The tree
through patch 15 was inspected but was not run as a separate control.
base-commit: a4311e9447bbb219044db38897f95be112f46a8a
next reply other threads:[~2026-11-12 0:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 0:46 Joonho Lee [this message]
2026-11-12 0:46 ` [PATCH v27 01/17] ALSA: pcm: mark stop-threshold accesses for capture policy sampling Joonho Lee
2026-11-12 0:46 ` [PATCH v27 02/17] ALSA: pcm: report partial progress under the stream lock Joonho Lee
2026-11-12 0:46 ` [PATCH v27 03/17] ALSA: pcm: add an optional reset operation " Joonho Lee
2026-11-12 0:46 ` [PATCH v27 04/17] ALSA: pcm: notify drivers after linked prepare completes Joonho Lee
2026-11-12 0:46 ` [PATCH v27 05/17] ALSA: pcm: serialize linked buffer actions Joonho Lee
2026-11-12 0:46 ` [PATCH v27 06/17] ALSA: virtio: propagate playback send failures through ACK Joonho Lee
2026-11-12 0:46 ` [PATCH v27 07/17] ALSA: virtio: Recover PCM state after a failed start Joonho Lee
2026-11-12 0:46 ` [PATCH v27 08/17] ALSA: virtio: Retain queued messages through device reset Joonho Lee
2026-11-12 0:46 ` [PATCH v27 09/17] ALSA: virtio: bound PCM transfers and retain DMA buffers Joonho Lee
2026-11-12 0:46 ` [PATCH v27 10/17] ALSA: virtio: Keep control payloads alive through DMA completion Joonho Lee
2026-11-12 0:46 ` [PATCH v27 11/17] ALSA: virtio: wait through signals for PCM teardown Joonho Lee
2026-11-12 0:46 ` [PATCH v27 12/17] ALSA: virtio: use request-owned capture and serialize recovery Joonho Lee
2026-11-12 0:47 ` [PATCH v27 13/17] ALSA: virtio: prioritize capture period work Joonho Lee
2026-11-12 0:47 ` [PATCH v27 14/17] docs: describe virtio-sound capture options Joonho Lee
2026-11-12 0:47 ` [PATCH v27 15/17] ALSA: virtio: reject invalid playback completions Joonho Lee
2026-11-12 0:47 ` [PATCH v27 16/17] ALSA: pcm: add an explicit application pointer to indirect playback transfer Joonho Lee
2026-11-12 0:47 ` [PATCH v27 17/17] ALSA: virtio: preserve playback progress across pause and buffer access Joonho Lee
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=20261112004704.49758-1-mynameisjune111@gmail.com \
--to=mynameisjune111@gmail.com \
--cc=anton.yakovlev@opensynergy.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=mst@redhat.com \
--cc=perex@perex.cz \
--cc=rdunlap@infradead.org \
--cc=skhan@linuxfoundation.org \
--cc=tiwai@suse.com \
--cc=virtualization@lists.linux.dev \
/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
all inboxes | Powered by JetHome®