Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
Adds conditional audio normalization for screen recordings while preserving PipeWire pop suppression.
Changes:
- Measures loudness and prompts only outside the -18 to -11 LUFS range.
- Adds CLI/environment overrides and persists start-time preferences.
- Expands tests and user documentation.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
bin/omarchy-capture-screenrecording |
Implements measurement, prompting, overrides, and optional normalization. |
test/shell.d/screenrecording-test.sh |
Tests thresholds, preferences, filtering, and prompt outcomes. |
manual/12-screenshots-recording.md |
Documents conditional normalization behavior. |
manual/14-omarchy-cli.md |
Lists the new CLI flags. |
default/agents/skills/omarchy/capture.md |
Updates agent-facing capture guidance. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Moving the output-directory check inside start_screenrecording let `start_screenrecording || cleanup_webcam` swallow its non-zero return: cleanup_webcam ends in a successful `rm -f`, so a missing directory notified the user and then exited 0. It exited 1 before this branch. Guard the start branch of the dispatcher instead. That restores the failing status without putting the check back in front of stopping, which still has to finalize a recording whose directory went away. Co-Authored-By: Codex XHigh <[email protected]> Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01UgPCZR2xnMwJELod9nfou2
|
Reviewed this by hand, with an independent second opinion from Codex XHigh. It found four defects; I verified each against the source and accepted two, rejected one, and treated one as yours to decide. Don't merge yet — one confirmed regression is now fixed on the branch, but the stop path can still be left stranded by the new prompt, and that one is a design call rather than a patch. Pushed to the branch: a missing recording directory reported success. Moving the Still open, and the reason not to merge: the prompt can strand finalization. Related, and the reason this is worth solving rather than papering over: On the complexity note: the part that does not earn its keep is the start-time flag tier. Codex also flagged that I rejected its finding about Coverage. The helper tests are good and not vacuous — I mutated the threshold comparison, the What I checked and found correct. The two-pass loudnorm genuinely works: real ffmpeg 9.0.1 measured Two things worth measuring on real hardware before this ships, neither of which I can do from here. The extra analysis pass costs about 4.4s per 10 minutes of recording (timed on ffmpeg 9.0.1), so a 30-minute capture sits for roughly 13 seconds after stop with the bar indicator already gone and nothing on screen, then the dialog appears. And a sink monitor is captured post-volume, so desktop audio recorded at anything much below full volume lands under −18 LUFS — if that's right, the prompt fires on most recordings rather than the unusual ones, which is the opposite of the intent. One real recording each way would settle both. Waiting on @ogarza for the stranding question and the flag-tier trim, and on @dhh for whether a blocking prompt belongs in the stop path at all. |
…LE once and passes it through, another menu unblocks stop as keep original
|
Kept the prompt in stop, moving it out still leaves a waiter, and you'd pay for a second encode if they say yes after the file is already “saved.” The actual hang was openExistingMenu / openDmenu wiping doneFile without finishRequest. Image picker already does this in openSelector (finishDoneFile before the new request). Menu now finishes first, so Super+Space (or any other menu) unblocks stop as keep-original. Esc was already fine. Also stopped re-reading RECORDING_FILE after finalize. It's captured once at the start of stop and used all the way through preview/cleanup, so a late answer can't toast or delete some other recording. If nobody answers, we wait 120s then keep original levels. Killing the waiter left the dialog sitting there after the saved toast (hit that on a real stop), so timeout now also omarchy-menu close. Didn't put a timeout on omarchy-menu-select itself. Dropped --normalize-audio / --no-normalize-audio altogether, not just the start sidecar. Nothing in the UI passed them, and OMARCHY_SCREENRECORD_NORMALIZE already covers skip-the-prompt. That also kills the env-vs-start-flag question. I tried to get too clever here, oops. The Menu.qml fix is worth keeping even if we yank the prompt from stop later, transcode/timezone/webcam-pick all hung the same way on replace. As for measuring on real hardware, I tested:
As for the delay between stop and the normalize prompt: I tried a 30-minute recording here and it was a bad experience. The bar indicator was already gone, so I thought I wasn’t recording anymore and started another capture before the prompt even showed up. I’d keep the current path for short files (say 10 minutes or less): analyze, and only ask if the levels actually look off. On longer files, ask right away with no analysis first. If they say yes, do a single loudnorm pass in the remux — same as we already do when normalize is always on. Short clips stay out of the way; after a long demo or cast, one extra click is fine, and you don’t sit there staring at a dead screen. Thoughts on this @dhh ? |
…top is still saving
|
If you stop a recording and start another one before the save is fully done, like during that quiet pause after a long capture, we were wiping the new recording’s saved path. Next time you hit stop, we wouldn’t know which file to finish. Now we only clear that path if it still belongs to the recording we just stopped. A new one that already started is left alone. Also took --normalize-audio / --no-normalize-audio out of the PR description. Those flags aren’t a thing anymore; OMARCHY_SCREENRECORD_NORMALIZE is how you skip the prompt. Still open: what to do about long recordings sitting there for a bit after you stop, before the normalize question shows up. |
|
Over 10 minutes we skip the analysis and ask immediately: normalize to typical broadcast levels (Recommended), or keep original. Yes is a single loudnorm pass, same as always-on. Short files still measure first and only ask if the levels actually look off. Unreadable duration falls through to analysis too. |
|
Confirmed this fixes a real case on Omarchy 4.0.2-1 with gpu-screen-recorder 6.0.1-1 and the internal Realtek ALC3246 microphone. After correcting excessive hardware gain, a direct PipeWire capture had a background noise floor around -54 dB. The standard screen-recording flow then applied loudnorm; a quiet section of the resulting recording measured around -15 dB, making the ambient noise clearly audible as static. Keeping the startup-pop mute/fade but removing loudnorm resolved the issue: voice is clear and background static is gone. Asking before normalizing unusually quiet/loud recordings would have prevented this. |
Summary
Discussion: #9020
Screen recordings no longer always run
loudnormon stop. That was crushing quiet sounds and dynamic range.After stop, short recordings are measured. If the audio is unusually quiet (more than 4 LU below -14 LUFS) or unusually loud (more than 3 LU above), a menu asks whether to normalize to typical broadcast levels or keep the recording as-is. Esc keeps the original. Audio already in that window is left alone.
Recordings longer than 10 minutes skip that analysis and ask immediately — measuring a long soundtrack left a dead screen after the bar indicator was already gone. The prompt is “Normalize audio to typical broadcast levels?” with Normalize (Recommended) first. Saying yes does a single
loudnormpass in the remux, same asOMARCHY_SCREENRECORD_NORMALIZE=true. Short clips that accept still get the two-pass path with the first-pass stats.The PipeWire capture-pop mute still always runs.
OMARCHY_SCREENRECORD_NORMALIZE=truealways normalizes;falsenever asks.Test plan
OMARCHY_SCREENRECORD_NORMALIZE=falsenever asksbash test/shell.d/screenrecording-test.sh