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

I have Audio Sink Error and Playback Error after playing 30 audios on android #1095

Closed
saffizahid28 opened this issue Oct 22, 2023 · 8 comments
Assignees
Labels
1 backlog bug Something isn't working

Comments

@saffizahid28
Copy link

Which API doesn't behave as documented, and how does it misbehave?
ExoPlayer API

Minimal reproduction project
After Playing 30 audios, I encounter these errors. Although the audio files continue to play, but no there is no audible sound , and the notification widget of the player remains stuck on the previous audio. This problem is only on Android. I have tried playing on Ios it plays fine. How can I resolve this issue? I have tried different solutions but still no success. I have tried playing audios on IOS it plays fine this error is just on android. I have tried playing audios from downloads and from server both have same issue.
To Reproduce (i.e. user steps, not code)
Play songs multiple times. After 30 audios sound

Error messages

E/android.media.AudioTrack( 8248): Error code -20 when initializing AudioTrack.
E/MediaCodecAudioRenderer( 8248): Audio sink error
E/MediaCodecAudioRenderer( 8248):   com.google.android.exoplayer2.audio.AudioSink$InitializationException: AudioTrack init failed 0 Config(44100, 4, 28288) Format(null, null, null, audio/raw, null, -1, null, [-1, -1, -1.0], [1, 44100])
E/MediaCodecAudioRenderer( 8248):       at com.google.android.exoplayer2.audio.DefaultAudioSink$Configuration.buildAudioTrack(DefaultAudioSink.java:2136)
E/MediaCodecAudioRenderer( 8248):       at com.google.android.exoplayer2.audio.DefaultAudioSink.buildAudioTrack(DefaultAudioSink.java:1073)
E/MediaCodecAudioRenderer( 8248):       at com.google.android.exoplayer2.audio.DefaultAudioSink.buildAudioTrackWithRetry(DefaultAudioSink.java:1051)
E/MediaCodecAudioRenderer( 8248):       at com.google.android.exoplayer2.audio.DefaultAudioSink.initializeAudioTrack(DefaultAudioSink.java:843)
E/MediaCodecAudioRenderer( 8248):       at com.google.android.exoplayer2.audio.DefaultAudioSink.handleBuffer(DefaultAudioSink.java:929)
E/MediaCodecAudioRenderer( 8248):       at com.google.android.exoplayer2.audio.MediaCodecAudioRenderer.processOutputBuffer(MediaCodecAudioRenderer.java:709)
E/MediaCodecAudioRenderer( 8248):       at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:1889)
E/MediaCodecAudioRenderer( 8248):       at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:782)
E/MediaCodecAudioRenderer( 8248):       at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1007)
E/MediaCodecAudioRenderer( 8248):       at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:502)
E/MediaCodecAudioRenderer( 8248):       at android.os.Handler.dispatchMessage(Handler.java:102)
E/MediaCodecAudioRenderer( 8248):       at android.os.Looper.loopOnce(Looper.java:240)
E/MediaCodecAudioRenderer( 8248):       at android.os.Looper.loop(Looper.java:351)
E/MediaCodecAudioRenderer( 8248):       at android.os.HandlerThread.run(HandlerThread.java:67)
E/MediaCodecAudioRenderer( 8248):   Caused by: java.lang.UnsupportedOperationException: Cannot create AudioTrack
E/MediaCodecAudioRenderer( 8248):       at android.media.AudioTrack$Builder.build(AudioTrack.java:1390)
E/MediaCodecAudioRenderer( 8248):       at com.google.android.exoplayer2.audio.DefaultAudioSink$Configuration.createAudioTrackV29(DefaultAudioSink.java:2185)
E/MediaCodecAudioRenderer( 8248):       at com.google.android.exoplayer2.audio.DefaultAudioSink$Configuration.createAudioTrack(DefaultAudioSink.java:2163)
E/MediaCodecAudioRenderer( 8248):       at com.google.android.exoplayer2.audio.DefaultAudioSink$Configuration.buildAudioTrack(DefaultAudioSink.java:2128)
E/MediaCodecAudioRenderer( 8248):       ... 13 more
E/ExoPlayerImplInternal( 8248): Playback error
E/ExoPlayerImplInternal( 8248):   com.google.android.exoplayer2.ExoPlaybackException: MediaCodecAudioRenderer error, index=1, format=Format(null, null, null, audio/mpeg, null, -1, null, [-1, -1, -1.0], [1, 44100]), format_supported=YES
E/ExoPlayerImplInternal( 8248):       at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:578)
E/ExoPlayerImplInternal( 8248):       at android.os.Handler.dispatchMessage(Handler.java:102)
E/ExoPlayerImplInternal( 8248):       at android.os.Looper.loopOnce(Looper.java:240)
E/ExoPlayerImplInternal( 8248):       at android.os.Looper.loop(Looper.java:351)
E/ExoPlayerImplInternal( 8248):       at android.os.HandlerThread.run(HandlerThread.java:67)
E/ExoPlayerImplInternal( 8248):   Caused by: com.google.android.exoplayer2.audio.AudioSink$InitializationException: AudioTrack init failed 0 Config(44100, 4, 28288) Format(null, null, null, audio/raw, null, -1, null, [-1, -1, -1.0], [1, 44100])
E/ExoPlayerImplInternal( 8248):       at com.google.android.exoplayer2.audio.DefaultAudioSink$Configuration.buildAudioTrack(DefaultAudioSink.java:2136)
E/ExoPlayerImplInternal( 8248):       at com.google.android.exoplayer2.audio.DefaultAudioSink.buildAudioTrack(DefaultAudioSink.java:1073)
E/ExoPlayerImplInternal( 8248):       at com.google.android.exoplayer2.audio.DefaultAudioSink.buildAudioTrackWithRetry(DefaultAudioSink.java:1051)
E/ExoPlayerImplInternal( 8248):       at com.google.android.exoplayer2.audio.DefaultAudioSink.initializeAudioTrack(DefaultAudioSink.java:843)
E/ExoPlayerImplInternal( 8248):       at com.google.android.exoplayer2.audio.DefaultAudioSink.handleBuffer(DefaultAudioSink.java:929)
E/ExoPlayerImplInternal( 8248):       at com.google.android.exoplayer2.audio.MediaCodecAudioRenderer.processOutputBuffer(MediaCodecAudioRenderer.java:709)
E/ExoPlayerImplInternal( 8248):       at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:1889)
E/ExoPlayerImplInternal( 8248):       at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:782)
E/ExoPlayerImplInternal( 8248):       at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1007)
E/ExoPlayerImplInternal( 8248):       at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:502)
E/ExoPlayerImplInternal( 8248):       ... 4 more
E/ExoPlayerImplInternal( 8248):       Suppressed: com.google.android.exoplayer2.audio.AudioSink$InitializationException: AudioTrack init failed 0 Config(44100, 4, 28288) Format(null, null, null, audio/raw, null, -1, null, [-1, -1, -1.0], [1, 44100])
E/ExoPlayerImplInternal( 8248):           ... 14 more
E/ExoPlayerImplInternal( 8248):       Caused by: java.lang.UnsupportedOperationException: Cannot create AudioTrack
E/ExoPlayerImplInternal( 8248):           at android.media.AudioTrack$Builder.build(AudioTrack.java:1390)
E/ExoPlayerImplInternal( 8248):           at com.google.android.exoplayer2.audio.DefaultAudioSink$Configuration.createAudioTrackV29(DefaultAudioSink.java:2185)
E/ExoPlayerImplInternal( 8248):           at com.google.android.exoplayer2.audio.DefaultAudioSink$Configuration.createAudioTrack(DefaultAudioSink.java:2163)
E/ExoPlayerImplInternal( 8248):           at com.google.android.exoplayer2.audio.DefaultAudioSink$Configuration.buildAudioTrack(DefaultAudioSink.java:2128)
E/ExoPlayerImplInternal( 8248):           ... 13 more
E/ExoPlayerImplInternal( 8248):   Caused by: java.lang.UnsupportedOperationException: Cannot create AudioTrack
E/ExoPlayerImplInternal( 8248):       at android.media.AudioTrack$Builder.build(AudioTrack.java:1390)
E/ExoPlayerImplInternal( 8248):       at com.google.android.exoplayer2.audio.DefaultAudioSink$Configuration.createAudioTrackV29(DefaultAudioSink.java:2185)
E/ExoPlayerImplInternal( 8248):       at com.google.android.exoplayer2.audio.DefaultAudioSink$Configuration.createAudioTrack(DefaultAudioSink.java:2163)
E/ExoPlayerImplInternal( 8248):       at com.google.android.exoplayer2.audio.DefaultAudioSink$Configuration.buildAudioTrack(DefaultAudioSink.java:2128)
E/ExoPlayerImplInternal( 8248):       ... 13 more
D/MediaCodec( 8248): [0xb4000075ee75b000] setState: 7
If applicable, copy & paste error message here, within the triple quotes to preserve formatting.

Expected behavior
The audios Still play but there is no sound. and the notification widget of the player remains stuck on the previous audio.

Screenshots

Desktop (please complete the following information):

  • Mac OS: [Sonama]

Smartphone (please complete the following information):

  • Device: [Oneplus *8
  • OS: [Android 13]

Flutter SDK version
3.13.8

insert output of "flutter doctor" here
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.13.7, on macOS 14.0 23A344 darwin-arm64, locale en-PK)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.83.1)
[✓] Connected device (3 available)
[✓] Network resources

Additional context
Add any other context about the problem here.

@saffizahid28 saffizahid28 added 1 backlog bug Something isn't working labels Oct 22, 2023
@ryanheise
Copy link
Owner

Did you read the bug report submission instructions? Please read them.

@saffizahid28
Copy link
Author

Yess I did. I am stucked here from few days. I have also asked question on stackoverflow. I am stucked kindly help.

@ryanheise
Copy link
Owner

You read the instructions, and then ignored them? There was for example one point in the instructions where you were asked to provide a minimal reproduction project using one of 2 different options, and you ignored both options and wrote something else.

@saffizahid28
Copy link
Author

I could't understand how I can provide you the project. As it is a podcast app .

@ryanheise
Copy link
Owner

The instructions don't ask you to provide your app, they ask you to prepare a minimal reproduction project by first cloning this repository and making the minimal changes required to reproduce the bug.

There is also a link to the contributing guidelines on every page.

Here's a direct link:

https://github.com/ryanheise/just_audio/blob/minor/CONTRIBUTING.md

@ryanheise
Copy link
Owner

@saffizahid28 I assume that is you who posted a similar question on StackOverflow, too?

If so, can you tell me which one you intend to keep open? I don't think it is helpful to carry on this same discussion in two places, so you should decide whether you have confirmed that there is a bug that I need to fix here, or whether there is just a question that you want to ask there.

@ryanheise
Copy link
Owner

Closing as a duplicate of a StackOverflow question.

Copy link

github-actions bot commented Nov 9, 2023

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs, or use StackOverflow if you need help with just_audio.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1 backlog bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants