androidx / androidx/media

custom receivers are holding corrupted queues

Open
#3,129 5 comments 0 reactions 2 assignees View on GitHub

@tanay187 is already working on this.

Since Aug 14, 2026.

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

Description

Version

Media3 1.9.2

More version details

No response

Devices that reproduce the issue

OnePlus Nord 2T (Android 14)
Google TV Streamer
Google Nest Mini

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

For your custom receiver:
1 - Create and publish a custom receiver app (you can use the google sample project here https://github.com/googlecast/CastReceiver and follow the steps) (the default receiver app works fine btw but since the code is not public no one knows why)
2 - Setup in the cast console doesn't seem to matter much but I supported audio only and didn't support guest mode and we have no Android TV app.

In the demo-cast Android project:
1 - add your own OptionsProvider that points to your custom receiver
2 - create a MediaSessionService with a CastPlayer that has both an ExoPlayer and a RemoteCastPlayer with a custom mediaItemConverter (you can use the DefaultMediaItemConverter inside the custom converter)
3 - edit the PlayerManager class to use a MediaController tied to our MediaSessionService as a player instead of the local player
4 - in the PlayerManager class implement the onTimelineChanged callback and log all the windows and their respective media item details
5 - run the app
6 - add 6+ items to the queue (first HLS stream item 6 times does the trick)
7 - connect cast to your preferred device (I used a Google TV Streamer or a Google Nest Mini) and wait for it to play
8 - stop casting

CastOptionsProvider.java
AndroidManifest.xml
PlaybackService.java
PlayerManager.java

Expected result
  • It should not crash.
  • The MediaQueueItem and MediaItem passed to the MediaItemConverter after switching to another cast device or disconnecting from cast should not have empty title, url, etc. fields.
  • The last onTimelineChanged trigger should log the queue with all the details just like the default receiver app (A12D4273) does.
Actual result
  • It crashes because the mediaItemConverter expects media item fields like the stream url, title, etc to be present.
  • onTimelineChanged logs a list where only the first or first couple of items are loaded (see the last lines of the log document below, this document contains the logs from my own app but the effect is the same)

Note that after connecting to the cast device even the default receiver app triggers an initial onTimelineChanged call with only one or two items that contain the values they should contain and the rest of the playlist has empty fields. However, the default receiver recovers itself by triggering a second onTimelineChanged call with a complete and uncorrupted playlist.

media3 casting issue.txt

Media

Not applicable but I mostly used the first HLS stream item and added it 6+ times to the queue before playing.

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.