androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
https://developer.android.com/media/media3
Apache License 2.0
1.73k stars 416 forks source link

android.media.MediaCodec$CodecException: error 0xfffffff4 / 0xffffffe0 #1789

Open VishnuprasadQp opened 1 month ago

VishnuprasadQp commented 1 month ago

Version

Media3 main branch

More version details

Version 1.4.1

Devices that reproduce the issue

Nothing 2a running on Android 14 Model number: Nothing A142

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

  1. The issue is reproducible when playing multiple DRM content one after the other on different OTT applications. For example, I played DRM content in the Media3 Demo app, moved that app to the background, and then started playing content on Netflix and continued to play such DRM content in other OTT applications. On returning to the Demo app, I can see the error.
  2. The issue is reproducible on L1 devices with MediaTek processors.
  3. Once the mobile device reaches its memory threshold, the issue can occur while playing any DRM content in the Media3 Demo application.
  4. The issue is easier to reproduce when PIP mode is enabled on other OTT applications.

Expected result

The media should play successfully.

Actual result

Playback fails with the exception. Caused by: androidx.media3.exoplayer.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: c2.mtk.avc.decoder.secure, Format(1, null, null, video/avc, avc1.640033, 26984312, null, [3840, 1714, 24.0, ColorInfo(Unset color space, Unset color range, Unset color transfer, false, 8bit Luma, 8bit Chroma)], [-1, -1]) Caused by: android.media.MediaCodec$CodecException: Failed to initialize c2.mtk.avc.decoder.secure, error 0xfffffff4 (NO_MEMORY) Screenshot_20241004-125534

Media

I will send the additional artefacts with the error logs, etc via mail.

Bug Report

VishnuprasadQp commented 1 month ago

Some applications recommend their users to restart the device. For example: JioCinema Screenshot_20241008-124319 Is it a good approach?

VishnuprasadQp commented 1 month ago

I have shared the bug report via mail. Please let me know if you require more details about the issue.

rrfrias commented 4 weeks ago

Do we have your permission to share this bugreport with MediaTek

Internal tracker: 376329580

VishnuprasadQp commented 4 weeks ago

Hi Androidx/Media Team,

 Thank you for reaching out. Yes, you can share this bug report with MediaTek.

With regards Vishnuprasad G

On Wed, Oct 30, 2024 at 3:51 AM rrfrias @.***> wrote:

Do we have your permission to share this bugreport with MediaTek

Internal tracker: 376329580 http://b/376329580

— Reply to this email directly, view it on GitHub https://github.com/androidx/media/issues/1789#issuecomment-2445435042, or unsubscribe https://github.com/notifications/unsubscribe-auth/BCLU5FRWDU2KCFSQBEQGX2TZ6AC77AVCNFSM6AAAAABPSMGTTOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBVGQZTKMBUGI . You are receiving this because you authored the thread.Message ID: @.***>

rrfrias commented 3 weeks ago

Thanks. We are trying to get the right people in MediaTek to take a look at this.

rrfrias commented 1 week ago

Mediatek reports that the device is not capable of handling two simultaneous (L1) secure video pipelines. Two secure video pipelines results in memory utilization where the performance of the system is affected. Oen can query the max supported instances by a given decoder [MediaCodecInfo.CodecCapabilities#getMaxSupportedInstances](https://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities#getMaxSupportedInstances()). But i think your problem goes deeper. Multiple apps are using instances that cause issues until those decoders are released.

From the first comment

  1. The issue is easier to reproduce when PIP mode is enabled on other OTT applications.

Are you experiencing this just by playing PIP content or switching between apps at least one of which uses PIP?

VishnuprasadQp commented 1 week ago

Yes, the issue occurs if I play PIP content and switch to another application that requires the decoder.

On Wed, Nov 13, 2024 at 11:01 PM rrfrias @.***> wrote:

Mediatek reports that the device is not capable of handling two simultaneous (L1) secure video pipelines. Two secure video pipelines results in memory utilization where the performance of the system is affected. Trying to find out if there is a way for the app to query this information.

From the first comment

  1. The issue is easier to reproduce when PIP mode is enabled on other OTT applications.

Are you experiencing this just by playing PIP content or switching between apps at least one of which uses PIP?

— Reply to this email directly, view it on GitHub https://github.com/androidx/media/issues/1789#issuecomment-2474288973, or unsubscribe https://github.com/notifications/unsubscribe-auth/BCLU5FTNNE4NIV7NIPLQR232AOEFHAVCNFSM6AAAAABPSMGTTOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZUGI4DQOJXGM . You are receiving this because you authored the thread.Message ID: @.***>