Sunshine icon indicating copy to clipboard operation
Sunshine copied to clipboard

Unable to capture FPS faster than refresh rate

Open trudnorx opened this issue 11 months ago • 6 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 nightly release?

  • [X] This issue is present in the nightly release

Describe the Bug

Say a game is consistently running at X fps (higher than Y and Z), Sunshine is asked to deliver Y fps, which is higher than monitor refresh rate of Z Hz. Sunshine proved unable to deliver any frame rate higher than Z. Only while moving the cursor did Moonlight report a FPS of Y being delivered, but this was of little value to the user because the game kept being actually delivered at Z FPS (perhaps only the cursor was updating faster?). A test on the same machine with OBS being asked to capture Y FPS proved that OBS game capture was able to successfully record the game at an actual rate of Y FPS.

Expected Behavior

No response

Additional Context

No response

Host Operating System

Windows

Operating System Version

Architecture

32 bit

Sunshine commit or version

0.21.0

Package

Windows - installer

GPU Type

Nvidia

GPU Model

GPU Driver/Mesa Version

Capture Method (Linux Only)

No response

Config

-

Apps

No response

Relevant log output

-

trudnorx avatar Feb 29 '24 22:02 trudnorx

Your cursor is drawn by GPU. The main frame is copied from (dwm?). OBS is probably using a different API, can it record UAC prompt?

Originalimoc avatar Mar 03 '24 09:03 Originalimoc

OBS has a different method of capture, akin to Steam remote play, they can capture the DX/GL render target window instead of the whole framebuffer, this has several advantages like not being bound to the monitor refresh rate/aspect ratio and perfectly reproduce adaptive sync on the client using variable frame rate.

This could be a nice feature added to Sunshine but not an easy one to implement for sure.

Slashic avatar Mar 20 '24 14:03 Slashic

Sunshine will capture the frame rate of the game, the refresh rate of the host does not matter at all. You most likely have vsync enabled, which causes the game to render at a lower frame rate. Or the game itself is rendering at a lower frame rate, due to the way how Sunshine captures the game there is no way for us to fix this.

Other products that captured at a constant frame rate had microstuttering problems due to uneven frames.

Nonary avatar Mar 23 '24 14:03 Nonary

FWIW, once https://github.com/LizardByte/Sunshine/pull/2149 is completed there is an option for constant capturing rate which would "fix" this issue, but you'll notice microstuttering problems due to uneven frame pacing like i mentioned before, so I am skeptical this is even possible to resolve.

Nonary avatar Mar 23 '24 14:03 Nonary

You most likely have vsync enabled, which causes the game to render at a lower frame rate.

Pls read what I stated carefully. The game is successfully rendering at a higher FPS than the monitor's refresh rate, but Sunshine fails to capture anything higher than the refresh rate. Unlike OBS.

trudnorx avatar Apr 16 '24 18:04 trudnorx

It seems this issue hasn't had any activity in the past 90 days. If it's still something you'd like addressed, please let us know by leaving a comment. Otherwise, to help keep our backlog tidy, we'll be closing this issue in 10 days. Thanks!

LizardByte-bot avatar Jul 16 '24 10:07 LizardByte-bot

This issue was closed because it has been stalled for 10 days with no activity.

LizardByte-bot avatar Jul 26 '24 10:07 LizardByte-bot