Skip to content

Fix voice/audio playback broken by media3 1.11.0, bump to 1.33.7 - #2237

Merged
mpretty-cyro merged 2 commits into
devfrom
hotfix/1.33.7
Oct 14, 2026
Merged

mpretty-cyro merged 2 commits into
devfrom
hotfix/1.33.7

Conversation

@mpretty-cyro

@mpretty-cyro mpretty-cyro commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Contributor checklist

  • I have tested my contribution on these devices:
  • Virtual device: Pixel 6 profile, API 37 (arm64), play flavour, both debug and release (minified, signed with the debug key)
  • My contribution is fully baked and ready to be merged as is
  • I ensure that all the open issues my contribution fixes are mentioned in the commit message of my first commit using the Fixes #1234 syntax

Description

Voice and audio messages don't play on 1.33.6. Tapping play shows a spinner forever. Sending still works and so does video.

Cause: #2188 bumped media3 from 1.10.0 to 1.11.0. In 1.11.0 the default MediaSession.Callback.onConnect() returns a placeholder result with empty commands. media3 swaps in the real defaults only when that placeholder is returned unmodified. AudioMediaService built its own result from super.onConnect(), so AudioPlaybackManager's MediaController was granted no player commands. Its setMediaItem / setPlaybackSpeed / prepare / play calls were dropped, and the only trace was a logcat warning:

W/MCImplBase: Controller isn't allowed to call command= 31   (also 13, 2, 1)
W/MCImplBase: Calling play() omitted due to COMMAND_PLAY_PAUSE not being available

The bug is in the library, not R8; it reproduces in debug builds too.

Fix: onConnect now builds its result from ConnectionResult.DEFAULT_SESSION_COMMANDS (plus the scrub commands) and DEFAULT_PLAYER_COMMANDS. The notification controller still drops seek-to-next. This is what media3 1.10.0's default onConnect granted, so behaviour matches 1.33.5. It uses ConnectionResult.accept() rather than AcceptedResultBuilder(session), which is deprecated in 1.11.0. Everything used exists in both media3 versions. media3 stays at 1.11.0.

Also:

  • AudioPlaybackManager.play() logs a warning when the controller is missing set-media-item, prepare or play/pause, so this kind of failure shows up in exported logs, not just logcat.
  • controllerListener.onPlayerError logs the error and stops playback, so the UI leaves the loading state.
  • New instrumented test AudioMediaServiceConnectionTest connects a MediaController to the real service and asserts those commands are available. It fails on the code before this change and passes with it.
  • Version bumped to 1.33.7 (455). The split APKs come out as 4551–4555.

Testing

On the emulator, before and after on the same install (the fixed build installed over the unfixed build of the 1.33.6 tag with adb install -r, data kept), for both debug and minified release:

  • Before: the spinner and the warnings above, in both build types.
  • After: no MCImplBase warnings. Play, progress, pause/resume, playback speed, scrubbing, starting a second message while one is playing (the first keeps its position and speed), and pause/play from the media notification all work.
  • AudioMediaServiceConnectionTest: fails before the fix (COMMAND_SET_MEDIA_ITEM not available to the in-app controller), passes after.

Not tested: lock-screen controls (the emulator has no screen lock; they use the same system media controls as the notification), the new onPlayerError path on a device, and upgrading from a store-signed 1.33.6 (only debug-signed builds were used).

Voice and audio messages never played on 1.33.6; the play button spun indefinitely.
AudioMediaService built its connection result from super.onConnect(), which in media3 1.11.0
returns a placeholder with no commands, so the in-app MediaController's setMediaItem, prepare
and play were all dropped. Grant the default session and player commands explicitly, as
1.10.0's onConnect() did.

Also log when the controller lacks playback commands, leave the loading state on a player
error, and add an instrumented test that the in-app controller is granted them.
@mpretty-cyro
mpretty-cyro marked this pull request as ready for review October 14, 2026 01:07
@mpretty-cyro
mpretty-cyro merged commit c10ce09 into dev Oct 14, 2026
8 of 10 checks passed
@mpretty-cyro
mpretty-cyro deleted the hotfix/1.33.7 branch October 14, 2026 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant