Fix AFTKRT + HSL/TS + EAC3 7.1 playback issues (#1580)

## Description
This is a targeting fix for a very specific bug: on Fire TV 4k Max
(AFTKRT), and possibly others but untested, ExoPlayer can't play an
HLS/TS stream that has 8-channel (7.1) EAC3 audio. Direct play is not
affected (7.1 EAC3 plays fine), and fewer channels work fine (i.e. 5.1
EAC3) even in an HLS/TS wrapper.

This bug + device is tracked in KnownDefects. If more models are tested
and found to have the same issue, they can be added to the list. Top
candidates are probably AFTKA and AFTKM since they are also in the
models with HEVC DoVi/HDR10+ playback issues and so probably have
similar underlying limitations, but I don't have those devices to test.

The fix is to first allow the app to make a playback request to the
server and receive the stream info Jellyfin has decided to send. Then it
evaluates the settings and stream for the following:
- Playback is using ExoPlayer
- Device is in the modelsWithEac3HlsPassthroughBug list (currently only
AFTKRT)
- Stream is not direct play
- Stream is HLS with MPEG-TS container
- Audio is 8-channel EAC3

We have to use a two-request fix because we don't know what Jellyfin is
going to decide for the stream until we receive it. That way normal
playable streams aren't getting overwritten by the fix when they
shouldn't be. So the only streams that get the two request path applied
is the exact fix for this bug.

To apply post-playback-info fixes (including this one) a helper file was
created PostPlaybackInfoFixes. In the future, if there are more bugs
that can only be determined after the decided stream info is received,
they can be added here. This keeps things logical and maintainable.


### Related issues
The bug was able to be reproduced on multiple items with this exact
scenario by simply playing back the item (making sure ExoPlayer is set
as the default player in settings).

### Testing
Tested on the target device: Amazon Fire TV 4k Max (2nd Gen), model
AFTKRT.

The following media was tested:
- ExoPlayer, multiple titles with HEVC, EAC3 7.1 copied into HLS/TS (all
failed, only processing 1-2fps)
- Direct play of the same titles (works)
- EAC3 5.1, HLS, MPEG-TS (works)
- MPV with failing titles (works)

The following device and settings were tested and had no effect on the
above media results, ruling out external connections and settings:
- HDMI to an LG TV, both connected to a soundbar via ARC, and
disconnected using internal speakers
- HDMI to a Dell computer monitor
- Fire TV Settings > Display & Sound > Audio > Surround Sound > all 4
settings tested (Best Available, PCM, Dolby Digital Plus, Dolby Digital)

## AI or LLM usage
Codex was used to debug the issue, create the initial change, and do
iterative testing on the device to narrow the scope. The code was then
carefully reviewed and I made structural decisions so everything fits
well within the project's established conventions, removing bloat, added
comments and kept it targeted, clear and maintainable.
This commit is contained in:
calebvetter 2026-06-27 14:42:01 -07:00 • committed by GitHub
parent 00338c5c11
commit 1c9081951a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 0 deletions

View file

@ -203,6 +203,19 @@ fun createDeviceProfile(
}
// / Codec profiles
// Prevent 8-channel EAC3 passthrough in TS on certain devices
if (KnownDefects.eac3HlsPassthroughBug && Codec.Audio.EAC3 in allowedAudioCodecs) {
codecProfile {
type = CodecType.VIDEO_AUDIO
container = Codec.Container.TS
codec = Codec.Audio.EAC3
conditions {
ProfileConditionValue.AUDIO_CHANNELS lowerThanOrEquals 7
}
}
}
// H264 profile
codecProfile {
type = CodecType.VIDEO

View file

@ -14,6 +14,14 @@ private val modelsWithDoViHdr10PlusBug =
"AFTKM", // Amazon Fire TV 4K (2nd Gen)
)
/**
* List of device models with known playback issues when 8-channel EAC3 is copied into MPEG-TS.
*/
private val modelsWithEac3TsPassthroughBug =
listOf(
"AFTKRT", // Amazon Fire TV 4K Max (2nd Gen)
)
/**
* List of device models that support H264 Hi10P 5.2, but don't advertise it
*
@ -30,5 +38,6 @@ private val modelsWithHi10P52Support =
object KnownDefects {
val hevcDoviHdr10PlusBug = Build.MODEL in modelsWithDoViHdr10PlusBug
val eac3HlsPassthroughBug = Build.MODEL in modelsWithEac3TsPassthroughBug
val supportsHi10P52 = Build.MODEL in modelsWithHi10P52Support
}