ANR triggered when calling stopRecording method in AudioRecorder on Android
Hello,
I'm experiencing an ANR (Application Not Responding) issue when stopping audio recording using the AudioRecorder.stopRecording() method from the audio_waveforms plugin. This issue doesn't crash the app but causes it to freeze while waiting for a binder transaction. Below is the stack trace of the issue:
main (native):tid=1 systid=4120
#00 pc 0x9ae90 libc.so (__ioctl + 8) #01 pc 0x6932f libc.so (ioctl + 26) #02 pc 0x39a13 libbinder.so (android::IPCThreadState::talkWithDriver(bool) + 238) #03 pc 0x3a655 libbinder.so (android::IPCThreadState::waitForResponse(android::Parcel*, int*) + 32) #04 pc 0x3a42b libbinder.so (android::IPCThreadState::transact(int, unsigned int, android::Parcel const&, android::Parcel*, unsigned int) + 122) #05 pc 0x35267 libbinder.so (android::BpBinder::transact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int) + 98) #06 pc 0x34b9f libmedia.so (android::BpMediaRecorder::stop() + 126) #07 pc 0x3b7df libmedia.so (android::MediaRecorder::stop() + 58) #08 pc 0x4c56b libmedia_jni.so (android_media_MediaRecorder_stop(_JNIEnv*, _jobject*) + 106) at android.media.MediaRecorder.stop(Native method) at com.simform.audio_waveforms.AudioRecorder.stopRecording(AudioRecorder.java) at com.simform.audio_waveforms.AudioWaveformsPlugin.onMethodCall(AudioWaveformsPlugin.java) at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java) at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java) at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0(DartMessenger.java) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7815) at java.lang.reflect.Method.invoke(Native method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1094)
Steps to Reproduce:
Start audio recording using the AudioRecorder.startRecording() method. Stop the recording using the AudioRecorder.stopRecording() method. Observe that the app freezes and eventually triggers an ANR.
Additional Information:
Flutter Version: 3.19.1 Plugin Version: 1.0.5 Android Version: 11 Device: Vivo V20 SE
Hello, @duchl0202 if possible, can you please share the code where you are doing this? and please also share how many numbers of files you are extracting at the same time. Thank you
Hello @duchl0202, We are closing this issue because we don't have much information. Feel free to open a new issue or this one.