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

[BUG]: Multiple videos playing at once causes several androidx.media3.exoplayer.ExoPlaybackException #4100

Closed
mfapproach opened this issue Aug 19, 2024 · 14 comments
Labels

Comments

@mfapproach
Copy link

mfapproach commented Aug 19, 2024

Version

6.4.5

What platforms are you having the problem on?

Android TV

System Version

12

On what device are you experiencing the issue?

Real device

Architecture

Old architecture

What happened?

A bug happened!

This is for a digital signage platform. A slideshow containing various image & videos. When a slide contains more than 1 video, androidx.media3.exoplayer.ExoPlaybackException eventually show up. Most of the time the errors begin showing within several minutes of the slides rotations.

'Video error occured', { errorStackTrace: 'androidx.media3.exoplayer.ExoPlaybackException: Unexpected runtime error\n\tat androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:720)\n\tat android.os.Handler.dispatchMessage(Handler.java:102)\n\tat android.os.Looper.loopOnce(Looper.java:201)\n\tat android.os.Looper.loop(Looper.java:288)\n\tat android.os.HandlerThread.run(HandlerThread.java:67)\nCaused by: java.lang.IllegalStateException\n\tat androidx.media3.common.util.Assertions.checkStateNotNull(Assertions.java:117)\n\tat androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecCallback.dequeueOutputBufferIndex(AsynchronousMediaCodecCallback.java:166)\n\tat androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecAdapter.dequeueOutputBufferIndex(AsynchronousMediaCodecAdapter.java:218)\n\tat androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:1994)\n\tat androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:873)\n\tat androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:1018)\n\tat androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1136)\n\tat androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:561)\n\t... 4 more\n', 08-19 10:05:14.149 4795 4829 I ReactNativeJS: errorCode: '21004', 08-19 10:05:14.149 4795 4829 I ReactNativeJS: errorException: 'androidx.media3.exoplayer.ExoPlaybackException: Unexpected runtime error', 08-19 10:05:14.149 4795 4829 I ReactNativeJS: errorString: 'ExoPlaybackException: ERROR_CODE_FAILED_RUNTIME_CHECK' }

'Video error occured', { errorStackTrace: 'androidx.media3.exoplayer.ExoPlaybackException: Source error\n\tat androidx.media3.exoplayer.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:736)\n\tat androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:706)\n\tat android.os.Handler.dispatchMessage(Handler.java:102)\n\tat android.os.Looper.loopOnce(Looper.java:201)\n\tat android.os.Looper.loop(Looper.java:288)\n\tat android.os.HandlerThread.run(HandlerThread.java:67)\nCaused by: androidx.media3.common.ParserException: Invalid NAL length{contentIsMalformed=true, dataType=1}\n\tat androidx.media3.extractor.mp4.FragmentedMp4Extractor.readSample(FragmentedMp4Extractor.java:1560)\n\tat androidx.media3.extractor.mp4.FragmentedMp4Extractor.read(FragmentedMp4Extractor.java:473)\n\tat androidx.media3.exoplayer.source.BundledExtractorsAdapter.read(BundledExtractorsAdapter.java:147)\n\tat androidx.media3.exoplayer.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1082)\n\tat androidx.media3.exoplayer.upstream.Loader$LoadTask.run(Loader.java:421)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)\n\tat java.lang.Thread.run(Thread.java:920)\n', 08-19 09:36:54.946 2767 2830 I ReactNativeJS: errorCode: '23001', 08-19 09:36:54.946 2767 2830 I ReactNativeJS: errorException: 'androidx.media3.exoplayer.ExoPlaybackException: Source error', 08-19 09:36:54.946 2767 2830 I ReactNativeJS: errorString: 'ExoPlaybackException: ERROR_CODE_PARSING_CONTAINER_MALFORMED' }

Video error occured {"errorCode": "24003", "errorException": "androidx.media3.exoplayer.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, avc1.64001F, -1, null, [720, 1280, 29.997833, ColorInfo(BT709, Limited range, SDR SMPTE 170M, false, 8bit Luma, 8bit Chroma)], [-1, -1]), format_supported=YES", "errorStackTrace": "androidx.media3.exoplayer.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, avc1.64001F, -1, null, [720, 1280, 29.997833, ColorInfo(BT709, Limited range, SDR SMPTE 170M, false, 8bit Luma, 8bit Chroma)], [-1, -1]), format_supported=YES at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:623) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.os.HandlerThread.run(HandlerThread.java:67) Caused by: androidx.media3.exoplayer.video.MediaCodecVideoDecoderException: Decoder failed: OMX.amlogic.avc.decoder.awesome2 at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.createDecoderException(MediaCodecVideoRenderer.java:1915) at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:848) at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:940) at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1112) at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:544) ... 4 more Caused by: android.media.MediaCodec$CodecException: Error 0x80001000 ", "errorString": "ExoPlaybackException: ERROR_CODE_DECODING_FAILED"}

Reproduction Link

https://drive.google.com/drive/folders/1uew90qtgdCrQPoiOE9gb9Q_TsctfqffZ?usp=sharing

Reproduction

Step to reproduce this bug are:

Play more than once video at once. I've never had any issues or errors when one video is playing at a time.

@mfapproach mfapproach added the bug label Aug 19, 2024
@moskalakamil
Copy link
Member

Hi, thanks for reporting an issue!

@freeboub
Copy link
Collaborator

@mfapproach it would be interesting to know how many decoder are available on the device ?
Is this something you also reproduce with the emulator ?
how many <Video do you have mounted simultanenously (with a source defined) ?

@mfapproach
Copy link
Author

@freeboub I'm looking into the number of video decoders today, I'm assuming thats what the issue is. I haven't tested to reproduce with the emulator, but I can do that today. The device I'm using is the Onn 4k streaming box, as that is the only device we currently use for digital signage.

I don't remember this being an issue until the switch to v. 6 was made and exoplayer was the default.

I've seen the issue with as few as two simultaneous <Video components playing, but have tested with maybe 6 simultaneous? It is strange, sometimes it will play for a little, sometimes a while, but the error always eventually shows up with multiple <Video playing.

@freeboub
Copy link
Collaborator

You are right, there was also a flag which was added recently: .setEnableDecoderFallback(true) It should allow fallback on sofware decoder in case HW decoder are not available...
Another complementary test you can do is to create a new app with 6 video playback in parallel. It can help you to identify the limitation...

@mfapproach
Copy link
Author

mfapproach commented Aug 22, 2024

Below is the hardware decoder for the codec I am using. I am a little confused how is says 9 concurrent-instances, shouldn't that mean it can handle 9 videos played at once?

<MediaCodec name="OMX.amlogic.avc.decoder.awesome2" type="video/avc" > <Limit name="alignment" value="2x2" /> <Limit name="block-size" value="16x16" /> <Limit name="size" min="64x64" max="4096x4096" /> <Limit name="block-count" range="1-34560" /> <!-- max 4096x2160 --> <Limit name="blocks-per-second" range="1-1036800" /> <Limit name="bitrate" range="1-300000000" /> <Feature name="adaptive-playback" /> <Feature name="tunneled-playback" /> <Feature name="low-latency" /> <Limit name="concurrent-instances" max="9" /> </MediaCodec>

With the new 6.4.5, I'm seeing the below error a lot more. But once again, it doesn't happen all the time and it is very hard to diagnose. For example, yesterday, in an attempt to reproduce the error, i played multiple videos to the point that the error occurred. Once the error occurred, even certain videos played by themselves would result in the error below. And from logging, before the error occurs it always gets stuck buffering. I tried clearing the cache and reinstalled the application and the same issue persisted. The only way the occasional errors went away was from a factory reset of the device.

'Video error occured', { errorStackTrace: 'androidx.media3.exoplayer.ExoPlaybackException: Unexpected runtime error\n\tat androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:720)\n\tat android.os.Handler.dispatchMessage(Handler.java:102)\n\tat android.os.Looper.loopOnce(Looper.java:201)\n\tat android.os.Looper.loop(Looper.java:288)\n\tat android.os.HandlerThread.run(HandlerThread.java:67)\nCaused by: java.lang.IllegalStateException\n\tat androidx.media3.common.util.Assertions.checkStateNotNull(Assertions.java:117)\n\tat androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecCallback.dequeueOutputBufferIndex(AsynchronousMediaCodecCallback.java:166)\n\tat androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecAdapter.dequeueOutputBufferIndex(AsynchronousMediaCodecAdapter.java:218)\n\tat androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:1994)\n\tat androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:873)\n\tat androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:1018)\n\tat androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1136)\n\tat androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:561)\n\t... 4 more\n', 08-19 10:05:14.149 4795 4829 I ReactNativeJS: errorCode: '21004', 08-19 10:05:14.149 4795 4829 I ReactNativeJS: errorException: 'androidx.media3.exoplayer.ExoPlaybackException: Unexpected runtime error', 08-19 10:05:14.149 4795 4829 I ReactNativeJS: errorString: 'ExoPlaybackException: ERROR_CODE_FAILED_RUNTIME_CHECK' }

Copy link

Thank you for your issue report. Please note that the following information is missing or incomplete:

  • reproduction link

Please update your issue with this information to help us address it more effectively.

Note: issues without complete information have a lower priority

There is a newer version of the library available.You are using version 6.4.5 (exoplayer), while the latest stable version is 6.4.5.Please update to the latest version and check if the issue still exists.

Note: If the issue still exists, please update the issue report with the latest information.

Copy link

Thank you for your issue report. Please note that the following information is missing or incomplete:

  • reproduction link

Please update your issue with this information to help us address it more effectively.

Note: issues without complete information have a lower priority

Copy link

Thank you for your issue report. Please note that the following information is missing or incomplete:

  • reproduction link

Please update your issue with this information to help us address it more effectively.

Note: issues without complete information have a lower priority

1 similar comment
Copy link

Thank you for your issue report. Please note that the following information is missing or incomplete:

  • reproduction link

Please update your issue with this information to help us address it more effectively.

Note: issues without complete information have a lower priority

Copy link

Thank you for your issue report. Please note that the following information is missing or incomplete:

  • reproduction
  • reproduction link

Please update your issue with this information to help us address it more effectively.

Note: issues without complete information have a lower priority

@github-actions github-actions bot added Missing repro Issue reproduction is missing and removed Repro Provided labels Aug 22, 2024
Copy link

Thank you for your issue report. Please note that the following information is missing or incomplete:

  • reproduction link

Please update your issue with this information to help us address it more effectively.

Note: issues without complete information have a lower priority

Copy link

Thank you for your bug report. We will review it and get back to you if we need more information.

@KrzysztofMoch KrzysztofMoch removed Missing info Some information from template are missing Missing repro Issue reproduction is missing labels Aug 23, 2024
Copy link

This issue is stale because it has been open for 30 days with no activity. If there won't be any activity in the next 14 days, this issue will be closed automatically.

@github-actions github-actions bot added the stale Closed due to inactivity or lack or resources label Sep 23, 2024
Copy link

github-actions bot commented Oct 7, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as completed Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants