Issue:
During playback of titles with higher than average (exceeding 11mbps on average) Dolby Atmos TrueHD-based bitrates, ExoPlayer v2 on the Nvidia Shield is dropping packets leading to moments of brief silence. This is a reproducible issue and is not a problem with the source material because when played back on a UHD-BD player or a certified software such as PowerDVD the dropouts do not occur.
Reproduction:
Playback linked content within Exo Player to an Atmos capable AV receiver.
Linked Content:
https://mega.nz/#!oJVzDDiZ
Decryption key: !VZSnDiayjtDl2RDCzNOV-kw6R3MV8bMwX3YXLMuXamg
Device: 2015 and 2017 Nvidia ShieldTV (firmware 6.3) on Android 7.0
Bug report forthcoming
Please could you try increasing the buffer size in DefaultAudioSink and let us know if that fixes the issue?
If that does fix it, we should probably just set the buffer size to the maximum allowed bitrate, assuming it's not too large. I haven't been able to find a specification saying what this value is, though. Do you or @drhill have any ideas about this? Thanks!
(Side note: I guess https://forum.kodi.tv/showthread.php?tid=327153 is your report too? I thought Kodi didn't use ExoPlayer. That makes me wonder if this is an issue with the passthrough implementation on these devices, or maybe they just use a too-small buffer size too.)
Yes, that is my post over at the Kodi forum. I decided to post the issue here, as well, since I also use Plex and they use ExoPlayer (albeit a modified version). I have asked the Plex devs to make the change you requested to the DefaultAudioSink to see if that works. There has been some discussion on the issue around the possibility that it is a Dolby MAT problem. Please see here for additional information: https://club.myce.com/t/atmos-audio-drop-outs-details-thread/399840
Just wanted to confirm that we (Plex) had seen this GHI and discussing how to best test the suggested changes.
I have few Atmos tracks and no Atmos system to test with. I never had drop outs on TrueHD tracks though, only DTS-MA tracks prior to upping the buffer size.
I had never had issues prior to a few of the new 4K BDs with much higher bitrate Atmos tracks. These discs, while still within Atmos spec, are substantially higher bitrate (>50%) versus the average Atmos track found on BD. As previously stated these discs play without issue on a UHD BD player and leads me to believe it could be an HDMI encapsulation problem due to the lack of documentation to Dolby’s MAT 2.0 spec.
On Feb 14, 2018, at 4:04 PM, drhill <[email protected]notifications@github.com> wrote:
I have few Atmos tracks and no Atmos system to test with. I never had drop outs on TrueHD tracks though, only DTS-MA tracks prior to upping the buffer size.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fgoogle%2FExoPlayer%2Fissues%2F3803%23issuecomment-365774510&data=02%7C01%7C%7Cd06baf5edd94427fe54308d573ff4351%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636542462538688871&sdata=cV9mj4ILobQPNCvQ4tYs8pzdjfsFC3Z%2FwmdlPpF3eWY%3D&reserved=0, or mute the threadhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAifn-sUi4qi208Lz_Op1kOJKSf0YlY95ks5tU2ZrgaJpZM4R570g&data=02%7C01%7C%7Cd06baf5edd94427fe54308d573ff4351%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636542462538688871&sdata=JYJJbN0ESL%2BXrjcN5ajHDxjpIpL15jxonDhf0J5pmTU%3D&reserved=0.
I have tested and was able to reproduce the issue with Atmos tracks (with Atmos capable receiver) and HEVC 4K video via Plex on Nvidia Shield. It does happen with Kodi as well on Android TV.
It's worth noting that in Plex, we actually still use our own implementation of True HD passthrough, since official support was added only last month. We'll likely drop our version to adopt the one recently added. However, it does appear that we use a smaller buffer than the one add in https://github.com/google/ExoPlayer/commit/8e8e53c42d7a63ee5f6703d86902ebb102c10af5.
One question about the buffer calculation though:
bufferSize = (int) (PASSTHROUGH_BUFFER_DURATION_US * 192 * 6 * 1024 / C.MICROS_PER_SECOND);
Am I missing something, but the * 6 is for 6 channels, at a maximum of 192 Khz audio. But for True HD and DTS-HD, shouldn't that be * 8 If you really want to try and handle the "maximum"?
@IanDBird There was some discussion on #2960.
Apparently the maximum bitrate for DTS MA is 24.5 Mbit/s, which I think would require a buffer size of about 800 KB for our usual buffer duration of 250 ms (we currently request about 300 KB).
FYI - Nevcairiel has fixed this in the latest release of LAV - https://github.com/Nevcairiel/LAVFilters/issues/208#issuecomment-394095164
I can concur that Nevcairiel's fixes do work on PC.
@andrewlewis - Can this be closed now?
I think we can close this on the assumption that the buffer sizes were too small before 7ead310. I tested the change using high bitrate content in various encodings on Nexus Player and Nvidia Shield.
@Balthazar2k4, @IanDBird, @drhill, @hjtech If you see issues with underruns after including the fix above please provide some sample content and a bug report on a new issue and we'll take a look. Thanks!
Most helpful comment
Just wanted to confirm that we (Plex) had seen this GHI and discussing how to best test the suggested changes.