-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(fps): support x-nv-video[0].clientRefreshRateX100 for requesting fractional NTSC framerates #4019
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
Conversation
cf98e43 to
4e25662
Compare
|
|
I moved the function to video, and reverted the stuff in utility.h affecting tools. No need to include rational.h now either. The only weird thing left is in |
|
Alternatively instead of x100 workaround you can introduce new fractional SDP parameter (or two). This should remove intermediate steps and extend the usability, like creating new virtual display modes in runtime. |
I don't follow. You actually need to avoid the use of any floating point numbers because they would introduce rounding errors that get worse over time. NTSC for example if you just tried to stream at 59.94 you would be running slightly off from your TV, as 59.94 is only an approximation. Nvidia had the right idea with this option, we just never implemented it before. |
|
I mean just pass a pair of integer numbers or |
Are you trolling? We have a simpler method and I already got it working. If your comment is about a way to avoid floats please look at the patch. I just hardcoded the few NTSC cases where it matters. |
I'm not. You're introducing technical debt into client-server contract by adding support for poorly designed GFE attribute. If clients desires particular precision, it should request particular precision without intermediate guesswork. |
|
It looks like this PR has been idle for 90 days. If it's still something you're working on or would like to pursue, please leave a comment or update your branch. Otherwise, we'll be closing this PR in 10 days to reduce our backlog. Thanks! |
|
I'd like to resurrect this PR. I've been running it lately while working on Xbox frame pacing, and it's essential. Without it, streaming a 60fps stream to a 59.94 client will have to drop 1 frame every 16 seconds. Here is the Xbox side of the code, for reference, mostly to try to argue against putting num/den in the request param: If the client is supposed to work out the correct num/den values for something like 119.88 I think it's a mistake. You might think you would just have each client pull in ffmpeg so they can call Actually I can remove 5994 and 11988 here because they're just doubling 2997, and we can assume in the future we'll see this doubling continue. |
|
You don't normally see NTSC rates on monitors, it's mostly a North American TV thing. So for your example of 59.95, my LG monitor's 94.98 option, things are easy: simply multiply by 100. Monitors running at arbitrary rates like this will run at exactly their listed fractional rate, and won't have any funny business the way NTSC does. |
4e25662 to
b7d86f5
Compare
Bundle ReportBundle size has no change ✅ |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4019 +/- ##
==========================================
+ Coverage 12.00% 12.10% +0.09%
==========================================
Files 87 87
Lines 17581 17610 +29
Branches 8082 8095 +13
==========================================
+ Hits 2111 2131 +20
- Misses 14573 14756 +183
+ Partials 897 723 -174
Flags with carried forward coverage won't be shown. Click here to find out more.
|
b7d86f5 to
509be48
Compare
… fractional NTSC framerates
509be48 to
fb93ee7
Compare
|
|
Just to reiterate my point - X100 precision is not enough. Your NTSC rate needed special handling only because X100 precision is not enough. And now, if/when someone finally comes up with a better precision parameter, every server will still be expected to have X100 legacy code block. Not the end of the world I guess, but that's rather annoying kind of technical debt to have. |
Indeed, X100 is not enough for NTSC, in fact no amount of precision would be enough. 60000/1001 is impossible to represent in IEEE floating-point. It's something like 59.940059940059939 and keeps going. This is a relic of the analog age and we don't need to worry about it beyond these few cases I think. "Every server" can just apply this commit, I don't see the problem. |
|
This PR broke several hardcoded config initializer expressions, because of the newly-inserted field in the config. Lines 2469 to 2471 in eb72930
Line 2566 in eb72930
Line 2573 in eb72930
I'll PR a fix today. |
What are you talking about, this PR doesn't add any config? Edit: I see what you mean now, the real bug is in the inflexible way those test objects are created. |
… fractional NTSC framerates (LizardByte#4019)






Description
This PR brings back an old GFE parameter for specifying fractional refresh rates. If the param is specified, Sunshine will try to deliver the exact rate requested, which can be helpful for clients using Apple TV, Xbox, and others that might be stuck at 59.94hz or 119.88hz.
Common NTSC rates are hardcoded to their exact values, because 59.94 is not really the true rate, it's defined as 60000/1001. Just for fun, 23.976hz film is also supported if either 2397 or 2398 is supplied.
Screenshot
Type of Change
Checklist