Cast: system output switcher on Samsung One UI 9 (Android 17) only offers Samsung Audio Mirroring, never a Cast session
Maintainers usually reply within 5 days
@tanay187 is already working on this.
Since Oct 30, 2026.
Assessment
This issue has not been assessed yet.
Description
Version
Media3 1.11.1
More version details
media3-cast1.11.1, initialized with:Cast.getSingletonInstance(this).initialize( CastParams.Builder() .setReceiverApplicationId(/* custom receiver */) .setRemoteToLocalEnabled(true) .setShowSystemOutputSwitcherOnCastButtonClick(true) .build() )compileSdk/targetSdk37.ACCESS_LOCAL_NETWORKis granted, andandroidx.mediarouter.media.MediaTransferReceiveris declared in the manifest.- The Cast button is set up with
MediaRouteButtonFactory.setUpMediaRouteButton. - Google Play services 26.42.31, Samsung Audio Mirroring (
com.samsung.android.audiomirroring) 4.1.00.5.
Devices that reproduce the issue
Samsung Galaxy S24 (SM-S921B), One UI 9, Android 17 (API 37), build CP2A.260605.016.S921BXXUHEZIF, security patch 2026-09-05. Also reported by a user on Samsung S24 with One UI 9 / Android 17.
Cast devices tried: a Chromecast
Devices that do not reproduce the issue
- A non-Samsung Android 17 phone, where the system output switcher starts a Cast session normally.
- Phones below Android 17, including Samsung. They aren't affected, because Media3 only uses the system output switcher on Android 17 and later. Below that, the Cast button opens the Cast dialog.
Reproducible in the demo app?
Yes
Reproduction steps
demos/session on main at 950e56896b reproduces it on the same Samsung S24 (One UI 9 / Android 17):
- Open Album Folder → Mango Open Movie project → Play.
- Tap the Cast button and pick a Chromecast connected to a TV in Samsung's media output panel.
SessionDemoApplication calls CastParams.Builder().setShowSystemOutputSwitcherOnCastButtonClick(true), so the demo goes through the same system output switcher path. Because the demo uses the default receiver, our custom receiver and app code are ruled out.
Expected result
A Cast session starts on the selected device, and playback moves to the remote player, as it does on non-Samsung Android 17 devices.
Actual result
- No Cast session starts.
SessionManagerListenergets no callbacks at all. - SystemUI moves the app's system routing session to Samsung's Audio Mirroring route for that device instead of the app's Cast route. The phone then streams its own audio output to the device.
- If the app has a video decoder open, Audio Mirroring refuses and shows the toast "Can't play video while mirroring sound to Wi-Fi speaker". Its allow list of apps that may play video while mirroring only contains Spotify.
Screenshot of the toast:
The only transferable routes SystemUI offers the app are Samsung's Audio Mirroring routes. The Cast routes from Play services (com.google.android.gms/.cast.media.CastMediaRoute2ProviderService_Persistent:…) are discovered by the app's MediaRouter with the app's Cast category, but they are never offered:
I InfoMediaManager: connectToDevice(), device = <Chromecast>/com.android.server.media/.SystemMediaRoute2Provider2:SYSTEM-com.samsung.android.audiomirroring/.service.MediaRoute2MirroringProviderService-fa48595f…
V MR2 : [proxy-<app>] Transferring routing session. session= RoutingSessionInfo{ sessionId=com.android.server.media/.SystemMediaRoute2Provider2:SYSTEM_SESSION, clientPackageName=<app>, selectedRoutes={…ROUTE_ID_BUILTIN_SPEAKER…}, transferableRoutes={…SYSTEM-com.samsung.android.audiomirroring/.service.MediaRoute2MirroringProviderService-a439b276…, …-2f84f900…, …-fa48595f…} … }, route=MediaRoute2Info{ id=…SYSTEM-com.samsung.android.audiomirroring/…-fa48595f…, type=REMOTE_TV, routingTypes=SYSTEM_AUDIO, isSystem=true, features=[com.google.android.gms.cast.CATEGORY_CAST…, com.samsung.android.audiomirroing.feature.AudioMirroring, android.media.route.feature.LIVE_AUDIO], deduplicationIds=fa48595f…, providerId=com.android.server.media/.SystemMediaRoute2Provider2 … }
I RemoteCast:MirroringProvServ: Current app using VideoCodec
I Toast : show: caller = N.a.run:21
The Audio Mirroring route has the same deduplication ID as the real Cast route for the same device (fa48595f…).
Workaround
With setShowSystemOutputSwitcherOnCastButtonClick(false), the Cast SDK's own dialog starts a real Cast session on the same device, and playback works. During that transfer, the framework logs the Play services Cast route as non-transferable for the app:
I MR2 : [local] Transferring to a non-transferable route=MediaRoute2Info{ id=com.google.android.gms/.cast.media.CastMediaRoute2ProviderService_Persistent:fa48595f…, type=REMOTE_TV, routingTypes=REMOTE, isSystem=false, … }
If the system output switcher can't offer Cast routes on some devices, could Media3 detect that and fall back to the Cast dialog? Or could the limitation be documented on setShowSystemOutputSwitcherOnCastButtonClick?
Media
Not specific to the media. It reproduces in demos/session with "Mango Open Movie project" from Album Folder, and in our app with an HLS live stream with video, loaded through a custom Web Receiver. Any media fails the same way, because no Cast session ever starts. Audio-only media just gets mirrored without the toast.
Bug Report
- You will email the zip file produced by
adb bugreportto [email protected] after filing this issue.
- Dominant language
- Java
- Stars
- 3.1k
- Forks
- 1k
- Avg merge
- 8d 4h
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from androidx/media
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
Maintainers usually reply within 5 days
-
Difficulty 4/5 3-5 days Newbie friendliness 22/100
Maintainers usually reply within 5 days
-
Waive ads when seek/start at the beginningPossibly taken @microkatz claimed this 5 days ago. Openenhancement
androidx/media#3496 · 3 comments · 1 assignee ·
Maintainers usually reply within 5 days
-
Since 1.9.0, skip buttons in SLOT_BACK / SLOT_FORWARD reach legacy controllers as custom actionsPossibly taken @marcbaechinger claimed this 4 days ago. Openbug
androidx/media#3495 · 1 comment · 1 assignee ·
Maintainers usually reply within 5 days
-
Allow configuring asset-list prefetch timing per HLS interstitialPossibly taken @marcbaechinger claimed this 5 days ago. Openenhancement
androidx/media#3494 · 3 comments · 1 assignee ·
Maintainers usually reply within 5 days
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
liberation-data/drivine4j#547 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
BindingServiceProperties.bindings regressed to a non-thread-safe TreeMap in GH-3158: concurrent first use of binding names corrupts itPossibly taken @AkashB23 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
spring-cloud/spring-cloud-stream#3321 ·
Maintainers usually reply within 1 day
-
[Bug] 资源包列表 与 模组/数据包/世界 列表排列顺序不一致Possibly taken @fishdry1000 claimed this 4 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
ai-driven-fuzzing bug claude Minor
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
linagora/twake-calendar-side-service#1333 ·
Maintainers usually reply within 1 day