Sunshine
Sunshine copied to clipboard
config: add min_fps_target setting
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
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
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
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?
@psyke83 fixed the apply button here: https://github.com/LizardByte/Sunshine/pull/1045
Easy test, tray icon disappears briefly and then re-appears.
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.
Updating to make this easier to fix conflicts after adjusting clang-format rules
@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.
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.
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: |