Skip to content

device_handbrake: Warn when simulation lags behind real time#11

Open
LingaoM wants to merge 1 commit intoBabbleSim:masterfrom
LingaoM:add_warn_for_handbrake
Open

device_handbrake: Warn when simulation lags behind real time#11
LingaoM wants to merge 1 commit intoBabbleSim:masterfrom
LingaoM:add_warn_for_handbrake

Conversation

@LingaoM
Copy link
Copy Markdown

@LingaoM LingaoM commented Apr 25, 2026

When the host is too slow to keep up with the requested ratio, the
handbrake silently skips stalling. Add a trace message at level 4 to
indicate how far behind real time the simulation is lagging.
Document this behavior in the README.

Use trace level 4 instead of bs_trace_warning_line because lagging
behind real time is expected under high load and not an error condition.
Using warning level would flood the output in normal use cases.

Level 4 is used (rather than 6, which is used for normal stall messages)
to make the lag more visible since it indicates the handbrake is not
achieving the requested ratio.

@LingaoM LingaoM force-pushed the add_warn_for_handbrake branch from 3bfda7e to f7d1c1e Compare April 25, 2026 06:13
Copy link
Copy Markdown
Contributor

@aescolar aescolar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be so kind as to sign-off the commit?
https://babblesim.github.io/contribution_guidelines.html

}
bs_trace_raw(6,"@%"PRItime" Stalled until real time = %"PRIuMAX"\n", wait_s.end, (uintmax_t)Expected_time);
} else {
bs_trace_raw(4,"@%"PRItime" Handbrake lagging behind real time by %"PRIi64" us\n", wait_s.end, -diff);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bs_trace_raw(4,"@%"PRItime" Handbrake lagging behind real time by %"PRIi64" us\n", wait_s.end, -diff);
bs_trace_raw(4,"@%"PRItime" Simulation lagging behind real time by %"PRIi64" us\n", wait_s.end, -diff);

When the host is too slow to keep up with the requested ratio, the
handbrake silently skips stalling. Add a trace message at level 4 to
indicate how far behind real time the simulation is lagging.
Document this behavior in the README.

Use trace level 4 instead of bs_trace_warning_line because lagging
behind real time is expected under high load and not an error condition.
Using warning level would flood the output in normal use cases.

Level 4 is used (rather than 6, which is used for normal stall messages)
to make the lag more visible since it indicates the handbrake is not
achieving the requested ratio.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
@LingaoM LingaoM force-pushed the add_warn_for_handbrake branch from f7d1c1e to ee8841e Compare April 27, 2026 03:26
@LingaoM LingaoM requested a review from aescolar April 27, 2026 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants