Locus Map - forum

Support => Troubles & Questions => Topic started by: joeloc on December 15, 2011, 20:15:29

Title: CPU usage while track recording
Post by: joeloc on December 15, 2011, 20:15:29
Something seems a bit bogus with Locus cpu usage while track recording.

My Galaxy Note stays mostly at 1400MhZ (dual core). Surely thats not really needed for simply storing away points from the GPS? Screen was OFF during measurements, but that didnt really change a thing.

GPS ON, Track Recording ON, Moving -> 1400MHZ

GPS ON, Track Recording OFF, Resting -> 200MHZ

GPS ON, Track Recording ON, Resting -> 1400MHZ

The last measurement is especially strange since Locus didnt have to store away any points then.

I can do more tests if required, but maybe you have some idea what's going on already? In the end, it would be nice if simple "track logger usage" (screen off and track recording on) would keep the processor at its slowest setting.
Title: Re: CPU usage while track recording
Post by: Menion on December 15, 2011, 20:28:18
hmm this is weird. Low CPU usage is for sure my main priority during track recording. When screen is off, then CPU usage should be really very very low, because no draw methods are used. I'll check it also, but for now ... no idea how this can happen
Title: Re: CPU usage while track recording
Post by: joeloc on December 15, 2011, 20:44:43
could of course be my methods of measuring... no idea. i used cpuspy and have locus sit quietly on the window for ten minutes with track recording on. 7:30 mins were spent at 1400MHZ and 2:20 mins at 200MHZ.
Title: Re: CPU usage while track recording
Post by: zailor on December 15, 2011, 22:16:27
ok i have not measured the cpu rate BUT  i know that my  htc wildfire don't like track recording ;-)
I use Locus a lot with my sailingboat AND i really want to use track recording.
So thats way I save tracks every 20 min and start a new one.
Very importent to uncheck the old one !!
If I not do like this, the zoomfunction get slower and slower ( and of course other funtions to )
Ok, i blame my "tired" wildfire and wait for my Samsung Galaxy S2 ;-)
BUT I think this "test" with the wildfire tell us something !? ( high cpu usage at track recording )
Sooooo if this is some kind of bug ???? I perhapes don't need to buy a Samsung ;-(
/zailor
Title: Re: CPU usage while track recording
Post by: berkley on December 16, 2011, 07:04:32
It is not only about CPU rate, it is also about RAM usage.

So please check, if you can use the settings for track recording. You definatly don't need to record every second and every moved meter. Just as an example. There is also an option - don't remember how it is called right now - to reduce the recorded points which are shown on the map. Limited points on the map needs less calculation which means lower CPU and RAM usage.

Cheers
Title: Re: CPU usage while track recording
Post by: joeloc on December 16, 2011, 08:29:36
I made a direct comparison of Locus vs Oruxmaps, track recording on, screen off, comparable settings, phone sitting quietly on window for ten minutes. Locus spent about 70% of time at 1400MHZ, Oruxmaps only 20%. Something still seems fishy :-).

Measuring was done with cpuspy. Of course there can be a million reasons for this, not neccessarily being Locus fault. Some code paths might work better with some schedulers than others. Android is a complex beast.
Title: Re: CPU usage while track recording
Post by: Menion on December 16, 2011, 16:10:17
hmm,
  I did some more updates to drawing system of whole locus. So ... may you test cpuspy on testing version? Because I tried it and (nice program anyway) if showed me most time in 200MHz part ... and only around 10% in 1200 :) ... so improvements did more then I expect :) or I have some different settings compare to yours ... thanks
Title: Re: CPU usage while track recording
Post by: joeloc on December 16, 2011, 16:32:06
sorry, still the same cpu usage with latest test version. about 70% on 1400mhz when track recording is on. screen off, phone sits quietly on window, gps fix acquired. system settings / location / use sensor aiding is disabled btw for these tests, otherwise android would simply turn the gps off after a while.

exact same test but with track recording OFF: only 5% at 1400 and 90% at 200MHZ!!

Maybe it has to do with the track recording message in notification area? Is it accidently updated too often? Or something on locus screen? Although the screen is off... I have no clue :)
Title: Re: CPU usage while track recording
Post by: Menion on December 16, 2011, 17:09:50
hmm this is weird. Do you know testing feature in locus that use NMEA messages? When you store during GPS on, NMEA messages to file and then put this file to cache/nmea, you'll able to turn on GPS - faked GPS, where source come from this NMEA data. Quite useful for some navigation and track recording testing. With this, I have after 20 mins of recording 12% on 1200MHz, 30% 800, 43 on 200MHz and some between ... hmm

about notification. I already discovered that this notification take really a lot of power. That's the reason why updating of notification is completely disabled
Title: Re: CPU usage while track recording
Post by: joeloc on December 16, 2011, 17:35:57
nmea recording was off during my tests. i only tested real gps data logging.

do you write other files while track recording? my locus dir is on sdcard/external_sd, maybe the external microsd makes a difference? although, since the phone was sitting quietly on the window, there were only very few points recorded. maybe five total.

but seriously... this result can have a million reasons. maybe it's only on my ROM or on galaxy notes or whatever. maybe you wait for other cpuspy reports from other people before wasting more time on this :-)
Title: Re: CPU usage while track recording
Post by: joeloc on December 16, 2011, 19:29:50
I just managed to get the 1400MHZ rate down to 1%, remaining usage is 200MHZ 60% and 500MHZ (20%) on track recording?

How? The tool "Antutu CPU Master Pro" allows to change the cpu frequency scaling algorithm. Android default on 2.3.6 is something called "ondemand" which goes up to Fullspeed rather quickly (probably after a few microsecs) when something is happening.

The setting "conservative" scales up a bit slower... probably slow enough so it is not triggered by simply reading data from gps driver every now and then. Result is very low cpu clock speed during track logging. Disadvantage could be a slightly larger lag when using the phone, although I didnt notice anything yet.

The pay version of Antutu CPU Master Pro would for example allow to set the scaling to "conservative" automatically only when screen is off.
Title: Re: CPU usage while track recording
Post by: joeloc on December 16, 2011, 20:27:45
HOWEVER... even with the conservative schedule governor, there is still a big difference in cpu usage depending on which map is enabled in Locus:

map "blank": 200MHZ almost 80%, 500MHZ 20%
mapsforge vector map: 200MHZ 30%, 500MHZ 70%(!)

certainly, the type of map should not make any difference at all when the screen is off?! something is bogus and locus still seems to call some rendering code, even if nothing needs to be rendered.
Title: Re: CPU usage while track recording
Post by: Menion on December 16, 2011, 22:08:35
hmm this is really weird because "not needed" redraw is one of improved things in testing version! When screen is OFF, there shouldn't be any of such tasks ... I'll check it tomorrow. And about difference of maps ... MapsForge maps need really a lot of CPU. I'm wondering that there is only 70% of 500MHz and not a more!!
Title: Re: CPU usage while track recording
Post by: joeloc on December 17, 2011, 11:04:42
I was just wondering... maybe there's a difference if Locus is minimized by home-key or if the screen is simply turned off while Locus was active?
Title: Re: CPU usage while track recording
Post by: Menion on December 20, 2011, 12:59:30
hmm weird, test with latest version ... here is settings viewtopic.php?f=10&t=1440#p8577 (http://forum.asamm.cz/viewtopic.php?f=10&t=1440#p8577) and below is result from cpuspy

[attachment=0:2ngfnk2s]shot_Dec_20_2011_0.png[/attachment:2ngfnk2s]

quite nice result I think. Also for almost whole time was running music. Battery consumption around 28% for that time ...
Title: Re: CPU usage while track recording
Post by: joeloc on December 21, 2011, 14:00:17
Did you also test battery usage while trackrecording when
a) mapsforge map is sued
b) blank map is used

imho there should be no difference at all (!) when the screen is off. Yet my tests showed case a) to use a lot more cpu.
Title: Re: CPU usage while track recording
Post by: Menion on December 21, 2011, 14:20:23
I'm using mainly vector maps in terrain so the stats reflect using of vector maps also. There was maybe issue on version before 1.15.x, but latest, should work correctly in this way. You may also try ...
Title: Re: CPU usage while track recording
Post by: joeloc on December 21, 2011, 15:24:38
locus 1.15.2.5

sorry, but imho this is still very wrong. why does the chosen map make a difference when the screen is off? are you absolutely sure that you arent calling pointless mapsforge functions when the screen is off?

blank map, track recording with screen off, cpu at 200mhz. FINE.
[attachment=0:1yw0l8ts]blankmap.png[/attachment:1yw0l8ts]

mapsforge, track recording with screen off, cpu all over the range. WRONG.
[attachment=1:1yw0l8ts]mapsforge.png[/attachment:1yw0l8ts]
Title: Re: CPU usage while track recording
Post by: Menion on December 21, 2011, 20:08:13
hmm quite interesting. Before your test, I should for sure say, that I'm sure :), anyway I'll check it again because there should not be any difference ... may you just for my curiosity, try this also with any offline map? Thanks ....
Title: Re: CPU usage while track recording
Post by: joeloc on December 21, 2011, 21:07:04
with rmap, it looks good. just like blank map.
Title: Re: CPU usage while track recording
Post by: joeloc on December 21, 2011, 21:15:26
... and now it looks good with mapsforge as well!

grmpf. maybe you should just ignore me :/
Title: Re: CPU usage while track recording
Post by: Menion on December 21, 2011, 21:22:33
hmm, this is similar like issue that I was discuss with rijackson here viewtopic.php?f=10&t=1440 (http://forum.asamm.cz/viewtopic.php?f=10&t=1440) ... it's not your problem but have to be some issue in Locus. If you discover some specific issue with some settings, tell me for sure ...
Title: Re: CPU usage while track recording
Post by: joeloc on December 21, 2011, 21:33:33
could it be related to the compass maybe? and auto-rotation of map? maybe that is called when screen is off?

anyway,  i cant really reproduce the problem at the moment. so better wor on something else :-).
Title: Re: CPU usage while track recording
Post by: Menion on December 21, 2011, 21:37:02
nono, in moment you turn off screen or screen that need compass goes away, compass is also disabled. Really, in locus is very lot of features that helps keep CPU and battery usage as low as possible. Anyway in every system are mistakes, so ...