FlightGear I/O considerations
This article is a stub. You can help the wiki by expanding it. |
Understanding VSync
Note
|
Note In its current form, this section/article is largely based on quotes collected from various related discussions/channels (devel list, forum etc) using the Instant-Cquotes script. Wiki users and other contributors are encouraged to help rewrite/edit contents accordingly to help get rid of unnecessary quoting (i.e. while the wiki is not intended to be a collection of quotes, quotes are sometimes the best/easiest way to bootstrap new articles, while also providing a good way to link back to related discussions in the archives).
While rewriting usually only entails changing first person speech to 3rd person. However, please try to retain references/links to the original discussion whenever possible. |
VSync is short for Vertical Sync. It's also an option you can enable somewhere in your video card settings. In short it makes sure the monitor doesn't display parts from different frames at the same time, like the upper half from a new frame and the lower half from the old one. This is not an issue for static images, but as soon as you start moving things in the image it might become visible. More technical info here. |
The thing about running with Vsync on is that you will always get 60fps (say) unless each frame takes longer then 1/60s (16.6ms) to prepare, which will cause a dropped frame as a minimum, and running at 30fps or 20fps if the interruption is longer. Even if the frame update time is 17ms (58.8fps) you will only see 30fps on screen.
Even one or two frames at half your regular frame rate will look like a stutter. If you are running with a high refresh rate (100Hz, 85Hz) you may want to reduce the refresh rate to 75Hz or even 60Hz to see if it reduces the stuttering. — Richard Bytheway (2007-04-11). Re: [Flightgear-devel] framerate hesitations....
(powered by Instant-Cquotes) |
OSX does the sensible thing and turns on vsync for your drivers, while windows doesn't. Try to switch off vsync if possible and you'll see much more than 60
|
Almost all LCDs have a native refresh rate of 60 FPS which works out to about 16.66 milliseconds per frame. There is a frame rate at which the human eye — Hal V. Engel (2007-02-24). Re: [Flightgear-users] sound stutters and frame rate drop on dual
core.
(powered by Instant-Cquotes) |
The reason to use higher refresh rates on CRTs is that this reduces the flicker that occurs because the phosphors start to fade during the longer — Hal V. Engel (2007-02-24). Re: [Flightgear-users] sound stutters and frame rate drop on dual
core.
(powered by Instant-Cquotes) |
A geforce 670mx is a powerful GPU and depending on the monitor resolution locking onto vsync (IE. 60 FPS) should be fairly common with that level of hardware even with high levels of eye candy.
|
My GTX 770 will run FG more or less locked onto vsync frame rates with all of the eye candy more or less maxed out at 2560x1600 (way over HD resolution).
|
- http://www.techopedia.com/definition/92/vertical-sync-vsync
- http://gaming.stackexchange.com/questions/198184/what-is-v-sync-and-when-should-i-enable-it
- http://www.geforce.com/hardware/technology/adaptive-vsync/technology
- http://www.tomshardware.com/reviews/g-sync-v-sync-monitor,3699-5.html
- http://www.pcgamer.com/nvidia-g-sync-synchronizes-monitor-refresh-rates-to-the-gpu/
Objective: High-Rate I/O
Workarounds
We do have a mechanism that uses a software timer based system so it is not perfect, but does seem to work pretty well. From the command line or your .fgfsrc file you can use the following option:
— Curtis Olson (2009-07-22). Re: [Flightgear-devel] Generic input protocol delay.
(powered by Instant-Cquotes) |
The main properties to adjust FlightGear's I/O rate are these:
Also, not all hard-coded I/O options may fully support these properties (e.g. telnet/props). |
Misc
Regarding your requirement to run the simulation at 700 hz - you need to differentiate between simulation and rendering - the latter often being affected by vsync, i.e. 60 hz/fps. That said, osg does have pretty good support for splitting up these two tasks. Like you say, the existing property tree/Nasal mechanism for using Canvas isn't designed for handling 700 hz/fps - mainly due to the way the main loop is structured, and due to the Nasal GC, as well as the fact that Canvas lives in the global property tree. — Hooray (Fri Apr 03). Re: Simgear-based subsystem with Canvas support?.
(powered by Instant-Cquotes) |
I only started with --model-hz=500 to make the difference really obvious (see the linked image) — Hooray (Sun Aug 19). Re: Actual programming language for autopilot implementation.
(powered by Instant-Cquotes) |
Problem & Background
It might be possible to get the systems to run at a more even frame rate by setting the property /sim/frame-rate-throttle-hz to something the computers can deliver consistently. With that done the genlock might be able to get the systems to render in synchrony too.
— AndersG (Wed Aug 22). Re: jerky behaviour in flightgear when running in three comp.
(powered by Instant-Cquotes) |
t can be done in several ways. The two most common is:
— AndersG (Mon Aug 27). Re: jerky behaviour in flightgear when running in three comp.
(powered by Instant-Cquotes) |
You can also set the /sim/max-sim-time-per-frame property to 0.01 or less to force FG into running at at least 100 HZ in simulated time. The simulation rate is likely to be below 1, however.
|
solution: enable sync to vblank in nividia-settings or set /sim/frame-rate-throttle-hz=60 (or some other number < 120).
|