-
Notifications
You must be signed in to change notification settings - Fork 6k
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
ANR on speficic devices when SurfaceView Visibility is set to GONE since version 2.5.0 #3724
Comments
Thanks for the detailed report. Could you try hardcoding |
As an aside, it's generally less error prone to have the |
I got hold of a device. It looks like hardcoding
|
As always, thanks for the quick response and detailed information for a fix. 👍 |
Also got this ANR after update ExoPlayer.
|
Another thing I just mentioned is, it doesn't seem to be a problem if the SurfaceView is wrapped in a layout and the visibility is set on the layout. As long as the SurfaceView stays untouched it's fine. |
Also disable use of dummy surface for devices that require the workaround. It's only useful in the case that we can use setOutputSurfaceWorkaround, so if it's disabled the dummy surface has no purpose (it actually makes things worse by consuming past the key-frame prior to the current position, which doesn't happen if you have no surface at all). Issue: #3724 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=182750068
This should be fixed for the P8 Lite in the |
@ojw28 We integrated today the |
Issue: #3724 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=185548632
Issue: #3724 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=185548632
Issue description
We recently updated the ExoPlayer version in our app from 2.4.0 to 2.6.1. After that we got a lot of ANR reports in the developer console, mostly from the Huawei P8 Lite.
This is important, on most devices the error doesn't occur, but on this and a couple others it happens every time you try to set up the player.
When setting up the player, the stream starts running (you can hear the sound) but the video is not being rendered. (The first frame is shown but stuck) As soon as there is an attempt to interact, the ANR is triggered and the app does not respond anymore.
After a lot of time spent investigating the problem (sorry for the whining but it was painful 😄 ) we found out that setting the visibility of the
SurfaceView
during the loading time of the player is causing the problem. (TextureView is fine, happening only withSurfaceView
)We tracked it down, the ANR happens since ExoPlayer Version 2.5.0 and ever since. Before that (until 2.4.4) it is not a problem.
We set the visibility to show some loading screen stuff as long as the stream needs to load. We can probably work around that but I thought it would be interesting to know what is causing the problem. Especially since it's only happening for special devices.
Reproduction steps
We could reproduce the problem on a slightly modified version of the demo app. Here is a fork of the ExoPlayer project with the necessary changes. We didn't release the player here in onPause because we reuse the instance in our app to show different streams.
https://github.com/ba-a/ExoPlayer
The commit with the changes:
ba-a@56af4de
To reproduce:
-> ANR Huawei P8 Lite
Version of ExoPlayer being used
ExoPlayer 2.5.0 or higher also tried out 2.6.0 and 2.6.1
Device(s) and version(s) of Android being used
Huawei P8 Lite
Android 6
A full bug report captured from the device
Here is traces log from the device. The player gets stuck in
ExoPlayerImplInternal.blockingSendMessages
I guess waiting for a message that is never delivered.
ANR Huawei P8 Lite traces.txt
If you need any more input just let me know.
Best regards
The text was updated successfully, but these errors were encountered: