Quest 2 Device Pause Unity Microphone Error

Options
paulgumr
paulgumr
edited June 2022 in Photon Voice

TL;DR

Since Quest OS Version 39 (now 40) the device pause we had working now fails with the following error

E/Unity: Starting microphone failed: "An error occured that wasn't supposed to.  Contact support. " (33)
UnityEngine.Microphone:Start(String, Boolean, Int32, Int32)
Photon.Voice.Unity.UnityMicrophone:Start(String, Boolean, Int32, Int32)
Photon.Voice.Unity.MicWrapper:.ctor(String, Int32, ILogger)
Photon.Voice.Unity.Recorder:CreateLocalVoiceAudioAndSource()
Photon.Voice.Unity.Recorder:Setup()
Photon.Voice.Unity.Recorder:StartRecordingInternal()
Photon.Voice.Unity.Recorder:StartRecording()

I am fishing to see if anyone has come across a similar problem. We have spent a few weeks on this and haven't got any closer to a solution. We also can't replicate it outside of our application, which doesn't help.

More Detail

  • Unity 2020.3.35f1
  • Photon Voice 2.31
  • Quest OS version 40
  • Oculus Integration 40

We use the Microphone Type Unity for a variety of reasons, related to previous discussions. However if we switch to Photon for the Microphone Type the application never receives the OnApplicationPause to unpause it.

However, we use the following to manage the state

  • HandleHMDMounted
  • HandleHMDUnmounted
  • InputFocusAcquired
  • InputFocusLost
  • OnApplicationPause

dependant on logic these on pause call

AudioListener.pause = true;
recorder.StopRecording();

on un-pause we call

AudioListener.pause = false;
recorder.StartRecording();

At that point we get the error at the start.

Once the error occurs we have no audio and have to restart the application to get it back. Everything else works perfectly.

Comments

  • vadim
    Options

    It seems like a Unity bug.

    It still would be interesting to know if it's triggered only by calling Start() after missing End() call or correct Start/End sequence causes the same error. A simple app without Voice starting and stopping the mic can help.

  • paulgumr
    Options

    @vadim Thanks for the suggestion, but if I force an end with Microphone.End(devicename) I still get the same behaviour. As you say I think I am going to have to try and replicate the behaviour in a simple app.