Skip to content

System.DllNotFoundException: Unable to load DLL 'livekit_ffi' on HoloLens 2 #92

Open
@phr4fh

Description

@phr4fh

We are trying to integrate LiveKit into a Unity app for Microsoft HoloLens 2.

We have first tried this package in Unity Editor Play Mode and could successfully connect to a room. The Unity scene was configured as an MRTK app (Mixed Reality Toolkit).

However when we build and deploy to the HoloLens, the app starts correctly, but we get an exception in C# when connecting to the room. Upon examination we found out:

The exception rises in FfiClient.SendRequest(), which has a call to NativeMethods.FfiNewRequest(), which itself makes the call to livekit_ffi_request of livekit_ffi.dll, which - as far as I understand - is the native implementation in Rust code.

Image

  • This package is imported to Unity via git url, it says version is 1.0.1 (also tried cloning the repo and imported to Unity from local path).
  • The HoloLens app is built with settings for ARM64 (also tried ARM32).
  • Unity Editor shows a livekit_ffi.dll in Library\PackageCache\io.livekit.livekit-sdk@2b346b9147\Runtime\Plugins\ffi-windows-arm64, which (examined with https://pev.sourceforge.io/) contains:
            Function
                Ordinal:                         358
                Address:                         0xa5f10
                Name:                            livekit_ffi_dispose
            Function
                Ordinal:                         359
                Address:                         0xa5ecc
                Name:                            livekit_ffi_drop_handle
            Function
                Ordinal:                         360
                Address:                         0xa5b2c
                Name:                            livekit_ffi_initialize
            Function
                Ordinal:                         361
                Address:                         0xa5d54
                Name:                            livekit_ffi_request

What we also tried, is, using MSIX Packaging Tool to manually add the DLL into the generated MSIX file (which is used to install the app on HoloLens). this caused a slightly different exception:

Image

So the exception is one of:

  • The specified module could not be found. (WinError:0000007e) (how Unity builds it)
  • The specified procedure could not be found. (WinError:0000007f) (when we add the DLL manually)

It appears as if manually adding the DLL allows the module to be found (which would be a good first step), but then the method cannot be called inside of that.

Has anyone ever tried to use this package on a HoloLens? Is it intended to use with UWP ARM64 or ARM32?

Any help would be appreciated. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions