Sunshine icon indicating copy to clipboard operation
Sunshine copied to clipboard

Second client inherits 120 FPS stream from first client, causing lag on older device

Open XPRAMT opened this issue 8 months ago • 4 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Is your issue described in the documentation?

  • [x] I have read the documentation

Is your issue present in the latest beta/pre-release?

This issue is present in the latest pre-release

Describe the Bug

When two clients are connected to the host, the first client (a modern phone) requests a 120 FPS stream. After the second client (an older phone) connects and requests 60 FPS, it still receives a 120 FPS stream. Since the second device cannot properly decode 120 FPS, it results in video lag and performance issues.

Expected Behavior

Each client should receive a stream that matches its requested frame rate. The second client should receive a 60 FPS stream instead of inheriting the 120 FPS setting from the first client.

Additional Context

No response

Host Operating System

Windows

Operating System Version

windows11 24H2 26120.3950

Architecture

amd64/x86_64

Sunshine commit or version

v2025.509.184504

Package

Windows - installer (recommended)

GPU Type

NVIDIA

GPU Model

5070ti

GPU Driver/Mesa Version

576.28

Capture Method

None

Config


Apps


Relevant log output

[2025-05-10 10:28:48.166]: Info: CLIENT DISCONNECTED
[2025-05-10 10:28:48.202]: Info: Starting async encoder teardown
[2025-05-10 10:28:48.232]: Info: Async encoder teardown complete
[2025-05-10 10:28:55.492]: Info: New streaming session started [active sessions: 1]
[2025-05-10 10:28:55.683]: Info: nvprefs: No need to modify application profile settings
[2025-05-10 10:28:55.683]: Info: nvprefs: No need to modify global profile settings
[2025-05-10 10:28:55.718]: Info: CLIENT CONNECTED
[2025-05-10 10:28:56.003]: Info: Audio mixer format is 32-bit, 96000 Hz, will be resampled to 48000 by Windows
[2025-05-10 10:28:56.008]: Info: Audio capture format is [F32 48000 2.0]
[2025-05-10 10:28:56.009]: Info: Opus initialized: 48 kHz, 2 channels, 512 kbps (total), LOWDELAY
[2025-05-10 10:28:56.139]: Info: 
Device Description : NVIDIA GeForce RTX 5070 Ti
Device Vendor ID   : 0x000010DE
Device Device ID   : 0x00002C05
Device Video Mem   : 15907 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 16338 MiB
Feature Level      : 0x0000B100
Capture size       : 3840x2160
Offset             : 0x0
Virtual Desktop    : 3840x2160
[2025-05-10 10:28:56.139]: Info: Active GPU has HAGS enabled
[2025-05-10 10:28:56.139]: Info: Using realtime GPU priority
[2025-05-10 10:28:56.140]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.676758,0.322266]
Green Primary      : [0.275391,0.629883]
Blue Primary       : [0.154297,0.0595703]
White Point        : [0.313477,0.329102]
Min Luminance      : 0.0199 nits
Max Luminance      : 400 nits
Max Full Luminance : 400 nits
[2025-05-10 10:28:56.140]: Info: Desktop resolution [3840x2160]
[2025-05-10 10:28:56.140]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2025-05-10 10:28:56.140]: Info: Display refresh rate [120Hz]
[2025-05-10 10:28:56.140]: Info: Requested frame rate [120fps]
[2025-05-10 10:28:56.140]: Info: Creating encoder [hevc_nvenc]
[2025-05-10 10:28:56.141]: Info: Color coding: SDR (Rec. 709)
[2025-05-10 10:28:56.141]: Info: Color depth: 10-bit
[2025-05-10 10:28:56.141]: Info: Color range: MPEG
[2025-05-10 10:28:56.151]: Info: Capture format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2025-05-10 10:28:56.220]: Info: NvEnc: created encoder HEVC P4 async 10-bit two-pass rfi

[2025-05-10 10:29:40.601]: Info: New streaming session started [active sessions: 2]
[2025-05-10 10:29:40.609]: Info: CLIENT CONNECTED
[2025-05-10 10:29:40.690]: Info: Creating encoder [hevc_nvenc]
[2025-05-10 10:29:40.690]: Info: Color coding: SDR (Rec. 709)
[2025-05-10 10:29:40.690]: Info: Color depth: 10-bit
[2025-05-10 10:29:40.690]: Info: Color range: MPEG
[2025-05-10 10:29:40.766]: Info: NvEnc: created encoder HEVC P4 async 10-bit two-pass rfi
[2025-05-10 10:29:41.095]: Info: Audio mixer format is 32-bit, 96000 Hz, will be resampled to 48000 by Windows
[2025-05-10 10:29:41.098]: Info: Audio capture format is [F32 48000 2.0]
[2025-05-10 10:29:41.099]: Info: Opus initialized: 48 kHz, 2 channels, 96 kbps (total), LOWDELAY

XPRAMT avatar May 10 '25 02:05 XPRAMT

@pedrocarlo This issue does not describe a problem. Is this a correctness thing or a code cleanup thing?

penberg avatar Oct 01 '25 12:10 penberg

At the time I believe, it was a correctness thing because we did casted booleans differently in the different parts of the codebase. But after the we introduced the numeric module, now everything should be converting correctly. So I will close this issue!

pedrocarlo avatar Oct 01 '25 14:10 pedrocarlo