Add 'SPDIF/ARC Mode' toggle and functionality#1410
Conversation
This change forces all multichannel audio to be transcoded to AC3 5.1. This is meant for TV's/devices that support SPDIF and/or ARC, but not eARC. Therefore they are limited to 6 channels and the AC3 codec (many such devices support DTS codec as well, but not as universally as AC3). However, they frequently advertise support for more channels and newer codecs, silently downmixing such audio streams internally. This change ensures that the client can still output multichannel audio that is compatible with the device. This change does not force video transcode, or alter existing video stream transcoding behavior. This change primarily: 1. Adds a toggle to enable this mode. 2. Manages potentially conflicting 'Downmix to Stereo' and 'AC3 Supported' toggles. 3. For video libraries, if toggle is enabled, sets max channels to 6 and invalidates all non-AC3 codecs for multichannel audio. 4. For music libraries, if toggle is enabled, sets max channels to 6 and requests transcode to AC3 in mka container for multichannel audio. Similar to Experimental PR damontecres#947. 1. UT's added to validate and prevent potential toggle conflicts. 2. Manually tested on Firestick 4k (1st gen) in video+audio libraries: - Stereo audio content plays with DirectPlay - Multichannel AC3 content plays with DirectPlay - Multichannel non-AC3 content plays with DirectStream N/A LLM's were used for planning, initial draft and critical review. All code changes were manually reviewed and vetted.
There was a problem hiding this comment.
These changes look pretty much the same as in #947. The device profile configuration and music transcoding are probably the only significant differences.
Can you elaborate more on the changes you've made?
|
Thanks for reviewing! Yes, the changes are similar, the intents of the PR's overlap but differ, and the device profile configuration is the key difference. My TV supports SPDIF and ARC, but not eARC. Due to SPDIF/ARC bandwidth constraints, my audio output is limited to 6 channel AC3 codec. All other multichannel audio is downmixed internally and output as stereo. I believe that such devices falsely advertise support for technically unsupported codecs and 8 channels to allow 'at least' downmixed stereo as a fallback. From what I understood in #947 and the related issues, the intent there is to support devices that have eARC, and which either downmix or can't decode multichannel AAC and OPUS. All other multichannel audio codecs are DirectPlayed. IIRC things like downmixing (eg. 7.1 -> 5.1) or Atmos backward compatibility with DD+ is usually smartly handled by the devices themselves. With the #947 toggle enabled for my SPDIF usecase, I would get:
So with this PR, the intent is to specifically support SPDIF/ARC devices by requesting audio transcode for ALL non-AC3 multichannel audio, rather than only AAC and OPUS. I'm doing this by setting the device profile to explicitly exclude all non-AC3 multichannel support if the toggle is enabled, so that AC3 is the only available compatible codec for multichannel. I've seen that other media players have an 'SPDIF mode' or similar for this reason - I've seen it in Kodi and Pot Player. Other differences:
Can I propose a change to add an 'Audio Transcoding' sub-menu instead of these toggles, where the user can explicitly specify channel count and have granular control over the DirectPlay supported codecs? I also ran into an issue with this PR that #947 had as well - PGS subtitles. I incorrectly said that subtitle burn-in was not forced. Turns out that since I've disabled video transcoding on my server, PGS subs were simply being dropped for me (despite 'selecting' them in the UI Subtitles menu). It looks like this is due to DirectStream remuxing to TS, which doesn't support PGS (IIRC you'd mentioned the same thing in a related thread). I'm exploring a workaround for it, but either way, I guess that would be a separate change, as it is unrelated to audio transcoding. |
Description
This change provides a toggle that forces all multichannel audio to be transcoded to AC3 5.1.
This change does not force video transcode, subtitle burn-in, or alter any existing video stream transcoding behavior.
Similar to the
downmixStereoandac3Supportedtoggles, this new toggle applies only to Exoplayer and not mpv.This is meant for TV's/devices that support SPDIF and/or ARC, but not eARC. Therefore they are limited to 6 channels and the AC3 codec (many such devices support DTS codec as well, but not as universally as AC3).
The main issue is that such devices frequently advertise support for more channels and/or newer codecs,
but silently downmix such audio streams to stereo internally.
This change ensures that the client will receive multichannel audio that is compatible with the device, while continuing to DirectPlay stereo audio without transcoding.
Of course, it requires audio transcoding to be enabled for the Jellyfin user and library.
This change primarily:
Related issues
#335 , #255
Similar to Experimental PR #947 - but includes (i) transcoding only if required (ii) handling multichannel music.
Testing
Screenshots
N/A
AI or LLM usage
LLM's were used for planning, initial draft and critical reviews.
All code changes were manually reviewed and vetted.