libretro / scummvm

ScummVM main repository
https://www.scummvm.org
GNU General Public License v3.0
4 stars 6 forks source link

120hz monitor problem #35

Closed KamiLordus closed 1 year ago

KamiLordus commented 1 year ago

On a 120hz monitor, the scummvm core has a performance issue. The games run too fast or too slow, the sound likes to crackle, etc. I've tried different settings but nothing helps. In other cores the vsync swap interval option helps, but not here. Games work fine if nvidia control panel is set to 60 hz and only like that.

RA 1.15 Win 11 rtx 3070ti, i7 8700k

spleen1981 commented 1 year ago

won't be able to test this, can you test refresh_rate_cap branch?

KamiLordus commented 1 year ago

https://git.libretro.com/libretro/scummvm/-/pipelines

@spleen1981 Script failure and I am unable to download the latest version.

spleen1981 commented 1 year ago

Should be fixed now

KamiLordus commented 1 year ago

Great job, problem solved. Thank you very much.

KamiLordus commented 1 year ago

The new version (b045872d) does not work well. DreamWeb freezes for a few seconds very often Legend of Kyradia has intro sound issues. Prince and Coward can crash. This version (c6cb7c3c) which limits the fps to 60 worked very, very good. Is it possible to add (c6cb7c3c) as main branch, and make some switch in core options limit fps 60 (on / off)? If someone needed. Although I tested this version also in 60hz and I didn't notice any problems.

edit: I will add that I use the 120 hz monitor mode with the black frame insertion option to avoid the ghost effect in many others cores. Otherwise I would only use 60hz / 60 fps mode because that's how retroarch games work best. However, the black frame insertion option doesn't work for 60hz.

spleen1981 commented 1 year ago

That's a test branch, https://github.com/libretro/scummvm/commit/b045872d1c33e897ad99f9464819603c662a6c38 was not ready to go... I'm not very convinced about limiting to 60hz without understanding the root cause, which may have other implications. We have the workaround ready to be merged anyways, in case we don't find a better solution.

Can you test 8423aadefd30baeb45bace25378585358ca385fe? What's the fps shown at 120 Hz?

KamiLordus commented 1 year ago

Ah sorry I thought b045872 was the finished version.

We have the workaround ready to be merged anyways, in case we don't find a better solution.

It's a good news. It can be hard to get 120hz though. I'm not an expert but I have a strange feeling that scummvm is very hard set to 60hz/60fps. 8423aad is still in pending status. If I can download it, I will test it and let you know.

KamiLordus commented 1 year ago

8423aad tested. Fps 116-119.94 depending on the game. Unfortunately same problem. In many games, the mouse cursor is noticeably faster, but very often game hang in random places. Core options like timing or auto performance tune hang the game completely. For example, DremWeb, or Beneath a Steel Sky.

edit: More 8423aad testing today. So I can add some details. The game freeze/lag issue almost occurs in every game I tested: Goblins 2, 3 Discword Beneath a Steel Sky Dreamweb Indiana Jones and the Fate of Atlantis Monkey Island 2 Prince and Coward etc, etc. Nightlong is one of the very few games without this bug. Especially when we move the mouse/controller cursor and the character we control is heading to a new location. Or we enter a new location - it's completely random. Sometimes the game freezes after 3s after starting, sometimes after 1 minutes. I haven't noticed any other problems. The sound is ok, nothing cuts out (previously in Prince and Coward the dialogue was cut off). With the exception of Legend of Kyradia, where the music on the start screen clips much more at 120 fps than at 60. @spleen1981 i think fix to 60 fps cap c6cb7c3 is the best solution. The games run smoothly with no freezing bugs. These are retro adventure games not first person shooters, no one here needs 120 or more fps :)

spleen1981 commented 1 year ago

@KamiLordus can you test 7d01683a67c25bb34b54dd91bae88a2031fdc7cf

KamiLordus commented 1 year ago

@spleen1981 7d01683 tested. The game freezing issue is gone and everything is working very well. Only Nightlong has fps in the range of 90-95 and sometimes you can hear the sound crackling. But the core option allow timing inaccuraties fixes this problem. can this branch be merged with main ?

spleen1981 commented 1 year ago

merged in master

KamiLordus commented 1 year ago

Thank you.