Skip to content

options: add --status-msg-update-rate/--status-msg-update-rate-forced - #18446

Open
MoSal wants to merge 1 commit into
mpv-player:masterfrom
MoSal:msg_status_update_rate
Open

options: add --status-msg-update-rate/--status-msg-update-rate-forced#18446
MoSal wants to merge 1 commit into
mpv-player:masterfrom
MoSal:msg_status_update_rate

Conversation

@MoSal

@MoSal MoSal commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

On high fps and/or high speed playback scenarios, status message
updates from both osd and term can incur a GPU load that is not
insignificant, as updates are forced on each frame update.

This commit introduces two options that control the update rate.

--status-msg-update-rate defaults to 20, which matches the 0.05 delay
that already existed when there were no forced updates.

--status-msg-update-rate-forced is set to no by default, also to
retain old behavior by default. But setting this option to yes turns
the update rate to a hard limit, unless frame updates happen while
paused (e.g. when frame stepping), as getting immediate updated info
in that case is the expected behavior.

@MoSal

MoSal commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Partially inspired by seeing this yesterday.

@llyyr

llyyr commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

can incur a GPU load that is not insignificant, as updates are forced on each frame update.

This is not a problem on any compositor or platform worth using. I don't think mpv needs to have this code

@MoSal

MoSal commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

This is not a problem on any compositor or platform worth using.

Do you have a list?

jay GPU load drops 50% with my POLARIS GPU too with --status-msg-update-rate 10 --status-msg-update-rate-forced yes, with the same use-case of mate-terminal tiled with mpv floating over it.

@llyyr

llyyr commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

The terminal already shouldn't be updating if the contents haven't changed, see term_osd_update. If somehow this check is insufficient I'd rather fix this instead of ratelimiting legitimate updates.

jay GPU load drops 50% with my POLARIS GPU too

50% of what original value? On anything that supports damage tracking it shouldn't even a measurable increase in GPU use unless there's literally nothing else that would drive that output to update otherwise I guess

@MoSal

MoSal commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

The terminal already shouldn't be updating if the contents haven't changed

The content does change.

It's this term-status-msg (which is similar to mine). Playing 50fps video at 1.2 speed. GPU load on the jay process (using GL renderer since this is POLARIS) drops from 20% to 10%.

alacritty and wezterm are alot more efficient though (single digit % load, 1-2% performance delta).

@llyyr

llyyr commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

I'd call that self inflicted pain then, although there may be some mpv bugs to fix here too.

avsync property is never stable, so it may need to be throttled in some way to make it more friendly for printing. Simply removing this property from the status line makes it update about half as often as otherwise.

*-bitrate properties claim "To make the property more UI friendly, updates to these properties are throttled in a certain way." but I don't see this implemented anywhere actually. video-bitrate is throttled by the fact that it's only updated on keyframes, but audio-bitrate doesn't have any throttling elements. (edit: it's throttled to 500 ms in demux.c)

After removing avsync and audio-bitrate from your status line, it already updates no faster than once per second (for time-pos).

@MoSal

MoSal commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

After removing avsync and audio-bitrate from your status line, it already updates no faster than once per second (for time-pos).

And this will all fall on showing sub-sec fractions.

@llyyr

llyyr commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

And this will all fall on showing sub-sec fractions.

Why do you change your status line to show sub second fractions if your goal is minimizing repaint? Explain what the user could be thinking for these two actions to be congruent.

@MoSal

MoSal commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Why do you change your status line to show sub second fractions if your goal is minimizing repaint? Explain what the user could be thinking for these two actions to be congruent.

The point was there are many ways to make the status messages update per frame, which can be a performance foot gun.

Going through properties one by one instead of using a simple global configurable higher level solution seems weird.

 On high fps and/or high speed playback scenarios, status message
 updates from both osd and term can incur a GPU load that is not
 insignificant, as updates are forced on each frame update.

 This commit introduces two options that control the update rate.

 `--status-msg-update-rate` defaults to 20, which matches the 0.05 delay
 that already existed when there were no forced updates.

 `--status-msg-update-rate-forced` is set to `no` by default, also to
 retain old behavior by default. But setting this option to `yes` turns
 the update rate to a hard limit, unless frame updates happen while
 paused (e.g. when frame stepping), as getting immediate updated info
 in that case is the expected behavior.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
@MoSal
MoSal force-pushed the msg_status_update_rate branch from 75e5116 to 690d342 Compare September 5, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants