Android : `await recorderController.stop();` sometimes never completes
Describe the bug
Since i have upgraded to 2.0.1 version, i have noticed (reproductible) that for audio recordings, when i call String? path = await recorderController.stop(); i don't see the log that is right after and the wave is not generated like frozen.
This only happens on Android, iOS works fine with the same code.
To Reproduce Steps to reproduce the behavior:
- Call
.recordon Android (physical device) - Record an audio for at least 30sec - 1min
- Call
.stopas above - Print / log the path output
- See that this log is never shown
Expected behavior
The method await recorderController.stop(); should complete like on version < 2.0.x on Android
Smartphone (please complete the following information):
- Device: Motorola
- OS: Android
- Version : 11
Screenshots If applicable, add screenshots to help explain your problem.
Additional context
This is reproductible no matter the size of the recording, but i think it's easier to reproduce it when the recording is large > 30 seconds.
I have customers on my live that app that have reported they have this issue with recordings less than 5sec but not all the time. However, more than 30 seconds it's almost 100% that the .stop doesn't complete.
Note : this is not device-specific since i could reproduce it with my Motorola, but my customers have Google Pixel 7, Samsung A51 for example with various Android version (11 - 14 - 15)
Here is how we record maybe this has an impact :
recorderController?.reset();
await recorderController?.record(
path: outputPath,
recorderSettings: const RecorderSettings(
androidEncoderSettings:
AndroidEncoderSettings(androidEncoder: AndroidEncoder.aacLc),
bitRate: 48000,
sampleRate: 44100));
On Android.
Thanks for reporting this issue. We can reproduce this issue.
Hello, Do you have expected resolution date?
I have same problem
Same Issue
@ujas-m-simformsolutions kindly fix this issue it effecting much even recorder is paused and call stop(): it never return path it stuck
is there any workarounds?
i have not found any yet...
I am having same issue. Any workaround yet?
Same issue on Galaxy
Hi @DorraY! Thanks for testing PR #486 and reporting that you still hit a crash (reference).
To help me track it down, could you share-
- The full stack trace / logcat from the crash
- Steps to reproduce (recording length, whether the recorder was paused before stop, etc.)
- The code snippet you used (your record(...) settings and the stop() call)
That would help a lot in reproducing it on my end. Thanks!
i did this a long time ago but it was on Samsung Galaxy A54 5g a record duration of less than 30 seconds
i did this a long time ago but it was on Samsung Galaxy A54 5g a record duration of less than 30 seconds
@DorraY Without a stack trace, it's hard to tell if something beyond what's being addressed in the PR is causing this on your end. Could you please test once the PR gets updated by its author and let us know if it resolves the issue? Your confirmation would be really helpful!