Skip to content

fix(launcher): cache system volume so OSD and settings agree - #252

Merged
dianjixz merged 1 commit into
masterfrom
fix/cache-system-volume-osd-settings-sync
Nov 13, 2026
Merged

dianjixz merged 1 commit into
masterfrom
fix/cache-system-volume-osd-settings-sync

Conversation

@dianjixz

Copy link
Copy Markdown
Collaborator

The volume shortcut re-read the mixer on every press while Settings -> Speaker rendered whatever its own asynchronous read returned, so the two could show different values for the same mixer state.

Read the mixer once at launcher startup on a worker thread. The reader waits for two consecutive equal readings before publishing, because WirePlumber applies the card's stored volume while it comes up, and falls back to the last valid reading if the value never settles. Shortcuts now step from the cached value instead of issuing another read, and every volume write updates the cache.

Settings -> Speaker seeds its first frame from the same cache and pushes mixer results (read, preview and commit) back into it, so leaving the page cannot expose a stale value. The persisted config key remains only a fallback for a page opened before the startup read finished.

Launcher teardown joins the startup reader, and the test build now links pthread for the worker thread.

The volume shortcut re-read the mixer on every press while Settings ->
Speaker rendered whatever its own asynchronous read returned, so the two
could show different values for the same mixer state.

Read the mixer once at launcher startup on a worker thread. The reader
waits for two consecutive equal readings before publishing, because
WirePlumber applies the card's stored volume while it comes up, and falls
back to the last valid reading if the value never settles. Shortcuts now
step from the cached value instead of issuing another read, and every
volume write updates the cache.

Settings -> Speaker seeds its first frame from the same cache and pushes
mixer results (read, preview and commit) back into it, so leaving the
page cannot expose a stale value. The persisted config key remains only a
fallback for a page opened before the startup read finished.

Launcher teardown joins the startup reader, and the test build now links
pthread for the worker thread.
@dianjixz
dianjixz merged commit 0590e73 into master Nov 13, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant