Hi, Maybe buffer the sensor data in memory & writing it periodically & don't write it to SD card when 2 minute video is being recorded, ie try to synchronize writing to sdcard amongst your activity/services.
I guess some contention writing to sdcard ? I've seen video frames be dropped when other task is writing to sdcard. ANR's I've experienced for a very similar app, was my error - just forgot to put sleep/wait in a thread loop. Regards On Apr 1, 1:32 am, Edward Cunningham <[email protected]> wrote: > Hello, > > I've got an app that capture photos and video according to a schedule > (for example, takes 6 photos at 10 second intervals, and then records > 2 minutes of video, then repeats). This all seems to be fine, and when > I leave it running it will continue for hours without any problem. > > However, if I run it at the same time as another app (that runs as a > Service, logging sensor information to SD card), the scheduled camera > app will mysteriously crash at some point (anywhere between 10 mins > and a couple of hours after it starts). The problem is always the same > - a call of the stop() method of my MediaRecorder object never > completes. > > In order to debug this, I created a wrapper class to MediaRecorder to > log each call to any of the MediaRecorder methods, and so I can verify > that the MediaRecorder object is always in the correct state when this > crash occurs (ie. I'm not doing anything in the wrong order). At the > point of the crash, the log message immediately before stop() is > logged, but the one immediately afterwards isn't. Additionally, no > exceptions are thrown, and logcat shows no error messages whatsoever. > The crash only becomes evident when I press the UI and several seconds > later an Application Not Responding dialog is shown (and the > corresponding messages appear in logcat). > > From looking at logcat, I wonder whether this could perhaps be some > sort of memory problem - often before the failed call to stop(), I see > a few Davlik garbage collector messages, but I didn't think they are > normally cause for concern? > > D/dalvikvm( 481): GC_CONCURRENT freed 517K, 59% free 2793K/6663K, > external 1625K/2137K, paused 6ms+2ms > D/dalvikvm( 481): GC_CONCURRENT freed 507K, 59% free 2794K/6663K, > external 1625K/2137K, paused 7ms+2ms > D/dalvikvm( 481): GC_CONCURRENT freed 525K, 59% free 2793K/6663K, > external 1625K/2137K, paused 6ms+2ms > > I'm not sure how to proceed in identifying the source of the crash. > Can anyone suggest what might be happening, or how I could continue my > investigations? Any help would be greatly appreciated. > > Many thanks, > > Edward -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

