Skip to content

build: update prebuilt runtimes with ctl shim wrappers#52

Closed
katruud wants to merge 7 commits intoAvionBlock:masterfrom
katruud:update-runtimes
Closed

build: update prebuilt runtimes with ctl shim wrappers#52
katruud wants to merge 7 commits intoAvionBlock:masterfrom
katruud:update-runtimes

Conversation

@katruud
Copy link
Copy Markdown
Contributor

@katruud katruud commented Apr 9, 2026

Summary

  • Replace all prebuilt native binaries with output from CI run 24171919999 — all platforms now include the opussharp_*_ctl non-variadic shim wrappers

Platforms updated

android (arm/arm64/x64/x86), iOS (xcframework), linux (arm/arm64/x64/x86), macOS (arm64/x64), windows (arm64/x64/x86)

Verification

Note

The previous DllImport change (__Internal"opus" on non-iOS) has been reverted — the existing Static/Dynamic namespace split already handles platform differences, so users should use Dynamic.OpusEncoder/Dynamic.OpusDecoder on non-iOS platforms instead.

katruud added 4 commits April 8, 2026 18:08
Replace stale native binaries with latest output from the
OpusCompile workflow (run 24160669210). All platforms now include
the non-variadic CTL shim wrappers (opussharp_*_ctl) needed to
avoid OPUS_BAD_ARG on ARM64 Apple Silicon.

Platforms updated: android (arm/arm64/x64/x86), iOS (xcframework),
linux (arm/arm64/x64/x86), macOS (arm64/x64), windows (arm64/x64/x86).
Change DllImport from unconditional "__Internal" to "opus" on all
platforms except iOS. "__Internal" requires static linking into
GameAssembly.dylib, which Unity IL2CPP does not support for .dylib/.dll
plugins — causing undefined symbol errors at link time on macOS and
potentially other platforms.

Using the named library "opus" lets Unity load the native plugin
dynamically at runtime, matching the pattern used by other native
plugins (e.g. rnnoise). iOS retains "__Internal" as it requires
static linking via xcframework.
The CI-built Windows DLLs have no exported symbols because MSVC's
linker does not export functions by default when creating a DLL from
a static library without a .def file or __declspec(dllexport).

Restore the working master copies which have a proper export table.
The OpusCompile workflow needs a .def file or /EXPORT flags to
produce valid Windows DLLs — tracked separately.
@SineVector241
Copy link
Copy Markdown
Member

using OpusSharp.Core;
    
IOpusEncoder encoder;
IOpusDecoder decoder;
//Decoder
#if UNITY_IOS && !UNITY_EDITOR
encoder = new Static.OpusEncoder(...);
decoder = new Static.OpusDecoder(...);
#else
encoder = new Dynamic.OpusEncoder(...);
decoder = new Dynamic.OpusDecoder(...);

Can't you use the explicit static/dynamic imports with IL2CPP? None of them reference each other e.g. Static.OpusEncoder has no references to NativeOpus and vice versa...

…ally

The Static/Dynamic namespace split already handles platform differences —
users should use Dynamic.OpusEncoder on non-iOS instead of preprocessor
guards in StaticNativeOpus.
@katruud katruud changed the title fix: update prebuilt runtimes and use dynamic library loading on non-iOS build: update prebuilt runtimes with ctl shim wrappers Apr 9, 2026
@katruud
Copy link
Copy Markdown
Contributor Author

katruud commented Apr 9, 2026

using OpusSharp.Core;
    
IOpusEncoder encoder;
IOpusDecoder decoder;
//Decoder
#if UNITY_IOS && !UNITY_EDITOR
encoder = new Static.OpusEncoder(...);
decoder = new Static.OpusDecoder(...);
#else
encoder = new Dynamic.OpusEncoder(...);
decoder = new Dynamic.OpusDecoder(...);

Can't you use the explicit static/dynamic imports with IL2CPP? None of them reference each other e.g. Static.OpusEncoder has no references to NativeOpus and vice versa...

Change reverted and PR updated

@katruud
Copy link
Copy Markdown
Contributor Author

katruud commented Apr 9, 2026

Replace win-arm64, win-x64, and win-x86 opus.dll binaries with output
from the latest successful OpusCompile CI run to ensure all platforms
include the ctl shim wrappers.
@katruud katruud closed this Apr 9, 2026
@katruud katruud deleted the update-runtimes branch April 9, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants