android - TimeoutException in MediaRecorder.finalize() after 10 seconds -
stacktrace0=java.util.concurrent.timeoutexception: android.media.mediarecorder.finalize() timed out after 10 seconds @ android.media.mediarecorder.native_finalize(native method) @ android.media.mediarecorder.finalize(mediarecorder.java:1200) @ java.lang.daemons$finalizerdaemon.dofinalize(daemons.java:187) @ java.lang.daemons$finalizerdaemon.run(daemons.java:170) @ java.lang.thread.run(thread.java:841) if (isdirectoryexists) { mediarecorder recorder= new mediarecorder(); recorder.reset(); recorder.setaudiosource(mediarecorder.audiosource.mic); recorder.setoutputformat(mediarecorder.outputformat.raw_amr); recorder.setaudioencoder(mediarecorder.audioencoder.amr_nb); recorder.setoutputfile(path); recorder.setmaxduration(30*60*1000); if(recorder!=null) { recorder.prepare(); } try { if(recorder!=null) { recorder.start(); isrecordingstarted=true; } } catch (illegalstateexception ilse) { try { if(recorder!=null) { recorder.prepare(); } } catch(exception e) { e.printstacktrace(); } try { if(recorder!=null) { recorder.start(); } } catch(exception e) { e.printstacktrace(); } }
}
detail : problem arrived in android 4.3 when first time exception occur when again going prepare , start media recorder. logic work in 4.0.. dont understand why exception occur.
it seems if device decide sleep, , gc decide run, happen.
see below:
sometimes (very rarely) system decide sleep in middle of gc run.
if sleep time long - on 10 seconds, concurrent.timeout exception thrown.
Comments
Post a Comment