Skip to content

transport: Engine::pause() doesn't stop audio for up to 0.7s #542

Description

@forkwright

Finding

Engine::pause() (line 243) only CASes the state atomic and emits PlaybackPaused; it never calls the output backend's pause(), and the cpal callback keeps popping already-buffered DSP-processed samples, so audio continues audibly for up to ring_buffer_capacity (~0.7s default) after pause() returns — 'pause' is not instantaneous on the shipped native-output path.

Evidence

crates/akouo-core/src/engine.rs:243. Surfaced by the 2026-07-03 deep-audit workflow (adversarially verified + Opus-judged).

Why this matters

Calling pause continues to play already-buffered audio audibly for up to ~0.7s, meaning 'pause' is not actually instantaneous on the shipped native-output path — a user-visible correctness bug.

Desired correction

Call the output backend's pause()/start() from Engine::pause()/resume() (the wiring already exists, used only by flush_ring_after_seek), or gate the callback to emit silence when state is PAUSED.

Done when: the defect's failure mode no longer reproduces and a regression test covers it.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions