jellyfin / jellyfin-androidtv

Android TV Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
2.69k stars 461 forks source link

Exoplayer not playing back DTS-HD and AAC 7.1 #3166

Open Eddez02 opened 10 months ago

Eddez02 commented 10 months ago

Describe the bug

When using my Nvidia Shield 2019 Pro with Exoplayer it doesn't play DTS-MA and AAC 7.1. When playing up a DTS-MA track the audio instead gets played back as the lossy DTS-Core. And AAC 7.1 gets played back as 2.0 PCM. On the supported format section on the Exoplayer website it says that both of these formats are supported when running the FFmpeg extension that jellyfin is using. When using libVlc the playback of these audio codes work correctly as it should but has the tendency to stutter in some scenes.

Logs

No response

FFmpeg logs

No response

Media info of the file

General
Unique ID                                : 263741017464459088190612439453010046358 (0xC66AAC1C7EAA09D9806DBE2F39512D96)
Complete name                            : \\TRUENAS\MediaSMB Iron Wolf\Movies\Batman Begins (2005)\Batman Begins (2005) [imdbid-tt0372784] - [Remux-2160p Proper][HDR10][DTS-HD MA 5.1][HEVC]-FGT.mkv
Format                                   : Matroska
Format version                           : Version 4
File size                                : 56.2 GiB
Duration                                 : 2 h 20 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 57.5 Mb/s
Frame rate                               : 23.976 FPS
Writing application                      : Lavf59.27.100
Writing library                          : Lavf59.27.100
ErrorDetectionType                       : Per level 1

Video
ID                                       : 1
ID in the original source medium         : 4113 (0x1011)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 2 h 20 min
Bit rate                                 : 52.4 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.264
Stream size                              : 51.3 GiB (91%)
Language                                 : English
Default                                  : No
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0050 cd/m2, max: 4000 cd/m2
Maximum Content Light Level              : 992 cd/m2
Maximum Frame-Average Light Level        : 226 cd/m2
Original source medium                   : Blu-ray

Audio #1
ID                                       : 2
ID in the original source medium         : 4352 (0x1100)
Format                                   : DTS XLL
Format/Info                              : Digital Theater Systems
Commercial name                          : DTS-HD Master Audio
Codec ID                                 : A_DTS
Duration                                 : 2 h 20 min
Bit rate mode                            : Variable
Bit rate                                 : 4 382 kb/s
Channel(s)                               : 6 channels
Channel layout                           : C L R Ls Rs LFE
Sampling rate                            : 48.0 kHz
Frame rate                               : 93.750 FPS (512 SPF)
Bit depth                                : 24 bits
Compression mode                         : Lossless
Stream size                              : 4.29 GiB (8%)
Title                                    : DTS-HD MA 5.1
Language                                 : English
Default                                  : Yes
Forced                                   : No
Original source medium                   : Blu-ray

Audio #2
ID                                       : 3
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                 : A_AC3
Duration                                 : 2 h 20 min
Bit rate mode                            : Constant
Bit rate                                 : 640 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Bit depth                                : 32 bits
Compression mode                         : Lossy
Stream size                              : 641 MiB (1%)
Title                                    : DD 5.1
Language                                 : English
Service kind                             : Complete Main
Default                                  : No
Forced                                   : No

Text #1
ID                                       : 4
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 2 h 10 min
Bit rate                                 : 52 b/s
Frame rate                               : 0.174 FPS
Count of elements                        : 1368
Stream size                              : 50.2 KiB (0%)
Language                                 : English
Default                                  : Yes
Forced                                   : No

Text #2
ID                                       : 5
ID in the original source medium         : 4768 (0x12A0)
Format                                   : PGS
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 2 h 20 min
Bit rate                                 : 30.2 kb/s
Frame rate                               : 0.351 FPS
Count of elements                        : 2946
Stream size                              : 30.1 MiB (0%)
Language                                 : English
Default                                  : No
Forced                                   : No
Original source medium                   : Blu-ray

Menu
00:00:00.000                             : Chapter 01
00:03:39.385                             : Chapter 02
00:07:31.325                             : Chapter 03
00:11:34.110                             : Chapter 04
00:16:15.683                             : Chapter 05
00:19:44.433                             : Chapter 06
00:24:19.124                             : Chapter 07
00:28:24.869                             : Chapter 08
00:31:25.383                             : Chapter 09
00:35:53.901                             : Chapter 10
00:38:24.677                             : Chapter 11
00:41:14.680                             : Chapter 12
00:43:07.876                             : Chapter 13
00:46:57.940                             : Chapter 14
00:49:43.939                             : Chapter 15
00:53:26.161                             : Chapter 16
00:55:55.143                             : Chapter 17
00:58:02.353                             : Chapter 18
01:03:31.849                             : Chapter 19
01:05:53.074                             : Chapter 20
01:08:38.656                             : Chapter 21
01:11:25.739                             : Chapter 22
01:13:19.520                             : Chapter 23
01:16:16.238                             : Chapter 24
01:19:50.327                             : Chapter 25
01:23:54.362                             : Chapter 26
01:29:02.754                             : Chapter 27
01:32:36.509                             : Chapter 28
01:37:48.946                             : Chapter 29
01:40:33.694                             : Chapter 30
01:45:09.136                             : Chapter 31
01:49:32.190                             : Chapter 32
01:51:29.349                             : Chapter 33
01:54:49.090                             : Chapter 34
01:58:11.125                             : Chapter 35
02:01:55.099                             : Chapter 36
02:05:01.285                             : Chapter 37
02:06:06.976                             : Chapter 38
02:09:18.292                             : Chapter 39
02:10:57.140                             : Chapter 40

Application version

v0.16.0-Beta.5

Device information

Nvidia Shield 2019 Pro

Android version

Andriod 11

Jellyfin server version

10.8.11

Eddez02 commented 10 months ago

Exoplayer is compiled and shipped by the firmware, in your case NVidia

jellyfin-androidtv is fully capable of providing the streams to exoplayer but does not perform the actual playback so issues with playback are a result of device firmware not jellyfin

the jellyfin androidtv app is fully capable of playing DTS on a Rocktek G2 as well as a FireTV Cube Gen3

on the FireTV, however, the FireTV has a firmware issue that causes freezing - not an issue with jellyfin either

as you state libvlc works it further points to exoplayer which can only be fixed by NVidia

  • 3rd party observations only, I do not claim to be part of the Jellyfin project

Installed and setup a Emby Server just to test as Emby also uses the Exoplayer backend. In Emby it plays back DTS-HD-MA files without a problem. The problem is with how the FFmpeg extension is set up in Jellyfin. The FFmpeg extension is used to get support for more audio codecs inside of Exoplayer. Also exoplayer is run at an applevel and not at an OS level. It's a feature that needs to be enabled in Exoplayer like Opus and Flac playback was in the latest beta version.

Eddez02 commented 10 months ago

Because you said we don't know if Emby is playing back the file untouched I decided to download a DTS-HD-MA 7.1 audio test file and open it up in the stock gallery app on the Shield. When playing back the mkv test file in the gallery app DTS-HD-MA 7.1 played back as intended. The shield also uses the exoplayer for playback in the gallery app. My server also tells me the file is being directly played on the Shield. I found if you turn off PCM to use Dolby reference level I can at least get the DTS-HD-MA to be output to LPCM instead of PCM 2.0.

Eddez02 commented 10 months ago

That file doesn't work to get output as LPCM so it should be lossless but it isn't output as a DTS-MA file so it can be a problem for people that want to listen to DTS:X audio.

I am running Jellyfin Server 10.8.11 and right now i am running the Jellyfin v0.16.0-Beta 5 i don't know how to compile an apk from the master branch myself, otherwise I would like to test it on the latest version of the branch if that would change anything.

Eddez02 commented 10 months ago

Dolby Digital+ Also experiences the same issue and gets converted to PCM instead. But i notice on my AVR that it flashes between DTS or DD+ depending on the format and in the end it sets it self to multichannel PCM. TrueHD, DD, DTS core works at it should.

Eddez02 commented 10 months ago

Also if you turn of Dolby bit streaming. DTS-MA will play as normal DTS insted of multichannel PCM.

Denist79 commented 10 months ago

I can concour there is issues with the bit streaming part using FireTV Cube 3. Set preferred player Exoplayer.

Latest Jellyfin 16 beta 5.

Works Dolby TrueHD, Dolby Atmos with DD

does not work correctly DD+ downmix to multi CH 2.0 DTS-HD outputs DTS Core sometime freezes or works weirdly.

with KODI all works except DD+ output Multi CH 5.1.

Thanks.

almightiest commented 9 months ago

Check out issue #1753 which is related. I have tons of issues with direct sound output on this app, so I have to use Plex even though I don't want to.

Starfoxfs commented 8 months ago

+1 Here, i have the same issue on Nvidia Shield TV Pro 2019.

DTS-HD MA not works is turned in DTS, Dolby True HD is turned in MultiChannel.

Here the Passthrough not works correctly

Version Jellyfin Android Player 0.16.04

Player for Playback is set to Automatic

realHyperMatrix commented 8 months ago

I have this same issue with AAC 7.1 audio stuttering on a brand new Nvidia Shield TV Pro through Plex. Video, in DV or HDR plays perfectly. Switching to other non-AAC 7.1 audio streams on the same movie has no stuttering. I checked the logs and there is no transcoding happening. It's a direct stream that's being passed through. All other formats including Dolby TrueHD/Atmos work fine. I connected Kodi on the Nvidia Shield to my NAS and played the file through there, and there was no stutter. This means:

That would seem to indicate an issue with the Exoplayer that Plex/Jellyfin are using on the Nvidia Shield Pro. Hope this helps.

Starfoxfs commented 8 months ago

It´s not an Exoplayer issue itself, because Jellyfin AndroidTV Player don´t work with Exoplayer and DTS-HD MA and e.g. Emby or Plex uses also the Exoplayer and here is no issue with playback of DTS-HD MA.

So i think it´s an issue somewhere between Jellyfin AndroidTV Player and Exoplayer.

I need to say i have only tested this with MKV Files, because these are the most common files at this time

almightiest commented 8 months ago

It´s not an Exoplayer issue itself, because Jellyfin AndroidTV Player don´t work with Exoplayer and DTS-HD MA and e.g. Emby or Plex uses also the Exoplayer and here is no issue with playback of DTS-HD MA.

So i think it´s an issue somewhere between Jellyfin AndroidTV Player and Exoplayer.

I need to say i have only tested this with MKV Files, because these are the most common files at this time

Starting with Android TV client 0.16.3, they switched away from exoplayer to the newer mediax library, but I still have playback issues like unable to play non-dolby 7.1 audio formats, jittery playback sometimes, etc.

Starfoxfs commented 8 months ago

If u choose LibVLC (experimental) DTS-HD MA works for me but then Subtitles don´t work correct or without Transcoding.

Landlord7284 commented 7 months ago

+1 Here, i have the same issue on Nvidia Shield TV Pro 2019.

DTS-HD MA not works is turned in DTS, Dolby True HD is turned in MultiChannel.

Here the Passthrough not works correctly

Version Jellyfin Android Player 0.16.04

Player for Playback is set to Automatic

+2 then. Same here. libVLC shows DTS-MA on receiver, but no audio, or stutter.

In Kodi external player the DTS-MA works fine, but if I have embedded subs and external subs, only the embedded are recognized.

TrapperJ commented 6 months ago

+3 exactly the same issue. This prevents me from using DTS:X or Auro3D. So it is a showstopper. No issues with exoplayer from any othe app. Problem seems to be with Jellyfin.

mikeporterinmd commented 5 months ago

TrueHD works for me. Latest Jellyfin Android for TV on Nvidia Shield Pro 2019. I think that DTS-HD MA does not work and gets interpreted as DTS (lossy) is simple enough. As far as I can tell, ffmpeg does not identify DTS-HD MA specifically, but rather sends AudioCodec=dts in the URL. However, there is in fact a mimeType for DTS-HD MA in Android:

public static final String [AUDIO_DTS_HD](https://developer.android.com/reference/androidx/media3/common/MimeTypes#AUDIO_DTS_HD()) = "audio/vnd.dts.hd"

So, it would seem that we need to get a chance for ffmpeg or perhaps libffmpeg and a change to jellyfin android tv to get DTS-HD to work.

Mike

cj0r commented 2 months ago

Same exact issue here. Using libvlc or vimu external player as work around but hoping for a solution for native exoplayer.

mikeporterinmd commented 2 months ago

Just (Video) Player works pretty well with Jellyfin client. It will play DTS-HD MA. Not sure why the projects don't collaborate. Anyhow, I like JP because it is simple and lightweight. Generally, I really like the Jellyfin client, but just ignoring DTS-HD MA for seemingly no reason makes it less than great. I looked at their source, but with no comments and new code vs. old code, and a working player I get could get elsewhere made it not really worth the time it would take to learn to fix the issue.

cj0r commented 2 months ago

I don't mind using an external player, however resume positions are lost because of this need which can be pretty frustrating.

dinosmm commented 1 month ago

With the removal of LibVLC, the Android TV client can no longer play DTS-HD and DTS:X. They are both played as plain DTS, which results in massively different sound, in the :X case losing depth and positional information. I believe this is because Exoplayer is still used as the now-only player, with its limitations regarding lack of DTS-HD and DTS:X support as described in this issue.

Henni16 commented 1 month ago

I'm having the same problem. My current solution is to use Just Player as @mikeporterinmd suggested. It also seems to remember the resume position now, which didn't work before. I'd still prefer an internal player as I like the jellyfin UI more.