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

Android crash : Fatal Exception: android.media.MediaCodec$CodecException : onInputBufferAvailable(WaveformExtractor.kt:72) #376

Open
Tom3652 opened this issue Dec 7, 2024 · 4 comments

Comments

@Tom3652
Copy link

Tom3652 commented Dec 7, 2024

Describe the bug

I have got another crash different from #375 also from my live Android users :

 Fatal Exception: android.media.MediaCodec$CodecException: Error 0xe
       at android.media.MediaCodec.native_queueInputBuffer(MediaCodec.java)
       at android.media.MediaCodec.queueInputBuffer(MediaCodec.java:2672)
       at com.simform.audio_waveforms.WaveformExtractor$startDecode$1$1.onInputBufferAvailable(WaveformExtractor.kt:72)
       at android.media.MediaCodec$EventHandler.handleCallback(MediaCodec.java:1824)
       at android.media.MediaCodec$EventHandler.handleMessage(MediaCodec.java:1752)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:204)
       at android.os.Looper.loop(Looper.java:291)
       at android.app.ActivityThread.main(ActivityThread.java:8155)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:601)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1136)

To Reproduce
I am not able to reproduce it on my end, i have never encountered it and don't know how my users got it unfortunately..

Expected behavior
The app should not crash

Smartphone (please complete the following information):

  • Device: Infinix HOT 40 Pro
  • OS: Android 13

Screenshots

Additional context

@Tom3652
Copy link
Author

Tom3652 commented Dec 22, 2024

I have new phones to add, i thought it was device specific but no unfortunately :

  • Realme C53 : Android 14
  • Itel RS4 : Android 13

It causes so far 20+ crashes, much less than #375 which has more than 100 crashes in my app so far

@manoj-simform
Copy link
Collaborator

Hello @Tom3652, Could you please specify the types of files users are allowed to pick or the format in which audio is being recorded for android users? I believe this information will help in further investigating the crash.

@Tom3652
Copy link
Author

Tom3652 commented Jan 8, 2025

Hello @manoj-simform , yes sure here is the code for the recorder and it's saved as an .mp4 file :

recorderController = RecorderController()
        ..androidEncoder = AndroidEncoder.aac
        ..androidOutputFormat = AndroidOutputFormat.mpeg4
        ..iosEncoder = IosEncoder.kAudioFormatMPEG4AAC
        ..sampleRate = 44100
        ..bitRate = 48000;
        
String outputPath = "${dir!.path}/${DateTime.now().millisecondsSinceEpoch}.mp4";
recorderController?.reset();
await recorderController?.record(path: outputPath);

After that, we upload that .mp4 to our serveur.

When they read the file, it's from the server URL so we download it first locally as .mp4 file and read it.
The file read on Android may come from an iOS recording if that helps.

@Tom3652
Copy link
Author

Tom3652 commented Jan 30, 2025

hi @manoj-simform, do you have any lead on this crash ?
i keep having multiple occurrences on my live app also on flutter: 3.27.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants