Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 26 Jan 2012
Offline Last Active Dec 25 2013 03:49 PM

Posts I've Made

In Topic: Stutter / Micro Stutter Even w/ VSync

29 November 2013 - 11:03 AM

Hmm, on Linux, have you ever tried LTTng? It basically creates a recording of your system activity which you can then view using tools like LTTv or an Eclipse plugin. Using that, you might be able to get a better understanding of what actually happens. You can see stuff like interrupts, syscalls and more. Maybe some high-prio process/task comes in, maybe there is some other driver doing something funky, etc.


I personally don't have a non-virtual Linux system which I can run it on and I also don't have stuff setup for SDL and or OpenGL on my development machines, so I can't really try to reproduce it at the moment.


About CPU parking, I don't really know honestly. All I know is that it has been known to cause hickups in games etc, so I disabled it early on and haven't looked back since. LTTng _might_ show you if cpu parking is related.


Just tried out LTTng and it dumped 60MB of data (which babeltrace spits out to my stdout) for only 10 second of gameplay. Wow. May install Eclipse to try and interpret the trace data. Tried plugging it all into an IDE when I set it up with visual studio, but trace data there didn't seem to help. The most valuable trace information so far is what I've posted in some other posts where I've screens that show how long each frame takes using c++11 chrono. I can't imagine system calls and other processes really interfering with the code, given that it happens the same way across multiple systems at the same times. I tried recording it to post a video, but it seems my computer can't handle that. Will try fraps or something in Windows and see if I can record with that.

In Topic: Stutter / Micro Stutter Even w/ VSync

29 November 2013 - 09:03 AM

Hello, and thanks for participating!


I would say 2-3 frames, if I had to guess. You should be able to replicate it via the sample program I posted on github 



As for system specs, this is the info for my laptop:



processor : 3
vendor_id : GenuineIntel
cpu family : 6
model : 42
model name : Intel® Core™ i3-2310M CPU @ 2.10GHz
stepping : 7
microcode : 0x1a
cpu MHz : 2093.189
cache size : 3072 KB
physical id : 0
siblings : 4
core id : 1
cpu cores : 2
MemTotal:        6099052 kB
MemFree:         3653744 kB
Buffers:          119444 kB
Cached:          1361440 kB
NOTE: I run ubuntu 32-bit, even though I've 6gigs of ram, hence the mem free being so low. All I have open when running this is 14 chrome tabs.
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)


Regarding the parked CPU, would this still be an issue if I don't limit frames and just let it run full boar at 700fps? Because the same stuttering issue occurs with or without Vsync enabled.


As for energy settings in Linux I have tried using cpu management tools to set the power to performance or else maxing out the CPU. Same for windows with high performance setting.


I have also tried setting task priority to very high in Linux and real time in Windows to no avail. Exact same stuttering in the exact same way.

In Topic: Stutter / Micro Stutter Even w/ VSync

28 November 2013 - 05:04 PM

I'm out of ideas, sorry.



Haha, it's okay. I am too, and I'm baffled. If I ever figure it out I'll be sure to post. Thank you very much for the help though everybody!!! :)

In Topic: Stutter / Micro Stutter Even w/ VSync

28 November 2013 - 09:28 AM

Not sure why I didn't think of this before, but is it possible that your stuttering is caused by the fact that you're writing to the console window every frame? I just tested the sample code on Windows... The regular size for the console window buffer is 80x300 characters, and with that setting, I get no/low stuttering. When I changed the buffer size to 3000x3000, it started stuttering the way you describe, and it was worse when I maximized the console window. The Linux console window probably also has this issue.


Another way I can think of to reproduce this would be to pipe the output of your program's stdout to a file.


IF you comment out the code that prints to the console, do you still get the stuttering?


Sorry for the very delayed response - been out of the country the past couple weeks. I did try removing all the output statements, piping them to a file, limiting them, etc. and the problem still persists.

In Topic: Stutter / Micro Stutter Even w/ VSync

09 November 2013 - 09:06 AM

I had stuttering issues myself, but it only happened on windowed linux and windowed AND fullscreen windows

My imperfect solution was to interpolate player camera rotation and movement (separately)

I didn't interpolate movement or rotation before, so when i did with rotation it became really smooth.

After that I just added weight to player position (very stupid 'fix',) but it actually works ok



player.xyz = oldPlayer.xyz * weight  +  newPlayer.xyz * (1.0 - weight);


where old and new are only updated each time the physics thread is updated

I'ts not a solution, but if it makes things smooth for you, like it did for me, at least we both know the reason smile.png

the physics thread just didn't update regularly enough because of the variable amount of background work it does and the irregularities in the update frequency


Also, for rotation i just interpolated pitch/yaw/roll, because that made things simpler (no need for slerp)

I'm not sure I understand this one completely, but the way I interpret it is having the player's movement depend on the delta between frames? If that is so, then it does do that already. Same for the scrolling of the background and everything else. The whole environment runs off a delta (which made me think of taking that out and seeing what happens when it doesn't - which is why I made the sample program I put on Github to take out all the variables I could).



Do you have a virus scanner active?


No sir, I do not. In fact I killed all running processes that were not critical in both Windows and Linux - and even reformatted Linux (and also upgraded it to Ubuntu 13.10 and installed only the SDL2 libs), AND reinstalled my video drivers in both Linux and Windows.