Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playback speed changes not working with AUDIO_OFFLOAD_MODE_ENABLED on some devices with Android 15 QPR 2.x Beta #2038

Open
1 task done
rnekicOD opened this issue Jan 14, 2025 · 2 comments
Assignees
Labels

Comments

@rnekicOD
Copy link

rnekicOD commented Jan 14, 2025

Version

Media3 1.5.1

More version details

Playback speed changes are suddenly not working on some devices with Android 15 QPR 2.x Beta when audio offload is enabled. PlaybackParameters are reporting the requested speed but actual playback is 1.0. Playback speed changes work if audio offload is disabled. Speed changes with audio offload enabled previously worked on these devices with Android 15 prior to the QPR 2.x Betas.

Reproduces with Media3 1.5.0, 1.5.1, and 1.6.0-alpha01. I don't know if this is a Media3 issue or an Android Beta issue.

Devices that reproduce the issue

Pixel 8 with Android 15 QPR 2.0 BP11.241121.010
Pixel 8 with Android 15 QPR 2.1 BP11.2411.21.013
Pixel 9 Pro with Android 15 QPR 2.0 BP11.241121.010

Devices that do not reproduce the issue

Pixel 7 Pro with Android 15 QPR 2.1 BP11.2411.21.013
Pixel 8 Pro with Android 15 AP4A.241205.013.C1

Reproducible in the demo app?

Yes

Reproduction steps

It is reproducible on the impacted devices in the Media3 demo app IF the demo app is modified to enable audio offload. Audio offload is disabled by default.

I accomplished this by changing the default values in TrackSelectionParameters.java:

FROM:
public Builder() { this.audioOffloadMode = AUDIO_OFFLOAD_MODE_DISABLED; this.isGaplessSupportRequired = false; this.isSpeedChangeSupportRequired = false; }

TO:
public Builder() { this.audioOffloadMode = AUDIO_OFFLOAD_MODE_ENABLED; this.isGaplessSupportRequired = false; this.isSpeedChangeSupportRequired = true; }

Alternately, I can also reproduce it by setting new AudioOffloadPreferences before the speed change is applied in PlayerControlView.java.

private void setPlaybackSpeed(float speed) {
    if (player == null || !player.isCommandAvailable(COMMAND_SET_SPEED_AND_PITCH)) {
      return;
    }

    TrackSelectionParameters.AudioOffloadPreferences newPreferences = new TrackSelectionParameters.AudioOffloadPreferences.Builder()
        .setAudioOffloadMode(TrackSelectionParameters.AudioOffloadPreferences.AUDIO_OFFLOAD_MODE_ENABLED)
        .setIsSpeedChangeSupportRequired(true)
        .build();
    player.setTrackSelectionParameters(player.getTrackSelectionParameters().buildUpon().setAudioOffloadPreferences(newPreferences).build());

    player.setPlaybackParameters(player.getPlaybackParameters().withSpeed(speed));
  }

Expected result

Playback speeds != 1.0 play as expected when audio offload is enabled on these devices.

Actual result

Audio offload is enabled and playback parameters are reporting the requested speed, but actual playback speed is 1.0.

Media

Reproduced in the demo app using the Jazz & Blues tracks: Jazz in Paris, The Messenger, Talkies.

Bug Report

  • You will email the zip file produced by adb bugreport to [email protected] after filing this issue.
@rnekicOD rnekicOD changed the title Playback speed changes not working with AUDIO_OFFLOAD_MODE_ENABLED on some devices with Android 15 QPR2 Beta 2.x Playback speed changes not working with AUDIO_OFFLOAD_MODE_ENABLED on some devices with Android 15 QPR 2.x Beta Jan 14, 2025
@microkatz
Copy link
Contributor

@rnekicOD

Thank you for reporting your issue! Does not appear to be an library regression. I've created an issue in our internal tracker(b/390364738 for our reference). I'll update this thread once we learn more.

@rnekicOD
Copy link
Author

Here is a link to the same issue reported in the Android 15 QPR Beta issue tracker. I wasn't aware someone had reported it there back on Jan 3rd. https://issuetracker.google.com/issues/387367533

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants