is there nay way for me to build the visionOS ffi ...
# ask-ai
l
is there nay way for me to build the visionOS ffi files for the livekit unity sdk ?
t
Thanks for reaching out, Rishav. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'd love to help you with building the visionOS ffi files for the LiveKit Unity SDK! Could you please share a bit more about what you need? For instance: • Are you looking for particular tools or dependencies to get started? • Would you like some guidance on how to integrate visionOS with the Unity SDK? • Are there any specific challenges or errors you've run into? The more details you can provide, the better I can support you. Looking forward to assisting you!
l
What I need help with (visionOS FFI for LiveKit Unity SDK) Goal: ship my existing Unity plugin (which wraps the LiveKit Unity SDK + FFI) to visionOS (device + simulator) without rewriting my media stack in Swift. 1) Environment & targets • Unity: Unity 6 + PolySpatial for visionOS (app modes: Windowed / MR / VR). • Xcode / SDK: Xcode with visionOS SDK (targeting visionOS 2+ where required). • Rust toolchains: aiming to build for ◦
aarch64-apple-visionos
(device) •
aarch64-apple-visionos-sim
(simulator) ◦ as documented by rustc platform support. (doc.rust-lang.org) 2) Dependencies I’m aligning to • LiveKit WebRTC XCFramework that already ships visionOS slices (device + sim). (If there’s a preferred version/commit, please advise.) (The Swift Package Index) • Unity SDK (client-sdk-unity) as the C# surface; I’m aware visionOS isn’t in the listed supported platforms yet, so I’m preparing to produce my own
ffi-visionos
build. (GitHub) 3) What I’ve tried / plan to try • Build
livekit-ffi
for the two visionOS Rust targets above and package into an XCFramework using: • xcodebuild -create-xcframework \ • -library path/to/device/liblivekit_ffi.a -headers path/to/device/Headers \ • -library path/to/sim/liblivekit_ffi.a -headers path/to/sim/Headers \ • -output LiveKitFFI.xcframework • (Apple’s guidance is to use
-create-xcframework
for multi-platform bundles.) (Apple Developer) • Link against LiveKitWebRTC XCFramework that includes visionOS; ensure both device + sim slices are present to avoid the classic “no library for this platform” error on the simulator. (The Swift Package Index) • Unity side: import the XCFramework under
Assets/Plugins/
and enable for visionOS in the Plugin Inspector (not iOS), then gate any platform logic with the proper defines/runtime checks. (Unity visionOS build guidance sits under PolySpatial docs.) (Unity Documentation) 4) Specific questions where guidance would help 1. Correct Rust target setup: ◦ Are there LiveKit-specific build flags or environment variables (e.g., min deployment target) I should set when targeting
aarch64-apple-visionos(-sim)
? rustc docs mention
XROS_DEPLOYMENT_TARGET
. Any recommendations from the LiveKit side? (GitHub) 2. Exact WebRTC dependency & versions: ◦ Which LiveKitWebRTC release/tag should I pin that’s verified with current LiveKit FFI for visionOS? Swift Package Index shows visionOS support; want to avoid ABI mismatches. (The Swift Package Index) 3. FFI feature flags: ◦ Are there any cfg/feature flags in
livekit-ffi
that need to change for visionOS (e.g., APIs unavailable compared to iOS, or transport nuances)? 4. Frameworks & entitlements: ◦ For visionOS, I’m assuming VideoToolbox and Network remain required; anything else specifically for visionOS vs. iOS (and anything to explicitly remove, e.g., OpenGLES/GLKit)? 5. Simulator gotchas: ◦ Historically, simulators fail with “no library for this platform found in WebRTC.xcframework” when slices are missing; is there a known-good simulator slice combo for LiveKit + visionOS you recommend? (There’s prior discussion on visionOS support/slices in the Swift SDK issue tracker.) (GitHub) 6. Minimum deployment target: ◦ Any guidance on visionOS minimum for FFI (1.0 vs 2.x)? Swift docs/indices say visionOS is supported, but I’d like the canonical target you test against. (LiveKit Docs) 5) What success would look like (acceptance checks) •
LiveKitFFI.xcframework
contains device + simulator variants for visionOS, loads on Vision Pro and sim. • Can publish/subscribe audio+video; no linker errors; no missing symbol errors from WebRTC or media subsystems. • Unity can consume decoded frames via my existing texture path (Metal-backed textures) within a PolySpatial volume/window. 6) Happy to provide • CI logs for Rust/Cargo and
xcodebuild
runs for both targets. • A minimal Unity sample (PolySpatial scene) + Xcode project demonstrating the FFI being loaded. • If helpful, I can also validate an official
ffi-visionos
drop in my plugin once you provide it. If you’d rather recommend I bridge to the Swift SDK for visionOS while Unity FFI is being sorted, I can do that too (Swift SDK explicitly lists visionOS support). But I’d prefer staying all-Unity if we can get a verified
ffi-visionos
. (LiveKit Docs)
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!