MantisBT - Zandronum
View Issue Details
0003848Zandronum[All Projects] Bugpublic2020-07-21 09:392025-03-03 17:41
Lunia 
 
normalmajoralways
resolvedfixed 
Linux5.7.9-arch1-1
3.1-beta 
3.23.2 
0003848: [Linux/SDL] OpenGL Stuttering (with fix)
Massive stuttering issues in OpenGL in Zandronum on Linux, practically unplayable, see here:'https://www.youtube.com/watch?v=IGhT4Pp1YW0 [^]'

Applying this fix'https://pastebin.com/sm8H6vRk [^]' from'https://forum.zdoom.org/viewtopic.php?f=2&t=46685 [^]' fixes this entirely. I tried it by compiling the source with the changes by myself. The game is silky smooth afterwards.
No tags attached.
Issue History
2020-07-21 09:39LuniaNew Issue
2021-07-20 01:32DoubleK1LLNote Added: 0021623
2021-07-20 03:09DoubleK1LLNote Edited: 0021623bug_revision_view_page.php?bugnote_id=21623#r13297
2021-07-20 03:29DoubleK1LLNote Edited: 0021623bug_revision_view_page.php?bugnote_id=21623#r13298
2022-01-01 23:30tm512Note Added: 0022068
2022-01-01 23:30tm512Note Edited: 0022068bug_revision_view_page.php?bugnote_id=22068#r13538
2022-01-02 00:00tm512Note Edited: 0022068bug_revision_view_page.php?bugnote_id=22068#r13539
2022-01-16 21:14Torr SamahoNote Added: 0022084
2022-01-16 21:15Torr SamahoStatusnew => needs testing
2022-02-20 05:37KaminskyTarget Version => 3.2
2022-04-25 18:15tautvisNote Added: 0022198
2022-06-19 21:34azvasKuklenkoNote Added: 0022270
2022-06-19 22:42KaminskyNote Added: 0022271
2022-06-22 13:56azvasKuklenkoNote Added: 0022273
2022-10-14 18:12Zom-BNote Added: 0022454
2022-10-14 20:40azvasKuklenkoNote Added: 0022455
2022-10-14 21:25Zom-BNote Added: 0022456
2022-10-14 21:26Zom-BNote Edited: 0022456bug_revision_view_page.php?bugnote_id=22456#r13742
2022-10-15 00:54KaminskyNote Added: 0022457
2022-10-15 09:53Zom-BNote Added: 0022460
2022-10-15 09:54Zom-BNote Edited: 0022460bug_revision_view_page.php?bugnote_id=22460#r13746
2022-10-15 09:54Zom-BNote Edited: 0022460bug_revision_view_page.php?bugnote_id=22460#r13747
2022-10-15 09:55Zom-BNote Edited: 0022460bug_revision_view_page.php?bugnote_id=22460#r13748
2022-10-15 09:55Zom-BNote Edited: 0022460bug_revision_view_page.php?bugnote_id=22460#r13749
2022-10-15 09:55Zom-BNote Edited: 0022454bug_revision_view_page.php?bugnote_id=22454#r13751
2022-10-15 13:00KaminskyNote Added: 0022462
2023-02-03 22:18mistyforestNote Added: 0022755
2023-05-03 14:29tautvisNote Added: 0022840
2023-05-03 14:30tautvisNote Edited: 0022840bug_revision_view_page.php?bugnote_id=22840#r13953
2023-06-08 04:09KingMagnaRoolNote Added: 0022847
2023-12-18 11:58tautvisNote Added: 0022934
2024-08-25 08:49DoubleK1LLNote Added: 0023965
2025-03-03 17:40Ru5tK1ngNote Added: 0024226
2025-03-03 17:41Ru5tK1ngStatusneeds testing => resolved
2025-03-03 17:41Ru5tK1ngResolutionopen => fixed
2025-03-03 17:41Ru5tK1ngFixed in Version => 3.2

Notes
(0021623)
DoubleK1LL   
2021-07-20 01:32   
(edited on: 2021-07-20 03:29)
I compiled Zandronum 3.1 alpha 5bb6162acea1 with this patch and I still have movement that has a slight stutter. It's not possible to play competitively like this. Mouselook is otherwise smooth like the video. Run out of options here to get Zandronum perfectly smooth in Linux. I'm on Mint 20.2.

Running the Windows variant (3.0) in Wine actually works smoothly compared to the native linux builds.

(0022068)
tm512   
2022-01-01 23:30   
(edited on: 2022-01-02 00:00)
I was getting this issue with the Zandronum 3.1 release on Linux. Pretty much everything lines up with what is described in the ZDoom forum post, with the degree of jitter varying every time Zandronum is started up.

The patch seems to alleviate the issue almost entirely, at the very least it now runs consistently. It still seems like maybe it's not as smooth as modern GZDoom is, but at this point it's slight enough to where it's hard to tell for sure. GZDoom has since switched over to using a timer source with nanosecond precision, a million times more precise than SDL_GetTicks(), so maybe that's got something to do with it, but I don't know this code well enough to tell how much inaccuracy Zan's millisecond timer would even produce at the 60Hz refresh rate I'm using.

I did my own video capture, comparing the patched and unpatched binaries back-to-back: 'https://youtu.be/HJAxTQ52NTY [^]' Do note that my capture software ended up having a hiccup at one point during the recording of the patched binary, but that wasn't visible in-game.

I also uploaded an updated patch that applies cleanly to the current codebase, for convenience: 'https://pastebin.com/w3Dmt1BQ [^]'

This overwrites a change that seems to be introduced here: 'http://hg.osdn.net/view/zandronum/zandronum-stable/rev/74fbeac6dbf6 [^]' but there don't seem to be any ill effects from that, if necessary, the change to how TicStart is calculated could probably be reintroduced, but I haven't tested that.

Really hoping to see this issue get resolved in the mainline source soon.

(0022084)
Torr Samaho   
2022-01-16 21:14   
Kaminsky pointed me to the corresponding GZDoom commit, which I now transplanted to our main repo:'https://osdn.net/projects/zandronum/scm/hg/zandronum-stable/commits/c55aa8bf98f44adae235c9b38315dd5f60e3342c [^]'
(0022198)
tautvis   
2022-04-25 18:15   
The patch using millisecond timer was not enough, at least for me subjectively the stutter problem (more like microjitter) was not completely gone. Situation looks is alleviated using the transplanted (copy from gzdoom source) time function with nanosecond resolution. After applying patch, which was not very intrusive (these few places more, where need to change variables to accommodate 64 bit timestamp) game felt much more smoother.

Created two patch versions:
* for ZA_3.1 version -'https://pastebin.com/jXDMsbE0 [^]'
* fairly recent commit c770f5a41612 -'https://pastebin.com/R5f7dBsz [^]'
(0022270)
azvasKuklenko   
2022-06-19 21:34   
I have exactly the same issue running Zandronum on Linux. Tested on 2 machines (NVIDIA RTX 3060Ti, Intel HD 620), I can always reproduce it. Whenever a map gets more crowded by monsters, it stats lagging in an odd way.

I compiled Zandronum 3.1 with the above patch and then played for about 2h - it's buttery smooth no matter how crazy the game goes (tested with Brutal Doom and Maps of Chaos, played through 4 different levels). I didn't notice any issues with the game itself.

Is there any chance this patch could be merged for future release as is or is there something more missing? I could do some more testing on my end.
(0022271)
Kaminsky   
2022-06-19 22:42   
Just to clarify, were you using the patch provided by tautvis or the GZDoom commit that was transplanted in 3.2? Is the GZDoom commit not working well enough for you?
(0022273)
azvasKuklenko   
2022-06-22 13:56   
This one:

> * for ZA_3.1 version -https://pastebin.com/jXDMsbE0 [^]

I cloned Mercurial repo and checked out into ZA_3.1, then applied the patch, made sure the diff is fine, then compiled it.

I couldn't compile it on Arch btw and actually used Ubuntu 20.04 in Docker container, but that's another issue.
(0022454)
Zom-B   
2022-10-14 18:12   
(edited on: 2022-10-15 09:55)
I compiled Zandronum 3.2 and this issue seems to be gone, despite none of the changes in the patch above seem to have been implemented.

As a test I checked out and compiled Zandronum 3.1 and the problem returned.

However it seems to suffer from a different kind of microstuttering that it doesn't do on Windows.

So I went and applied the patch on 3.2 and all changes were still compatible (although I had to manually massage in some rejected patches), but the microstuttering persists.

It's nowhere as extreme as the original stuttering-while-aiming, but still annoying. Can others confirm whether it's Zan or something about my system causing these new stutters?

(0022455)
azvasKuklenko   
2022-10-14 20:40   
Zom-B, I can confirm most of what you said. I just tried:

  1. Reproduce it using Zandronum 3.1, where it used to happen, I used build from the download section of this site - problem persists.
  2. Reproduce it using Zandronum 3.2, test build from this site's download section. CANNOT REPRODUCE!
  3. Repetead 1 and 2 several times to make completely sure. Both results the same each time.

I'm not sure what sort of different microstutter do you mean. To me it runs just as smooth as it should. Maybe it didn't happen to me, maybe I cannot perceive it, maybe it requires some more complex scene to happen. I just tried plain Doom 2, first 2 levels, 1440p, 60Hz, nothing crazy.
(0022456)
Zom-B   
2022-10-14 21:25   
(edited on: 2022-10-14 21:26)
It happens to me just as often in MAP01 as in the biggest of the Sunder maps, so it's not map related. It comes in very short burst very separated in time, and remind me of those hiccups in games where new parts of the world get loaded as you progress (although it's never in the same place even if I try to repeat it). The microstutter is like 0.2 seconds of 30fps in between smooth 60fps. Not the back&forth jittering of the original bug.

(0022457)
Kaminsky   
2022-10-15 00:54   
If you compile Zandronum 3.2 with tautvis' patch (found here:'https://zandronum.com/tracker/view.php?id=3848#c22198 [^]'), does it fix the microstutter that you described?
(0022460)
Zom-B   
2022-10-15 09:53   
(edited on: 2022-10-15 09:55)
I wrote here:'https://zandronum.com/tracker/view.php?id=3848#c22454 [^]' that it didn't

(0022462)
Kaminsky   
2022-10-15 13:00   
I see, thanks for the clarification. I was wondering exactly which "patch" you were talking about in that note.

Do you notice the same kind of microstuttering in newer versions of GZDoom (newer than 1.8.6)? If there isn't, would you be able to tell the earliest version where it stops?

Also out of curiosity, what are your PC specs like?
(0022755)
mistyforest   
2023-02-03 22:18   
Can confirm here at this build
hg update -cd '2022-10-30 03:16 +0000'
all working buttery smooth:)
previously i need to use this patch
'https://pastebin.com/raw/w3Dmt1BQ [^]'

c2d q6600, gf9800gtx(340.108),4gb ram, hdd, Linux Mint 21 Vera
(0022840)
tautvis   
2023-05-03 14:29   
(edited on: 2023-05-03 14:30)
Probably there is additional data point:
did game is running under old libsdl 1.2 or from shim/compat layer (https://github.com/libsdl-org/sdl12-compat)? It could eliminate this problem too, as switching to shim there is noticeable frame boost.

On other hand could not test sdl12-compat with old version on my system because got early crash event before rendering something.

(0022847)
KingMagnaRool   
2023-06-08 04:09   
Off topic to the issue, but I couldn't find any other means of contact.

I found tautvis' patch to be very useful. So much so that I have created an install script of Zandronum 3.1 with the patch applied. Unfortunately, I had to apply the patch manually because I'm not too well versed in diff files, and mercurial decided it didn't want to apply any of the 6 file patches, so my script relies on having the patched versions of the files. With that said, and with appropriate credit, do I have permission to post the script on github, and if so under what license?
(0022934)
tautvis   
2023-12-18 11:58   
There is one more data point which can be related to stuttering, if sv_updatemaster is true and master server is not in dns cache. The engine will be blocked by dns update when ttl expires (dns ttl 300 seconds currently) on update master function tick.

see'https://zandronum.com/tracker/view.php?id=4175 [^]'
(0023965)
DoubleK1LL   
2024-08-25 08:49   
Currently tested 3.2 240414-191 in EndeavourOS (arch) and it works great. Very smooth.

Whatever changes made here were positive. Hopefully 3.2 release is coming soon and out of dev!
(0024226)
Ru5tK1ng   
2025-03-03 17:40   
Closing ticket based off DoubleK1ll's feedback and the lack of complaints after mistyforest's feedback. Someone can reopen is necessary.