HLS-FMP4 DTS:X Profile 2 Streams are missing first 2 seconds during Tunnel mode (Direct) Playback due to timestampAdjuster in FragmentedMp4Extractor.java
@tianyif is already working on this.
Since Apr 4, 2024.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Version
Media3 main branch
More version details
Devices that reproduce the issue
All Android TV with DTSX Decoder. E.g. Xiaomi Q2 55"
Devices that do not reproduce the issue
None.
Reproducible in the demo app?
Yes
Reproduction steps
- Add the following URL to media.exolist.json: https://secured.streamdts.com/dtsx/dtsx/hls/fmp4/callout/index.m3u8
- Enable Tunnel mode
- Playback the stream and observe that the first 2 seconds are skipped.
- Disable Tunnel mode
- Playback the stream and observe that playback is now ok.
- Playback is also ok with the follow DASH stream in tunnel mode. And I have verified that for DASH, there is no timestamp adjustments that are going on: https://secured.streamdts.com/dtsx/dtsx/dash/callout/index.mpd
NOTES:
HLS-FMP4 DTS:X Profile 2 Streams are missing first 2 seconds of audio during Tunnel mode (Direct) Playback due to timestampAdjuster in FragmentedMp4Extractor.java.
- This only happens for Tunnel mode playback with DTS:X audio playing back via Direct Passthrough.
- This does not happen when playing back through MediaCodec DTSX Decoder.
- When the following lines (around line 1538) in FragmentedMp4Extractor.java are commented, the playback seems ok.
if (timestampAdjuster != null) {
sampleTimeUs = timestampAdjuster.adjustSampleTimestamp(sampleTimeUs);
} - FYI, DTS:X Profile 2 audio codec has a sync and non-sync frame concept. So once the first sync frame is lost, the whole section of audio cannot be decoded properly until the next sync frame can be located. In this stream, the sync interval is 2 seconds. It correlates with the 2 seconds lost in the beginning.
- What does timestampAdjuster do exactly? When are these adjustments to the presentation time stamps required?
- Is the presentation time stamp adjustments necessary when playing back via Direct Passthrough?
- How can we resolve this issue more gracefully?
Thanks!
Expected result
Playback does not skip the first 2 seconds.
Actual result
Playback skipped the first 2 seconds.
Media
HLS-fMP4 stream. First 2 seconds lost during playback in tunnel mode:
DTS:X 5.1.4 - HLS fMP4: https://secured.streamdts.com/dtsx/dtsx/hls/fmp4/callout/index.m3u8
DASH stream with no playback issues:
DTS:X 5.1.4 - DASH: https://secured.streamdts.com/dtsx/dtsx/dash/callout/index.mpd
The PTS values are the same in both streams.
Bug Report
- You will email the zip file produced by
adb bugreportto android-media-github@google.com after filing this issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.