LizardByte / LizardByte/Sunshine

Changes to rc_buffer_size for hardware cbr encoding causes increased latency on client

Open
#881 2 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
41.4k
Forks
2.1k
Avg merge
23h 47m
Merged PRs (30d)
124

Description

Is there an existing issue for this?
  • I have searched the existing issues
Is your issue described in the documentation?
  • I have read the documentation
Is your issue present in the nightly release?
  • This issue is present in the nightly release
Describe the Bug

Since c72aeef67bbcc31406525eda46e6586f8cb769d7 introduced a change to rc_buffer_size, I get increased decoding latency on a client running Windows 10 and an Intel Celeron 2957U. Prior to this commit, I was getting <1ms decoding latency, same as with regular Gamestream. After this change, latency spikes to 35+ms, with frequent freezes. Happens on bitrates exactly 100mbps or above (99.5mbps works with no issues).
Streaming at 1080p@60 h264 with NVENC.

Changing the line back to ctx->rc_buffer_size = bitrate / ((config.framerate * 10) / 15); in the latest nightly fixes the issue.

Probably related to issue #478, though this seems to be the opposite.

Expected Behavior

Same decoding latency as with Gamestream (<1ms) for high bitrates (above 100mbps).

Additional Context

Updated Windows 10 client PC, using latest Moonlight, 150mbps bitrate at 1080p@60.
Intel Celeron 2957U.

Host Operating System

Windows

Operating System Version

Windows 11

Architecture

64 bit

Sunshine commit or version

0.17.0

Package

Windows - portable

GPU Type

Nvidia

GPU Model

RTX 3080

GPU Driver/Mesa Version

528.24

Capture Method (Linux Only)

No response

Relevant log output

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.