Skip to content

Loopback route: a Dolby Vision item parsed as dvh1 stays labelled HDR10 on macOS #515

Closed

Description

@superuser404notfound

Split out of #493, where it turned up as a side finding while measuring something else. Reported and diagnosed by @Rasmusmart57, down to the two line numbers.

What happens

On the loopback route the engine publishes videoFormat = .hdr10 for a Dolby Vision Profile 5 source on macOS, while AVFoundation has already parsed the served item's video track as dvh1 and the engine's own host has logged it:

[Marten] badge output=HDR10/PQ source=Dolby Vision P5 -> HDR10/PQ
[NativeAVPlayerHost] #1 remote-HLS videoFormat=dolbyVision subType='dvh1'

A host reading videoFormat therefore badges a Dolby Vision session HDR10. The reporter worked around it host-side by reading the sample entry off nativePlayerLayer, which is public, so nothing is blocked; the engine's published label is the wrong one.

Where it comes from

NativeAVPlayerHost.publishDetectedVideoFormat (Native/NativeAVPlayerHost.swift:2234) has no route gate. It runs at readyToPlay and again at the first .playing for every native session, loopback included, and sets detectedVideoFormat. The engine subscribes to host.$detectedVideoFormat in exactly one place, AetherEngine+Loading.swift:396, inside loadRemoteHLS. loadNative never reads it.

That is correct as far as it goes: the remote-HLS bypass runs no libav probe, so AVFoundation's parse is the only source it has for both sourceVideoFormat and videoFormat, and the sink sets both unconditionally. The loopback route has a probe, so sourceVideoFormat is already right there, and videoFormat is the effective label clamped against displayCapabilities.

The clamp is what produces .hdr10: AVPlayer.availableHDRModes is API_UNAVAILABLE(macos), so supportsDolbyVision is false on every Mac unless the host asserts it (LoadOptions.panelPresentsDolbyVision), and effectiveVideoFormat sends a PQ base to .hdr10. Measured in #493 with the assertion off, on a 16" XDR: Profile 5 and Profile 8.1 both strobe against Dolby's reference content, so the RPU reaches the pixels with no claim set anywhere. The label is the only thing that was still following the clamp.

Why the sink cannot simply be mirrored

Copying the loadRemoteHLS sink into loadNative would let AVFoundation's parse overwrite the clamped label on every platform, and the case that breaks is tvOS: a Profile 5 master carries a dvh1 sample entry on any panel, so a session on a panel parked in SDR, whose label is deliberately .sdr, would republish .dolbyVision. That is the label the clamp exists to prevent. It would also overwrite a sourceVideoFormat the probe had already answered better.

Planned shape

An upgrade only, on the pattern of handleHDR10PlusDetected:

  • only when the published label reads .hdr10, which is the one value a clamped DV source can hold. An SDR label (macOS on an SDR display, tvOS parked in SDR) and an already asserted .dolbyVision are both left alone by that guard.
  • only when the source is Dolby Vision and the item's sample entry parses as dvh1 / dvhe. Profile 8.1 reports hvc1 and keeps .hdr10, which is honest: it composes on that display, and nothing in the stack says so.
  • only where the platform has no per-mode capability table, which today means macOS. tvOS and iOS read availableHDRModes and the label follows their answer.

Not settled here, and worth its own measurement if anyone wants it: whether a Profile 5 that AVFoundation tonemaps onto an HDR10-only panel deserves the Dolby Vision badge on tvOS. The panel does not present DV, the RPU is still applied, and the current label follows the panel.

Also in scope, because it cost the reporter time: publishDetectedVideoFormat logs its line as remote-HLS on every route, including the loopback one where the name is wrong.

Activity

  1. superuser404notfound commented on Sep 8, 2026

    @superuser404notfound
    OwnerAuthor

    On main in 895ccd0c, not released.

    AetherEngine.dolbyVisionLabelUpgrade carries the rule and the reason for each of its four terms; the loopback route reads host.$detectedVideoFormat through it, and sourceVideoFormat is left where the probe put it. 7 tests, and each one pins a case the rule keeps out rather than the case it lets in, since that is where a mirror would have gone wrong. Full suite green on both runners (XCTest 607 with 1 skipped, swift-testing 2781 in 379 suites).

    What it should look like from a host, with no assertion and no local patch:

    • Profile 5 on macOS: videoFormat reads .dolbyVision, with [AetherEngine] item carries a Dolby Vision sample entry, upgrading videoFormat hdr10 → dolbyVision in the log once, at readyToPlay.
    • Profile 8.1 on macOS: unchanged, .hdr10. It reports hvc1, it composes on that display anyway, and nothing in the stack reports that.
    • tvOS and iOS: unchanged, both directions. The per-mode table answers there, and a session on a panel parked in SDR keeps its .sdr label even though the item carries dvh1.
    • The host's format line now reads item videoFormat= instead of remote-HLS videoFormat= on every route.

    Left open for a retest on real hardware, since the arm it rests on is one display and two files.

  2. superuser404notfound commented on Sep 9, 2026

    @superuser404notfound
    OwnerAuthor

    Released in 6.75.0 (f436d89).

  3. superuser404notfound commented on Sep 10, 2026

    @superuser404notfound
    OwnerAuthor

    Closing this one.

    The loopback label has carried the parsed Dolby Vision configuration since 6.75.0, and there is no open question left on the thread: the remaining step is a run on this side, not something the issue is waiting to hear.

    Reopen, or file fresh, if a dvh1 item ever comes back labelled HDR10 on that route again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions