fix(audio): gate strict buffer-size verification to ASIO; review cleanups

Post-open verification previously failed closed on any buffer-size delta on
every backend. The wedge this guards against (a driver accepting a request
without changing its buffer, then blocking the next in-place request) is
ASIO behaviour; ALSA rounds requests to period constraints and CoreAudio
can clamp, and both previously worked by storing the driver-adjusted
actuals. Keep exact buffer equality for ASIO only; other backends log and
accept the adjusted size. Rate and channel-mask verification stay strict
everywhere.

Also from review: print the real `options.compatible` in the live-probe log
instead of a hard-coded 1, and document that the live-endpoint reuse in
probeDual is safe only under runDeviceLifecycleOp's message-thread
serialisation (PR #113).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
OmikronApex
2026-07-17 22:20:03 +02:00
co-authored by Claude Fable 5
parent a558873c43
commit 16686389fd
2 changed files with 38 additions and 3 deletions
+11
View File
@@ -68,6 +68,17 @@ test('duplex success is gated on actual rate, buffer, and active channel masks',
assert.match(applyDuplex, /validateOpenedDeviceFormat\(/);
});
test('strict buffer-size verification is gated to ASIO; other backends accept driver-adjusted', () => {
// ALSA rounds to period constraints and CoreAudio can clamp; both must
// keep their pre-#114 store-the-actuals behaviour instead of failing
// closed on a working driver-rounded open.
assert.match(applyDuplex,
/const bool strictBufferSize = \(configuredTypeName == "ASIO"\);/);
assert.match(applyDuplex,
/strictBufferSize \? setup\.bufferSize : bs/);
assert.match(applyDuplex, /accepting driver-adjusted buffer size/);
});
test('duplex failures clear observable format state and release monitor resources', () => {
const cleanupStart = applyDuplex.indexOf('auto failClosed =');
const cleanupEnd = applyDuplex.indexOf('// Channel masks must match too', cleanupStart);