Repository navigation
Conversation
Recording or playing software instruments wants a small audio buffer, and PipeWire's default quantum is sized for power, not latency. omarchy toggle low-latency-audio forces a 256-sample quantum (about 5 ms at 48 kHz) and clears it again, the equivalent of the buffer size in macOS's Audio MIDI Setup. It is a runtime setting, so nothing restarts and playback carries on, and the next session starts back on the default. When rtkit is missing, PipeWire cannot take realtime priority and a buffer this small can crackle, so the notification says so. The Toggle menu shows it with its state checked, and the toggles manual page documents it. Refs omacom#13832 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Medium impact] The PR appears safe to merge; no new actionable issues remain. SummaryAdds a runtime low-latency audio switch that sets PipeWire's buffer to 256 samples and clears the override when disabled.
Reviews (6) · Last reviewed commit: "Merge current quattro into low-latency a..." · Reviewed by Greptile |
…me priority directly Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| if PIPEWIRE_DOWN=1 toggle on 2>/dev/null; then | ||
| fail "a failed PipeWire write is reported as a failure" | ||
| fi | ||
| [[ ! -s $tmp/notifications ]] || fail "a failed PipeWire write sends no notification" "$(cat "$tmp/notifications")" |
There was a problem hiding this comment.
PIPEWIRE_DOWN=1 makes the stub fail the initial read, so this case never reaches a write. It would still pass if set_quantum stopped checking write failures, leaving that behavior unprotected.
Add a separate write-only failure flag. Let the initial read succeed, then check that the command fails without changing the setting or sending a notification.
There was a problem hiding this comment.
Greptile was right: PIPEWIRE_DOWN=1 failed the initial read, so the alleged write-failure case never reached set_quantum. Commit 2ff70c64 adds a separate write-only failure flag, lets the read succeed, and verifies that on exits non-zero without changing the quantum or sending a notification. The focused test passes, along with Bash syntax, shellcheck, and git diff --check; a fresh Codex review found no issue.
|
Closing this to keep my open PRs to a handful. Thanks for looking, and I'm happy to reopen it if it's still useful. |
This adds a session-scoped low-latency audio switch for recording and software instruments.
PipeWire normally chooses a power-friendly graph quantum. On my stock setup I measured 1024–2048 samples, or about 21–43 ms at 48 kHz. The new
omarchy toggle low-latency-audio [toggle|on|off|--status]command usespw-metadatato force 256 samples, about 5 ms, and clears the override back to0when switched off. It does not restart audio, and PipeWire returns to its automatic choice at the next session.The command refuses to replace a different forced quantum unless
onis requested explicitly. It also fails without notifying when the current setting cannot be read or a write is rejected. When enabling the switch, it checks this user's PipeWire data loop for realtime scheduling and warns if the small buffer is likely to crackle under load.The Toggle menu presents separate on/off actions that follow the current setting. The English menu and notification catalogs cover the new strings, and the manual documents the runtime scope and realtime requirement.
Regression proof:
test/shell.d/low-latency-audio-test.sh: 9 focused assertions pass, covering state changes, expliciton/off, read and write failures, foreign forced values, argument validation, realtime detection, and current menu wiring.I18N_STRUCTURAL=1 test/shell.d/i18n-test.sh: 401 passed, 0 failed.test/shell.d/menu-test.sh: 200 passed, 0 failed.git diff --checkpass.I previously verified the command against live PipeWire 1.6.8 with a stream playing: the graph moved from 2048 to 256 samples and returned to 2048 when disabled. I did not repeat that live check after merging current
quattro; the PipeWire code path did not change.