Description
ExoPlayer Version
2.17.1
Devices that reproduce the issue
Nvidia Shield TV Pro
Devices that do not reproduce the issue
None
Reproducible in the demo app?
Yes
Reproduction steps
Playback a HLS (fMP4) DTS Digital Surround audio stream on Nvidia Shield TV Pro (connected to an AVR via HDMI) running v2.17.1 Exoplayer demo app.
The DTS bitstream should be passthrough to the AVR for decoding. This works in earlier versions of Exoplayer, E.g. v2.14.1. In v2.17.1 the playback fails.
Expected result
The DTS bitstream should be passthrough to the AVR for decoding.
Actual result
Playback Fails.
Diagnosis
In Exoplayer, there is a variable allowChunklessPreparation in HLSMediaPeriod.java which determines whether chunkless preparation (for HLS-fMp4 streams) is allowed. If chunkless preparation is allowed, the attributes of the Codec (such as channelCount) will not be determined by downloading a segment and parsing the Moov box (AtomParsers.parseAudioSampleEntry()). Instead, it will be trying to read these attributes from the Multivariant HLS playlist. Details on Multivariant playlist is here: https://developer.apple.com/documentation/http_live_streaming/example_playlists_for_http_live_streaming/creating_a_multivariant_playlist
When Exoplayer is deciding whether to passthrough the bitstream, it calls DefaultAudioSink().isPassthroughPlaybackSupported(), which will return false when channelCount of the stream is unknown.
When allowChunklessPreparation is set to true, it depends on the HLS manifests (See HlsPlaylistParser::parseMultivariantPlaylist(), HLSMediaPeriod::deriveAudioFormat()) to provide information on the CODECS. However, in the test streams used, "channelCount" is not part of the information provide by the HLS Multivariant playlist. This resulted in the channelCount not being defined and DefaultAudioSink().isPassthroughPlaybackSupported() will return false causing the Digital Surround bitstream passthrough to fail.
When allowChunklessPreparation is set to false, channelCount will be read by parsing the Moov box (AtomParsers.parseAudioSampleEntry()) during the setup stage. A subsequent call to DefaultAudioSink().isPassthroughPlaybackSupported() will then return true and passthrough is possible.
In Exoplayer v2.14.1, allowChunklessPreparation in HLSMediaPeriod.java was not set explicitly and it defaults to false. Therefore passthrough works.
In Exoplayer v2.17.1, allowChunklessPreparation in HLSMediaPeriod.java was initialised to true. This caused passthrough to fail for the reasons mentioned earlier (channelCount undefined).
Solution
In order to overcome this issue, It is recommended in Exoplayer v2.17.X to initialise allowChunklessPreparation to false in the constructor of HLSMediaSource.Factory. This will allow HLS-fMP4 with DTS Digital Surround to passthrough successfully.
Media
Test media will be emailed to dev.exoplayer@gmail.com
Bug Report
- You will email the zip file produced by
adb bugreport
to dev.exoplayer@gmail.com after filing this issue.