RemoteCastPlayer silently ignores MediaChannelResult status for setPlayWhenReady, setPlaybackParameters, setRepeatMode and setVolume
Los mantenedores suelen responder en 5 días
@tanay187 ya está trabajando en esto.
Desde el 14/8/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Version
Media3 1.11.0
More version details
androidx.media3:media3-cast:1.11.0 with play-services-cast-framework:22.3.1. Findings below come from reading the shipped bytecode of media3-cast-1.11.0.aar with javap -c -p.
Devices that reproduce the issue
Not device-specific. The symptom needs a receiver that rejects a request; mine was a Chromecast Audio on the Default Media Receiver (CC1AD845) with a second sender attached to the same session, which made the receiver answer Invalid Request.
Devices that do not reproduce the issue
n/a
Reproducible in the demo app?
Not tested
Reproduction steps
- Cast to a receiver that will reject a request. The reliable way is to join a Default Media Receiver session that another sender is also mutating, so the receiver's sequence numbers stop matching.
- Call
setPlaybackParameters(orsetPlayWhenReady,setRepeatMode,setVolume) on theCastPlayer. - Watch logcat and watch the app.
The Cast SDK reports the rejection:
W/MediaControlChannel: received unexpected error: Invalid Request.
W/MediaControlChannel: Possibility of local queue out of sync with receiver queue.
Refetching sequence number. Current Local Sequence Number = 6
Media3 does not, and the app has no callback through which it could learn.
Expected result
An app can tell that a request it issued was rejected by the receiver, so it can retry, reconcile, or tell the user. Media3 already does this for two other request families, which is why the gap reads as an oversight rather than a deliberate contract:
RemoteCastPlayer$SeekResultCallbackreadsStatus.getStatusCode()and logsSeek failed. Error code.RemoteCastPlayer$StatusListenerlogsSession start failedandSession resume failed.
Actual result
The ResultCallback<MediaChannelResult> instances used for the state setters never look at the result. RemoteCastPlayer$1.onResult is representative — it null-checks the client, clears the pending-result bookkeeping and flushes listener events, and that is all:
public void onResult(RemoteMediaClient$MediaChannelResult);
0: getfield this$0
4: invokestatic RemoteCastPlayer.access$1100 // remoteMediaClient
7: ifnull 28
10: ...
15: invokestatic RemoteCastPlayer.access$1200 // clear pending callback
22: invokestatic RemoteCastPlayer.access$1300 // listeners
25: invokevirtual ListenerSet.flushEvents
28: return
RemoteCastPlayer$2 through $5 have the same shape. None of the five references Status, getStatusCode, or isSuccess; by contrast SeekResultCallback does.
Tracing where those five are constructed, they cover:
| Callback site | Public API |
|---|---|
RemoteCastPlayer$1–$5 |
setPlayWhenReady(boolean), setPlaybackParameters(PlaybackParameters), setRepeatMode(int), setVolume(float), plus updateTracksAndNotifyIfChanged |
So a rejected play/pause, playback-speed, repeat-mode or volume change is indistinguishable from a successful one. The player's masked state reverts on the next receiver status, but nothing tells the app why, and nothing is logged.
The practical consequence for me: playback speed set locally did not take effect on the receiver, and there was no way to find out from the library whether the setPlaybackParameters request had been rejected or never mattered. I ended up re-applying the speed after STATE_READY as a workaround, without being able to confirm which of the two it was.
I have not traced the queue-mutation path (queueInsertItems, queueReorderItems, queueRemoveItems, load) to the same level of certainty, so I am not claiming anything about it here — though those also attach a ResultCallback through StateHolder and were what first sent me looking.
Logging a failure the way SeekResultCallback already does would be enough to make this diagnosable. Surfacing it to the app would be better.
Media
Not content-dependent.
- Lenguaje dominante
- Java
- Estrellas
- 3.1k
- Forks
- 998
- Merge medio
- 8 d 4 h
- PR fusionados (30 d)
- 5
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de androidx/media
-
Cast: system output switcher on Samsung One UI 9 (Android 17) only offers Samsung Audio Mirroring, never a Cast sessionPosiblemente ocupada @tanay187 la tomó hace 1 día. Abiertobug cast needs triage
androidx/media#3500 · 3 comentarios · 2 asignados ·
Los mantenedores suelen responder en 5 días
-
Waive ads when seek/start at the beginningPosiblemente ocupada @microkatz la tomó hace 3 días. Abiertoenhancement
androidx/media#3496 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 5 días
-
Since 1.9.0, skip buttons in SLOT_BACK / SLOT_FORWARD reach legacy controllers as custom actionsPosiblemente ocupada @marcbaechinger la tomó hace 2 días. Abiertobug
androidx/media#3495 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 5 días
-
Allow configuring asset-list prefetch timing per HLS interstitialPosiblemente ocupada @marcbaechinger la tomó hace 3 días. Abiertoenhancement
androidx/media#3494 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 5 días
-
Offloaded audio left paused keeps AudioFlinger's AudioOffload wake lock forever, device never suspendsPosiblemente ocupada @microkatz la tomó hace 3 días. Abiertobug
androidx/media#3493 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 5 días
Todos los issues de androidx/media
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
quarkusio/quarkus-agent-mcp#302 ·
Los mantenedores suelen responder en 2 días
-
build
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
MetricsHub/metricshub-community#1472 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
IdentityArrayObjectSet iterator remove may throw ArrayIndexOutOfBoundsExceptionPosiblemente ocupada @jiteshkhatri11 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
javapathfinder/jpf-core#660 · 1 comentario ·