Skip to content

visionOS 1.0 minimum conflicts with 1.1-only AVFoundation APIs #344

Closed

Description

@YangHanqing

What happened?

AetherEngine 6.15.3 fails availability checking when built for visionOS.

Package.swift declares .visionOS(.v1), but the engine references AVFoundation APIs introduced in visionOS 1.1 without a visionOS availability check:

  • AVSampleBufferVideoRenderer.videoPerformanceMetrics
  • AVSampleBufferDisplayLayerReadyForDisplayDidChange
  • AVSampleBufferDisplayLayer.isReadyForDisplay

The surrounding checks name tvOS, iOS, and macOS, then fall through to *. For visionOS, that allows 1.0, so these references are rejected by the compiler.

My app targets visionOS 26, but the package's own declared minimum still makes this a compile-time error.

Steps to reproduce

  1. Add AetherEngine 6.15.3 to a visionOS target.
  2. Build the target with the visionOS 26 SDK.
  3. Observe availability errors for the 1.1-only APIs listed above.

No media is involved; this fails at compile time.

AetherEngine version or commit SHA

6.15.3 / 643f032

Host app

Custom / my own integration

Platform

iOS

OS version

visionOS 26.0 SDK (xrsimulator)

Device / chip

Apple Vision Pro simulator, arm64

Playback path

Not sure / not a playback bug

Source media (for playback bugs)

N/A — compile-time availability issue

Error codes / log lines

'videoPerformanceMetrics' is only available in visionOS 1.1 or newer
'AVSampleBufferDisplayLayerReadyForDisplayDidChange' is only available in visionOS 1.1 or newer
'isReadyForDisplay' is only available in visionOS 1.1 or newer

Anything else

Suggested fix: raise the package minimum to .visionOS(.v1_1). If visionOS 1.0 support is intentional, each use needs an explicit #available(visionOS 1.1, *) guard instead.

The form does not offer visionOS as a platform, so I selected iOS above.

Activity

  1. added
    bug
    on Aug 9, 2026
  2. superuser404notfound commented on Aug 9, 2026

    @superuser404notfound
    Owner

    Reproduced and fixed. The diagnosis in the report is exact, including the mechanism: the three availability lists name tvOS, iOS and macOS and then fall through to *, and on visionOS * resolves to the package's declared floor, which is 1.0. All three symbols are visionos(1.1) in the SDK headers, so they are a hard compile error on visionOS and on no other platform. A build against xrsimulator26.5 here fails with exactly the three quoted lines:

    • Sources/AetherEngine/Native/SoftwarePlaybackHost.swift:383 (AVSampleBufferDisplayLayerReadyForDisplayDidChange)
    • Sources/AetherEngine/Native/SoftwarePlaybackHost.swift:389 (AVSampleBufferDisplayLayer.isReadyForDisplay)
    • Sources/AetherEngine/Renderer/SampleBufferRenderer.swift:170 (loadVideoPerformanceMetrics)

    Fix taken: the second option, explicit visionOS 1.1 in each list, not the floor raise. Raising platforms: is breaking for every consumer that still declares the old minimum, and SwiftPM picks the version first and checks the platform floor afterwards, so such a consumer does not fall back to an older tag, it fails the build outright. That happened here once already with a dependency, so the rule now is that a floor raise is a major release. Naming visionOS 1.1 keeps .visionOS(.v1) intact and costs a consumer nothing.

    On visionOS 1.0 the platform now takes the same documented fallbacks the engine already has for tvOS/iOS below 17.4: first-frame readiness comes from the first frame handed to the renderer rather than from the layer's own readyForDisplay, and loadRenderMetrics() reports nil. The #unavailable twin at SoftwarePlaybackHost.swift:410 got visionOS 1.1 as well, otherwise visionOS 1.0 would sit in the gap between both branches and never publish readiness at all.

    Why it shipped: visionOS has been declared since 6.0.0 and CI only ever built tvOS, iOS and macOS, so nothing compiled the platform. CI now has a visionOS Simulator job next to the other two, which is also the only place the platform gets exercised here at all, there is no Vision Pro on this side.

    Verified locally: xcodebuild -scheme AetherEngine -destination 'generic/platform=visionOS Simulator' builds clean, 0 errors and 0 warnings, same for the AetherEngineSMB product; tvOS unchanged; full test suite green.

    The bug form now lists visionOS as a platform, thanks for flagging that too. Precise report, the two options and the exact SDK versions saved the whole investigation.

    Released as 6.18.1. Leaving this open until a visionOS build on your side confirms it.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions