You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
frontend: VolumeMeter 60 Hz repaint timer never pauses (hidden, minimized or silent) #1281
frontend/components/VolumeMeter.cpp.hpp:323-336: one shared Qt::PreciseTimer at 16 ms (~60 Hz) repaints every volume meter (update(getBarRect())) on the UI thread. It never stops or pauses: it keeps running while the mixer is hidden, OBS is minimized, or every source is silent. This is the largest steady UI-thread cost found.
(Related, smaller: frontend/components/MediaControls.cpp.hpp:179 runs a 16 ms slider timer, but only while media is playing, which is fine.)
Fix: stop the timer when no meter is visible (hidden dock, minimized window), and skip repaints for meters whose level and peak hold haven't changed; restart on the next level change.
Test: with the meters hidden, or all sources silent, the timer is inactive and there are no meter repaints over a few seconds.
RED: a C++ test on Qt's offscreen platform (like test_replay_buffer_estimate) for two pieces the widget will use: volumeMeterSettled() (pure: another repaint would draw the same meter, that is the display has caught up with the input and no peak hold is pending) and VolumeMeterTicker (the shared 16 ms timer: repaints only meters that are visible and not settled, stops when there are none, wake() restarts it, also from another thread). Tests: hidden meters and silent meters stop the timer with no repaints over a few seconds; a wake from another thread restarts it and repaints; a visible meter that still decays keeps it running.
GREEN: the two pieces, and VolumeMeter uses them: it wakes the ticker when a level changes (a silent source sends -inf again, which is not a change) and on showEvent (dock shown, window restored); the timer callback skips meters that are hidden, in a minimized window, or settled.
Decisions:
Settled includes the holds: the peak hold falls back after 20 s and the input peak hold after 1 s, and both are visible changes, so a meter keeps repainting until they have fallen back. After a sound stops, the timer stops about 20 s later, not at once.
Minimized:window()->isMinimized() counts as not visible; restoring the window sends a show event, which wakes the ticker.
Measurement: before/after on a headless Linux box (Debian 13 LXC, X display without a monitor), with the UI thread's wake-ups and CPU time while all sources are silent.
Claiming. Plan: stop the shared 16 ms meter timer when no meter is visible (hidden dock, minimized window) and while every meter is idle (level and peak hold unchanged / decayed to the floor), restarting on the next level update or show. Test in the Qt lane: with meters hidden or silent the timer is inactive and no meter repaints happen over a few seconds; with audio it runs at the same rate as today.
Claim bot:@zackees, this is already claimed by vpacher. Pick something else or offer help here; once the claim goes stale, comment Taking over stale claim from @vpacher.
Withdrawing my claim above: @vpacher already has this in PR #1307 (same design: repaint only visible, unsettled meters; the timer stops when none needs it; an audio-thread-safe wake). I missed it when I claimed. Sorry for the noise. I'll review #1307 instead.
Activity
vpacher commentedon Oct 17, 2026
Claiming: #1281
Plan (one PR):
test_replay_buffer_estimate) for two pieces the widget will use:volumeMeterSettled()(pure: another repaint would draw the same meter, that is the display has caught up with the input and no peak hold is pending) andVolumeMeterTicker(the shared 16 ms timer: repaints only meters that are visible and not settled, stops when there are none,wake()restarts it, also from another thread). Tests: hidden meters and silent meters stop the timer with no repaints over a few seconds; a wake from another thread restarts it and repaints; a visible meter that still decays keeps it running.VolumeMeteruses them: it wakes the ticker when a level changes (a silent source sends-infagain, which is not a change) and onshowEvent(dock shown, window restored); the timer callback skips meters that are hidden, in a minimized window, or settled.Decisions:
window()->isMinimized()counts as not visible; restoring the window sends a show event, which wakes the ticker.First PR today.
frontend: Volume meters repaint only when something changed (RED, Refs …
frontend: Volume meters repaint only when something changed (RED, Refs …
frontend: Volume meters repaint only when something changed (RED, Refs …
frontend: Volume meters repaint only when something changed (GREEN, F…
docs: Ledger line for the volume meter repaints (Refs obs-rust#1281)
zackees commentedon Oct 17, 2026
Claiming. Plan: stop the shared 16 ms meter timer when no meter is visible (hidden dock, minimized window) and while every meter is idle (level and peak hold unchanged / decayed to the floor), restarting on the next level update or show. Test in the Qt lane: with meters hidden or silent the timer is inactive and no meter repaints happen over a few seconds; with audio it runs at the same rate as today.
github-actions commentedon Oct 17, 2026
Claim bot: @zackees, this is already claimed by
vpacher. Pick something else or offer help here; once the claim goes stale, commentTaking over stale claim from @vpacher.zackees commentedon Oct 17, 2026
Withdrawing my claim above: @vpacher already has this in PR #1307 (same design: repaint only visible, unsettled meters; the timer stops when none needs it; an audio-thread-safe wake). I missed it when I claimed. Sorry for the noise. I'll review #1307 instead.
test: Include the volume meter ticker before cmocka.h (Refs obs-rust#…
frontend: Volume meters repaint only when something changed (obs-rust…