Repository navigation
Conversation
When no default audio sink exists (boards without audio brought up yet), omarchy-mute-switch retried wpctl every 2 s forever, burning CPU and writing hundreds of kilobytes of identical 'Translate ID error: -1' lines to the RAM-backed runtime log. It also scanned /sys/class/input every 2 s and woke every 1 s to check compositor liveness. Back off consecutive set_mute failures exponentially (2 s up to 60 s, reset immediately on any switch move or success), deduplicate repeated stderr lines, and lengthen idle wake/keyboard-scan intervals to 5 s / 10 s. Assisted-by: LLM
Assisted-by: LLM
tcballard
force-pushed
the
perf-mute-switch-backoff
branch
from
December 2, 2026 06:14
5db2c2f to
7e03fa1
Compare
Contributor
Author
|
Superseded by #222, which replaces the Python mute-switch daemon with a small C99 helper including this retry backoff and deduplicated error logging. |
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.
Summary
gpio-keysKEY_MUTE) whose audio output is not brought up yet,omarchy-mute-switchretriedwpctl set-mute @DEFAULT_AUDIO_SINK@every2 sindefinitely — burning CPU (1m38sover 1.5 d on iPhone 6) and writing360 KBof repeatedTranslate ID error: '-1'lines into RAM-backed$XDG_RUNTIME_DIR/omarchy-mute-switch.log.Follower.failed()(2 sup to60 s, reset immediately on any switch movement or successful mute) and deduplicates consecutive identicalstderrerror messages.selectliveness timeout (1 s → 5 s) and newly-connected keyboard rescan interval (2 s → 10 s).Testing
tests/test_mute_switch.pywith backoff cap/reset and deduplicated error-logging tests (22/22pass).