Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When recording to a stream calling stop crashes on Android #325

Closed
bayasdev opened this issue May 27, 2024 · 4 comments
Closed

When recording to a stream calling stop crashes on Android #325

bayasdev opened this issue May 27, 2024 · 4 comments
Labels
Android bug Something isn't working

Comments

@bayasdev
Copy link

bayasdev commented May 27, 2024

Package version
record 5.1.0 and record_android 1.2.1

Environment

  • OS: [e.g. iOS/Windows/...]
  • Browser [e.g. chrome, safari]

Describe the bug

When recording audio to a stream calling stop crashes the app only on Android

I/flutter (21998): AudioRecorderService: Voice detected: false
I/flutter (21998): AudioRecorderService: Stopping recording
E/AndroidRuntime(21998): FATAL EXCEPTION: Thread-7
E/AndroidRuntime(21998): Process: com.example, PID: 21998
E/AndroidRuntime(21998): java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime(21998): 	at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:431)
E/AndroidRuntime(21998): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:272)
2
E/AndroidRuntime(21998): 	at com.llfbandit.record.methodcall.RecorderWrapper$stop$1.invoke(RecorderWrapper.kt:113)
E/AndroidRuntime(21998): 	at com.llfbandit.record.record.recorder.AudioRecorder.onStop(AudioRecorder.kt:122)
E/AndroidRuntime(21998): 	at com.llfbandit.record.record.recorder.RecordThread.updateState(RecordThread.kt:162)
E/AndroidRuntime(21998): 	at com.llfbandit.record.record.recorder.RecordThread.onEncoderStop(RecordThread.kt:65)
E/AndroidRuntime(21998): 	at com.llfbandit.record.record.encoder.PassthroughEncoder$EncodeThread.encode(PassthroughEncoder.kt:106)
E/AndroidRuntime(21998): 	at com.llfbandit.record.record.encoder.PassthroughEncoder$EncodeThread.run(PassthroughEncoder.kt:69)
I/Process (21998): Sending signal. PID: 21998 SIG: 9
Lost connection to device.

Add your record configuration RecordConfig(...)

const RecordConfig(
    encoder: AudioEncoder.pcm16bits,
    sampleRate: 16000,
    numChannels: 1,
  );

To Reproduce

Call recorder like this

final recorderStream = await _recorder.startStream(_recorderConfig);

When I stop the recorder (eg: VAD silent signal) like this

await _recorder.stop();

It crashes only on Android, iOS is working fine

Expected behavior

It should not crash on Android

Additional context

Add any other context about the problem here.

@llfbandit
Copy link
Owner

I can't reproduce it with the example project.
Can you provide a reproducer?

@llfbandit
Copy link
Owner

Version 5.1.1 has been released. It may worth a try.
Feedback welcomed!

@llfbandit llfbandit added bug Something isn't working Android labels May 30, 2024
@Roee-Tsur
Copy link

Didn't try upgrading the package but for me this happens when stop was called twice and together.

@bhargav-me
Copy link

@llfbandit - This issue is reproducible on Android devices with v5.1.1

It can be reproduced by calling start and stop in quick succession [recordings of 1s].
It generally crashes while stopping the 3rd or 4th recording.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants