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/[email protected]/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
