amzn / exoplayer-amazon-port

Official port of ExoPlayer for Amazon devices
Apache License 2.0
173 stars 80 forks source link

[Fire TV Stick (model AFTT)] pause/resume issue while playing eac3 content on dolby supported sink #102

Closed nsesh closed 4 years ago

nsesh commented 4 years ago

Hi, Downloaded Exoplayer v2.11.3 and tested the demo app on FireTV Stick (2nd Gen), model: AFTT. Please note apart from editing JSON, we didn't make any changes.

FireTV stick is connected to TV (or AVR) that supports Dolby Digital or Dolby Digital Plus. FireTV audio settings is in "auto" mode.

During playback, when we press "pause", the video is pausing immediately but not the Audio. Audio keeps playing for around 3-4 seconds and pauses. When we press "resume", video is catching up with audio and playback resumes properly.

Of course the expected behaviour is that audio pauses immediately.

When we change FireTV audio settings to "Dolby OFF" then there is no audio pause issue.

We have tested other models of FireTV i.e. 1st Gen FireTV Box, Fire OS 6 based FireTV sticks and all these devices are working fine. Only we are experiencing this issue in 'AFTT' model FireTV sticks.

For testing we updated the JSON as below: [ { "name": "Dolby Developer Portal", "samples": [ { "name": "HLS DD+ 5.1 clip", "uri": "https://nsesh-s3.s3.ap-south-1.amazonaws.com/VOD/5ch_HLS/ChID_voices_51_256_ddp_sub.m3u8" }, { "name": "DASH DD+ 5.1 clip", "uri": "https://nsesh-s3.s3.ap-south-1.amazonaws.com/VOD/5ch_DASH/ChID_voices_51_256_ddp.mpd" } ] }

]

Attaching two logcat outputs. dash_dd_logcat.txt - This is captured while setting FireTV audio setting to "Dolby Digital over HDMI" and TV supporting Dolby Digital dash_dd_logcat.txt

dash_dd_off_logcat.txt - This is captured while setting FireTV audio setting to "Dolby Digital OFF" dash_dd_off_logcat.txt

-Nanda

nsesh commented 4 years ago

On further analysis, we found that in v2.8.4 this issue is not noticeable but same 'pause' issue is noticeable in v2.9.0. In v2.9.0 the bufferSize in DefaultAudioSink.java is increased to 192kBytes but in v2.8.4 the bufferSize is 20480 bytes.

On reducing the bufferSize to ~20000 this issue is not noticeable. Seems in this FireTV model (due to OS limitation) there is no way to query the minimum buffer size and during 'pause' it has to go for 'underrun'. On reducing the bufferSize we are quickly draining the data and hence on 'pause' the issue is not noticeable.

Looking forward to comments from others.

-Nanda

nsesh commented 4 years ago

Closing this ticket and proceeding with bufferSize reduction solution for this particular model of FireTV.

-Nanda