audio_waveforms icon indicating copy to clipboard operation
audio_waveforms copied to clipboard

Android : `await recorderController.stop();` sometimes never completes

Open Tom3652 opened this issue 10 months ago • 13 comments

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:

  1. Call .record on Android (physical device)
  2. Record an audio for at least 30sec - 1min
  3. Call .stop as above
  4. Print / log the path output
  5. 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)

Tom3652 avatar Jan 07 '26 12:01 Tom3652

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.

Tom3652 avatar Jan 07 '26 12:01 Tom3652

Thanks for reporting this issue. We can reproduce this issue.

ujas-m-simformsolutions avatar Jan 08 '26 07:01 ujas-m-simformsolutions

Hello, Do you have expected resolution date?

mostafasany avatar Jan 18 '26 13:01 mostafasany

I have same problem

GereyTatarkhanov avatar Jan 19 '26 16:01 GereyTatarkhanov

Same Issue

AmrTawfek avatar Jan 22 '26 08:01 AmrTawfek

@ujas-m-simformsolutions kindly fix this issue it effecting much even recorder is paused and call stop(): it never return path it stuck

mzubairr999 avatar Jan 22 '26 14:01 mzubairr999

is there any workarounds?

hunghuy201280 avatar Feb 03 '26 06:02 hunghuy201280

i have not found any yet...

Tom3652 avatar Feb 15 '26 15:02 Tom3652

I am having same issue. Any workaround yet?

Abaxx avatar Mar 08 '26 13:03 Abaxx

Same issue on Galaxy

DorraY avatar Apr 09 '26 09:04 DorraY

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!

lavigarg-simform avatar Jun 23 '26 13:06 lavigarg-simform

i did this a long time ago but it was on Samsung Galaxy A54 5g a record duration of less than 30 seconds

DorraY avatar Jun 23 '26 14:06 DorraY

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!

lavigarg-simform avatar Jun 24 '26 13:06 lavigarg-simform