Open DavidFair opened 2 years ago
Have you tried reproducing on any other devices (e.g. a phone) to see if this is specific to the Sony Bravia TV you're using?
Please provide content we can use to try and reproduce the problem, and please provide the result of adb bugreport
after reproducing the error in the ExoPlayer demo app.
The exception message (arguments out of range
) is defined in android_media_AudioTrack_set_playback_params
and it will be attached to any non-OK response from AudioTrack::setPlaybackRate
. It looks like there's additional warning logs in the AudioTrack
method that will hopefully be visible in a bug report and may give a better clue as to exactly what property of the playback speed is causing a problem on this device.
As an aside: We've seen serious 'frame drop' symptoms when trying to play content at non-1.0x speed on Sony Bravia TVs (https://github.com/google/ExoPlayer/issues/7683). I don't know if the model you're using is affected by this issue. One wild guess is that the TV is deliberately not accepting the speed adjustment because it knows it will result in a bad experience (as I say, no concrete evidence that this is true).
Have you tried reproducing on any other devices (e.g. a phone) to see if this is specific to the Sony Bravia TV you're using?
So I've reproduced it on a completely different make and model of TV (hence the delay): Android version: 9 Android device: JVC LT-40CA890
Please provide content we can use to try and reproduce the problem, and please provide the result of
adb bugreport
after reproducing the error in the ExoPlayer demo app.
Content: https://drive.google.com/file/d/1B67k_9rDGUIBgNPdFp2vSlJ_hiRMsfJC/view?usp=sharing
(I'm simply hosting with an Nginx docker instance locally: docker run -p 8080:80 -v /tmp/repro.mkv:/usr/share/nginx/html/repro.mkv:ro nginx && adb shell am start -a com.google.android.exoplayer.demo.action.VIEW -d http://192.168.10.31:8080/repro.mkv
)
I can reproduce this on physical devices using the demo app, but not the emulator where it will always respect playback speed.
The exception message (
arguments out of range
) is defined inandroid_media_AudioTrack_set_playback_params
and it will be attached to any non-OK response fromAudioTrack::setPlaybackRate
. It looks like there's additional warning logs in theAudioTrack
method that will hopefully be visible in a bug report and may give a better clue as to exactly what property of the playback speed is causing a problem on this device.
Interestingly the emulator reports the audio track is not supported, but the physical device plays it fine, so I feel this confirms the audio track as the culprit: bugreport-BRAVIA_VH2_EU-QTG3.200305.006.S118-2022-03-21-20-51-37.zip
I'm happy to do any other testing you need too.
As an aside: We've seen serious 'frame drop' symptoms when trying to play content at non-1.0x speed on Sony Bravia TVs (#7683). I don't know if the model you're using is affected by this issue. One wild guess is that the TV is deliberately not accepting the speed adjustment because it knows it will result in a bad experience (as I say, no concrete evidence that this is true).
I originally thought this was true, hence I grabbed a non-Sony TV to confirm it too. Good shout though for me to test it
On random media setting PlaybackParameters has no effect, this was noticed in: https://github.com/jellyfin/jellyfin-androidtv/issues/1517 I've hit the limit of the debugger as there's something within the OS layer that I can't step into. Looking around other developers have reported this exception was thrown when the buffer passed to
AudioTrack
was too small, but as the playback speed is half then naively I'd assume the buffer effectively serves 2x the content now.Since we don't directly interact with
AudioTrack
in any-way within the app I'm pretty sure this is something ExoPlayer isn't handling correctly:Reproducer
DefaultRendererFactory
hassetEnableAudioTrackPlaybackParams(true);
, this makes the reproducer appear in the debugger (rather than be handled elsewhere)false
the playback speed still ends up forced to 1x, but I can't see where it's failing within the debuggerexoplayer.setPlaybackParameters(0.5)
On working media:
audioTrackPlaybackParameters
with speed set to0.5
On "broken" media:
audioTrackPlaybackParameters
is updated to1.0
speed internally so the user's selection ends up "ignored"Media info
Working example:
Failing example:
I provide a cut down 2 minute clip of an hour long licensed episode which reproduces it, but I'm not sure about the repo's policy on copyrighted material? Unfortunately all content that exhibits this behaviour (so far) is privately purchased media.
Additional Info
I've tried the additional steps to eliminate external factors:
EXTENSION_RENDERER_MODE_OFF
ac3
anddts
audio codecs (eliminating a single codec as the point of failure)