Opened 5 years ago

Closed 5 years ago

#1332 closed defect/bug (fixed)

Lag when reading reports from gpsd

Reported by: sleske Owned by: KaZeR
Priority: major Milestone:
Component: core Version: git master
Severity: normal Keywords:
Cc:

Description

In https://github.com/navit-gps/navit/pull/7 , grep42 reports:

After driving for a while, navit started to lag behind several minutes on my system. [...] The problem occurred on a raspberry pi running Navit, while doing other stuff in the background. When the problem occurred, the system was under a permanent high load.

Change History (4)

comment:1 Changed 5 years ago by sleske

On my system (Debian desktop), I could replicate the problem when streaming GPS data using gpsfake:

  • run gpsfake with parameter "-c 0.0001" (10,000 data sentences/second).
  • start Navit with vehicle_gps configured (source="gpsd://localhost")

-> Navit causes high CPU load, but still works.

  • Enable the GPS vehicle in the settings (Settings / Vehicle / Set as active )

-> Navit consumes 100% CPU, the GUI is unresponsive. Debugging shows that a GPS reports accumulate because Navit cannot keep up.

10,000 data sentences/second is unrealistic, but this hopefully approximates the situation where Navit is overloaded for other reasons, like grep42 reported.

comment:2 Changed 5 years ago by sleske

Additional information from greg42:

The problem occurred on a Raspberry Pi running Navit, while doing other stuff in the background. When the problem occurred, the system was under a permanent high load.

From what I can tell (please correct me if I'm wrong), Navit is inherently single-threaded. Therefore, I believe vehicle_gpsd_io is called when the gpsd socket becomes ready and Navit is idle. Do you think it make make sense to repeat your test while stressing Navit a bit (say, by repeatedly zooming the map via the dbus interface or so)?

comment:3 Changed 5 years ago by kazer

I actually have witnessed this issue in the past, also on a raspi (b+).

I also have faced it more recently using a more powerful carputer. One way to reproduce it seems to be to trigger a call to the external speech function without sending it to the background ( original intent was to avoid overlapping chatter when there is a recalculation of the route while navit is announcing the current maneuver). When this external call relies on internet connectivity and when there is a connectivity issue, i have noticed a lag, easily going up to 10 seconds.

comment:4 Changed 5 years ago by sleske

  • Resolution set to fixed
  • Status changed from new to closed

Fix committed as 3203adf4 - vehicle_gpsd:Read all pending data on every poll.. Navit now reads all pending data on every poll.

With that fix, in my tests Navit no longer freezes in the situation I described above. Hopefully this also fixes the problem greg42 observed. Otherwise, please reopen this ticket.

Note: See TracTickets for help on using tickets.