androidx / androidx/media

Android 14: Failed to set playback params: arguments out of range

Open
#1,101 6 comments 0 reactions 1 assignee View on GitHub

@marcbaechinger is already working on this.

Since Feb 19, 2024.

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

Description

Version

Media3 1.2.1

More version details

No response

Devices that reproduce the issue

Samsung S21 running Android 14

Devices that do not reproduce the issue

Huawei Mate9 Android 9
Emulator Pixel_6a_API_34 Android 14
Emulator Pixel_7_33_OS Android 13

Reproducible in the demo app?

No

Reproduction steps
import androidx.media3.exoplayer.*
import androidx.media3.common.*

var exoPlayer: ExoPlayer =  ExoPlayer.Builder(context, DefaultRenderersFactory(context)).build()
var speed = 1.5f
Log.d(TAG, "setPlaybackParams speed=$speed pitch=${playbackParameters.pitch}")

playbackParameters = PlaybackParameters(speed, playbackParameters.pitch)
exoPlayer.playbackParameters = playbackParameters
Expected result

speed should be 1.5x

It works on Android 9

Actual result

speed is not changed

logcat output:

setPlaybackParams speed=2.45 pitch=1.0

 W  Failed to set playback params
java.lang.IllegalArgumentException: arguments out of range
    at android.media.AudioTrack.native_set_playback_params(Native Method)
    at android.media.AudioTrack.setPlaybackParams(AudioTrack.java:2809)
    at androidx.media3.exoplayer.audio.DefaultAudioSink.setAudioTrackPlaybackParametersV23(DefaultAudioSink.java:1519)
    at androidx.media3.exoplayer.audio.DefaultAudioSink.setPlaybackParameters(DefaultAudioSink.java:1273)
    at androidx.media3.exoplayer.audio.MediaCodecAudioRenderer.setPlaybackParameters(MediaCodecAudioRenderer.java:691)
    at androidx.media3.exoplayer.DefaultMediaClock.setPlaybackParameters(DefaultMediaClock.java:140)
    at androidx.media3.exoplayer.ExoPlayerImplInternal.setMediaClockPlaybackParameters(ExoPlayerImplInternal.java:1026)
    at androidx.media3.exoplayer.ExoPlayerImplInternal.setPlaybackParametersInternal(ExoPlayerImplInternal.java:1417)
    at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:535)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loopOnce(Looper.java:230)
    at android.os.Looper.loop(Looper.java:319)
    at android.os.HandlerThread.run(HandlerThread.java:67)
Media

https://22953.mc.tritondigital.com/OMNY_STUFFYOUSHOULDKNOW1_PODCAST_P/media-session/cdfbdc63-4e2f-45cd-9d7b-155498835265/d/clips/e73c998e-6e60-432f-8610-ae210140c5b1/a91018a4-ea4f-4130-bf55-ae270180c327/1607b16b-4ee6-484b-88c8-b11501676a3b/audio/direct/t1707904871/Short_Stuff_The_Original_Snake_Oil_Salesman.mp3?t=1707904871&starship-rollup=v0_444444444444&starship-episode-id=01698d33-28e1-4a29-a5e5-1b23f0ae4a62&in_playlist=44710ecc-10bb-48d1-93c7-ae270180c33e

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.