Board index FlightGear Support Multiplayer

rendering interruptions in MP mode

Trouble getting online, setting up a server?
Forum rules
In order to help you, we need to know a lot of information. Make sure to include answers to at least the following questions in your initial post.

- what OS (Windows Xp/Vista, Mac etc.) are you running?
- what FlightGear version do you use?
- copy&paste your commandline.

Please, also see Requesting Technical Help.

Note: If you did not get a reponse, even after 7 days, you may want to check out the FlightGear mailing lists to ask your question there.

rendering interruptions in MP mode

Postby columbo » Tue Mar 25, 2014 3:12 pm

Whenever i'm flying on a busy airport ( many aircraft) rendering is interrupted ( display freezes) when ( i guess) some data has to be loaded from disk. Sometimes this takes a few seconds...

Especially in a chopper this can cause an aircraft-crash or at least a lot of steering when rendering resumes.
Is there a way to prevent such 'hickups' or change this behaviour ?

I don't undestand why rendering is halted in the first place...anyone can explain that to me ?

Thanks.
columbo
 
Posts: 8
Joined: Sun Nov 10, 2013 12:05 am

Re: rendering interruptions in MP mode

Postby someguy » Tue Mar 25, 2014 10:12 pm

I think it happens every time another user spawns into the sim within a certain distance of you; FG searches for his model on your disk, and if found, loads it. You still get some lag even if you don't have the model. It's worst when the kiddies are spawning and crashing (i.e., loading and unloading) those large, over-detailed airliners in rapid succession at KSFO.

The only solutions: go fly somewhere or some time less busy, or turn off MP. Or, I suppose, spend $thousands on a much faster computer with SSD. It may help to open the pilot list and X out the offending airliners so they are ignored, but I've never taken the trouble for that experiment. As to why FG seems to make loading other users' models the priority task, you'll have to ask a developer. Best of luck with that.
User avatar
someguy
 
Posts: 1650
Joined: Tue Nov 25, 2008 6:54 am
Location: USA
Version: 2019.1.1
OS: Mac OS X 10.11.6

Re: rendering interruptions in MP mode

Postby hvengel » Wed Mar 26, 2014 12:02 am

My understanding is that the process of loading these models is supposed to be in a separate thread, In theory this should make this issue go away. But I know from working with various things that on some hardware disk IO blocks or mostly blocks other processes. It seems to be disk IO driver and/or BIOS dependent but I don't have enough data to be able to specify which combinations of hardware, BIOS and drivers have the issue but it is not at all uncommon and I have seen it happen with virus software running on a number of machines. My last computer had significant issues with this in FG (things would stop for 1 or 2 seconds at a time) but my new one has only very minor issues with this (slight frame rate drop while the MP model is loading). So the right hardware, BIOS and drivers can reduce the problem greatly. Of course YMMV.
hvengel
Retired
 
Posts: 1127
Joined: Sun Dec 24, 2006 5:35 am
Location: Minden Nevada

Re: rendering interruptions in MP mode

Postby Johan G » Wed Mar 26, 2014 12:23 am

someguy wrote in Tue Mar 25, 2014 10:12 pm:The only solutions: go fly somewhere or some time less busy, or turn off MP.

Another way around it is to take the folders for aircraft you rarely or never use and move them somewhere else, like "../data/Aircraft/Disabled aircraft" or something. They will instead load the default aircraft model, i.e. the infamous "glider", unless one change it (/sim/multiplay/default-model/<aricraft .ac or .xml> in the property tree or preferences.xml if I am correct).

Edit: As a side note I found the glider too small and hard to spot and replaced it with a model of my own (though I am quite sure one can write an xml file doing a scale animation).

Image
My glider replacement, a.k.a. the "Wedgie" by Johan G, on Flickr
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: rendering interruptions in MP mode

Postby columbo » Wed Mar 26, 2014 4:50 am

Thanks for all the fast replies.

You still get some lag even if you don't have the model. It's worst when the kiddies are spawning and crashing (i.e., loading and unloading) those large, over-detailed airliners in rapid succession at KSFO.


Yes...chopper flying at KSFO is 'handicapped' for that reason...i already unloaded the default cessna ( rather detailed ) and the 747.
But still...sometimes stop-motion for a few seconds...also when users switch the livery.

The only solutions: go fly somewhere or some time less busy, or turn off MP.


Sure...but flying in MP mode at KSFO is fun _because_ of all the other pilots...experienced and new. You can go there anytime...

I have an ssd drive with the OS on it though...I like the idea of putting the aircraft folder on that drive and will give that a try.
( though no $thousands worth of machinery here... :( );

My understanding is that the process of loading these models is supposed to be in a separate thread, In theory this should make this issue go away. But I know from working with various things that on some hardware disk IO blocks or mostly blocks other processes


That's what i thought...a separate thread to load data.
But I don't think disk i/o in one process or thread will block any other...that should not happen. ( i'm talking about Linux here, don't know about other OS'ses). But i'll take a look at the bios anyway...just checking. A 'slight frame rate drop' wouldn't be much of a problem....far better than dropping down like a fly. :D

Another way around it is to take the folders for aircraft you rarely or never use and move them somewhere else,


I thought of that and already removed a few detailed and much used aircraft. But MP gets less interesting with every 'blue glider' or replacement of that, that shows up.

And i do not think it's necessary to stop the rendering when loading data. Maybe a FG_dev can give me a clue on that.

I'll post here if the ssd-option or "smth. else" will reduce the prob.
Thanks.
columbo
 
Posts: 8
Joined: Sun Nov 10, 2013 12:05 am

Re: rendering interruptions in MP mode

Postby hvengel » Wed Mar 26, 2014 4:22 pm

columbo wrote in Wed Mar 26, 2014 4:50 am:...

My understanding is that the process of loading these models is supposed to be in a separate thread, In theory this should make this issue go away. But I know from working with various things that on some hardware disk IO blocks or mostly blocks other processes


That's what i thought...a separate thread to load data.
But I don't think disk i/o in one process or thread will block any other...that should not happen. ( i'm talking about Linux here, don't know about other OS'ses). But i'll take a look at the bios anyway...just checking. A 'slight frame rate drop' wouldn't be much of a problem....far better than dropping down like a fly. :D

...


My old machine (which I replaced about 8 months ago) had this issue in both Windows and Linux. In theory IO should only block the thread/process that is dependent on the IO but on some hardware this is not what happens although I don't know exactly why. I do know that my new hardware is almost unaffected by this issue and that the chip set/BIOS vendor (Intel) specifically lists better IO concurrency (don't remember the exact terminology they used) as one of the improvements in the chip set/BIOS over the previous version. I have a dual boot Mac Pro tower at work with a slightly older Intel chip set and BIOS (two versions earlier) and it blocks horribly when virus scans are running to the point where I can't even work in Visual Studio (Even editing files is painful and software builds are nearly impossible). I have seen similar things on Linux so I am fairly certain that this behavior is chip set/BIOS, and maybe to some extent, driver related. There are also long threads about this same basic issue in Linux on a number of forums and I know that there is a regularly updated and still active thread on the Gentoo forum on disk IO causing general blocking of other processes that is at least 5 years old. My old machine did NOT have an Intel chip set so this issue seems to exist in many of not most existing chip sets.
hvengel
Retired
 
Posts: 1127
Joined: Sun Dec 24, 2006 5:35 am
Location: Minden Nevada

Re: rendering interruptions in MP mode

Postby Hooray » Wed Mar 26, 2014 5:21 pm

Being a little familiar with FlightGear, and some of its multi-threading issues, I would be more inclined to look at the way FlightGear synchronizes multiple threads (i.e. via mutexes/semaphores) and check first if there's any kind of serialization taking place when that happens - FlightGear has a whole bunch of such shortcomings (and other algorithmic) in various places, so many of these problems are not really due to lower level issues like drivers/hardware, but simply due to the way FlightGear works currentlly, given that it's an old code base that's been written by many people over time, many of whom are no longer actively involved in project, and who never really documented the whole FlightGear multi-threading "architecture" (admittedly, a very big word in this particular context):

FlightGear's way of using "threading" was never formally agreed upon or explicitly "designed" the way a commercial project would approach such an undertaking - FG merely evolved up to a point where the FlightGear main loop became a real bottleneck, so that people started looking into moving certain stuff out of the main loop and using threads for those, despite many long-time contributors being strongly opposed to the idea. Unfortunately, this is indeed causing some new challenges, especially when it comes to long-term maintenance, because active core developers are generally not familiar with the way threading is supposed to work. Hopefully, this is one of those things that will be solved over time by adopting HLA.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: rendering interruptions in MP mode

Postby Johan G » Wed Mar 26, 2014 8:31 pm

There is also another way. Somewhere in the past (before most of us had heard about FlightGear) there apparently was a mechanism by which AI models would be loaded instead of the full aircraft. Unfortunately this is not that well known, and not that well documented.

As it required that the AI model would have the same name (either the .ac file directly or referred from a .xml file with animations) as the full blown aircraft, the aircraft developers sometimes supplied an AI model together with the aircraft. It so happens that the name of the .ac or .xml file is the name of the aircraft as reported over multiplayer. What you see in the pilot list and on the MPMap is most probably that name, but with the file extension stripped off.

There are of course both advantages and disadvantages to this technique.

For more information on that see this post and the posts around there: Re: Plane & ground textures high or low resolution ?
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: rendering interruptions in MP mode

Postby DEEG » Thu Mar 27, 2014 6:18 pm

I used to have that same lag in MP, but I moved my aircraft folder from my 5200rpm drive over to by 10,000rpm velociRaptor. I guess the speed of your hard drive matters. If you have an SSD that's even better. An idle HD has to spool up, an SSD is instantly accessible.
Aircraft:
Diamond DA-20 "Katana"
Cessna 172p "Skyhawk"
Cessna 182 "Skylane"

Airports:
Queen City Muni (KXLL)
LV International (KABE)
User avatar
DEEG
 
Posts: 19
Joined: Thu Nov 14, 2013 2:10 pm
Location: Pennsylvania
Callsign: PA-WH04
Version: 3.0
OS: OSX 10.9 | Vista

Re: rendering interruptions in MP mode

Postby daveculp » Thu Mar 27, 2014 9:34 pm

There several levels of modding that you can do to stop MP airplanes from freezing your sim.

1) Remove the offending models from your Aircraft directory. This leaves you with the tiny blue/yellow glider.
2) Same as above, but replace the tiny glider with a more visible model, like Johan's wedge mentioned above.
3) Replace the offending models with low-poly substitutes. This is very time consuming, though.
4) Leave it to the developer to make use of the existing methods of shrinking the MP version of their model. This doesn't appear to be working.

I'm sure every user has a different opinion on what an MP representation of a particular model should look like. For instance, I'd be happy to see a 1000 poly, untextured model with no moving parts and no gear. Others want to see much more in MP. Fundamentally, it's an issue of what each user/developer believes the flight simulator is all about.
User avatar
daveculp
 
Posts: 505
Joined: Sun Feb 24, 2013 2:50 am
Location: Las Vegas, USA
Callsign: DCulp
Version: 2017.3.1
OS: Ubuntu 17.10

Re: rendering interruptions in MP mode

Postby columbo » Fri Mar 28, 2014 2:10 pm

My old machine did NOT have an Intel chip set so this issue seems to exist in many of not most existing chip sets.


Well...the prob is not only caused by disk loading. I'm sure of that because i moved the "Aircraft" directory to a ram drive and used that. ( how to do that on a linux sys. i'll describe at the end of this post )

This will reduce the prob. to a much more usable level though some 'freezes' still happen. So data parsing seems to take some notable time also.

I would be more inclined to look at the way FlightGear synchronizes multiple threads (i.e. via mutexes/semaphores) and check first if there's any kind of serialization taking place when that happens


Yes..i also think the prob is a result of either loading/parsing new data in the render thread or the render thread waiting for another thread that loads/parses the data. I'd love to hack in on the sources but i'm only fairly familiar with c and c++ is is just not my thing...at least at the moment. ( many times i started an online course..but.... :) ).

it's an old code base that's been written by many people over time, many of whom are no longer actively involved in project, and who never really documented the whole FlightGear multi-threading "architecture"


Many open source projects suffer from lack of documentation and in-line comments and it takes much time to figure out how things work with just the code. And when a problem isn't hindering good operation or not irritating enough it won't be solved very fast.
All undestandable...

Hopefully, this is one of those things that will be solved over time by adopting HLA.


https://en.wikipedia.org/wiki/High_Level_Architecture_%28simulation%29

That is very interesting. Is this change already decided and is it being discussed these days on the devel mailing list ?
If so i might subscribe to that list...

For more information on that see this post and the posts around there: Re: Plane & ground textures high or low resolution ?


Thanks for that. I havent' read it all yet but using simple Ai models sounds like a step foreward as not only the time to load but also the parsing time will be reduced a lot. Looks like the link and (more link there) provides enough inflo for me to try and cerate an AI model for 747 or cessna...I miss those two planes most, both to fly and see in MP.

If you have an SSD that's even better.


And ramdisk is the best :)
See end of this post.

There several levels of modding that you can do to stop MP airplanes from freezing your sim.


1) i did.
2) i'd really like to see the actual planes. I used a rafale as 'glider stand in' but a lot of rafales in stead of boeings is just no replacement.
3) that sounds like a usable solution a.t.m. see above.
4) -


Part of the prob can be solved by putting the Aircraft folder, or just some of the largest models, in memory.
On linux that is simple.

First take a look at the size of the directory :
Code: Select all
du -ch /usr/share/fgdata/Aircraft


Mine is about 650 Mb and i have 8 Gigs of memory;

Check if there is shared memory available:
Code: Select all
df -h


will print a line like :
Code: Select all
tmpfs           3.9G  670M  3.3G  17% /dev/shm


So /dev/shm is available in the needed amount,
As you see 670 M is in use and that's my aircraft folder.

Now you should
-create a dir. on /dev/shm to use
-rename the aircraft dir. on disk
-copy the contents of that dir to /dev/shm and start fgfs with the option :

Code: Select all
 --fg-aircraft=/dev/shm/.../dir.


f.i.:

mkdir /dev/shm/fg/
mv /usr/share/fgdata/Aircraft /usr/share/fgdata/Aircraft1
cp -r /usr/share/fgdata/Aircraft1 /dev/shm/fg/Aircraft

And then start fg with
--fg-aircraft=/dev/shm/fg/Aircraft.


After a reboot this has to be done again :)
Of course YMMV.

Thanks.
columbo
 
Posts: 8
Joined: Sun Nov 10, 2013 12:05 am


Return to Multiplayer

Who is online

Users browsing this forum: No registered users and 4 guests