Sunshine icon indicating copy to clipboard operation
Sunshine copied to clipboard

config: add min_fps_target setting

Open ReenigneArcher opened this issue 2 years ago • 9 comments

Description

Add minimum fps target setting to help in situations where 10 fps is too low.

Screenshot

Issues Fixed or Closed

  • Fixes #1042
  • Fixes #1009
  • Fixes #988

Type of Change

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [x] 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)
  • [x] Documentation update (changes to documentation)
  • [ ] Repository update (changes to repository files, e.g. .github/...)

Checklist

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my own code
  • [x] 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

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch must be updated before it can be merged. You must also Allow edits from maintainers.

  • [ ] I want maintainers to keep my branch updated

ReenigneArcher avatar Mar 15 '23 22:03 ReenigneArcher

Left a comment re: broken HTML. With the issue manually fixed, the web UI's "Apply" button doesn't seem to work, but I'm not sure if that's related to this PR or perhaps the tray icon? Also, no matter what I set min_fps to, I'm not seeing any real difference in the minimum FPS with the AMD or Software encoder.

Edit: verified that "apply" is broken on nightly, so that issue is not related to this PR.

psyke83 avatar Mar 16 '23 01:03 psyke83

@psyke83

the web UI's "Apply" button doesn't seem to work

I may have broke something in this PR. https://github.com/LizardByte/Sunshine/pull/1023

Seems okay in the tray icon PR which was merged before #1023. https://github.com/LizardByte/Sunshine/actions/runs/4429570080

ReenigneArcher avatar Mar 16 '23 02:03 ReenigneArcher

Hmm you know I don't think it might be this simple, just removing the delay for example or making it very short (1ms) only causes 60fps for me.

So making it configurable is probably not going to be a simple fix, I guess that makes sense though.

It's possible that the encoding threads just don't really work as hard if there is a lot of static content?

Nonary avatar Mar 16 '23 02:03 Nonary

@psyke83 fixed the apply button here: https://github.com/LizardByte/Sunshine/pull/1045

Easy test, tray icon disappears briefly and then re-appears.

ReenigneArcher avatar Mar 16 '23 03:03 ReenigneArcher

This is working now. I was missing the part where it reads the config option from the saved config file so it was always using the default value.

I also renamed the setting to min_fps_target as setting this to a high value wouldn't guarantee a high FPS, which would have probably been misleading.

For me, if I set the value to 1 FPS, my stream is about 7-8 FPS (according to Moonlight) with static content. If I set to 240 FPS, I get about 65-68 FPS. I only tested on my laptop with integrated AMD graphics, with all other options as default.

ReenigneArcher avatar Mar 16 '23 15:03 ReenigneArcher

Updating to make this easier to fix conflicts after adjusting clang-format rules

ReenigneArcher avatar Mar 28 '23 01:03 ReenigneArcher

:white_check_mark: Qodana success :white_check_mark: Results:
- python
- js

LizardByte-bot avatar Apr 05 '23 14:04 LizardByte-bot

@cgutman do you think this PR should be resumed? I know there's been a lot of activity to try to improve streaming performance, and I don't know if this is still relevant.

ReenigneArcher avatar May 05 '23 01:05 ReenigneArcher

This change seems to improve slightly the number of microstutters when switching from a static image to an active one and back. Needs further testing / changes.

Jocelyn-JE avatar Mar 21 '24 14:03 Jocelyn-JE

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 8.96%. Comparing base (d6dd1ab) to head (f651fc9). Report is 144 commits behind head on master.

Files with missing lines Patch % Lines
src/video.cpp 0.00% 0 Missing and 3 partials :warning:
src/config.cpp 0.00% 0 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff            @@
##           master   #1043      +/-   ##
=========================================
- Coverage    8.97%   8.96%   -0.01%     
=========================================
  Files          94      94              
  Lines       17389   17392       +3     
  Branches     8267    8270       +3     
=========================================
  Hits         1560    1560              
  Misses      12967   12967              
- Partials     2862    2865       +3     
Flag Coverage Δ
Linux 6.79% <0.00%> (-0.01%) :arrow_down:
Windows 4.16% <0.00%> (-0.01%) :arrow_down:
macOS-12 10.04% <0.00%> (-0.01%) :arrow_down:
macOS-13 9.95% <0.00%> (+<0.01%) :arrow_up:
macOS-14 10.24% <0.00%> (-0.01%) :arrow_down:

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

Files with missing lines Coverage Δ
src/config.h 0.00% <ø> (ø)
src/config.cpp 4.77% <0.00%> (-0.01%) :arrow_down:
src/video.cpp 25.23% <0.00%> (-0.05%) :arrow_down:

codecov[bot] avatar Jun 18 '24 21:06 codecov[bot]