jellyfin / jellyfin-androidtv

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

AAC LC audio always outputs 2.0 PCM. DTS/AC3 passes through correctly. #520

Closed michaelkrieger closed 2 years ago

michaelkrieger commented 4 years ago

AAC LC formatted audio always outputs 2.0ch PCM 48kHz irrespective of what passthrough settings are selected on Android TV. DTS/AC3 correctly plays 5.1 audio through Jellyfin No transcoding is occurring as per Jellyfin's logs.

Possible solutions:

Checks

Media Info of the file

General Complete name : S:\Movies\Movie1.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom (isom/iso2/avc1/mp41) File size : 1.85 GiB Duration : 1 h 37 min Overall bit rate : 2 732 kb/s Movie name : Movie1 Encoded date : UTC 2020-06-29 11:26:31 Tagged date : UTC 2020-06-29 11:26:31 Writing application : Lavf58.20.100 Comment : Movie1

Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L4.1 Format settings : CABAC / 4 Ref Frames Format settings, CABAC : Yes Format settings, Reference frames : 4 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 1 h 37 min Bit rate : 2 500 kb/s Width : 1 920 pixels Height : 804 pixels Display aspect ratio : 2.40:1 Frame rate mode : Constant Frame rate : 23.976 (23976/1000) FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.068 Stream size : 1.70 GiB (92%) Writing library : x264 core 152 r2851M ba24899 Encoding settings : cabac=1 / ref=4 / deblock=1:-1:-1 / analyse=0x3:0x113 / me=umh / subme=9 / psy=1 / psy_rd=1.00:0.15 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-3 / threads=16 / lookahead_threads=4 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=2pass / mbtree=1 / bitrate=2500 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=31250 / vbv_bufsize=31250 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=3:1.00 Encoded date : UTC 2020-06-29 11:26:31 Tagged date : UTC 2020-06-29 11:26:31 Codec configuration box : avcC

Audio ID : 2 Format : AAC LC Format/Info : Advanced Audio Codec Low Complexity Codec ID : mp4a-40-2 Duration : 1 h 37 min Bit rate mode : Constant Bit rate : 224 kb/s Channel(s) : 6 channels Channel layout : C L R Ls Rs LFE Sampling rate : 48.0 kHz Frame rate : 46.875 FPS (1024 SPF) Compression mode : Lossy Stream size : 156 MiB (8%) Language : English Default : Yes Alternate group : 1 Encoded date : UTC 2020-06-29 11:26:31 Tagged date : UTC 2020-06-29 11:26:31

Logs

FFmpeg Logs No transcoding is taking place on Jellyfin

System (please complete the following information):

Additional context Both Kodi and Jellyfin correctly plays DTS audio via EARC over HDMI. Kodi correctly plays AAC audio with the following settings (the important ones that I needed to get it working are the two with asterisks by them)

Can this be forced server-side on Jellyfin to transcode to DTS? Can a change be made in the Jellyfin app to mimic what Kodi is doing?

stale[bot] commented 4 years ago

This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments. If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or master branch, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label. This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.

michaelkrieger commented 3 years ago

Bumping in hopes that this reopens. Would eliminate the need for external players entirely for me.

svemonix commented 3 years ago

The issue is more on server side than on the client side. Basically, Kodi works because it implements a multichannel AAC to AC3 transcoding ("Enable Dolby Digital (AC3) transcoding: On") so it is effectively AC3 that is being passed through.

It is the jellyfin server that should properly differenciate stereo AAC from multichannel AAC. Right know it seems the server only looks at the codec which is insufficient. If jellyfin would somehow be aware of the multichannel AAC, then it could take care of the transcoding to AC3.

svemonix commented 3 years ago

Someone has been working on a server fix with chromecast in mind: #6043

peterspenler commented 3 years ago

I'm not sure if my fix will have any effect here, since I wasn't able to reproduce the issue. I was running the app through an emulator, so I don't know if that's part of why I couldn't reproduce it, but I played a number of files with 5.1 AAC LC audio, and their audio was all transcoded to AC3 5.1. Could you provide a transcoding log from when you try to play the file?

svemonix commented 3 years ago

We can't provide a transcoding log since there is no transcoding occuring which is precisely the issue.

I'm not sure how the emulator behaves but if it worked I assume it actually reports 2 channels AAC which would indicate that the server side is actually fine (you tried your fix or the current release?). Unless transcoding occured for another reason.

Then the question would be why it is not the case on actual devices. I suspect getMaxInputChannelCount() returns more than 2 channels since the device will actually be able to playback multi AAC but will downmix to be able to output it properly (i.e. playback capabilities vs actual output/passthrough capabilities). Many devices can't output multi PCM. They can only do 2.0 PCM and passthrough AC3, DTS, etc.

If that's the case, I would suggest to literally hardcode AAC to be limited to 2 channels so that the server can transcode. This wouldn't be an issue since the app only relies on passthrough (no multi PCM) with both Exoplayer and libVLC and multi AAC cannot be passed through anyways.

stale[bot] commented 3 years ago

This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments. If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or master branch, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label. This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.

michaelkrieger commented 3 years ago

Still relevant. Two channel audio through eARC to the receiver whereas Kodi will pump out 5.1

AlexKalopsia commented 2 years ago

Having the same issue :( Hoping this can get prioritized

ChristofferKarlsson commented 2 years ago

Same issue here. Works perfectly with the suggested Kodi settings posted.

jellyfin-bot commented 2 years ago

This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments.

If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or master branch, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label.

This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.

LionelDerBoven commented 2 years ago

Still a issue today. No transcoding happening when it should transcode to ac3 multichannel. Only thing making it hard to switch from plex.

hrvojehegedus commented 2 years ago

Same issue here. AAC multichannel doesn't work...

thiakil commented 2 years ago

I'm also still getting this - even with my hdmi going via avr Unless I turn off refresh rate switching - it now seems to be opening an lpcm 5.1 output with that turned off

Nvidia shield running shield OS 9.1.1

hrvojehegedus commented 1 year ago

It still doesn't work on Mi Box TV (build PI.3933), regardless of whether refresh rate switching is turned on or off...

Mavyre commented 1 year ago

Still an issue!

abramvp commented 1 year ago

Doesn't Work on Both Mi Box TV and Bravia

IzzyMC commented 1 year ago

Still an issue for me as well!

SuperMario86 commented 1 year ago

Still an issue for me

codmpm commented 1 year ago

Just this won't stale again: Still an issue with Jellyfin 10.8.10.

SplitMilky commented 1 year ago

I am currently have this issue. All files with AAC 5.1 come through as 2,0. Currently resorting to manually reencoding to AC3. Android 9 on Sony AndroidTV Marrantz 7703 preamp/processor

saxobroko commented 1 year ago

To avoid this issue going stale again, as i still have this issue, I am once again commenting.

zkhcohen commented 11 months ago

I'm getting different results, with multichannel PCM being output, NOT stereo:

https://github.com/jellyfin/jellyfin-androidtv/issues/1753#issuecomment-1853148550