androidx / androidx/media

Live stream starts in pause state not showing first frame for long time with tunnelling mode

Open
#2,919 0 comments 0 reactions 1 assignee View on GitHub

@tianyif is already working on this.

Since Nov 28, 2025.

bug needs triage
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Version

Media3 1.4.1

More version details

After upgrade to Media3 1.3.0 this issue happens which added the MediaCodec.BUFFER_FLAG_DECODE_ONLY to DecoderInputBuffer for tunnelling mode.
With this flag Decoder will drop the frames and until a frame without this flag it will render the first frame.
Depending on how many frames marked as DECODE_ONLY, the first frame can be delayed 5-10 seconds.
(like 2 seconds segment with 60 fps, it normally will have 50-90 frames marked as DECODE_ONLY)
The reason is that:
Player is in ready and pause state, it will go to sleep 1 second once there is no inputBuffer index from HW.
Once the player wakes up from 1 second it will consume all the inputBuffer at once(in a while loop).
Then the player goes to sleep 1 second again, whilst later some inputBuffer available, but the player is already in sleep.
Then keep this route until first frame rendered without DECODE_ONLY flag.

Devices that reproduce the issue

Customer STB with tunnelling mode support

Devices that do not reproduce the issue

Without tunnelling mode support

Reproducible in the demo app?

Yes

Reproduction steps
  1. Configure the player with tunnelling mode
  2. Play a live stream with long timeshift buffer(like 1 hour) without autostart.
Expected result

The first frame should display less than 1 seconds

Actual result

The first frame displays after 5-10 seconds

Media

Not applicable

Bug Report
  • You will email the zip file produced by adb bugreport to android-media-github@google.com after filing this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.