Photon Voice Stuck in Disconnecting State after Pause

Hey,

We are using PhotonVoice on Oculus Quest (android) for a VR game, Unity Version 2018.4.11 and Photon Voice v2.9 / PUN2: v2.14 .

The audio works smoothly when starting the app and we can hear other clients. However, after pausing the app and unpausing the app, the Photon Voice Networking state gets stuck in "Disconnecting" and no audio can be heard.

We have found a temporary solution is to check if the voice state is "Disconnecting" after Photon Network has successfully joined a room, force set the state to "Disconnected", and try to reconnect manually.
if (PhotonNetwork.InRoom && PhotonVoiceNetwork.Instance.ClientState == ClientState.Disconnecting) {
     PhotonVoiceNetwork.Instance.ClientState = ClientState.Disconnected;
     PhotonVoiceNetwork.Instance.ConnectAndJoinRoom();
}
This solution works, but we are concerned that force setting a state may cause other issues. Is there another way to handle this situation?

Comments

  • JohnTubeJohnTube mod
    edited October 18
    Hi @snayss,

    Thank you for choosing Photon!

    PUN2 and Voice clients should have the same connection flow and network state.
    If Voice is disconnecting what about PUN2? maybe it's disconnecting also?

    By pausing you mean you send the application to the background on Android by clicking the back or home buttons?
    How long do you keep the application in the background?

    You could control how long the background ack-only thread keeps the connection alive:
    PhotonNetwork.KeepAliveInBackground: for the PUN2 client
    PhotonVoiceNetwork.Instance.KeepAliveInBackground: for the Photon Voice 2 client.

    When the client state is Disconnecting could you log the value of PhotonVoiceNetwork.Instance.Client.LoadBalancingPeer.PeerState.
    Could you also log PUN2's client state: PhotonNetwork.NetworkClientState.
Sign In or Register to comment.