Skip to content

Software path starts SDR playback without waiting for the frame-rate switch it just requested #885

Open

Description

@akhanwav

What happened?

For SDR sources the software path writes rate-only display criteria and then plays at once, while the panel may still be renegotiating HDMI for the new refresh rate.

From the 7.47.0 source:

  • DisplayCriteriaController.apply returns .applied for SDR (Display/DisplayCriteriaController.swift:859-860, "SDR rate-only switches are sub-second; only HDR criteria need the waitForSwitch delay"). So the pre-load wait at AetherEngine.swift:4955-4968 runs only for .willSwitch, which is HDR only.
  • The native branch then gates play() on the panel (AetherEngine.swift:5620, waitForSwitch(startGrace: Self.playGateGrace(…)), .brief for an engine-written SDR switch).
  • The software branch (loadSoftware at 5519, softwareHost?.play() at 5556) has no equivalent gate, so an SDR rate switch is never waited for there.

On our box a rate-only switch is not always negligible. On the native path, a switch from 23.977 to 50 Hz was observed starting 558 ms before gate entry and settled 370 ms after it, so it ran about 0.9 s in all. Our host's own transcode route, waiting on the mode-switch notifications, measured 2.5 to 2.7 s from criteria write to settle, though those switches also changed dynamic range. Most panels blank or blink during the handshake, so on the software path the first second or so of an AV1, VP9, MPEG-2 or VC-1 SDR title plays into it.

We found this by reading the source, not on a device: we had no software-path SDR title to hand. A play gate on the software branch matching the native one (the .brief grace for an engine write) looks like the fix.

Steps to reproduce

  1. Match Content on (Match Frame Rate on), home screen at 60 Hz.
  2. Load an SDR source that takes the software path (AV1, VP9, MPEG-2 or VC-1) at a rate other than the panel's, for example 23.976 fps.
  3. Expect [DisplayCriteria] SET: format=sdr … rate=23.976 followed directly by playback, with no switch settled or play-gate line in between.

AetherEngine version or commit SHA

7.47.0 (source reading); also present in 7.32.3 and 7.42.0

Host app

Custom / my own integration (Rivulet)

Platform

tvOS

OS version

tvOS 26.6 (23L773)

Device / chip

Apple TV 4K (3rd generation), AppleTV14,1

Playback path

Software (dav1d) host

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions