Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin not working on Quest when building from Windows #33

Closed
jinpavg opened this issue Dec 18, 2023 · 6 comments
Closed

plugin not working on Quest when building from Windows #33

jinpavg opened this issue Dec 18, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@jinpavg
Copy link
Contributor

jinpavg commented Dec 18, 2023

After building an android build of the plugin on macOS, and then building a Quest game on macOS that includes that plugin, a user reports that the plugin works on Quest, loaded either as a "custom filter," or as a plugin effect loaded on an AudioMixer. However, when building the Quest game from a Windows machine, the AudioMixer-loaded version of the plugin no longer works (the user reports that the filter version still works).

I can reproduce with slightly different variables -- if I build the plugin for android on Windows (using Ninja), the plugin builds successfully but I don't hear it working as a filter or mixer-loaded plugin on the Quest. The Windows version works fine in the Unity Editor, and other audio (non-RNBO) works fine on the Quest.

@jinpavg jinpavg added the bug Something isn't working label Dec 18, 2023
@x37v
Copy link
Contributor

x37v commented Dec 19, 2023

@jinpavg just to be sure, when you built the plugin on windows, did you supply this option -DANDROID_CPP_FEATURES=exceptions

@jinpavg
Copy link
Contributor Author

jinpavg commented Dec 19, 2023

Ah, I tried both with and without, with the same results so far.

@x37v
Copy link
Contributor

x37v commented Jan 3, 2024

I just built and ran successfully from my windows machine:
I'm using 'Ninja' to build.

cmake .. -G "Ninja" -DANDROID_PLATFORM=29 -DANDROID_ABI=arm64-v8a -DCMAKE_TOOLCHAIN_FILE="C:\Program Files\Unity\Hub\Editor\2021.3.23f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\build\cmake/android.toolchain.cmake" -DRNBO_EXPORT_DIR="C:\Users\xnor\Documents\export\simple-freq-param\" -DRNBO_CPP_DIR="C:\Users\xnor\Documents\export\simple-freq-param\rnbo" -DPLUGIN_NAME="SimpleFreqParam" -DANDROID_CPP_FEATURES=exceptions
cmake --build .

then I copied my native windows plugin into correct folder:

PS C:\Users\xnor\dev\rnbo.unity.audioplugin\build> ls .\SimpleFreqParam\Assets\Plugins\Windows\


    Directory: C:\Users\xnor\dev\rnbo.unity.audioplugin\build\SimpleFreqParam\Assets\Plugins\Windows


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----          1/2/2024   4:34 PM        1958912 SimpleFreqParam.dll
-a----          1/2/2024   4:03 PM           1366 SimpleFreqParam.dll.meta
-a----          1/2/2024   4:34 PM       15192064 SimpleFreqParam.pdb
-a----          1/2/2024   4:34 PM            155 SimpleFreqParam.pdb.meta

I wonder if there is something going on with signatures when you build the android plugin on mac and then try to deploy to android from windows?

@x37v
Copy link
Contributor

x37v commented Jan 4, 2024

I'm using Unity Editor version 2021.3.23f1, I used the VR template and these instructions for setting it up further: https://www.circuitstream.com/blog/oculus-quest-2-setup

in powershell, in the unity plugin project directory

cd .\build\ 
cmake .. -G "Ninja" -DANDROID_PLATFORM=29 -DANDROID_ABI=arm64-v8a -DCMAKE_TOOLCHAIN_FILE="C:\Program Files\Unity\Hub\Editor\2021.3.23f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\build\cmake/android.toolchain.cmake" -DRNBO_EXPORT_DIR="C:\Users\xnor\Documents\export\simple-freq-param\" -DRNBO_CPP_DIR="C:\Users\xnor\Documents\export\simple-freq-param\rnbo" -DPLUGIN_NAME="SimpleFreqParam" -DANDROID_CPP_FEATURES=exceptions
cmake --build .
cd ..
mkdir build-windows
cd build-windows
cmake .. -G "Visual Studio 19" -DRNBO_EXPORT_DIR="C:\Users\xnor\Documents\export\simple-freq-param\" -DRNBO_CPP_DIR="C:\Users\xnor\Documents\export\simple-freq-param\rnbo" -DPLUGIN_NAME="SimpleFreqParam"
cmake --build .
Copy-Item -Path .\SimpleFreqParam\Assets\Plugins\Windows -Destination ..\build\SimpleFreqParam\Assets\Plugins\ -Recurse

In my Unity project, I add the RNBOTypes package and also SimpleFreqParam by path (I didn't move them), I also edited the "Audio" project settings and setup the occulus spacializer, then I created a mixer and then found an object in the scene, added an audio source to it, selected an audio file (not sure if i needed to do that), then set the mixer for the source to the mixer I just created, finally I added my plugin to the top of the mixer I just created and deployed to my occulus via 'Build and Run'

@x37v
Copy link
Contributor

x37v commented Jan 4, 2024

I suspect the issue some people are seeing is with a mismatch of player and plugin architectures.. the plugin is being built for ARM64, make sure that your player is also targeting ARM64

@jinpavg
Copy link
Contributor Author

jinpavg commented Apr 19, 2024

closing this for now, i think this is working if folks set this up as described above

@jinpavg jinpavg closed this as completed Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants