Description
ExoPlayer Version
2.18.2
Devices that reproduce the issue
Evolution Digital eStream 4k (https://evolutiondigital.com/estream-4k/) (probably many others)
Easiest to reproduce if device is running AC-3 audio with off-board decode.
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
Pretty difficult, working on a ExoPlayer unit test case (not sure it is even possible)
The steps are to repeatedly tune to a live channel, while speed adjustment is progress, then:
- Disable the audio
- Set the speed to > 1.0. (eg 8x)
Expected result
Media plays at 2.0x (or whatever the setting was).
Actual result
Playback reverts immediately to 1.0 (with adjustment +/- 3% default).
The branch x-live-speed-overwrites-user-logging has the logging shown in the description below. Here's the sequence that causes the bug with my analysis:
DO_SOME_WORK
— sees renderer clock is 1.0, does live speed adjustment, sets speed to 1.03
12-21 14:34:41.564 7303 7343 I ExoPlayerImplInternal: updatePlaybackPositions() changing speed -
old: PlaybackParameters(speed=1.00, pitch=1.00)
new speed: 1.03
MediaClock: DefaultMediaClock isUsingStandaloneClock: false standaloneClockIsStarted: true
rendererClock: PlaybackParameters(speed=1.00, pitch=1.00)
standaloneClock: PlaybackParameters(speed=1.00, pitch=1.00)
12-21 14:34:41.564 7303 7343 I ExoPlayerImplInternal: handlePlaybackParameters() updatePlaybackInfo:false acknowledgeCommand:false
currentPlaybackSpeed: 1.03 currentParameters: PlaybackParameters(speed=1.00, pitch=1.00) playbackParameters: PlaybackParameters(speed=1.00, pitch=1.00)
2a. DO_SOME_WORK
— Renderer reports speed 1.0 (ignore 1.03 setting), and this queues a MSG_PLAYBACK_PARAMETERS_CHANGED_INTERNAL
, and resets standalone clock to 1.0
12-21 14:34:41.580 7303 7343 I DefaultMediaClock: syncClocks() mismatch - renderer: PlaybackParameters(speed=1.00, pitch=1.00) standalone: PlaybackParameters(speed=1.03, pitch=1.00)
2b. In same DO_SOME_WORK
message, live speed again sees speed is 1.0 (from 2a), and again trys to set it to 1.03
12-21 14:34:41.581 7303 7343 I ExoPlayerImplInternal: updatePlaybackPositions() changing speed -
old: PlaybackParameters(speed=1.00, pitch=1.00)
new speed: 1.03
MediaClock: DefaultMediaClock isUsingStandaloneClock: false standaloneClockIsStarted: true
rendererClock: PlaybackParameters(speed=1.00, pitch=1.00)
standaloneClock: PlaybackParameters(speed=1.00, pitch=1.00)
12-21 14:34:41.581 7303 7343 I ExoPlayerImplInternal: handlePlaybackParameters() updatePlaybackInfo:false acknowledgeCommand:false
currentPlaybackSpeed: 1.03 currentParameters: PlaybackParameters(speed=1.00, pitch=1.00) playbackParameters: PlaybackParameters(speed=1.00, pitch=1.00)
-
MSG_TRACK_SELECTION_INVALIDATED
— disable audio renderer, this messages does the following:- update tracks, then calls
updatePlaybackPositions()
, which does asyncClocks()
, again clocks don't match so queuesMSG_PLAYBACK_PARAMETERS_CHANGED_INTERNAL
- disables audio renderer, so standalone clock is now master, standalone clock has 1.03 and renderer vetoed it (so it has 1.0)
- update tracks, then calls
12-21 14:34:41.592 7303 7343 D ExoPlayerImplInternal: handleMessage() - msg: 10 playbackInfo.playbackParametersPlaybackParameters(speed=1.00, pitch=1.00)
MSG_SET_PLAYBACK_PARAMETERS
— handle the user requested speed.
12-21 14:34:41.655 7303 7343 D ExoPlayerImplInternal: handleMessage() - msg: 4 playbackInfo.playbackParametersPlaybackParameters(speed=1.00, pitch=1.00)
12-21 14:34:41.655 7303 7343 I ExoPlayerImplInternal: setPlaybackParametersInternal() - parameters: PlaybackParameters(speed=8.00, pitch=1.00)
MediaClock: DefaultMediaClock isUsingStandaloneClock: true standaloneClockIsStarted: true
rendererClock: none
standaloneClock: PlaybackParameters(speed=1.03, pitch=1.00)
12-21 14:34:41.655 7303 7343 I ExoPlayerImplInternal: handlePlaybackParameters() updatePlaybackInfo:true acknowledgeCommand:true
currentPlaybackSpeed: 8.0 currentParameters: PlaybackParameters(speed=1.00, pitch=1.00) playbackParameters: PlaybackParameters(speed=8.00, pitch=1.00)
- Then the
MSG_PLAYBACK_PARAMETERS_CHANGED_INTERNAL
, queued in step 3 (track selection) overwrites the 8x speed back to 1.0
12-21 14:34:41.657 7303 7343 D ExoPlayerImplInternal: handleMessage() - msg: 16 playbackInfo.playbackParametersPlaybackParameters(speed=8.00, pitch=1.00)
12-21 14:34:41.657 7303 7343 I ExoPlayerImplInternal: MSG_PLAYBACK_PARAMETERS_CHANGED_INTERNAL updatedParameters : PlaybackParameters(speed=1.00, pitch=1.00)
EPII.playbackParameters: PlaybackParameters(speed=8.00, pitch=1.00)
MediaClock: DefaultMediaClock isUsingStandaloneClock: true standaloneClockIsStarted: true
rendererClock: none
standaloneClock: PlaybackParameters(speed=8.00, pitch=1.00)
12-21 14:34:41.657 7303 7343 I ExoPlayerImplInternal: handlePlaybackParameters() updatePlaybackInfo:true acknowledgeCommand:false
currentPlaybackSpeed: 1.0 currentParameters: PlaybackParameters(speed=8.00, pitch=1.00) playbackParameters: PlaybackParameters(speed=1.00, pitch=1.00)
- Lastly, again main loop sees renderer clock is 1.0, does live speed adjustment, sets speed to 1.03
12-21 14:34:41.658 7303 7343 I ExoPlayerImplInternal: updatePlaybackPositions() changing speed -
old: PlaybackParameters(speed=8.00, pitch=1.00)
new speed: 1.03
MediaClock: DefaultMediaClock isUsingStandaloneClock: true standaloneClockIsStarted: true
rendererClock: none
standaloneClock: PlaybackParameters(speed=8.00, pitch=1.00)
12-21 14:34:41.658 7303 7343 I ExoPlayerImplInternal: handlePlaybackParameters() updatePlaybackInfo:false acknowledgeCommand:false
currentPlaybackSpeed: 1.03 currentParameters: PlaybackParameters(speed=1.00, pitch=1.00) playbackParameters: PlaybackParameters(speed=1.00, pitch=1.00)
Media
I'll send a live URL.
Bug Report
- You will email the zip file produced by
adb bugreport
to [email protected] after filing this issue.