Skip to content

SDR start on the native path: rate-only gate releases on the exact display-link reading before the refresh switch ends, and the panel sometimes shows pink noise #950

Closed

Description

@secunit404

What happened?

On SDR 23.976 sources with Match Frame Rate on, a very short burst of pink/magenta noise sometimes appears over the black screen before the first video frame (speckle-like, not a solid full-screen colour, and not blocks inside the video picture; 3 of 6 logged starts, plus 2 more seen without a log; random). The engine writes rate-only criteria, sees the switch start, and releases the play gate 50 to 135 ms later through the rate-only criteria already satisfied exit, because the display link already reads the requested rate. tvOS has not reported the end of the switch at that point. When the gate does wait for modeSwitchEnd on this panel, tvOS reports switches of 2.5 s (Match Frame Rate off, panel stays at 50 Hz) and 2.9 s (Dolby Vision, range and rate). So the first frame and playback most likely go out while the TV is still re-locking HDMI.

Expected: no picture until the TV has finished the switch, as on the HDR path.

Controls on the same TV and media:

  • Match Frame Rate off: no noise in any start.
  • Another tvOS player app, Match Frame Rate on: no noise in about 6 starts.
  • Dolby Vision sources (gate waits for modeSwitchEnd or the cap): no noise.

The host mounts AetherPlayerSurface over a black background with nothing drawn over it, so the only things on screen before the first frame are the surface's black background and the player layer.

In #885 the exact-rate exit is described as correct ("released ... because the panel already measured the requested 23.976 Hz, before tvOS delivered the end notification"). This report is the visible cost of that exit on this panel: the display link reads the new cadence as soon as the compositor runs at it, and the HDMI sink re-locks well after.

Steps to reproduce

  1. Match Content on with Match Frame Rate on; home screen in its default 50 Hz SDR mode.
  2. load() an SDR 23.976 source (native route, loopback HLS), resume position or start.
  3. Leave the player (stop(), which resets the criteria), and load again. Repeat 5 to 10 times.
  4. Watch the TV right before the first frame. Some starts show the pink noise over black.

AetherEngine version or commit SHA

7.53.1

Host app

Custom / my own integration

Platform

tvOS

OS version

tvOS 27.2

Device / chip

Apple TV 4K (3rd gen, 2022), AppleTV14,1

Playback path

Native AVPlayer

Source media

MKV, H.264 Main 1920x1080 23.976 fps SDR, E-AC-3 5.1 (stream-copied as ec-3)

Error codes / log lines

A start that showed the noise:

11:25:35.768 [DisplayCriteria] panel readout before apply: currentEDR=1.00 potentialEDR=1.00 headroomLimit=unspecified switching=no matching=on hdrEligible=yes provenHDR=no
11:25:35.768 [DisplayCriteria] SET: format=sdr codec=hvc1 rate=23.976 extensions=none
11:25:35.859 [NativeAVPlayerHost] #1 load url=http://127.0.0.1:50723/<redacted>/master.m3u8 startPos=1088.70s headers=none
11:25:35.920 [DisplayCriteria] rate-only criteria already satisfied (start pre-gate (start notification, before gate entry) 88ms before gate entry, total 52ms, panel 23.976Hz, the requested rate; released 5948ms before the 6000ms cap)
11:25:36.055 [NativeAVPlayerHost] #1 layer.isReadyForDisplay=true t+0.20s
11:25:36.148 [NativeAVPlayerHost] #1 timeControlStatus=playing reason=- t+0.29s
11:25:39.712 [DisplayCriteria] mode check (native): content=23.976 requested=23.976 panel=23.977Hz (nominal 23.977) player=13.067fps

The same switch when the gate waits for the end (Match Frame Rate off, so the panel stays at 50 Hz; and a DV start):

11:38:08.812 [DisplayCriteria] switch settled via modeSwitchEnd (start pre-gate (start notification, before gate entry) 10ms before gate entry, total 2544ms, switch 2506ms end to end, panel 50.001Hz, neither the requested rate nor a multiple of it)
11:35:01.340 [DisplayCriteria] switch settled via modeSwitchEnd (start pre-gate (start notification, before gate entry) 2052ms before gate entry, total 842ms, switch 2885ms end to end, panel 23.976Hz, the requested rate)

Six logged SDR starts, Match Frame Rate on:

Start Pink noise Switch start before gate entry Gate released after First frame after SET
A yes 88 ms 52 ms 287 ms
B no 9 ms 105 ms 166 ms
C yes 135 ms 51 ms 293 ms
D no 10 ms 102 ms 204 ms
E no 64 ms 51 ms 165 ms
F yes 51 ms 50 ms 202 ms

Noisy and clean starts overlap in every timing, so whether a start shows the noise looks like a race inside the TV's re-lock. What they share is that the picture always goes out within 300 ms of the switch starting, long before tvOS reports any switch on this panel as finished.

Anything else

Suggested direction (your call): when a switch start was observed for this write, do not settle on an .exact reading alone; wait for modeSwitchEnd or the cap as the HDR path does, or require a dwell past the sink's re-lock. Keep the fast exit when no switch started (panel already at the rate, the #449 case). #348's overlap of load and switch would keep the startup cost down.

Output chain: LG C2 OLED, Apple TV connected directly over HDMI (no AVR or soundbar).

Activity

  1. added
    area: hdr-dv
    bug
    on Nov 1, 2026
  2. added 2 commits that reference this issue on Nov 1, 2026
  3. superuser404notfound commented on Nov 1, 2026

    @superuser404notfound
    Owner

    Thanks for the detailed report. The table and the two modeSwitchEnd controls showed where to look.

    Fixed on main in #952 (merge efa95c17). It is not in a release yet.

    Cause. The reporter's suggested distinction ("keep the fast exit when no switch started") does not separate the two cases on its own. In the #449 case the panel is already at the requested rate, and tvOS still posts a modeSwitchStart there and never an end. Both cases look the same in the notifications. What differs is the cadence the panel ran before the write.

    Change.

    • The engine now reads the panel's display-link cadence while the source is being probed, and keeps the reading from just before the criteria write.
    • If that reading was a different rate (50 Hz before a 23.976 write, as here), the panel had to switch. An exact display-link reading no longer releases the play gate. It now waits for modeSwitchEnd, the in-progress flag clearing, or the cap, as the HDR path does. On VOD the cap is the 6 s awaitObservedEnd budget, so on this panel the gate should hold for about 2.5 s.
    • If the panel was already at the rate (the A rate-only criteria write for a rate the panel already runs spends the full 2 s cap holding play() #449 case), the fast exit stays.
    • If there is no reading, the behaviour is unchanged.

    New log lines.

    • SET: now ends with before write: panel …Hz, ….
    • A gate that turns down an exact reading for this reason logs one [DisplayCriteria] #950: … line. The switch settled via modeSwitchEnd line that follows shows how long the switch actually took.

    Known limits.

    • Live loads keep the 2 s .standard cap, so a live zap that changes rate can still release before a ~2.5 s re-lock.
    • A load issued within a second or two of stop() can read the old rate while the panel is still switching back to the home mode, and then takes the old path.

    Retest, once there is a release. The same 5 to 10 SDR 23.976 starts from the 50 Hz home screen, plus one capture with:

    • before write: reading 50 Hz,
    • the #950: line,
    • the modeSwitchEnd settle line.

    If the noise is gone and first frame arrives after the end, it is solved. If the noise still shows after modeSwitchEnd, the cause is on the sink side after the end notification and needs a different approach.

  4. superuser404notfound commented on Nov 1, 2026

    @superuser404notfound
    Owner

    Released in 7.54.0 (ee5027c).

  5. secunit404 commented on Nov 7, 2026

    @secunit404
    Author

    Still seen on 7.58.0 (Apple TV 4K 3rd gen, tvOS 27.2, LG C3, native AVPlayer route, SDR HEVC 23.976 from a 50 Hz menu). There are two cases.

    1. A start whose switch settles correctly still shows pink noise, about 1 time in 4. These are four fresh starts of the same file, each one 10 s or more after the previous stop. Only the second showed the noise:

    19:44:56.374 SET: format=sdr codec=hvc1 rate=23.976 ... before write: panel 50.001Hz
    19:44:56.461 #950: panel 23.976Hz, the requested rate after 52ms of the wait ... waiting for the end
    19:44:58.969 switch settled via modeSwitchEnd (start notification, 25ms before gate entry, total 2560ms, switch 2557ms end to end, panel 23.977Hz, the requested rate)
    19:44:59.266 playbackPhase playing                                   <- clean
    
    19:45:16.958 SET: format=sdr codec=hvc1 rate=23.976 ... before write: panel 50.001Hz
    19:45:17.043 #950: panel 23.976Hz, the requested rate after 53ms of the wait ... waiting for the end
    19:45:19.540 switch settled via modeSwitchEnd (start notification, 25ms before gate entry, total 2551ms, switch 2557ms end to end, panel 23.977Hz, the requested rate)
    19:45:19.746 playbackPhase playing                                   <- pink noise
    
    19:45:36.963 switch settled ... total 2586ms ... panel 23.977Hz      <- clean
    

    The engine logs look the same for the clean and the noisy start, so my guess is that on this TV the sink is still re-locking for a moment after modeSwitchEnd. A short settle margin after the end notification may be what's missing.

    2. A restart within about 2 s of a stop releases the gate on the reset's switch, at the old rate. The new SET lands while the switch that RESET started (back to 50 Hz) is still running. The gate ends on that switch, with no start notification for the new one:

    19:45:37.928 RESET
    19:45:39.800 panel readout before apply: ... switching=yes ...
    19:45:39.801 SET: format=sdr codec=hvc1 rate=23.976 ... before write: panel 50.001Hz
    19:45:40.512 switch settled via modeSwitchEnd (start pre-gate (flag only, no start notification since the criteria write) after 0ms, total 682ms, panel 50.001Hz, neither the requested rate nor a multiple of it)
    19:45:44.265 mode check (native): content=23.976 requested=23.976 panel=23.977Hz ... player=19.000fps
    

    The same thing happened three more times: settled after 876 ms and 1024 ms with the panel at 50.001 Hz, and after 1187 ms reading 23.976 Hz.

    Expected: when a switch is already in flight at SET, the gate waits for the switch to the requested mode, or re-checks the panel rate once the in-flight switch ends.

  6. added a commit that references this issue on Nov 8, 2026
  7. superuser404notfound commented on Nov 8, 2026

    @superuser404notfound
    Owner

    Thanks for the retest. Both cases are fixed on main in #1003 (merge cb9a5d28). Not in a release yet.

    Case 2, restart within ~2 s of a stop. The cause was what the capture showed: the criteria write landed while the reset's switch back to 50 Hz was still running, this write got no start notification of its own, and the reset's modeSwitchEnd settled the gate.

    • apply() now records whether a switch was already in flight at the write. SET: then ends with , a switch already in flight.
    • A gate with no start notification since such a write first waits that switch out and takes its end off the record. The write's own switch then gets the full 1000 ms to start, and its end (or the cap) settles the gate as usual.
    • This logs one [DisplayCriteria] #950: a switch was in flight at the write ... line, which says how the old switch ended and what the panel read at that moment.

    Case 1, noise after a correctly observed end. As you suggested, there is no signal for the sink's re-lock, so this is a margin. It only applies where the panel actually changed rate: an engine SDR rate-only write whose panel read another rate before the write. The gate now holds 1000 ms after modeSwitchEnd (measured from the end) before releasing play. The settle line ends with ; #950: holding 1000ms more for the sink to re-lock. Starts where the panel was already at the rate are unchanged.

    Retest, once there is a release:

    • The same 5 to 10 fresh SDR 23.976 starts from the 50 Hz menu. Is the noise gone? If it is not, roughly how long does it last? That tells whether 1000 ms is too short.
    • A few restarts within 2 s of a stop, with the SET: line, the #950: line and the settle line that follows.
  8. superuser404notfound commented on Nov 8, 2026

    @superuser404notfound
    Owner

    Released in 7.61.1 (5f22505).

  9. secunit404 commented on Nov 9, 2026

    @secunit404
    Author

    Follow-up on 7.61.1: case 1 was tvOS "quick switching", not the sink re-lock. My settle-margin suggestion came from tests with the Apple TV's quick switching on. With it off (Apple TV 4K 3rd gen, tvOS 27.2, LG C3, SDR 23.976 from a 50 Hz menu, 7.61.1 owning the criteria):

    • 11 starts, no noise. That includes 3 quick restarts where SET: read panel cadence unmeasured … a switch already in flight, so the 1000 ms hold didn't run. Those started in 3.1–3.3 s. The 7 that held started in 4.0–4.3 s.
    • With quick switching on, the noise still showed on 7.61.1 despite the hold. Host-side waits of 0, 500 and 1000 ms after modeSwitchEnd made no reliable difference: about 1 in 8 against 1 in 10, over about 60 switches each.

    So the 1000 ms hold adds a second to every rate-changing SDR start without fixing case 1. Could it be removed, or made opt-in? The case 2 fix works: each in-flight restart waited out the reset's switch and landed on 23.976 Hz.

    Open question: Infuse shows no noise with quick switching on, so something in how it switches avoids it.

  10. added a commit that references this issue on Nov 9, 2026
  11. superuser404notfound commented on Nov 9, 2026

    @superuser404notfound
    Owner

    Thanks, that settles case 1. The hold is removed on main in #1010 (merge 4472aa0d). Not in a release yet.

    • A start that changes the panel's rate releases at modeSwitchEnd again, about a second sooner. The settle lines no longer end with ; #950: holding ....
    • The case 2 fix (waiting out a switch already in flight at the write) and the pre-write cadence check stay.

    On Infuse with quick switching on. The engine has no view into how Infuse switches, so for now this is open. Two observations from Infuse with quick switching on would help narrow it down:

    • Roughly how long from pressing play to the first frame, compared with Sodalite on the same file.
    • Whether Infuse shows a black screen during the switch, or keeps its own UI visible until the panel is at 23.976 Hz.

    If Infuse waits noticeably longer, it may hold the first frame until some later signal. If it starts as fast, the difference is more likely in how the criteria are written.

  12. superuser404notfound commented on Nov 10, 2026

    @superuser404notfound
    Owner

    Released in 7.62.1 (a4b7fa8c): the 1000 ms post-end hold from 7.61.1 is gone again, so a start that changes the panel's rate releases at modeSwitchEnd, about a second sooner. The in-flight restart fix from 7.61.1 stays. Sodalite and AetherPlayer are bumped to it.

  13. secunit404 commented on Nov 22, 2026

    @secunit404
    Author

    Retested on 7.72.1 (Apple TV 4K 3rd gen, tvOS 27.2, LG C3, native AVPlayer route, SDR 23.976 from a 50 Hz menu, Match Frame Rate on): no pink noise across repeated starts and quick restarts. Confirmed fixed, thanks for working through all three rounds of this. Closing.

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

    area: hdr-dvbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions