Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(config): increase range for min_fps_factor #3715

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

momala454
Copy link

@momala454 momala454 commented Mar 8, 2025

Description

Allow for more than 3 for min_fps_factor

Screenshot

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

@momala454 momala454 changed the title Allow for more min_fps_factor fix(video): Allow for more min_fps_factor Mar 8, 2025
Copy link
Member

@ReenigneArcher ReenigneArcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A. 50 is far too high. I think a max of 25 or 30 might be okay.
B. There are other places this value needs to be updated. (probably docs and the web ui)

@momala454
Copy link
Author

not sure for the docs, the file docs/source/about/advanced_usage.rst does not exist anymore

@ReenigneArcher
Copy link
Member

@momala454 momala454 requested a review from ReenigneArcher March 8, 2025 14:56
Copy link

sonarqubecloud bot commented Mar 8, 2025

@ReenigneArcher ReenigneArcher changed the title fix(video): Allow for more min_fps_factor fix(config): increase range for min_fps_factor Mar 8, 2025
Copy link

codecov bot commented Mar 8, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 11.61%. Comparing base (bd359b2) to head (d496c6c).

Files with missing lines Patch % Lines
src/config.cpp 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3715   +/-   ##
=======================================
  Coverage   11.61%   11.61%           
=======================================
  Files          92       92           
  Lines       17337    17337           
  Branches     8100     8100           
=======================================
  Hits         2013     2013           
  Misses      12833    12833           
  Partials     2491     2491           
Flag Coverage Δ
Linux 11.28% <0.00%> (ø)
Windows 13.01% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/config.cpp 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ReenigneArcher ReenigneArcher mentioned this pull request Mar 8, 2025
2 tasks
@momala454
Copy link
Author

momala454 commented Mar 8, 2025

windows artifacts are not generated
nevermind it's here https://github.com/LizardByte/Sunshine/actions/runs/13738725260/artifacts/2715990901

@ReenigneArcher
Copy link
Member

Not much feedback on this PR from the linked issue. Only feedback reported that going above 10 had no effect.

@momala454
Copy link
Author

yes that was me :)

@ReenigneArcher
Copy link
Member

Oh, I didn't look at the usernames, lol. I will test it out on different capture methods and see for myself.

@ReenigneArcher
Copy link
Member

I noticed the same, more than 10 fps had no effect. Should probably make the max 10 in that case?

@andygrundman
Copy link
Contributor

This setting is very confusing in particular, and you need to read the code to understand it.

// set minimum frame time, avoiding violation of client-requested target framerate
    auto minimum_frame_time = std::chrono::milliseconds(1000 / std::min(config.framerate, (config::video.min_fps_factor * 10)));
    BOOST_LOG(debug) << "Minimum frame time set to "sv << minimum_frame_time.count() << "ms, based on min fps factor of "sv << config::video.min_fps_factor << "."sv;

The current range allows you to have a min of 10, 20, or 30fps, and if it drops under this limit frames will start to be copied. Just a quick look at this code tells you that anything higher than framerate / 10 will be ignored. It probably needs a new name and to be in plain fps. Maybe with more helpful wording like this:

By default, Sunshine's framerate is dynamic and attempts to match the content. When watching a movie you will receive only 24fps for example. Low framerates can be problematic for some displays, so this setting lets you enforce a minimum framerate. If the framerate is low, frame doubling will be used to increase it. Using a higher value here can also help reduce the sudden burst of data that occurs when ramping up from 10fps to 60 or higher. Tip: if your client has a variable refresh rate display, set this to slightly above the lowest value within the VRR range. This is often in the 40s.

@ReenigneArcher
Copy link
Member

When I originally added this I tried using straight FPS but it was not linear. Like setting 90 didn't result in 90 fps. This was before the client.framerate was respected. Since it wasn't linear I went with a "factor" so when someone used 3 and it ended up as 26 fps we wouldn't get a ton of unnecessary bug reports.

@andygrundman
Copy link
Contributor

In a weird coincidence the 30fps cutscenes in AC Shadows have been making me care a lot more about this. Normally I stream to my Macbook Pro without vsync and keep things in the VRR range with a 117 frame cap and everything is fine. However, 30 is too low for this display so I get extremely bad tearing. When playing the game directly on my LG CX over HDMI, the Nvidia driver must be doing some low framerate compensation because the TV reports something above 40 and there is no tearing.

I'm going to build myself a Sunshine that allows up to 6 and see if it does anything about the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Frame rate drops when idle
3 participants