VSYNC issues

Started by Coder Apprentice, June 05, 2019, 19:27:46

Previous topic - Next topic

Coder Apprentice

Hey Guys,

Playing around with AGK Classic v2019.05.22 on my Win7 laptop and experiencing screen tearing both in windowed and fullscreen mode. Most examples produce this and I tried to use both SetVSync() and SetSyncRate() in codes they were not present, but didn't make too much difference. I found a topic about this bug from 2017 on TheGameCreator's forum and it seems the bugfix never really solved this issue or just came back in later versions? Do you guys experience the same with current AGK Classic?

https://forum.thegamecreators.com/thread/219910

Steve Elliott

Myself and others have had problems with Vsync on AGK.  The problem I had last was that even though my monitor refresh was 75hz, it would sync at 60hz.  This has been fixed in AGK Studio.  The AGK guys seem to be putting all their efforts into Studio.

The code I use:

SetSyncRate( 0, 1 ) // max sync rate
SetVSync( 1 ) // turn on vsync
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

Coder Apprentice

#2
z





Steve Elliott

np.  Bug fixes and a much nicer IDE with AGK Studio.
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

Coder Apprentice

#4
OK, problem solved! So I had this VSYNC issue where the program didn't want to sync to the refresh rate no matter what command I used. So here is the deal. In the GPU settings VSYNC was not allowed. You might ask why didn't I check that first? Because test programs I made with PureBasic synced just fine. So I thought it was enabled. How could PureBasic sync? I guess it could overwrite the settings and AGK couldn't...? Whatever the reason is if one app can sync and another cannot it's better to check the video card settings just to make sure.

Pfaber11

That's very interesting and nice to know. I intend to be using classic for some time yet as my computer is not vulkan compatible . Hopefully AGK classic will be looked after and supported  for some time to come .
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Rick Nasher

#6
Ok, new experiments..

Experiment I:
1. In NVIDIA Control panel, set my default driver to NVIDIA (has Intel HD too, but no difference regarding fps though).
2. While there, also set vSync to "On" in here also. (default was "Use the 3D application setting")
3. Speed test(Studio version) again.

Results:
With AGK vSync on: still 30fps.
With AGK vSync off(thus forcing the vSync on the NVIDIA defaults): 60fps!

*Hmm makes me think it really doesn't do what it should.



Experiment II:
1. In NVIDIA Control panel, set vSync to "Off".
2. Speed test again.

Results:
With AGK vSync on: 60fps.
With AGK vSync off: ~350fps.

*That is more what I expected with the default NVIDIA vSync-setting on "Use the 3D application setting". Looks like a communications error to me.



Question on the table is now:
Could it be that AGK isn't reading the GPU settings properly or that NVIDIA driver is screwing up not reading the AGK app settings properly??
(dunno how it works behind the scenes)
_______________________________________
B3D + physics + shaders + X-platform = AGK!
:D ..ALIENBREED *LIVES* (thanks to Qube).. :D
_______________________________________

plenatus

Did you mean the FPS inside Studio?

Rick Nasher

Fps in Qube's speed test program ran in AGK studio.
_______________________________________
B3D + physics + shaders + X-platform = AGK!
:D ..ALIENBREED *LIVES* (thanks to Qube).. :D
_______________________________________

plenatus

#9
Okay.In the driver settings i let the apps decide for vsync on or off.
But no problems so far.

But i see in the Studio settings for the IDE is something weird. Switch between 30fps/60fps/vsync/fullspeed here and there it works not always.
As example if i switch from 30fps to vsync it doesn´t sync with 60fps.
We both don´t know what is under the hood.

Rick Nasher

#10
Yep, AGK's ways are mysterious..  :P
I've posted the test results on AGK Studio forums under Qube's thread: https://forum.thegamecreators.com/thread/224808?page=2#msg2647629

Hope it helps (and gets noticed of course).


BTW: Dunno why this is declared "Solved", for it certainly isn't solved on my machine. Unless, I really never fully understood vSync or so.
_______________________________________
B3D + physics + shaders + X-platform = AGK!
:D ..ALIENBREED *LIVES* (thanks to Qube).. :D
_______________________________________

Coder Apprentice

#11
Quote from: Rick Nasher on August 18, 2019, 12:55:18
BTW: Dunno why this is declared "Solved", for it certainly isn't solved on my machine. Unless, I really never fully understood vSync or so.

Well I thought my (the original) vsync issue was solved via the graphics card settings. But hey! I removed the "solved" part so we can continue to discuss all vsync issues in AGK.

I can't wait to see how the tests will behave with the upcoming new (bug fix) version of both AGK Classic and Studio Paul mentioned in the topic Qube started over at the GameCreator's forum.

Coder Apprentice

#12
Another thing that came to my mind. I experienced many times that windows does not recover properly from standby mode. Don't have too much experience with Win10 but experienced many times with XP/Win7/Win8. So when scrolling gets jerky a fresh reboot might be a good practice just so we can exclude this form of graphics driver issue from the list of possible causes on windows machines during testing. Just my two cents.

8)

Rick Nasher

Yep, I use hibernate most of the time, however I've tested this after a reboot which doesn't change a thing in regards to the vSync fps issues.
_______________________________________
B3D + physics + shaders + X-platform = AGK!
:D ..ALIENBREED *LIVES* (thanks to Qube).. :D
_______________________________________