google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.74k stars 6.03k forks source link

Codec error. Specific platform. #7729

Closed Kronos0041 closed 4 years ago

Kronos0041 commented 4 years ago

[REQUIRED] Issue description

When I try to play some videos, I got some error like this issue: https://github.com/google/ExoPlayer/issues/3953

Device info

Android version: 6.0 Model: LG-K420 Firmware: CyanogenMod 12.1

Error:

E/ACodec: [OMX.MTK.VIDEO.DECODER.AVC] ERROR(0x80001005)
E/ACodec: signalError(omxError 0x80001005, internalError -2147483648)
E/MediaCodec: Codec reported err 0x80001005, actionCode 0, while in state 6
E/ExoPlayerImplInternal: Renderer error: index=0, type=video, format=Format(1, null, null, video/avc, null, -1, null, [1080, 1920, 23.999205], [-1, -1]), rendererSupport=YES
      com.google.android.exoplayer2.ExoPlaybackException: java.lang.IllegalStateException
        at com.google.android.exoplayer2.BaseRenderer.createRendererException(BaseRenderer.java:359)
        at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:735)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:599)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:329)
        at android.os.Handler.dispatchMessage(Handler.java:98)
        at android.os.Looper.loop(Looper.java:135)
        at android.os.HandlerThread.run(HandlerThread.java:61)
     Caused by: java.lang.IllegalStateException
        at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
        at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:1036)
        at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:1520)
        at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:721)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:599) 
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:329) 
        at android.os.Handler.dispatchMessage(Handler.java:98) 
        at android.os.Looper.loop(Looper.java:135) 
        at android.os.HandlerThread.run(HandlerThread.java:61) 
E/ExoPlayerImplInternal: Disable failed.
      java.lang.IllegalStateException
        at android.media.MediaCodec.native_flush(Native Method)
        at android.media.MediaCodec.flush(MediaCodec.java:665)
        at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.flushOrReleaseCodec(MediaCodecRenderer.java:777)
        at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.flushOrReleaseCodec(MediaCodecVideoRenderer.java:724)
        at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onDisabled(MediaCodecRenderer.java:636)
        at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onDisabled(MediaCodecVideoRenderer.java:569)
        at com.google.android.exoplayer2.BaseRenderer.disable(BaseRenderer.java:168)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.disableRenderer(ExoPlayerImplInternal.java:1142)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.resetInternal(ExoPlayerImplInternal.java:891)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.stopInternal(ExoPlayerImplInternal.java:850)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:382)
        at android.os.Handler.dispatchMessage(Handler.java:98)
        at android.os.Looper.loop(Looper.java:135)
        at android.os.HandlerThread.run(HandlerThread.java:61)
E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7f9fcd68c0
E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7f9fe0f620
E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7f9fe117a0
E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7f9fe118c0
E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7f9fe119e0
E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7f9fe11b00
E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7f9fe11c20
E/ExoPlayerImplInternal: Reset failed.
      java.lang.IllegalStateException
        at android.media.MediaCodec.native_stop(Native Method)
        at android.media.MediaCodec.stop(MediaCodec.java:631)
        at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.releaseCodec(MediaCodecRenderer.java:671)
        at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.releaseCodec(MediaCodecVideoRenderer.java:714)
        at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onReset(MediaCodecRenderer.java:643)
        at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onReset(MediaCodecVideoRenderer.java:578)
        at com.google.android.exoplayer2.BaseRenderer.reset(BaseRenderer.java:175)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.resetInternal(ExoPlayerImplInternal.java:900)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.stopInternal(ExoPlayerImplInternal.java:850)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:382)
        at android.os.Handler.dispatchMessage(Handler.java:98)
        at android.os.Looper.loop(Looper.java:135)
        at android.os.HandlerThread.run(HandlerThread.java:61)
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.test.liqvid.black_box, PID: 8391
    java.lang.IllegalStateException
        at com.google.android.exoplayer2.util.Assertions.checkState(Assertions.java:81)
        at com.google.android.exoplayer2.ExoPlaybackException.getSourceException(ExoPlaybackException.java:200)
        at com.test.liqvid.black_box.MainActivity$playerListener$1.onPlayerError(MainActivity.kt:235)
        at com.google.android.exoplayer2.ExoPlayerImpl$PlaybackInfoUpdate.lambda$run$2$ExoPlayerImpl$PlaybackInfoUpdate(ExoPlayerImpl.java:812)
        at com.google.android.exoplayer2.-$$Lambda$ExoPlayerImpl$PlaybackInfoUpdate$fI_Ao37C4zouOtNaX7xHdRfgmVc.invokeListener(lambda)
        at com.google.android.exoplayer2.BasePlayer$ListenerHolder.invoke(BasePlayer.java:182)
        at com.google.android.exoplayer2.ExoPlayerImpl.invokeAll(ExoPlayerImpl.java:845)
        at com.google.android.exoplayer2.ExoPlayerImpl.access$000(ExoPlayerImpl.java:43)
        at com.google.android.exoplayer2.ExoPlayerImpl$PlaybackInfoUpdate.run(ExoPlayerImpl.java:812)
        at com.google.android.exoplayer2.ExoPlayerImpl.notifyListeners(ExoPlayerImpl.java:736)
        at com.google.android.exoplayer2.ExoPlayerImpl.updatePlaybackInfo(ExoPlayerImpl.java:710)
        at com.google.android.exoplayer2.ExoPlayerImpl.handlePlaybackInfo(ExoPlayerImpl.java:652)
        at com.google.android.exoplayer2.ExoPlayerImpl.handleEvent(ExoPlayerImpl.java:595)
        at com.google.android.exoplayer2.ExoPlayerImpl$1.handleMessage(ExoPlayerImpl.java:127)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5294)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
        at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:117)
Device info

Android version: 7.1 Model: x96mini (TV box) Firmware: Custom. Like this firmware: TANIX TX3 MAX & MINI

Error:

java.lang.IllegalStateException: null
    at com.google.android.exoplayer2.util.Assertions.checkState(Assertions.java:81)
    at com.google.android.exoplayer2.ExoPlaybackException.getSourceException(ExoPlaybackException.java:200)
    at com.liqvid.android_tv.business_logic.player.controllers.PlayerController$playerListener$1.onPlayerError(PlayerController.kt:594)
    at com.google.android.exoplayer2.ExoPlayerImpl$PlaybackInfoUpdate.lambda$run$2$ExoPlayerImpl$PlaybackInfoUpdate(ExoPlayerImpl.java:812)
    at com.google.android.exoplayer2.-$$Lambda$ExoPlayerImpl$PlaybackInfoUpdate$fI_Ao37C4zouOtNaX7xHdRfgmVc.invokeListener(lambda)
    at com.google.android.exoplayer2.BasePlayer$ListenerHolder.invoke(BasePlayer.java:182)
    at com.google.android.exoplayer2.ExoPlayerImpl.invokeAll(ExoPlayerImpl.java:845)
    at com.google.android.exoplayer2.ExoPlayerImpl.access$000(ExoPlayerImpl.java:43)
    at com.google.android.exoplayer2.ExoPlayerImpl$PlaybackInfoUpdate.run(ExoPlayerImpl.java:812)
    at com.google.android.exoplayer2.ExoPlayerImpl.notifyListeners(ExoPlayerImpl.java:736)
    at com.google.android.exoplayer2.ExoPlayerImpl.updatePlaybackInfo(ExoPlayerImpl.java:710)
    at com.google.android.exoplayer2.ExoPlayerImpl.handlePlaybackInfo(ExoPlayerImpl.java:652)
    at com.google.android.exoplayer2.ExoPlayerImpl.handleEvent(ExoPlayerImpl.java:595)
    at com.google.android.exoplayer2.ExoPlayerImpl$1.handleMessage(ExoPlayerImpl.java:127)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6125)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:892)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:782)

[REQUIRED] Reproduction steps

Sample app with videos in asset folder: https://github.com/AlexandrPuryshev/exoplayer_bug

[REQUIRED] Link to test content

https://github.com/AlexandrPuryshev/exoplayer_bug/tree/master/app/src/main/assets

[REQUIRED] A full bug report captured from the device

sended to dev.exoplayer@gmail.com

[REQUIRED] Version of ExoPlayer being used

"latest" (2.11.7)

[REQUIRED] Device(s) and version(s) of Android being used

Android version: 6.0 Model: LG-K420 Firmware: CyanogenMod 12.1

Android version: 7.1 Model: x96mini (TV box) Firmware: Custom. Like this firmware: TANIX TX3 MAX & MINI

andrewlewis commented 4 years ago

The provided bug report doesn't appear to contain the MediaCodec-related logging shown here, so I can't look for any diagnostic information output before the exception was thrown. I don't think there's much we can do to help based on this.

I'd suggest you have a look at logcat output just before the exception, and also try playing the streams in the ExoPlayer demo app to see if there's any useful information to figure out what's going on. For example, the demo app will log information about what tracks are supported and you can look for NO_EXCEEDS_CAPABILITIES to check if the device just doesn't advertise support for the format.

Also, since you have CyanogenMod/custom firmware on the devices it's unclear whether the devices have actually passed Android compatibility testing, so the system image may just not be working correctly. I'd recommend reporting the problem to the Amlogic (or the originator of the system image) and Cyanogen.

Aside: I think the following part of the stack trace suggests your PlayerController listener is trying to getSourceException for a different type of exception (you need to check the type of exception -- see ExoPlaybackException's javadoc for more information):

java.lang.IllegalStateException: null
    at com.google.android.exoplayer2.util.Assertions.checkState(Assertions.java:81)
    at com.google.android.exoplayer2.ExoPlaybackException.getSourceException(ExoPlaybackException.java:200)
    at com.liqvid.android_tv.business_logic.player.controllers.PlayerController$playerListener$1.onPlayerError(PlayerController.kt:594)