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
[android-5.0] fix playback getting progressively slower and memory filli... #5592
Conversation
Tested on:
Successfully fixes heavy stuttering and crashing on the Android 5.0 devices, no difference noted on the 4.4 device. This only pertains to MediaCodec based decoding, should have noted that somewhere in the commit, I guess. |
IIRC @davilla already adjusted this value for AFTV. |
Yes, tried a few different values, 20ms for example didn't work well for me. Could be that >= 1 frame is actually the magic. There's some other things I may want to look into fixing for my ADT-1, so if @davilla is also working on that, please point me at the changes he made so I'm not wasting my time... |
@davilla is no more in the team itself, we are just asking for his enlightened advice, so if you have other stuff in mind, please go on. It makes sense to wait for a picture the necessary time here, although I'd be much more comfortable not waiting more than a frame duration. |
@koying ping. This is still an issue. |
+1 |
well the PR needs some cleanup to get rid of the merge/master commits :) |
This timeout should be tied to the version of android unless you want to break older android versions. The version test is easy and quick, setup the timeout when mediacodec is created. |
PR welcome, you know best ;) |
Thinking on this PR, there's something else going on and this PR is a band-aid on it. Most likely behavior changes that Google made to MediaCodec in 5.0 to support their async callback for processing buffers. My bet is they broke something or something MediaCodec does is not quite right now. As for PRs, sorry, I don't do PRs for Kodi but you are certainly welcome to cherry-pick from Pivos fork when we push out. |
OK. Let's go with the band-aid for Helix. It's apparent that a too small timeout causes issues. |
Probably not. Asus Flo is Nexus 7. |
@Chainfire please rebase/remove the merge commits |
Clean PR here: #5891 |
That PR got deleted, sorry, new one here: #5898 |
...ng up until crash
The timeout in dequeueOutputBuffer has been increased to 50ms (from 5ms), to ensure a buffer will be available. While it appears this is not an issue on 4.4 and older, on Android 5.0 dequeueOutputBuffer with a 5ms timeout will usually fail, releaseOutputBuffer will not be called, and this will lead to most dequeueInputBuffer calls failing as well (far fewer than wanted fps calls will succeed). This in turn leads to the m_demux queue quickly filling up with the raw frame data, consuming all system memory, until a crash results.