Tuning RenderStream Active Latency
このコンテンツはまだ日本語訳がありません。
This guide walks through tuning active latency on a RenderStream workload when the active latency oscillates instead of settling to a steady value. It covers three option switches: renderstreamActiveLatencyPercentile, renderstreamActiveLatencyOffset, and renderstreamBufferSize.
The initial state we want to resolve is shown below — active latency is fluctuating over time rather than holding flat:
Active latency oscillating before tuning.
Stabilise active latency
Section titled “Stabilise active latency”Procedure
Section titled “Procedure”Run the RenderStream workload and observe the active latency graph:
- If active latency is oscillating up and down, reduce the active latency percentile threshold to 75% or 50%.
- The threshold can be adjusted in the Advanced project settings via the
renderstreamActiveLatencyPercentileoption switch (see note below for value range). - Values of 750 (75%) and 500 (50%) are recommended as starting points. One of these two values should get us into a pretty stable spot.
Result
Section titled “Result”Active latency is a flat line for the duration of the RenderStream workload.
Active latency as a flat line after adjusting the percentile threshold.
Compensate for latency spikes
Section titled “Compensate for latency spikes”Procedure
Section titled “Procedure”Once active latency is flat, we need to be able to cope with latency spikes above the active latency:
- Visually measure the amplitude of latency spikes above the active latency line.
- Divide the amount by which the spikes exceed active latency by the length of a frame in milliseconds; this gives us the number of frames of difference we need to offset by.
- Set the
renderstreamActiveLatencyOffsetoption switch to the calculated number of frames.
Result
Section titled “Result”Active latency is a flat line located just above the highest latency spikes of the RenderStream workload.
Adjust frame buffer size
Section titled “Adjust frame buffer size”Procedure
Section titled “Procedure”Default RenderStream buffer size is 4. If the offset calculated in previous step is too big, it may exceed the capabilities of the RenderStream frame buffer and result in dropped frames anyway.
- At this stage, frame irregularities can be observed as spikes in the render skew graph.
- If
renderstreamActiveLatencyOffsetwas set to a value greater than 2 in the previous step, increase the RenderStream buffer to be larger than the active latency offset. - Set the
renderstreamBufferSizetorenderstreamActiveLatencyOffset+ 2
Result
Section titled “Result”Flat active latency graph and flat render skew graph.
Flat active latency and render skew graphs after applying the offset and buffer size.