Locus Map - forum

Support => Troubles & Questions => Topic started by: auric on May 25, 2011, 15:30:59

Title: Tracking stops by itself
Post by: auric on May 25, 2011, 15:30:59
Version: 1.8.3ME
Android version: 2.3.3, HTC build 2.36.405.8
Device: DHD

Hi Menion,

This was reported previously, then considered solved. However, I'm experiencing the same issues as a while ago: track recording stops by itself.
A little while ago, I updated my DHD to Gingerbread. Since then, I started stress-testing Locus again and I stumbled upon the same issue as in the early days of Locus.

Concrete situation: This morning at 8:09 local time I started a recording. Then, I hit the home button to return to my home screen with Locus running on the background. It's a 20 minute drive from home to work and I kept Locus recording on arrival. During the morning, I did little to nothing with my phone before I checked on Locus around 13:30. The GPS indicator told me that GPS was active and in good reception.

When I started Locus, it started from scratch (noticed because the screen was rebuild) as though it wasn't started yet, then the notification "unfinished track detected" popped up and the "recording state" was set to "paused".

Since I noticed this in the days after the upgrade, I cleaned all error logging yesterday (there were a bunch of  them) and I checked those log files: there was one created at 12:31.
Then I checked the recording itself and it seems that it didn't record a lot since my arrival at work, which could be due to my settings (not recording when new point is no 3m from previous recorded point, no recording when accuracy is lower then 15m).
Then I checked the NMEA file, which is recorded on track record, the last entry was saved at 9:20

During the recording, I was inside the building all the time, mostly next to a large window which means that I did have full GPS reception, I did however move some times so that GPS reception was sometimes lost.
At 9:20 I was still at my desk next to the window and what's more: yesterday I had a 150km car trip on which recording was stopped as well after about two hours of recording and while having a constant reception.

Included there's the error log from today - which is quiet unreadable due to obfuscation :-)  - which I hope can clarify things to you. It is created the moment that I opened Locus again to check for the current recording state.


After I noticed recording was stopped, I restarted recording (around 13:31) and checked again at 14:30. The same happened: Locus had to re-open and rebuild all over again and a new error log was created (included as well). No extra points were recorded, which could be because of my settings of course but I'm not sure because in the NMEA file there was no new entry either: the last entry was still the one of 9:20 and there was no new entry created for the recording (re-)started at 13:30

So, I'm detecting a couple of problems here:

Please note: when starting a recording, stop recording after a little pause, restart recording after a little pause... both normal tracking as well as NMEA tracking work as expected!
Title: Re: Tracking stops by itself
Post by: daubor on May 25, 2011, 22:04:11
Same here!
Tried to record a car-trip. After finishing it, i checked locus and it said that it detects an unfinished recording :( -> recording was stopped in the middle! No logs at this point of time.
GPS should be there as well!
Locus was in the background and screen was off.

I will check this in different environments...because i have some additional apps running.
-JuiceDefender
-Tasker
Maybe there is some influence between them!
Title: Re: Tracking stops by itself
Post by: Menion on May 26, 2011, 05:49:44
aren't these two killing running services? check it because when they kill recording, notification will remain but record stops ...
Title: Re: Tracking stops by itself
Post by: durian on May 26, 2011, 06:54:28
I had the same experience yesterday evenning. Had logging on the whole time in the train, while I was watching a Doctor Who episode. The tracking had stopped and Locus had disappeared. Train journey is about an hour.

I assumed it was the system who killed them (I don't have anything special running, but I though Android killed processes as well?).

I also had the logging on in the morning, without watching a movie, and then it worked OK.

-peter
Title: Re: Tracking stops by itself
Post by: daubor on May 26, 2011, 08:27:46
Quote from: "menion"aren't these two killing running services? check it because when they kill recording, notification will remain but record stops ...
No, JuiceDefender is capable of enabling/disabling e.g. wifi/radio/... but not gps!!
Tasker is able to kill apps, but it's not configured to do this!

This morning i did a background recording again!
Everything was fine.
Even a short gps lost was no problem.
Title: Re: Tracking stops by itself
Post by: auric on May 26, 2011, 12:55:50
Quote from: "menion"aren't these two killing running services? check it because when they kill recording, notification will remain but record stops ...
As for me, I don't have any process killer installed.
Title: Re: Tracking stops by itself
Post by: fencepost on May 26, 2011, 15:28:21
I'm having a similar problem.  Running Locus Pro on a rooted Motorola Droid.  No app killers on my phone.
Title: Re: Tracking stops by itself
Post by: Menion on May 27, 2011, 17:43:06
hmm so today I finally tested locus in terrain and I had after cca hour (2700 points recorded) same issue. When I came home, I watched logs in phone and no error, no memory problem. Only message:
  Scheduling restart of service TrackRecording ...
  Scheduling restart of service GpsConnection ...

So it looks like system killed both my services for unknown reason (I was listening music only) and problem was mainly that these services do not restart itself correctly, so when they are killed, they will remain killed ...

Solution probably would be, fix this and allow correct restarting of services. If this will be fixed, there should be only few seconds space (it takes around 5sec before restart is called) in recording. Sounds good right? I'll look at is soon ...
Title: Re: Tracking stops by itself
Post by: auric on May 28, 2011, 13:42:57
That looks good indeed. 5 seconds of missing tracks is not so bad.
Its strange however that services are killed, even when not under extreme memory usage...

Just for your information, although I'm sure you already know this: on Android Developers there's an interesting paragraph on Process Lifecycle (//http://developer.android.com/reference/android/app/Service.html#ProcessLifecycle) that says:
A started service can use the startForeground(int, Notification) API to put the service in a foreground state, where the system considers it to be something the user is actively aware of and thus not a candidate for killing when low on memory. (It is still theoretically possible for the service to be killed under extreme memory pressure from the current foreground application, but in practice this should not be a concern.)
[/list]
I haven't created a service myself yet, but it might be a thought? :-)
Title: Re: Tracking stops by itself
Post by: auric on May 28, 2011, 14:13:07
I don't know if this has its effect on the MyTracks recording as well.
I've been thinking about creating a new bugreport for this, but I have a feeling that this could be related, so I'm posting it here.

If I use the (less preferred) MyTracks method to record a track, this is what I see (although further testing is required since I don't fully understand what's happening)
I started the tracking at 9:10 local time and didn't touch my phone until 10:07. The MyTracks tracking icon wasn't there and neither was the GPS signal indicator. I opened Locus (it started from scratch) and showed me that recording was stopped. So I started it again.

At that point, 10:07:04, there's a log file created:
----------  May 28, 2011 10:07:04 AM  ----------
TAG:MyTracks
MSG:onServiceConnected()
TRACE:java.lang.IllegalStateException: A track is already in progress!
at android.os.Parcel.readException(Parcel.java:1330)
at android.os.Parcel.readException(Parcel.java:1276)
at com.google.android.apps.mytracks.a.a.a(L:171)
at menion.android.locus.core.a.b.a.onServiceConnected(L:123)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1098)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1115)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4196)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)

Indeed, when I stop the recording, I can see that there's just one file.
However, tracking stopped at 9:54:37 (maybe because I entered a building by then) and restarted at 10:07:59 (same trackfile)

As said, maybe this is because of the same issue.
And although I hope the Locus tracking is reliable soon (so that I can use that again  :D ), you might want to know about this one as well :-)
Title: Re: Tracking stops by itself
Post by: rijackson741 on May 29, 2011, 00:47:49
The same thing happened to me today. I have no app killer installed, and was not running anything that would use a lot of resources. I didn't even put Locus into the background, just turned the screen off. I turned the screen back on several times, and it looked fine, then at one point I tuned it on, and Locus was not there any more. And of course it had stopped recording. You seem to have figured out what the problem is, but in case it helps I have attached the error log. I notice that it is quite different to the one Auric posted.

As another note, I have also recently upgraded to Gingerbread.
Title: Re: Tracking stops by itself
Post by: Menion on May 30, 2011, 15:23:35
fine, version for test is on forum ...
Title: Re: Tracking stops by itself
Post by: auric on May 30, 2011, 21:06:49
I'm excited. Current results are very promising.
Started the recording at 17:03:04 and my trip must have ended around 17:20 local time.
I didn't stop the recording, kept Locus in the background and used my phone minimally.

At 20:10 I opened Locus and paused the recording. It was only then that it appeared to me that Locus itself was still up and running! The track was complete, but of course, it was only 20 minutes of recording.
Then, I checked the NMEA file and the last entry was at 20:10:51!
Ten minutes later, I restarted recording, one minute later I paused it again and checked the NMEA log. The entries were added to the log.

Now I'm pausing it and I'm planning to restart it tomorrow morning.
Good job!

Oh, and I have the impression that Locus is much more battery efficient now. So I'm twice as happy :-)
Title: Re: Tracking stops by itself
Post by: rijackson741 on May 31, 2011, 04:50:37
10 hours, and it's still recording. I'll leave it recording overnight (although it's obviously not going to move, so it will not add any points until I get up tomorrow!).
Title: Re: Tracking stops by itself
Post by: Menion on May 31, 2011, 06:05:14
hmm I tested it over night and seems that recording works fine but GPS was turned of during night :) damn ... so still some "mistake" somewhere ...
Title: Re: Tracking stops by itself
Post by: auric on May 31, 2011, 08:47:16
Everything's still fine here. Of course, I paused recording during the night, so GPS was inactive anyway.
Today, I'm going to keep it recording all day, let's see what's happening.
Title: Re: Tracking stops by itself
Post by: auric on May 31, 2011, 09:08:10
Just saying: recording was still running, Locus was still up and running.

I killed it  :twisted:

But the result was not as I expected it. It seems that the build in application manager in 2.3.3 kills everything, so the services were killed as well: Locus gone, "Track record" notification icon gone, GPS signal gone.
Damn :-)
So I relaunched Locus: Track Recording icon re-appeared, recording was paused. I restarted recording and now I'm not touching it before this evening...
Title: Re: Tracking stops by itself
Post by: rijackson741 on May 31, 2011, 14:06:29
Mine is still running OK. GPS is still on, it's still recording. Now more than 19 hours (although only 137 points). I have done a few other things to stress it a little (played a couple of games, etc), but nothing extreme. I'll continue to leave it recording, but if it hasn't crapped out by now I doubt it's going to.
Title: Re: Tracking stops by itself
Post by: rijackson741 on May 31, 2011, 19:52:43
It looks like I finally manged to break it.

I went for a walk (during which I inserted a few waypoints, just for testing), then went to the supermarket. When in the supermarket I know it lost the GPS signal, because I checked. When I came out it picked it up again and continued recording though, so no problems to that point. By the time I got home it had been recording for over 24 hours (and by then about 1100 points) with no problems. So I decided to try a couple of other things. I launched GPS Status to see if that would screw anything up. That's not the GPS status screen in Locus, but a separate app. It found the satellites OK, so I exited and checked Locus. Still recording! Next I went into the GPS status screen in Locus. It showed no satellites. Is it supposed to work when recording is on? Then I hit the three +'s at the top right, one after the other, each time backing out of the settings and back to Locus. Still "No Satellites", so I backed out of that screen. Now Locus is not recording! The status still shows recording (my notification bar shows recording, and the recording icon is gray, not black), but if I move around Locus doesn't do anything. It doesn't even know I have moved! I have left it in this hung state for now, in case you read this and want me to try something. If you do, just let me know what to do.
Title: Re: Tracking stops by itself
Post by: rijackson741 on May 31, 2011, 20:04:25
An update

I checked the phone settings, and the GPS was on. So then I went back into GPS Status (the separate app). The previous time it found the satellites almost immediately, but this time it took a minute or so, as though the GPS had only just been turned on. So I went back into Locus, and now it's working fine again! It has restarted recording as though nothing happened. I then repeated my experiment with the GPS status screen in Locus, and no problems there either. It showed the satellites, and after going into the settings and back out again, then backing out of the GPS status screen, Locus is still recording.

Weird. I'll see if I can reproduce it later.
Title: Re: Tracking stops by itself
Post by: Menion on May 31, 2011, 20:05:00
hi, interesting :) I'll try your moves too. In logs there will probably not be any problem. Thanks for info. So I have to go tomorrow afternoon to some shoping and then I have to play with phone before going to bed :D
Title: Re: Tracking stops by itself
Post by: auric on May 31, 2011, 20:44:44
As for me, 74km, 3120 points, 11h and 45m recording, 13MB NMEA file. Not a single problem, so I'm extremely satisfied.
Didn't go to the supermarket though ;-)

No, really, I didn't check using GPS status or the satellites status in Locus, will do that tomorrow.

However, this is a major improvement!
Title: Re: Tracking stops by itself
Post by: rijackson741 on May 31, 2011, 21:06:50
To avoid any confusion, this is the app I'm talking about:

//https://market.android.com/details?id=com.eclipsim.gpsstatus2&feature=search_result
Title: Re: Tracking stops by itself
Post by: rijackson741 on June 01, 2011, 00:19:44
I can't reproduce that problem. I have tried several times, but Locus always shows me the satellites and then keeps on recording. Maybe it lost the GPS fix for some reason and I just wasn't patient enough. I waked around for what seemed like a long time with no response from Locus, but maybe it seemed longer than it really was. Maybe it was my brain that hung up, not Locus :D

Over 29 hours now, and it's still recording. Personally, I think you fixed it  :)
Title: Re: Tracking stops by itself
Post by: rijackson741 on June 01, 2011, 15:56:07
I just shut it down. The total recording time was over 45 hours, with only the one incident, that I now think was probably a non-incident.
Title: Re: Tracking stops by itself
Post by: Menion on June 01, 2011, 15:58:39
OK, 45 hours is pretty nice number :) I'll release it with actual state and if there will be some troubles, I'll still be working on it. But looks promising. Thank you for excellent testing!! :)
Title: Re: Tracking stops by itself
Post by: auric on June 01, 2011, 21:22:01
Quote from: "rijackson741"To avoid any confusion, this is the app I'm talking about:

//https://market.android.com/details?id=com.eclipsim.gpsstatus2&feature=search_result

I know :-)
Tried several times with gps status, no interference...

I had only 23h 12m recording, a full track recording and a 46MB NMEA file, but Locus is just fine, not a single problem.

Quote from: "menion"OK, 45 hours is pretty nice number :) I'll release it with actual state and if there will be some troubles, I'll still be working on it. But looks promising. Thank you for excellent testing!! :)

Thanks for following this up so quickly (as always ;) )
Title: Re: Tracking stops by itself
Post by: elmuSSo on June 02, 2011, 13:40:45
I just want to say, I had this error a few times, so its good that you are aware of it. The additional thing I found is: when you click to continue the recording, the blue arrow icon disappears. So the track is being logged, but there is no "head".