Android 14: Failed to set playback params: arguments out of range
Open
@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
Bug Report
- You will email the zip file produced by
adb bugreportto android-media-github@google.com after filing this issue.
Contributor 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.
Assessment
This issue has not been assessed yet.