Repository navigation
Description
What happened?
A Dolby Vision Profile 8.1 MKV whose hvcC states general_level_idc = 156 (level 5.2) never plays on the master playlist. The DV master is refused, then the reduced HDR master too, with AVFoundationErrorDomain -11848 'Cannot Open' (underlying CoreMediaErrorDomain -15517). The readiness gate falls back to the media playlist, so the session plays the HDR10 base with the DV upgrade dropped, and videoFormat publishes .sdr.
The stream is really 1080p24; the encoder stamped level 5.2 on it. CodecRoutePolicy copies that level into the CODECS attribute (hvc1.2.4.L156). AVPlayer checks a master variant's declared level against the device and refuses 5.2, which is 2160p120 class. The same bytes decode fine on the media playlist, where nothing is declared, and in players that don't use HLS.
Capping the declared level at 5.1 (L153) fixes it. The DV master is accepted first time and the TV engages Dolby Vision (confirmed from the TV's picture-mode menu: Dolby Vision Bright).
This is not #667. There is no -11868 in the log, and the failure reproduces unchanged on an immediate replay with the panel already in Dolby Vision, so no mode switch is involved.
Steps to reproduce
- On an Apple TV 4K with Match Dynamic Range and Match Frame Rate on, connected to a Dolby Vision TV, load a DV Profile 8.1 HEVC MKV whose hvcC has
general_level_idc = 156. - The master (
CODECS="hvc1.2.4.L156,ac-3",SUPPLEMENTAL-CODECS="dvh1.08.03/db1p") fails with -11848 / -15517 on both attempts,master_hdr.m3u8fails the same way, and the media playlist plays. - Change the declared level to 153 and reload: the master is accepted and DV engages.
AetherEngine version or commit SHA
7.22.2 (the same title also showed as SDR-clamped on 6.21.1, before logs were captured)
Host app
WonkoTV (personal NAS player, not published). AetherPlayerSurface with the engine as sole writer of display criteria, .custom IOReader source over NFS.
Platform
tvOS
OS version
tvOS 27.0
Device / chip
Apple TV 4K (3rd gen) → Sony BRAVIA XR-65X90L (advertises Dolby Vision, HDR10, HLG). Format 4K SDR, Match Dynamic Range and Match Frame Rate on.
Playback path
Native, loopback remux (fMP4/HLS → AVPlayer), master playlist.
Source media
MKV, HEVC Main10 1920×802 23.976, Dolby Vision Profile 8.1 (dvh1.08.03, BL compat 1), PQ / BT.2020, AC-3 5.1.
hvcC header: profile_idc 2, compat 0x20000000, constraint 90 00 00 00 00 00, level_idc 156.
Error codes / log lines
#EXT-X-STREAM-INF:BANDWIDTH=15179914,AVERAGE-BANDWIDTH=7589957,CODECS="hvc1.2.4.L156,ac-3",SUPPLEMENTAL-CODECS="dvh1.08.03/db1p",RESOLUTION=1920x802,FRAME-RATE=23.976,VIDEO-RANGE=PQ,AUDIO="aud",CLOSED-CAPTIONS=NONE
[DisplayCriteria] SET: format=dolbyVision codec=dvh1 rate=23.976 extensions=HDR
[DisplayCriteria] switch settled via modeSwitchEnd (... panel 23.976Hz, the requested rate)
[DisplayCriteria] panel unproven but HDR-eligible: serving the master and letting AVPlayer answer
[NativeAVPlayerHost] #1 item.status=failed err=AVFoundationErrorDomain/-11848 'Cannot Open'
[NativeAVPlayerHost] #1 item.error.underlying=CoreMediaErrorDomain/-15517
[NativeAVPlayerHost] #1 errorLog dump: 0 events
[AetherEngine] #35 readiness gate: master did not start (dead) after a panel switch; reloading the master (attempt 2/2)
[NativeAVPlayerHost] #2 item.status=failed err=AVFoundationErrorDomain/-11848 'Cannot Open'
[AetherEngine] #35 readiness gate: master never produced tracks; trying the HDR-preserving reduced master (subtitles preserved, DV dropped)
[NativeAVPlayerHost] #3 item.status=failed err=AVFoundationErrorDomain/-11848 'Cannot Open'
[AetherEngine] #35 readiness gate: master never produced tracks after 2 attempts; falling back to the media playlist (HDR10 base, DV upgrade dropped this session)
[NativeAVPlayerHost] #4 item.status=readyToPlay
Results with one change at a time:
| Title | Declared CODECS | Result |
|---|---|---|
| The Thing With Feathers (DV P8.1) | hvc1.2.4.L153.90,ec-3 |
master accepted, Dolby Vision |
| Dune (DV P8.1), 7.22.2 as shipped | hvc1.2.4.L156,ac-3 |
refused ×3, media fallback |
| Dune, constraint bytes restored | hvc1.2.4.L156.90,ac-3 |
refused ×3, media fallback |
| Dune, level capped | hvc1.2.4.L153.90,ac-3 |
master accepted, Dolby Vision |
Anything else
Suggested fix. Cap the declared level in the CODECS attribute. min(general_level_idc, 153) covers everything up to 2160p60. A tighter version would derive the level from resolution × frame rate and declare the lower of that and the stated level. The init segment's hvcC can stay as-is; the media-playlist path shows the decoder accepts it.
Related, not the cause here. The DV branches of resolveCodecRoute hardcode hvc1.2.4.L\(hevcLevel). That drops the constraint bytes the plain-HEVC branch has derived from the hvcC since AE#187, so the DV master declares hvc1.2.4.L156 against an init whose hvcC carries .90. Restoring it alone didn't help (row 3), but it's the same master/init disagreement AE#187 fixed, and routing those branches through plainHEVCCodecs(codecpar:fallbackLevel:) makes them consistent.
Both changes are in one commit on a fork, tested on the device above: https://github.com/gonkowonko/AetherEngine/commit/58fe14067f5e25689f5735af78a80b71ee61c123. Happy to open it as a PR if that's useful; I haven't added tests to the suite.
Activity
Merge pull request #677 from superuser404notfound/fix/674-hevc-level-cap
superuser404notfound commentedon Sep 30, 2026
Released in 7.23.2 (95b7c31), via #677 with your commit (cd579ab) plus a follow-up (c415e2d):
hvc1.2.4.L<level>fallback used when the extradata carries no parseable hvcC.CODECSfrom the hvcC, so Dune should now declarehvc1.2.4.L153.90withSUPPLEMENTAL-CODECS="dvh1.08.03/db1p".Leaving this open until it is confirmed on the X90L with the released tag.
gonkowonko commentedon Oct 1, 2026
Tested 7.25.0 on my X90L (Apple TV 4K, tvOS 27) and Dune plays in Dolby Vision now 🎉 Master gets accepted first try, CODECS shows L153.90 as expected. Thanks for sorting it so fast!
cmcpherson274 commentedon Oct 2, 2026
A device reading of #677 at 7.24.0 (
9bd00968), which became our app's pin on 2026-10-01.Setup. Apple TV 4K (3rd generation,
AppleTV14,1, tvOS 26.6) on a Dolby Vision panel, an HDMI analyser reading the wire, Debug builds of our app, our loopback route. 7.17.1 (7d2d1f21) and 7.24.0 ran in one session on 2026-10-01, the same titles and waits, one run per title per version. The table gives the video part of the master'sCODECS.CODECSat 7.17.1CODECSat 7.24.0hvc1.1.6.L186.b0-11848,-15517), the process HDR-master latch set, played on the media-playlist fallback (started in 3.7 s)hvc1.1.6.L153.b0hvc1.2.4.L186hvc1.2.4.H153hvc1.2.4.L156hvc1.2.4.H153.90dvh1,dvhe)hvc1.2.4.L153hvc1.2.4.H153.90hvc1.2.4.L153hvc1.2.4.H153.b0hvc1.2.4.L156-11855hvc1.2.4.H153.90-11855So on this box both level-6.2 masters, refused at 7.17.1, are accepted at 7.24.0 and no HDR-master latch is set; every Dolby Vision master that was accepted at 7.17.1 is accepted under the High-tier label with the panel still in LLDV; and the 120 fps title is unchanged (nothing rejects its master on either version, and the item then fails to decode).
One difference from the report above: this box, on tvOS 26.6, accepted a level-5.2 (
L156) master at 7.17.1.Not measured: any other panel or tvOS version, a Release build, more than one run per title.
superuser404notfound commentedon Oct 3, 2026
@gonkowonko thanks for the retest on the X90L, good to hear Dune is back in Dolby Vision with the master accepted first try.
@cmcpherson274 thanks for the analyser reading, that is the broadest confirmation this change has had. Two notes on it:
Hinhvc1.2.4.H153is the tier flag read straight from each file's hvcC (general_tier_flag), so those titles are High-tier encodes; the cap only touches the level, not the tier. That is also why the X90L sample showsL153.90and yours showH153.90.-11855on both versions is outside this change: its master was never the problem, the item itself does not decode on that box. If that is worth chasing, a separate issue with the title's stream info would be the place.Closing this as confirmed on the reporter's hardware with the released fix.