Closed Rohith-Nanthan closed 2 years ago
Could you check if the OnAudioConfigurationChanged
callback (docs) happens when you do this? We've had some reports of it not happening in certain circumstances.
Yes, the callback gets invoked every time I turn off the bluetooth but I get a warning stating that Audio system failed to initialize.
I think I'll need to have a look through the full log of this to see how Dissonance is reacting to the failed reset. Before sending me that could you please:
"Unity OnAudioConfigurationChanged called here (martindevans)"
Debug
for all categories (Window > Dissonance > Diagnostic Settings)Thanks.
I have attached the log file below for your reference. Please look into it.
It looks like Dissonance is responding to the audio reset event basically as I would expect. The capture pipeline gets totally reset, which emptees out all buffers and attempts to re-initialise the microphone. You can see it re-initialising with messages like this:
DEBUG [Dissonance:Recording] (17:06:08.478) BasicMicrophoneCapture: GetDeviceCaps name=
` min=
48000max=
48000`
The empty name
here indicates that Dissonance is not specifying a mic and is instead telling Unity to use whatever the system default Microphone is.
On the other end (playback) Dissonance actually doesn't have any input into which playback device is used - it simply plays audio through an AudioSource and Unity is responsible for playing that out through some actual hardware.
Unfortunately I think this is a Unity bug. If you report it to Unity please share a link to the bug report here.
Some potential workarounds:
Microphone
wrapper. It might workaround the issue (but only for the mic).Hi, I tried to force reset but it did not work. Also, I found a few use-cases around this bug:
but I get this error only sometimes, other times it works when I select microphone from editor and I get no error.
When I turn-off my Bluetooth, my microphone works but my speaker does not work (a wired headset already connected with my system was the fallback device when my Bluetooth turned off) but still I get an error stating that "Unknow microphone capture error" even though my wired headset microphone works. It was different for my colleague - both microphone and speaker didn't work for her. She was using a MacOs and built-in system microphone and speaker was her fallback device.
This audio device switching bug happens only when another participant has started speaking, it does not happen before that. The switching between devices is smooth when no one has started speaking.
Can you please look into it these use-cases and solve this issue ?
Unfortunately I don't think there's much I can do about these bugs. Have you reported them to Unity to see if they know about the bugs or have a potential workaround?
For input device selection the bugs are coming up from the Unity Microphone
API (e.g. Failed to get recording driver capabilities
when calling Microphone.GetDeviceCaps
. Dissonance responds to this by disabling the input system (until a reset is forced). The only thing that can be done about this is simply to try again later and hope that the Unity API is no longer throwing exceptions.
For the output device issues Dissonance doesn't have any influence at all on the output device that Unity uses! The only thing I can can think that may be related is Unity not properly switching output device while there is an active audio playback (try playing some music through an audiosource instead of speech to see if the issue persists).
Context
If I switch off my system Bluetooth while my headset is still connected to the system, dissonance throws Unknown microphone capture error and it does not switch back to default microphone. It is also not switching my speaker to default system speaker. It works fine if I disconnect the headset first and then switch off the Bluetooth of my device.
Expected Behavior
It must switch back to default speaker and microphone
Actual Behavior
It throws error and I am unable to use speaker and microphone. [Dissonance:Recording] (11:52:34.005) BasicMicrophoneCapture: Unknown microphone capture error (zero length clip) - restarting mic UnityEngine.Debug:LogError (object) Dissonance.Logs/LogMessage:Log () (at Assets/Plugins/Dissonance/Core/Log.cs:69) Dissonance.Logs:SendLogMessage (string,Dissonance.LogLevel) (at Assets/Plugins/Dissonance/Core/Log.cs:98) Dissonance.Log:WriteLog (Dissonance.LogLevel,string) (at Assets/Plugins/Dissonance/Core/Log.cs:181) Dissonance.Log:Error (string) (at Assets/Plugins/Dissonance/Core/Log.cs:425) Dissonance.Audio.Capture.BasicMicrophoneCapture:UpdateSubscribers () (at Assets/Plugins/Dissonance/Core/Audio/Capture/BasicMicrophoneCapture.cs:250) Dissonance.Audio.Capture.CapturePipelineManager:Update (bool,single) (at Assets/Plugins/Dissonance/Core/Audio/Capture/CapturePipelineManager.cs:188) Dissonance.DissonanceComms:Update () (at Assets/Plugins/Dissonance/Core/DissonanceCommsImpl.cs:683)
Steps to Reproduce
Provide a detailed set of steps to reproduce the problem
Your Environment
Dissonance version used: v8.0.0
Unity version: 2020.3.6f1
Editor Operating System and version: Microsoft Windows 10 Pro (x64)
Build Settings: PC - Windows x86_64