Skip to content

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

Closed

Description

@Tom3652

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

Activity

  1. Tom3652 commented on Dec 22, 2024

    @Tom3652
    Author

    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

  2. manoj-simform commented on Jan 8, 2025

    @manoj-simform
    Contributor

    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.

  3. Tom3652 commented on Jan 8, 2025

    @Tom3652
    Author

    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.

  4. Tom3652 commented on Jan 30, 2025

    @Tom3652
    Author

    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

  5. Tom3652 commented on Feb 13, 2025

    @Tom3652
    Author

    Hey @manoj-simform I have a new info on what is going on wrong, instead of Error 0xe it's written codec is released already:

    Fatal Exception: java.lang.IllegalStateException: codec is released already
           at android.media.MediaCodec.getBuffer(MediaCodec.java)
           at android.media.MediaCodec.getInputBuffer(MediaCodec.java:4245)
           at com.simform.audio_waveforms.WaveformExtractor$startDecode$1$1.onInputBufferAvailable(WaveformExtractor.kt:69)
           at android.media.MediaCodec$EventHandler.handleCallback(MediaCodec.java:1913)
           at android.media.MediaCodec$EventHandler.handleMessage(MediaCodec.java:1841)
           at android.os.Handler.dispatchMessage(Handler.java:106)
           at android.os.Looper.loopOnce(Looper.java:257)
           at android.os.Looper.loop(Looper.java:368)
           at android.app.ActivityThread.main(ActivityThread.java:8826)
           at java.lang.reflect.Method.invoke(Method.java)
           at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:572)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)
    
  6. changed the title [-]Android crash : Fatal Exception: android.media.MediaCodec$CodecException : onInputBufferAvailable(WaveformExtractor.kt:72)[/-] [+]Android crash : `Fatal Exception: android.media.MediaCodec$CodecException : onInputBufferAvailable(WaveformExtractor.kt:72)`[/+] on May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions