fix(windows): eq lifecycle — apo bypass on daemon exit, profile auto-apply, console flashes#65
Open
ealtun21 wants to merge 9 commits into
Open
fix(windows): eq lifecycle — apo bypass on daemon exit, profile auto-apply, console flashes#65ealtun21 wants to merge 9 commits into
ealtun21 wants to merge 9 commits into
Conversation
Track the stale->live heartbeat transition and invalidate the worker's latched generation so the existing rebuild path re-reads the daemon's snapshot on the next tick. Previously the worker only ever forced enabled=false on staleness; nothing rebuilt on recovery, so the APO stayed bypassed until the daemon's next publish (which may never come, e.g. after a suspend/resume or the startup beat-before-publish race). Also swap two em-dashes for ASCII hyphens in log strings that render as mojibake in the ANSI apo.log, clean up leftover temp files in two state.rs tests, and add a worker-level harness test proving the full stale-bypass-then-recover cycle through the real FFI exports.
publish_apo_bypass ran on the SIGTERM/Ctrl-C signal path with a plain lock().unwrap(); a poisoned mutex there would panic the signal task and eat shutdown forever. Recover the guard via PoisonError::into_inner instead. set_apo_writer now beats immediately after its initial publish, so liveness lands together with the first snapshot (belt-and-braces against the startup race the APO side now guards against). Also note in pump_telemetry's doc that it doubles as the APO's liveness signal and must keep running with no clients connected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes three Windows tester bugs:
1. EQ kept running after quitting from the tray
The DSP lives in the APO inside audiodg, fed by a shared state file; killing the daemon left the last EQ snapshot active forever.
enabled=0bypass snapshot on every graceful shutdown (IPCShutdown, SIGTERM/Ctrl-C), and Windowsservice::stop()tries graceful IPC first (taskkill only as fallback).taskkill /f, crash, hang) and rebuilds when it resumes (suspend/resume safe).STATE_VERSION9→10 — manual deployers must update daemon +resonance_apo.dlltogether and restart the audio service (the installer already does this).quit_stops_daemon(default on); "Quit tray" (setting off) exits only the tray.2. Device-mapped profile not applied after daemon restart
The cross-platform output-mapping task was never fed on Windows (
output_txdropped; no audio backend). The device-watch thread now reports the default render device, so the mapped profile auto-applies at startup and on device change.3. PowerShell window flash at startup
The GUI-subsystem daemon spawned
powershell.exe(APO endpoint attach) withoutCREATE_NO_WINDOW; same for the quit-pathtaskkill. Both flagged.Verification
snapshot_enabled=0+ daemon gone;taskkill /fduring playback → apo.logdaemon heartbeat stale - forcing bypasswithin ~2 s,enabled=falseon subsequent blocks; daemon restart → profilevmtestauto-applied +enabled=true. Full cycle repeated 3×.cargo test -p resonance-apo: 35/35 (incl. new heartbeat-watch + three-phase recovery harness tests).make checkgreen;cargo clippy --target x86_64-pc-windows-msvcclean across apo/ipc/daemon/tray.