google / ExoPlayer

An extensible media player for Android
Apache License 2.0
21.64k stars 6k forks source link

Video freezes and audio continues to play on ABR switch, reproducible on Skyworth Android(10) STB, Amlogic S905X2 #10369

Closed luckygoyal-bitmovin closed 2 years ago

luckygoyal-bitmovin commented 2 years ago

ExoPlayer Version

2.16.1

Devices that reproduce the issue

Skyworth Digital Android STB running Android 10 and using Amlogic S905X2 chipset

Devices that do not reproduce the issue

Issue did not occur on tested Android Mobile devices(Samsung S21, OnePlus AC 2003) etc.

Reproducible in the demo app?

Yes

Reproduction steps

Expected result

Actual result

Media

Will send media details to dev.exoplayer@gmail.com

Bug Report

luckygoyal-bitmovin commented 2 years ago

Hi Exoplayer team, I have sent the bugreport and stream information over email. The issue is also reproducible on latest Exoplayer release-v2 branch. The issue is also reproducible with clear stream decoded using non-secure decoder OMX.amlogic.hevc.decoder.awesome2 instead of OMX.amlogic.hevc.decoder.awesome2.secure which is used for encrypted content.

I understand it may not be possible to reproduce the issue if you do not have the specific STB Model (or any Amlogic S905X2 STB device), in which case any debug steps to isolate the problem to player/decoder/stream will be really helpful.

luckygoyal-bitmovin commented 2 years ago

Hi Exo team, any feedback on this ticket please?

gb103 commented 2 years ago

Any resolution on this, am also facing the same issue. My exoplayer version is 2.15.1

christosts commented 2 years ago

This sounds like a device-specific problem but let's try to strike out some other possibilities first.

On the email we received, the test content is protected with Widevine and the bug-report has some CDM errors logged by the platform as soon as playback starts (not after an adaptive switch). You also mentioned that the issue reproduces with clear content, so it's not related to DRM. Can you please send us a link to the clear content and a bug-report after the issue reproduces with the clear content?

You also mentioned that the issue reproduces with 2.16.1 and the latest ExoPlayer release-v2 branch (I assume that's 2.18.0?). Did this content ever work on this device with an ExoPlayer version before 2.16.1?

You also mention

Video back buffer continues to grow over time and leads to playback failure eventually.

I did not see a related error on the bug-report. Did you see a player error reported by the player about this?

luckygoyal-bitmovin commented 2 years ago

Hi @christosts , thanks for checking this issue. We have made some progress on analysis of this issue since reporting it and have a hypothesis. I am sharing it below to get a feedback and hopefully any further direction from Exo team.

hevc_ref_frames_config

We are now checking this with STB provider. But would be really helpful to have your feedback on same.

christosts commented 2 years ago

It sounds like this is a device-specific problem.

Does above hypothesis seem to be in the right direction?

Yes. If a MediaCodec instance stops producing input/output buffers, the player will get stuck. This is aligned with your observation of video freeze (the last decoded frame remains on screen). Unfortunately, we do not detect such cases as it is very difficult to reliably detect a decoder is stuck.

Is there anything that can be done in Exoplayer to bypass/workaround this problem? For example any possibility to initialize the decoder with maximum number of reference frames configured in ABR ladder.

The renderer expects the initialization data to be in the Format.initializationData. For the renderer, this is just a byte-sequence. I guess it's better/easier to override what the renderer does rather than how the extractor reads the data from the container. You could try to override MediaCodecVideoRenderer.onInputFormatChanged() (see code) and tweak the format's initialization data (or copy the format instance) before calling super.onInputFormatChanged(formatHolder). I have not tried this though, so I cannot guarantee it will work.

In your experience, is having different ref_frames configuration for different video renditions a common practice?

I don't have something in my mind, but this is beyond my expertise.

Since this is a device-specific problem, I'll close this issue, Feel free to re-open if there's ExoPlayer issue that you come across with.