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

Getting IllegalStateException for Xiaomi devices, works when codecNeedsSetOutputSurfaceWorkaround set to true. #5169

Closed
ankitkhare opened this issue Nov 29, 2018 · 4 comments
Assignees

Comments

@ankitkhare
Copy link

ankitkhare commented Nov 29, 2018

Issue Description

On Xiaomi devices getting IllegalStateException for XiaomiTv devices. Here is the stacktrace

E/ExoPlayerImplInternal: Internal runtime error.
    java.lang.IllegalArgumentException
        at android.media.MediaCodec.native_setSurface(Native Method)
        at android.media.MediaCodec.setOutputSurface(MediaCodec.java:1962)
        at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.setOutputSurfaceV23(MediaCodecVideoRenderer.java:1023)
        at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.setSurface(MediaCodecVideoRenderer.java:435)
        at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.handleMessage(MediaCodecVideoRenderer.java:401)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.deliverMessage(ExoPlayerImplInternal.java:958)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.sendMessageToTarget(ExoPlayerImplInternal.java:929)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.sendMessageInternal(ExoPlayerImplInternal.java:911)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:366)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:164)
        at android.os.HandlerThread.run(HandlerThread.java:65)

Steps to reproduce

  1. Play any video(in Exoplayer demo as well) and do backpress, you will get the exception.

Device Info

Decoder Name Manufacturer Model Api Level
OMX.amlogic.avc.decoder.awesome Xiaomi MiTV-AXSO0 27

Exoplayer Version

2.8.2 and above.

Worked when set the following in codecNeedsSetOutputSurfaceWorkaround

protected boolean codecNeedsSetOutputSurfaceWorkaround(String name) {
      //Xiaomi devices needs workaround
    if(name.equalsIgnoreCase("OMX.amlogic.avc.decoder.awesome")){
      return  true;
    }
}

As I can see for API 27 false is returned but this is happening on API 27.

@andrewlewis
Copy link
Collaborator

Please could you provide a full bug report (adb bugreport) taken just after seeing the exception? I think this issue shouldn't happen from API 27 because device compatibility test suites have cover the functionality we're using. @ojw28 can confirm and recommend how to proceed.

@ankitkhare
Copy link
Author

ankitkhare commented Dec 3, 2018

Here is the bug report.

bugreport-dangal-OPM1.171019.011-2018-12-03-11-41-34.zip

@ankitkhare
Copy link
Author

ankitkhare commented Dec 6, 2018

@andrewlewis @ojw28 Can you guys please have a look at this?

@ojw28
Copy link
Contributor

ojw28 commented Dec 11, 2018

I don't understand how this device passed our certification process. That said, I think we should just add the workaround. It's not particularly feasible for us to get hold of a device given it's (I think?) a physical TV.

ojw28 added a commit that referenced this issue Dec 14, 2018
Issue: #5169
PiperOrigin-RevId: 225025357
@ojw28 ojw28 closed this as completed Dec 14, 2018
ojw28 added a commit that referenced this issue Dec 19, 2018
Issue: #5169
PiperOrigin-RevId: 225025357
@google google locked and limited conversation to collaborators May 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants