コンテンツにスキップ

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 graph oscillating before any tuning has been applied Active latency oscillating before tuning.

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 renderstreamActiveLatencyPercentile option 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.

Active latency is a flat line for the duration of the RenderStream workload. Active latency graph showing a flat line after adjusting the percentile threshold Active latency as a flat line after adjusting the percentile threshold.

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 renderstreamActiveLatencyOffset option switch to the calculated number of frames.

Active latency is a flat line located just above the highest latency spikes of the RenderStream workload.

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 renderstreamActiveLatencyOffset was 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 renderstreamBufferSize to renderstreamActiveLatencyOffset + 2

Flat active latency graph and flat render skew graph.

Flat active latency and flat render skew graphs after applying the offset and buffer size Flat active latency and render skew graphs after applying the offset and buffer size.