fix(CavaService): prevent 100% CPU EOF spin loop by using temp file#2471
Open
Angerion wants to merge 1 commit into
Open
fix(CavaService): prevent 100% CPU EOF spin loop by using temp file#2471Angerion wants to merge 1 commit into
Angerion wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates how the Cava process is started by writing the generated config to a temporary file and then launching cava pointing at that file.
Changes:
- Switch Cava config delivery from a stdin heredoc pipe to writing
/tmp/dms-cava.conf. - Start
cavaviaexec cava -p /tmp/dms-cava.confand detach stdin (< /dev/null).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| running: root.cavaAvailable && root.refCount > 0 | ||
| command: ["sh", "-c", `cat <<'CAVACONF' | cava -p /dev/stdin | ||
| command: ["sh", "-c", `cat <<'CAVACONF' > /tmp/dms-cava.conf |
Comment on lines
+55
to
+56
| CAVACONF | ||
| exec cava -p /tmp/dms-cava.conf < /dev/null`] |
|
|
||
| running: root.cavaAvailable && root.refCount > 0 | ||
| command: ["sh", "-c", `cat <<'CAVACONF' | cava -p /dev/stdin | ||
| command: ["sh", "-c", `cat <<'CAVACONF' > /tmp/dms-cava.conf |
Comment on lines
+55
to
+56
| CAVACONF | ||
| exec cava -p /tmp/dms-cava.conf < /dev/null`] |
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.
Fix
CavaService100% CPU EOF spin loopDescription
This pull request resolves a critical performance issue in
CavaService.qmlwhere the visualizer process would hit anEOFonstdinand spin infinitely at 100% CPU usage.When
Quickshell.Io.Processexecutes the commandcat <<'CAVACONF' | cava -p /dev/stdin,catfinishes writing the config quickly and exits, causing a broken pipe/EOF oncava's standard input.cavaspins in a tight loop attempting to read from the closed stream, consuming 100% CPU and flooding the shell with thousands of zeroed visualizer frames per second. This in turn drives the compositor and Qt quickshell usage to ~80% CPU and heavily overheats integrated GPUs.Changes
CavaService.qmlto write the configuration to a temporary file (/tmp/dms-cava.conf) instead of relying on astdinpipe.cavais now invoked withexec cava -p /tmp/dms-cava.conf < /dev/null, completely decoupling itsstdinfrom the configuration stream and eliminating the EOF spin loop bug.Testing
cavanow correctly idles around ~8% CPU instead of locking a core at 100%.cavacontinues to produce audio visualization frames properly using the temporary configuration file.