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

Repeating single media causes the player to freeze on certain frame intermittently #3829

Closed
akurni opened this issue Feb 12, 2018 · 13 comments
Closed
Assignees

Comments

@akurni
Copy link

akurni commented Feb 12, 2018

Issue description

I tried to play one video in a loop by Setting play mode to REPEAT_MODE_ALL. After it runs for a while, it will freeze on the same frame intermittently.
MessageQueue: Handler (com.google.android.exoplayer2.upstream.Loader$ReleaseTask) {426ebbe8} sending message to a Handler on a dead thread java.lang.RuntimeException: Handler (com.google.android.exoplayer2.upstream.Loader$ReleaseTask) {426ebbe8} sending message to a Handler on a dead thread at android.os.MessageQueue.enqueueMessage(MessageQueue.java:320) at android.os.Handler.enqueueMessage(Handler.java:626) at android.os.Handler.sendMessageAtTime(Handler.java:595) at android.os.Handler.sendMessageDelayed(Handler.java:566) at android.os.Handler.sendEmptyMessageDelayed(Handler.java:530) at android.os.Handler.sendEmptyMessage(Handler.java:515) at com.google.android.exoplayer2.upstream.Loader$ReleaseTask.run(Loader.java:433) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:841)

Reproduction steps

Just set single media running from local storage and set the player mode to player.setRepeatMode(Player.REPEAT_MODE_ALL);
The player will play normally, but it will freeze after a while.

Link to test content

By email

Version of ExoPlayer being used

2.6.1

Device(s) and version(s) of Android being used

Orange Pi PC Plus Android v4.4

A full bug report captured from the device

log.txt

@tonihei
Copy link
Collaborator

tonihei commented Feb 12, 2018

I tried to reproduce your problem by leaving the test sample looping for about 10-15 minutes without noticeable problems.

  • What exactly happens when you say your playback freezes? Does it skip samples or does playback stop entirely?
  • Also, did you see this problem on this device only? Or is it reproducible on other devices as well?

The test log you sent doesn't show any suspicious entries and also the warning in your post is unrelated. (The warning may be triggered when the player is released, but should be harmless).

@tonihei tonihei self-assigned this Feb 12, 2018
@akurni
Copy link
Author

akurni commented Feb 14, 2018

The issue can only be reproduced after playing it for at least 1 day.
I haven't tried it on another device, but will let you know. I'm trying to reproduce it again and will send you the updated log. The app itself didn't crash, background service still works, the only symptom is the video freezes and usually at the same position. Will update you soon with the new log once it happens again

@akurni
Copy link
Author

akurni commented Feb 22, 2018

Here is the new bugreport when the frame freezes.

bugreport.txt

The app seems to be running normally, except the videoview. When it freezes the video stops playing and it just stuck on the same frame.

@tonihei
Copy link
Collaborator

tonihei commented Feb 22, 2018

Unfortunately, the bug report still doesn't show any obvious error. There are some minor oddities which are most likely not relevant:

  • There are 4 loader thread for ExtractorMediaPeriods. Only one of them is active, the others may not have shut down completely from previous players.
  • There are multiple activities in your app which use SimpleExoPlayerView, but there is only one player. Also unlikely to be a problem.

I'm going to try and loop your file for a longer period (more than a day) to see if I can reproduce the bug locally. I assume you load the file from storage and not from a server. Is that correct?

Also, do you know whether the player switches from state READY to state BUFFERING when the video freezes? That's difficult to tell from the bug report as there are no log entries about state changes.

@tonihei
Copy link
Collaborator

tonihei commented May 17, 2018

I played the file looping for multiple days without any problems. So I'm afraid it's almost impossible to reproduce and without further hints there is unfortunately nothing we can do about it.

Closing for now for this reason. If you have any further information that might help, feel free to reopen the issue.

@tonihei tonihei closed this as completed May 17, 2018
@akurni
Copy link
Author

akurni commented Aug 6, 2018

Just found another similar issue with the above issue, @tonihei . I'll send the content and video capture of the issue by email. Here is the bug report dump.
bugreport.txt.zip

When it freezes, the logcat shows

08-06 11:12:47.734 5281-28546/id.lumio.videoplayer I/OMXClient: Using client-side OMX mux. 08-06 11:12:47.744 5281-28547/id.lumio.videoplayer I/SoftAAC2: Reconfiguring decoder: 0->44100 Hz, 0->2 channels 08-06 11:14:18.784 5281-5281/id.lumio.videoplayer D/VideoPlayer: Currently Playing: 1944cf1658e8e25fa8645d5f9f6b2ccb4ef797ebd617804ae0b988d307a84654.mp4 08-06 11:14:19.164 5281-28562/id.lumio.videoplayer D/dalvikvm: GC_FOR_ALLOC freed 2300K, 33% free 7867K/11688K, paused 20ms, total 20ms 08-06 11:14:33.554 5281-5462/id.lumio.videoplayer W/AudioTrack: releaseBuffer() track 0x736fac38 name=s:114;n:2;f:-1 disabled due to previous underrun, restarting

I also saw some error on discontinuity.
08-03 19:39:17.904 5281-5462/id.lumio.videoplayer E/AudioTrack: Discontinuity detected [expected 1904548953, got 1904765219]

The app i'm using is just a modification of the demo video app that has a file finder built-in. So there's only single activity.

@tonihei
Copy link
Collaborator

tonihei commented Aug 24, 2018

Did you try disabling the edit list handling as suggested on #4559? If it helps, then it's probably the same issue.

@akurni
Copy link
Author

akurni commented Aug 27, 2018

Hi @tonihei,
I tried the solution, but it seems like the problem still persist.

DefaultExtractorsFactory extractorFactory = new DefaultExtractorsFactory(); extractorFactory.setMp4ExtractorFlags(Mp4Extractor.FLAG_WORKAROUND_IGNORE_EDIT_LISTS); return new ExtractorMediaSource.Factory(mediaDataSourceFactory) .setExtractorsFactory(extractorFactory) .createMediaSource(uri, mainHandler, null);

Still seeing
W/AudioTrack: releaseBuffer() track 0x76653570 name=s:115;n:1;f:-1 disabled due to previous underrun, restarting at the end of the video

@tonihei
Copy link
Collaborator

tonihei commented Aug 28, 2018

I just checked the new sample files you've sent and I can now reproduce the issue. Thanks for that!

However, the issue seems to be indeed an exact duplicate of #4559 and can be prevented by setting the FLAG_WORKAROUND_IGNORE_EDIT_LISTS flag (or by commenting out the gapless information handling as I've done in #4559).

@akurni
Copy link
Author

akurni commented Aug 30, 2018

@tonihei I tried to use the workaround and it doesn't work on the first try. I tried to change the loop mode from using player.setRepeatMode to using LoopingMediaSource and it started to work. That's what i thought. The video that used to start freezing in 5 minutes now plays for 1 day without any problem, but when I checked the next day, the video freezes.

I'll send you another video file by email to help you reproduce the problem.

Note: I still see 08-30 15:41:05.352 16479 16561 E AudioTrack: Discontinuity detected [expected 15972850620, got 15973079219] . I don't know if it's related or not. Thanks

@tonihei
Copy link
Collaborator

tonihei commented Aug 30, 2018

That's interesting. Do I understand you correctly that player.setRepeatMode and LoopingMediaSource lead to different behaviour? They both use the same underlying functionality to loop media, so I wouldn't expect a difference.

Besides that I can also see the audio track discontinuities from time to time. But they don't cause the freezing as before (the freezing usually happens when an underrun was reported).

@akurni
Copy link
Author

akurni commented Sep 6, 2018

I've done some test and it took 1.5 days to eventually freeze. It's the same video that i've sent you before.. i will send you the video sample and bug report by email

@tonihei
Copy link
Collaborator

tonihei commented Sep 6, 2018

Thanks. It's still a duplicate of #4559 I think. The file provided there shows the same effect. Freezing after some loops with edit lists. And occasional discontinuities when the FLAG_WORKAROUND_IGNORE_EDIT_LISTS is enabled. May take a look again later on.

ojw28 pushed a commit that referenced this issue Sep 12, 2018
When the stream is changed in the audio renderer, the timestamps of the
samples can no longer be expected to match the calculations in the AudioSink.

This change tracks the samples at which the stream is changed and notifies the
AudioSink of the discontinuity.

Issue:#4559
Issue:#3829

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212435859
@google google locked and limited conversation to collaborators Sep 27, 2018
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

2 participants