-
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 in com.google.android.exoplayer2.PlayerMessage.blockUntilDelivered() #5887
Comments
The ANR information doesn't seem to reference the ExoPlayer playback thread. Were you able to reproduce the ANR yourself? Is any information about what the playback thread is doing visible in Play Console? |
Unfortunately attached stacktrace is only the information which I see in Play Console. |
Hi @andrewlewis, We have a custom MediaSource extending CompositeMediaSource and an activity with PlayerView. ExoPlayer.prepare(mediaSource) is called on Activity create. Our application works also in background. If work in prepareSourceInternal() takes a long time and phone was locked/screen off before it finished, the app will crash with ANR stacktrace in first post. |
You should ensure that |
Thanks @ojw28, that solved my problem. Summary of how I fixed this ANR in custom MediaSource:
|
Hey @Odysseos. We need more information to resolve this issue but there hasn't been an update in 14 days. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
I see this ANR in Google Play Console -> Vitals, and all I have for it is the stacktrace. What kind of information do you need and how I can get this information? |
The VM stack traces like the ones in your first comment would be helpful, but the problem is that there is no reference to 'ExoPlayerImplInternal:Handler', which is what would tell us what the playback thread is doing. Do you have any other traces visible for the same bug that do include this thread? Alternatively, if you can reproduce the issue locally, the output of |
As I said in origin message I have only stack trace from Google Play Console. And I can not reproduce this ANR "in vitro" :( BTW: now I see in Google Play Console several ANRs with the same stack traces on different devices (Sony TV, Philips TV, Xiaomi MiBox S, Xiaomi MiTV and some other devices) |
hello,I have the same problem . when call release the SimpleExoPlayer,it happens ANR on the method blockUtilDelivered() in the class of PlayerMessage. How can we resolve this problem? |
Hi, we have the same issues on many devices but we cannot reproduce the issue in our QA. `"main" tid=1 Waiting
|
ANY FIX FOR THIS ISSUE AM ALSO GETTING ON MY MOTO DEVICE |
@ojw28 how codecNeedsSetOutputSurfaceWorkaround is working?will it fix the anr issue if i specify the device?? also should i need to download the sourse of exo player and edit MediaCodecVideoRenderer.java and make as a module in my project to make it working ? As said in #6294 it now not occasional its common, please look in to this issue.if you want the anr log i can give add |
@ojw28 not caring about this issue?or you guys are working on it? |
Hello, "main" prio=5 tid=1 Waiting
The ExoPlayer thread (the one that I used to create ExoPlayer and send control messages) private void setVideoSurfaceInternal(@nullable Surface surface, boolean ownsSurface) { I would like to suggest to add a special case where the surface parameter is null (which is the case in my scenario), so that no messages will be sent or blocked. You don't need to send any messages if the surface is being destroyed, right? Thanks |
Hi, we have the same problem! Does it can be resolved? |
We are also seeing this issue with the following stacktrace:
|
we have the same problem! mark. |
Experiments showed the timeout is beneficial to avoid ANRs and we can thus enable the feature by default. Also add configuration to set the timeout if required. Issue: #5887 PiperOrigin-RevId: 335652506
We now enabled a change that times out when detaching or replacing surfaces with The underlying platform issue for this ANR is hopefully solved from Android 11, and this workaround is probably all we can do for the existing Android versions. |
@tonihei seems the above issue is in 2.12.0 for pre Android 11 devices. Any chance there is an update which can fix this issue for pre Android 11 devices? |
@harshmittal29 I don't understand the question. The Android platform fix will only be available for devices running Android 11 and above and is independent from ExoPlayer. ExoPlayer's dev branch (not 2.12.0) contains the workaround referenced above that prevents most of the ANRs for pre Android 11 devices. It will likely be part of 2.13.0. |
Thanks @tonihei . Got the answer I was looking for :). So will wait for 2.13.0 update. |
Issue description
I see ANR in Google Play Console on Xiaomi MiBox S (oneday), Android 8.1 (I use ExoPlayer r2.9.6, but this device is absent in ExoPlayer r2.10.0
MediaCodecVideoRenderer.codecNeedsSetOutputSurfaceWorkaround()
too)Reproduction steps
Unknown
Link to test content
Unknown
Version of ExoPlayer being used
r2.9.6
A full bug report captured from the device
The text was updated successfully, but these errors were encountered: