Board index FlightGear Support Interfacing

Lag When Using Generic Protocol

Connecting two computers, using generic protocol, connecting with Matlab?

Lag When Using Generic Protocol

Postby Zago » Wed Aug 21, 2019 9:16 pm

I have a generic protocol that is streaming information to and from MATLAB. I've noticed when I run FlightGear with this protocol in use for a few minutes the program begins to stutter and the frame rate visibly drops. This stutter doesn't seem to show up if the generic protocol is removed and all other startup options are kept the same. Has anyone else experienced this or have an idea on what could be causing it?

Some potentially useful information:
-Operating system is Windows 10.
-The generic protocol is set to 30Hz.
-On the MATLAB end, the socket is created with udp() from the Instrument Control Toolbox, and frequency is only regulated by a 1/30s pause (I'm not sure if that needs a more robust timing method).
Zago
 
Posts: 6
Joined: Wed Oct 31, 2018 7:54 pm

Re: Lag When Using Generic Protocol

Postby legoboyvdlp » Wed Aug 21, 2019 10:40 pm

How many properties are you sending 30 times a second and what hardware are you running it on? Just to get an idea if it's just sending too much and that's slowing it down or if something else is causing it.
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Lag When Using Generic Protocol

Postby Zago » Thu Aug 22, 2019 6:44 pm

legoboyvdlp wrote in Wed Aug 21, 2019 10:40 pm:How many properties are you sending 30 times a second and what hardware are you running it on? Just to get an idea if it's just sending too much and that's slowing it down or if something else is causing it.


There's 20 values in the output of the protocol and 4 in the input. Binary mode is set to true and all values are sent as doubles.

Hardware Specs:
-Intel(R) Core(TM) i7-8700 CPU @ 3.2GHz
-32 GB RAM

It doesn't slow down until a few minutes into running. I would think if the issue was shear transfer rate it would start lagging immediately.
Zago
 
Posts: 6
Joined: Wed Oct 31, 2018 7:54 pm

Re: Lag When Using Generic Protocol

Postby AndersG » Thu Aug 22, 2019 7:40 pm

Do you get a frame rate of 30 or higher all the time? Otherwise FlightGear will probably start to lag behind your selected generic property rate?
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2524
Joined: Wed Nov 29, 2006 10:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: Lag When Using Generic Protocol

Postby Zago » Tue Aug 27, 2019 9:22 pm

I believe the frame rate is consistently above 30 fps up until the stutter starts.
Zago
 
Posts: 6
Joined: Wed Oct 31, 2018 7:54 pm

Re: Lag When Using Generic Protocol

Postby jano » Sun Oct 06, 2019 12:09 am

That doesn't ring a bell for me, you can check if it's really bad frame rate coming, or something in the protocol (only thing i think of is a propagation of "nan" in the property tree, following bad properties being sent)
you can make the framerate appear in the display options, and in the debug menu you can have a more detailed analyse of the different subsystems timings in "follow the system performance" (or similar, i got it in french here :) )

do you have a steady memory footprint, or does fg eat memory unendlessly ?

in case this is because fg is only linked to the first core of the cpu, you can try to change the core affinity (not sure for this on windows, but here all fg sessions are on the first core, except if i change the affinity after they start)
jano
 
Posts: 221
Joined: Fri Nov 30, 2007 12:32 am
Location: france
Callsign: jano
Version: git
OS: debian SID


Return to Interfacing

Who is online

Users browsing this forum: No registered users and 2 guests