Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Street name and lane marker disappear. #3898

Open
PaulStets opened this issue Jun 9, 2017 · 63 comments
Open

Street name and lane marker disappear. #3898

PaulStets opened this issue Jun 9, 2017 · 63 comments
Labels
Observed Needs more clarification, feedback, or research

Comments

@PaulStets
Copy link
Contributor

The street name and lane marker show up like normal when I start riding, and once I turn off of that first road, they disappear and never come back.

Android 5.1.1, OsmAnd version 2.6.5

Video: https://drive.google.com/file/d/0B_epabEezdJreFV4Ql8wLWd6eEk/view?usp=sharing

@vshcherb vshcherb added this to the 2.7 milestone Jun 11, 2017
@vshcherb
Copy link
Member

Do we have this part of GPX file?

@PaulStets
Copy link
Contributor Author

I've asked for it. Will post it when the user responds.

@PaulStets
Copy link
Contributor Author

@polarbearing
Copy link

The video does not load for me. However it sounds like an issue I experienced on my old single core Nexus S phone, see #2962.
Naturally, when the street is not recognised, there is no lane information.
Did not yet have the issue on my current multicore device.

@tazva
Copy link

tazva commented Jun 21, 2017

I published the issue to Paul. It doesn't matter what street it's on, after a short while (usually within a few miles), osmand simply stops displaying the street names and lane indicators. It worked fine for months, then one day simply stopped working--I believe after an upgrade, but cannot recall the specific day.

@tazva
Copy link

tazva commented Jun 22, 2017

I have the app on another device running android 6.0.1, I've noticed that this bug does not appear on that device, only my tablet which is running 4.4.2.

@sonora
Copy link
Member

sonora commented Jul 1, 2017

Very weird, I can almost 100% reproduce this on a Samsung S4 Mini with Android 4.4.2 stock ROM, in a simulation. Losing the street name display at almost the identical spots. But it does actually recover, also reproducible, at fixed locations:

  • In your video, the first loss happens at 1:31, going from "Butts Station Road " via very briefly showing "Near Butts Station Road" (which seems to indicate OsmAnd somehow moves away from a named way segment) to blank, but it recovers at around 1:44.

  • Your second occurrence happens at 3.46 losing "Greenbrier Parkway", again via a brief appearance of "Near Greenbrier Parkway". It does not recover in the time span of your video, but when I simulate this, it actually recovers after pulling onto I-64, when it starts displaying "I 64" about near http://www.openstreetmap.org/way/391802357. Very briefly only, however, as more losses occur thereafter when proceeding down I 64. The next brief appearance of "I 64" is right after the Indian River Road bridge. These losses and re-coveries seem to reliably happen at reproducible points, I think.

It does not seem to be an issue with our reverse geocoding code, because if I manually select a point on the map at a stretch where (and during) the street name widget shows blank, the selected point's context menu correctly resolves and shows the address as e.g. "Greenbrier Parkway" (although that name could be retrieved from e.g. the opposite way of the divided highway. Looks like most or all occurrences happen on divided highways.)

Rather weird, needs more investigation. I would normally suspect a mapping issue, but cannot find one at first sight. Maybe someone more experienced with mapping can take a look at the ways in question and check out if there is anything faulty.

@tazva
Copy link

tazva commented Jul 3, 2017

I'm an OSM contributor, and have examined various pathways where this occurs. At first I believed it to be because some points lacked road names, but then it would happen in places where there's no lack or break of road names. On my system, it sporadically "recovers", but only briefly. One day last week I was riding somewhere (nowhere near any of the locations in the evidence provided), and suddenly a street name popped up, but a few seconds later it did the "Near ...." thing, and then it dropped off again.

If there's any specific roads I should examine in OSM, let me know. Personally, I don't think it's OSM-related, because it didn't do this prior to the recent upgrade. I'm more inclined to believe it's an implementation/method of code.

I've also begun to notice that in Android 6x, the new version seems to lose track of GPS when walking, something it didn't do before--but that's for another thread.

@sonora
Copy link
Member

sonora commented Jul 3, 2017

Thanks for investigating. Have you seen any occurrences on non-divided highways?

Regarding loss of GPS on newer Android systems: Chances are this is related to new power saving features, check out e.g. #3923 (comment) .

@tazva
Copy link

tazva commented Jul 5, 2017

I see occurrences of this thread's issue everywhere. I haven't come across anything where it hasn't happened. First boot, "Road" shows up. A short while later "Near Road", and finally nothing.

Regarding the GPS loss, I thought about power, but other GPS apps aren't losing it. For example, I stopped using OsmAnd to record GPX on my newer devices because it "can't see" the GPS for long periods of time, whereas my other GPS items (and GPX logger), never lose a connection. I examined my power options, I have all power saving disabled.

@tazva
Copy link

tazva commented Jul 6, 2017

I actually had a moment of surprise when the functionality remained intact yesterday for about 10 minutes before dropping out. No apparent reason why.

@tazva
Copy link

tazva commented Jul 6, 2017

This is an odd question, but is it possible the reverse lookup (which I'm presuming is whats being used to query the name for display), is timing out? Or whatever function passes the coordinates is getting backlogged or gets stuck? It seems like nearly every single "loss" is prefixed by the "near... road" display, which almost seems like OSM StreetName gets stuck on a node or street, and as I get further away its next update renders to "Near" that road, and then finally it just stops.

@sonora
Copy link
Member

sonora commented Jul 6, 2017

Yes, I have a similar suspicion. But strangely, it seems that during such an "outage" I can tap any POI or long-tap any other point on the map and the popup context menu will actually correctly resolve and display its address. So it seems that not the reverse geocoding lookup gets overall stuck, but somehow maybe only the lookup process for the current/next street segment lookup.

Not sure if that makes sense, but I think Victor (@vshcherb) needs to take a look at the symptoms we found, he had discovered and fixed similar reverse lookup process collisions in the past.

@tazva
Copy link

tazva commented Jul 7, 2017 via email

@tazva
Copy link

tazva commented Jul 7, 2017

I tried the reverse lookup as you suggested. I tried this after it had lost the street display. No-dice.. couldn't get it to reverse lookup anything by selecting a point. It shows the coordinates just fine, and then it'll say "looking up address" (or whatever), and that's all it does. I tried a bunch, moved around the map selecting different roads and buildings.. nothing, it just sits there in an endless "looking up address".

I'll try it again before it loses street display.

@tazva
Copy link

tazva commented Jul 7, 2017

After a fresh boot of the tablet today, I waited until OSM had fully loaded in and the street name was showing. I used the reverse lookup to check various streets with success. After about a minute of moving down the road, the street/everything went out like usual, and reverse lookup stopped functioning.

@sonora
Copy link
Member

sonora commented Jul 8, 2017

Not my observation, actually, but I may be wrong. I thougt the address lookup still works, it may just take a lot longer during an ongoing navigation, probably a matter of CPU performance.

But I am afraid I was heading down the wrong track here anyway, because we do not necessarily use reverse geocoding lookup to determine the street name. EDIT: But processGeocoding in CurrentPositionHelper may be hung nevertheless, not sure.

In any case, the fact that we always lose the display via a brief appearance of "Near ..." seems to indicate tthat to OsmAnd we are moving away from a named segment, so somehow when the condition occurs we seem to use use the orthogonal distance to a past portion of a way (and that distance is too far to detect we are on it) and not the portion we are actually on.

@sonora
Copy link
Member

sonora commented Jul 8, 2017

@tazva
Copy link

tazva commented Jul 8, 2017 via email

@sonora
Copy link
Member

sonora commented Jul 8, 2017

That sounds somehow like a process competition...something somehow taking REALLY long. And that matches my observation. And it seems perfectly reproducible when repeating the exact same steps e.g. by running a simulation along the identical GPX track.

Can you specify with which update exactly you think this started? Thx!

@tazva
Copy link

tazva commented Jul 8, 2017

Whichever one provided the animation smoothing for your current location.. I want to say it was the most recent update.

Also, if this is helpful, this doesn't occur during navigation (that I can recall, I will test it), but it's when I'm just riding around.

@sonora
Copy link
Member

sonora commented Jul 9, 2017

When I simulate a navigation along the GPX track provided above, it seems to happen on my device at the exact same places as shown in the video (which shows the just-cruising case). I have however, not seen the effect (yet) for not simulated "real" navigation.

@sonora
Copy link
Member

sonora commented Jul 9, 2017

After lots of more testing, it turns out this is not 100% reproducible. I simulated the stretch on Greenbrier Parkway in front of Greenbrier Mall now 12 times. In 10 cases, I lost the "Greenbrier Parkway" Display just after crossing Eden Way North, but in 2 cases I did get the display ok together with the "3 lanes" indicator just fine all the way to the I-64 ramp.

I think we can rule out that this is a simple screen refresh issue because of this additional observation: The CPU consumption my Task Manager reports for OsmAnd even with OsmAnd in the background is really high after occurrences of this issue, about 50%-60% continuously until I kill OsmAnd. I clearly attribute this CPU consumption to continuous (or stuck) reverse geocoding lookup: Normally, when I have OsmAnd in the background in e.g. Browse map profile without street name display, OsmAnd CPU consumption is 0%. It only rises to double-digit values when manually starting a reverse address lookup, (like for a point's context menu), falling back to 0% as soon as the address is displayed.

So it really looks like we are dealing with a process competition issue here. I now tend to think that this issue is an exact duplicate of #2962.

@sonora
Copy link
Member

sonora commented Jul 9, 2017

PS: Also related to #2960 (comment). I guess we have to re-visit how we organize our reverse geocoding lookup, and also investigate to cache results to some extend because repeated attempts all the time are quite CPU/power intensive.

@tazva
Copy link

tazva commented Jul 9, 2017 via email

@vshcherb
Copy link
Member

vshcherb commented Jul 9, 2017

@sonora geocoding lookup - shouldn't happen during navigation. It uses navigational data which is precalculated. As I saw in the video it was a navigation case.

@tazva
Copy link

tazva commented Jul 9, 2017 via email

@sonora
Copy link
Member

sonora commented Jul 9, 2017

Victor, I was confused at first as well, but we are talking the non-navigation case here. Although I could also reproduce this using a simulated navigation in Follow mode.

@scaidermern
Copy link
Contributor

I just experienced some of these issues again during hiking. I had the walking profile active, so the street name widget was not enabled. Nevertheless after some hours I did encounter long delays on various actions. E.g. adding an OSM note or editing a POI. The corresponding dialogs did appear only after several minutes.

@tazva
Copy link

tazva commented Sep 25, 2017

I recently used this to navigate a short distance away from my origination point, it went fairly well. Later in the day another navigation episode was a little more rough, as a few times it had to reroute due to road construction, and at one point it took so long to reroute I simply pulled over and had to cancel it all out and reload everything.

There's been a couple of times this week where its attempt to "catch up" was burning so much energy, the device was unable to "charge" and simply "maintained" its capacity at the same % for the duration.

@tazva
Copy link

tazva commented Oct 10, 2017

I ran this on a Note 4 Edge over the weekend, to monitor some OSM map changes over the course of a 5 minute trip. During this time, the street display washed in/out (as described in this thread), CPU usage was absolutely off the charts, and I lost 20% of the battery of the phone. This is absolutely ridiculous.

I would have to put the device into an ARM stress test just to match the resources Osmand+ is using when this happens. On the bright side, if I ever needed to heat my hands up while in Russia during winter, I could just load the app and hold onto the phone.

@CJTmmr
Copy link
Contributor

CJTmmr commented Oct 17, 2017

Can confirm excessive CPU-use upto 27%..when not displaying current streetname, lanes when in simple follow-me -mode. Even when OsmAnd is no longer running in foreground. On Samsung Galaxy Camera2, Android 4.3, 4 cores.
When somehow display is okay again CPU is back to normal.
Some search proces gets probably in a endless loop.

@tazva
Copy link

tazva commented Oct 25, 2017

In the interest of data points, I'll see if I can log cpu usage while using the app. Watching it the other day, cpu usage is 60-90% for all 4 cores on my device, at any given point.

@tazva
Copy link

tazva commented Nov 1, 2017

A week ago I said I'd start logging load to see if I can provide any further useful objective data. The purpose of this wasn't to prove this issue (as it has been observed by many), but to examine what it actually looks like, from a data-visual perspective.

In order to monitor process usage and log CPU load, I used Cool Tool Pro from deviantstudio (https://play.google.com/store/apps/details?id=ds.cooltool). This lets you use a window overlay to monitor chosen fields.

In my case, for the window overlay, I keep an eye on battery%, cpu load%, memory free, temperature, and most important, what system process is using the most resources.

My observations:
For visual monitoring, I have it set to 1s update intervals. For logging CPU load to a file, I had it set to
30s intervals (I forgot to set it to 10s). I've kept an eye on the overlay over the past week, and OSM+ cpu usage was much higher than I realized.. at idle it's burning up the CPU for no apparent reason. By idle, I mean just turning the tablet on and letting it sit motionless. GPS shows no movement, but OSM+ is typically loading the CPU 30-40% at idle.

When not idle (ie, when simply moving on roads), usage typically bounces between 60-80%, with spikes to 100%. Navigation mode doesn't appear to make a difference (good or bad). I've also twiddled with GPX recording, it may make a hair difference (couple of %), but appears to be a victim of this issue more than anything.

To try and provide a simple visual illustration of my findings, I transposed the CPU load log results with GPX recordings of trips, one data group using navigation to get to a destination, and the other was simply riding around town--the data was tied together using system timestamp. GPX interval for nav mode is 3s, while in explore mode is 2s.

Below is a snapshot showing these two situations. The top chart is "cruise" mode, simply exploring, bottom chart is "navigation" mode. Red line is speed in MPH (axis to the right), blue is CPU load in % (axis to the left).

osmandplus_load

Notice in exploration mode (top), CPU load quickly ramps up to the 70% range and stays there until movement is at a stop, once at a stop it drops to the 30% range. Occasionally while at rest, it will spike--doubling--for no apparent reason. All of this usage is OSM+. The duration for exploration was around an hour--I truncated the speed timestamp of the tail because it was motionless, but allowed the load to be displayed to show that it was using very much CPU despite being at rest doing absolutely nothing.

In navigation mode (bottom), you can see it's not much different. There's thousands more data points here due to the duration (5+ hours), so the chart is thicker. Again, OSM+ "idle" appears to just use 30% of CPU for no apparent reason (the 4 hour gap of being at rest), and its "normal operating load" appears to be 60-70% at any given point (which corresponds to the operating load for non-nav mode).

For anyone curious, Base CPU load (booted but without osm+, doing nothing) is < 4%.

Other data points I examined mirror this, OSM+ load at idle being very high, and while in use, more than doubles. My concern is that moving forward (building on the existing code/bug or whatever is causing this), is going to be hurtful to the app, because CPU usage makes it very inefficient. I believe it's also going to cause other issues, as more features will become available, but performance may be sluggish. The fact that I can install this on a new device, and drain the device battery by the second, is further proof of this. It seems there's an inefficiency in the code somewhere. I've mirrored these results on another device, and it's rate is no different.

When I first got this app, I was excited at the prospect of being able to explore and see the current road and the number of lanes, because I'm an OSM developer, and this helps me test changes in the real world environment. With this inefficiency, I can no longer do that, because these displays disappear, as mentioned in the beginning of this thread.

@tazva
Copy link

tazva commented Nov 3, 2017

Here's some screenshots showing the user-side of the data collection. I was travelling yesterday as a passenger, and had the chance to capture these. The first one shows you the base performance of the tablet with everything but OSM+ loaded up.

screenshot_2017-11-01-14-06-46

The following are some shots taken a few seconds apart. Note the lack of street name/lane markers, which disappeared moments into loading OSM+, as the CPU load ramped up.

screenshot_2017-11-02-13-13-20

Notice with the load being so high, when OSM+ goes to automatically change zoom levels based on speed, it's unable to clearly render the map for a short amount of time, and the overlays disappear.

screenshot_2017-11-02-13-13-23
screenshot_2017-11-02-13-13-27

This lag of drawing map on the screen (somewhat) demonstrates one of the observations I make earlier in the thread, where driving at night, the screen will often flash bright white as it loads new segments of the map, but CPU load is so high, it loads them in "day" mode before "slowly re-drawing them" in night mode (which is the darker theme).

@sonora
Copy link
Member

sonora commented Nov 3, 2017

The day/night mode observation is a separate issue and should not matter here. I also occasionally observe this, as follows: Normally, when the map is panned, the background default color should be that of the mode in which the map is displayed (at least ever since v2.8.x or so), e.g. dark green for night mode, something grey/whitish for day mode. It seems that when sometimes OsmAnd switches from an app profile which uses day mode to one which uses night mode (or maybe also when the day/night mode switches based on sunrise/sunset, not sure), the panning of the night view map still appears on the gray/whitish background, producing the "flashing" appearance. Killing/re-starting the app at this time fixes it. But this issue should not be the prime root cause for the CPU usage here.

@tazva
Copy link

tazva commented Nov 3, 2017

I just presumed it may have been an offshoot, because it will sometimes take 2..5..12 seconds for the map to colorize properly, as I am travelling. In other words if I am travelling south, the bottom half of the screen will be tiles of day mode, which eventually turn dark. I just presumed the high CPU load was causing it to "take awhile".

Your description of it matches mine, it is a very good description.

@sonora
Copy link
Member

sonora commented Nov 4, 2017

To get back to the original issue: Are we quite confident the high CPU usage is

  • (1) connected to when the device is or was in motion (i.e. does not occur when the device is at rest from the start)
  • (2) connected to the street name display being enabled or disabled?

@tazva
Copy link

tazva commented Nov 7, 2017

On point (1), It absolutely occurs regardless of motion--while completely at rest.

Here's a series of tests I ran lastnight using the same methodology as before. I only plotted load this time, no speed (no motion..). Device was powered on and left abandoned for periods of time. Capture intervals for data points was 10sec. I clipped out the first 30 seconds of boot time, as that would prejudice the chart. What is seen below is the device simply at rest:

osmandplus_load_motionless

There are four tests, all of them the same except for test 3. For this particular test, I blocked the GPS from being able to receive a signal. This shows OSM doing something, even when no GPS data is being parsed. 30% load with 0/0 for satellite signal.

As to point (2), I can run the same test with the street display disabled.

@sonora
Copy link
Member

sonora commented Nov 8, 2017

Very interesting. So it seems what you see is not related to map rendering, as the map remains stationary. We must be doing something else continuously using lots of CPU.

Not sure I can reproduce the observation though: On Samsung devices, and using Samsung's built-in "Active apps" monitor, OsmAnd's CPI usage seems to strictly drop to 0.00% when OsmAnd is in the background (and the app monitor is in the foreground): When in motion after latest 3 seconds from when switching from OsmAnd to the "Active apps" app. And when performing that switch while at rest, the Active app monitor immediately shows OsmAnd using 0.00% CPU, which seems to indicate that is also the value for when OsmAnd is in the foreground.

So I cannot actually confirm the observation OsmAnd is using any CPU at all, unless

  • you are in motion and the map needs to get panned and re-rendered
  • you are in motion and in an app profile with street name display active (like our car profile by default), which seems to add extra and excessive CPU load (we currently refresh the street name lookup rather frequently every 10m of position change or so)

@tazva
Copy link

tazva commented Nov 9, 2017

This is a Samsung tablet I'm using, as I've stated before. I can also reproduce it on a Samsung Note 4 Edge, but I used the third party app to provide objective raw usage of hardware, which could then be written to a log file. I have no idea how Samsung's applet work.

Now, as promised, here's my data from point (2), where I disabled street display.

osmandplus_load_motionless_streetless

Completely motionless with street displays disabled, there appears to be no difference with the previous test (street displays enabled).

Combining these results, with the previous--particularly noting the CPU usage with GPS signal blocked--as an outside analyst, I can only conclude something in the code is burning up CPU slices in a loop, and it only gets worse when there's GPS data stream involved. That it grows significantly with higher speeds (thus, more GPS data/longer distances between points), only adds to the theory.

Again, baseline study of the device without OSM+ loaded, shows 0-4% CPU usage at most--typically 0-1%. The other 20-40% is coming from OSM+, for whatever reason. I've run a few other apps, including Nav apps, just to test. They don't appear to have the strain/drain OSM+ does. I will examine them in more detail.

@CJTmmr
Copy link
Contributor

CJTmmr commented Nov 9, 2017

I have seen the high CPU-use as well on Samsung Galaxy Camera 2 (in latest nightlies)
In my experience: after a fresh start the CPU-use stays high for a long time, even when OsmAnd is no longer on foreground.
The Street name and Lane marker are not shown in follow-me-mode.
But even when the map is on a fixed position the CPU-use stays high.
I guess the disappearing streetname is a consequence of the high CPU-use, rather than a cause.

Only after a search for address or POI is completed, the CPU-use goes back to normal...
Is it possible that at start-up some initial search-proces is started, which somehow does not end?

Good luck investigating.

@tazva
Copy link

tazva commented Nov 9, 2017

Thanks for that input CJ, I will try the POI/address search you suggested, to see if that does something.

@scaidermern
Copy link
Contributor

To the developers: Please just use a profiler. It shouldn't be too hard to identify the cause of this high CPU consumption. Fixing this bug will help a lot of your users and improve one of the main point of criticism of OsmAnd (= consuming lots of CPU / battery).

@tazva
Copy link

tazva commented Feb 12, 2018

Rounding the corner on almost a year old, I wonder how the progress is? I haven't had a chance to do any additional debugging since my last post, I've been very busy :(

I can no longer reliably use OSMand for navigation purposes due to the CPU load. A couple of times in the past month I've needed to navigate somewhere and would input the location. Inevitably I'd choose a destination, and it would take ages to calculate. Eventually it worked, but I would have to change route due to some issues, and recalculation simply took forever--and every intersection was a recalculation, so this forced it to just keep lagging and lagging. Ended up just killing it off and toggling over to google maps, it was up and running to my nav point within 3 seconds, with no issue.

I simply use OSMand for general quick-visual reference now, the CPU overhead is simply too great to do anything else with it. It still burns a hole in my hand if I use it on a more modern device, where the battery drains as quickly as pouring water from a glass.

@vshcherb
Copy link
Member

I guess here there were measurements about navigation mode without calculating route, so in that case "reverse geocoding" is happening every 50 meters which is very CPU expensive for each call. Unfortunately no progress was made in that direction

@CJTmmr
Copy link
Contributor

CJTmmr commented Mar 20, 2018

CPU load is high sometimes, even while navigating along a calculated route. And even while standing still, even when OsmAnd is running in background..... Unfortunately

@tazva
Copy link

tazva commented Apr 5, 2018

@vshcherb as @CJTmmr and some others have pointed out, it's not just in one mode, it's in every mode, whether calculating or not, whether in navigation mode, or in exploration mode. Something is clearly going on. Seeing all of the new bugs popping up, all in some way relating to 'slowdown', on brand-new multi-core very fast devices... this is pointing to something eating up processor time.

I can play HD games on my new phone and use less battery than OSM will just driving around. Yes, it is unfortunate no progress has been made to route this out, as mentioned last year, this will continue to plague OSM until fixed.

This issue was formerly tagged as a milestone event, but appears to no longer be the case. Rolling out new features is great, but shouldn't be a focus until foundational problems are resolved. Not sure why this isn't in the top 3 priorities. Just speaking from an outsider's perspective, of course.

@tazva
Copy link

tazva commented May 30, 2018

While it's great to see OSMAnd is at a whole new version, and all sorts of features are being added, it would be great to fix underlying issues. Like #3898.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Observed Needs more clarification, feedback, or research
Projects
None yet
Development

No branches or pull requests

7 participants