flyinghead / flycast

Flycast is a multiplatform Sega Dreamcast, Naomi, Naomi 2 and Atomiswave emulator
GNU General Public License v2.0
1.39k stars 169 forks source link

Duplicate frames when FPS < 60 #520

Open ghost opened 2 years ago

ghost commented 2 years ago

So after a period of testing i think frame pacing issues in 30fps games would be improved by being able to duplicate frames, users with/without gsync monitors etc would benefit from this and would not have to force their refresh rate to 30 hz to improve pacing which impacts input lag poorly.

Chaseroni commented 2 years ago

I’d just like to add on that this would greatly enhance the experience on android as well under the GL renderer, if it’s possible!

stf999 commented 2 years ago

I second all this ! This is my first wish !

jeremy27041980 commented 2 years ago

Third !

RiasatSalminSami commented 1 year ago

Would be really nice to have a feature like this, especially on phones since there is no way to force Half Vsync from GPU drivers on phone.

On pc, at least with nvidia gpu, forcing standard half vsync from nvidia inspector [standard half is required. Adaptive half vsync results in vsync to disengage at 30 fps cap and starts to tear+ stutter anyway] and then using special K to cap the emulator at 30 fps does seem to significantly reduce the stutter. But the process is inconvenient and also caps the whole game to 30 even on menus and start-up logo that can be 60 fps, not to mention, the 30 fps cap has to be disengaged every time I need to play a 60 fps game.

Having the emulator to do the duplication natively will solve all these issues. This should be optional though, since on some slower hardware, duplication might result in slow downs. So for those hardwares, you'd be better off turning off duplication and just play with the stutters at full speed instead of slowing down.

bryc commented 1 year ago

I'm experiencing this issue as well under Windows 10. Happens in both standalone and libretro.

Whenever a game is in "30 FPS mode", the frame rate is not smooth, it is intermittently choppy.

Flycast:

https://github.com/flyinghead/flycast/assets/1408749/d7e6d1d3-a2ea-44cb-8ec8-29874862a61d

Redream:

https://github.com/flyinghead/flycast/assets/1408749/67756d41-9bc3-45b2-bb41-3653d607fb0d

I don't have HW to test, but this video of a Dead or Alive 2 intro cutscene on real hardware shows smooth 30fps movement, whereas in Flycast, it's still somewhat choppy.

Real hardware (not my video, from https://youtu.be/y1F-kWiM71k?t=65):

https://github.com/flyinghead/flycast/assets/1408749/ff9e9496-12c9-41b0-a779-d68cc24443e3

Flycast:

https://github.com/flyinghead/flycast/assets/1408749/1c04dc63-13a3-4353-9dc5-c9291834232d


Update: I saw one solution mentioned that fixes this, "Full Framebuffer Emulation". And it does appear to smoothen the framerate.

However it causes a reduction in the color depth, resulting in color banding / posterization.

Here's an exaggerated example. Game is paused, I made it brighter, which made the banding issues more pronounced. image

This can't be what the hardware does, can it? Xemu (Original Xbox emulator) also has this issue when I tried Fable, it's not at all how I remember the games. Is this the result from unimplemented dithering?

mfigueirido commented 1 year ago

Not trying to be pushy or anything, but how I wish this duplicate frames on 30 FPS be a reality. I would love to test it and send bug reports :)

Immersion95 commented 10 months ago

Framebuffer doesn't do the trick anymore and I still have uneven framepacing with VRR. I need to enable Vsync to solve it.

vanfanel commented 10 months ago

I too have observed that there are major frame pacing issues observable in 30FPS games, like Sonic Adventure 1, REZ, Napple Tale, etc... During the same scene, frame rate goes from smooth to constantly plagued by small hiccups, even on 30FPS menus where graphical load is constant.

FPS COUNTER ALWAYS STAYS AT 30 FPS. This problem is not noticeable on the FPS counter, but on the game motion

IMPORTANT NOTE: 60FPS games (Daytona USA 2001, DOA1, VF3, etc) are not affected at all: I run them using a 59.94Hz video mode and video synchronization is perfect.

There's no VRR, GSYNC or anything like that set up on this system: only real 59.94Hz video mode set up for Dreamcast emulation.

IMPORTANT CLUE THAT COULD HELP TO SOLVE THIS: Setting a 29.97Hz video mode, frame pacing in 30FPS games is simply perfect: but that breaks 60FPS sequences, like the Dreamcast boot logo, etc, that naturally run half-speed and with broken audio, so this is not a fix. All in all, there's an internal framerate pacing issue with 30FPS games on Flycast (which are more like 29.97FPS, really).

Is Flycast computing frame time internally to insert delays in order to achieve ~30FPS? If that's the case, those delays should be removed and rely solely on VSYNC instead, so the games run at a constant framerate synchronized with the physical refresh rate, NOT with some calculated frame time. I have seen many SDL2-based engines doing that to lower framerates when VSYNC is disabled, but it causes exactly the kind of inconsistent framerates I am seeing here: to achieve perfect frame synchronization, VSYNC must be the only synchronization method used.

nexus382 commented 7 months ago

I am willing to stress test any thing that's needed.... but now I have moved from redream to flycast.... the ONLY thing I miss.... is everything playing at "60fps" on redream....that made the games much smoother. I know it's duplicating frames... maybe it's just allowing for better frame timing... hense the smoother apperance... but I think it's more than that. I have used programs that will take a video with 30 fps .. and make it 60....and while it won't look as good as native 60fps... there is a decent improvement.

ORIGINAL FRAMES 1,2,3, NEW FRAMES 1,1.5,2,2.5,3,3.5

Rather then just duplicating, iv seen scripts/programs that will take frame 1 AND 2... make them both semi transparent... then overlap them.... and THATS frame 1.5 ..... I almost feel redream is doing this due to the pretty big difference playing the same games on both. Redream lacks the Dreamcast Majik, I call it, and redream to me is explained as a sophisticated robot...that does things very....to the rules... and flycast utilizes the DC MAJIK, [1st lvl of SA1. You run on the pier while camera panning s around u, holding up the whole time on original HW, OR flycast... this works perfect... redream... tries to take the scene to litteraly and as camera moves and the point of view does sonic stops running this perfect "predefined" path.] And has that home cooked, sit by the fireplace, good ole dreamcast majik. Seems many people feel that this would be a great upgrade for flycas⁷t. I'm a video/image recovery....not specialist... but i have the tools and know enough to be dangerous...so if I can help if this ever starts to come together.... please, ask.