Closed vollstock closed 2 years ago
The System.EntryPointNotFoundException
doesn't mean that the DLL can't be loaded (you'd get something like a DllNotFoundException if that were the case). Instead it means that a particular method call in the DLL does not exist, in this case Dissonance_CreateRnnoiseState
. All of the following warnings about "lost samples" are just a consequence of the first error, so once we fix that they should disappear.
On MacOS the Dissonance_CreateRnnoiseState
method does not exist in the native plugin because that feature is not yet supported on MacOS. You should be protected from the EntryPointNotFoundException
happening by some #if
checks which swap in some other code on non-supported platforms.
Could you check in Assets\Plugins\Dissonance\Core\Audio\Capture\AudioPluginDissonanceNative.cs
on line 26, you should find this:
#region rnnoise
#if UNITY_EDITOR_WIN || (UNITY_STANDALONE_WIN && !UNITY_WSA) || UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX || UNITY_ANDROID || UNITY_LUMIN
[DllImport(ImportString, CallingConvention = Convention)]
public static extern IntPtr Dissonance_CreateRnnoiseState();
// ... <trimmed some more code here> ...
#else
private static bool _rnnoiseWarning = false;
public static IntPtr Dissonance_CreateRnnoiseState()
{
if (!_rnnoiseWarning)
{
Log.Warn("Rnnoise is not supported on this platform");
_rnnoiseWarning = true;
}
return new IntPtr(1);
}
As you can see we've got a list of supported platforms at the top which does not include MacOS, so it should be calling into the C# code which simply prints a warning. Does yours look different?
no, mine looks the same. Indeed if I temporarily replace this line with
#if false //|| UNITY_EDITOR_WIN || (UNITY_STANDALONE_WIN && !UNITY_WSA) || UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX || UNITY_ANDROID || UNITY_LUMIN
it works. I don't quite know, why i run into this on my machine…
Could you try adding in the terms one-by-one to see which one is enabling that block?
Unfortunately those compile-time directives are true
depending on my build settings. See comment here
I am developing on a Mac but I am targeting Linux (the server) and Android (a VR headset).
UNITY_ANDROID
is true
if I set Android as target platform in the build settings
UNITY_EDITOR_LINUX
is true
when I set Linux as target platform
A working line for me is e.g.
#if !UNITY_EDITOR_OSX && (UNITY_EDITOR_WIN || (UNITY_STANDALONE_WIN && !UNITY_WSA) || UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX || UNITY_ANDROID || UNITY_LUMIN)
as the UNITY_EDITOR*
directives are not evaluated at compile time
Aha! Yes you're absolutely right, I didn't consider that case properly.
I'll either change it to this for the next version:
#if (!UNITY_EDITOR_OSX) && (UNITY_EDITOR_WIN || (UNITY_STANDALONE_WIN && !UNITY_WSA) || UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX || UNITY_ANDROID)
Or I'll compile RNNoise support into the MacOS plugins.
(Nb.UNITY_LUMIN
is intentinally missing from that line).
This line works fine for me :-) Don't need noise suppression on my dev-machine
Thanks!
Don't need noise suppression on my dev-machine
Fortunately disabling this on your dev machine doesn't totally remove noise suppression!
The basic noise suppression which removes "pure" noise (e.g. fans) works on all platforms. That's actually the most important one since almost all audio setups will have some static in them (unless you're developing in a recording studio!).
RNNoise is a new system which uses a machine learning system to detect background sounds (e.g. someone talking in the background, dogs barking) and removes them. Since the process of background sound removal can distort voice this is only something you'd want to use in very noisy environments (e.g. mobile game where players are in busy environments, VR exercise game where the player will be breathing heavily).
You can read more about these systems and the tradeoffs involved here: https://placeholder-software.co.uk/dissonance/docs/Reference/Other/VoiceSettings.html#noise-suppression
This was released a while ago!
Context
Following this guide, I have included Dissonance in our Project.
Behavior
After starting a Host, no Audio is being captured (or at least I can’t hear anything on other instances of the game). An error message is printed and then subsequently many, many warnings.
Tries and thoughts
Microsofts docs on an EntryPointNotFoundException suggest I can't load a DLL.
I have tried to delete and re-install the Plugins folder as suggested in #207, though. Will try on Windows later today…
Error message
[Dissonance:Recording] (09:59:16.417) BasePreprocessingPipeline: Error: Unhandled exception killed audio preprocessor thread: System.EntryPointNotFoundException: Dissonance_CreateRnnoiseState
Subsequent warnings
[Dissonance:Recording] (09:59:16.693) BasePreprocessingPipeline: Lost 960 samples in the preprocessor (buffer full), injecting silence to compensate
My Environment