Placeholder-Software / Dissonance

Unity Voice Chat Asset
69 stars 5 forks source link

[bug] Dissonance Echo Cancellation audio plugin is not showing debug data #218

Closed vladbasin closed 3 years ago

vladbasin commented 3 years ago

Context

According to documentation https://dissonance.readthedocs.io/en/latest/Tutorials/Acoustic-Echo-Cancellation/index.html (section 5. Testing AEC), there should be debug information near Dissonance Echo Cancellation audio plugin to understand how well it performs while the app is running.

Expected Behavior

There should be debug values in Inspector according to documentation

Actual Behavior

There are NO debug values in Inspector. The configuration is correct. image

Your Environment

martindevans commented 3 years ago

This is because a bug in the Unity editor specific to MacOS caused a complete crash of the editor if trying to view this information. I did report the bug to Unity so it's possible that it has been fixed now, you can try removing the preprocessor check in Assets/Plugins/Dissonance/Editor/DissonanceAecFilterInspector.cs to see if it has been fixed:

#if !(UNITY_EDITOR_OSX && UNITY_2019_3_OR_NEWER) // <--------------- Remove this
float[] data;
if (plugin.GetFloatBuffer("AecMetrics", out data, 10))
{
  // etc
}
#endif // <--------------------------------------------------------- Remove this

If that doesn't work I have a workaround that will be in the next version of Dissonance.

vladbasin commented 3 years ago

@martindevans, after removing these lines, everything works correctly. Looks like this has been fixed. https://issuetracker.unity3d.com/issues/editor-freezes-or-crashes-when-interacting-with-native-audio-plugin-sdks-audio-mixers

However, I can see Fraction Poor Delays is often more than zero. Could you please provide some guide how can I troubleshoot this?

martindevans commented 3 years ago

Looks like this has been fixed.

Thanks for confirming that. I've changed it for the next version of Dissonance.

Fraction Poor Delays is often more than zero.

The AEC system works by correlating output sound (as measured by the filter) to input sound (recorded by the mic), calculating the time delay from playback to recording and then removing echoes. Fraction Poor Delays indicates that the timing of the audio stream is too delayed (or too jittery) for the system to work out a proper delay. This is most likely caused by something in your audio system outside of Unity - for example bluetooth headsets often introduce huge latency that prevents the AEC from ever converging.

martindevans commented 3 years ago

Dissonance 7.2.0 was just approved by Unity and is now live on the asset store. That includes two fixes for this issue: