Voice Cuts Out With 8ish Players

Hello, I'm working on a social VR project using Photon and Photon Voice. It's been _great_ to work with so far except for one serious problem that has me pulling my hair out.

Occasionally when we get more than a half dozen players in the same room chatting away there will be a "pop" and then all sound will cut out. Not just Photon Voice but all sound. It will then come back a minute or two later. Players who restart will be able to hear "deaf" players talk but deaf players will not be able to hear them. This only happens in production builds, not in the Unity editor, players in the editor will be unaffected.

I'm pretty sure it's Photon Voice related because we have cut out almost all other sound and it happens simultaneously to all players.

This _might_ be related to players leaving one room and starting/entering another. Perhaps entering a new room before they are fully logged out of the previous one? That's a theory I have some circumstantial evidence for but have not managed to reproduce.

This is Photon Voice v1.91. I have turned on voice debugging and get no logs around the sound cut-out besides the usual voice overrun and underrun warnings.

This is a pretty big problem for me and is hard to test because I need to get ~10 people together.

Help is greatly appreciated!

Colin Northway

Best Answer

  • ColinNorthway
    edited August 2017 Answer ✓
    ok, this problem has been resolved!

    I went to great lengths to reproduce it and capture the error but it looks like we accidentally fixed it when we made some changes to our net-code.

    My fault all along.

    I believe we were passing bad data into our spacializer because of a player with a scale of zero for one frame. If anyone else is having this problem it's likely being caused by a NaN, Inifnity or other bad data being passed into the audio engine.

Answers

  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @ColinNorthway,

    Thank you for choosing Photon!

    The description of the issue is still not clear.

    - I did not get this "pop" sound. do you have a recording of this maybe or a video?
    - So you think the issue is related to the number of players and not how long the voice chat has been going?

    Not just Photon Voice but all sound. It will then come back a minute or two later.
    This is weird.
    This only happens in production builds, not in the Unity editor, players in the editor will be unaffected.
    This is also weird.
    Players who restart will be able to hear "deaf" players talk but deaf players will not be able to hear them.
    What do you mean by "restart" and "deaf"? Does a "restart" lead to a rejoin to the same room?

    This _might_ be related to players leaving one room and starting/entering another. Perhaps entering a new room before they are fully logged out of the previous one?
    Yes we need to make sure there is no room mismatch between PUN and Voice (it should be: "what you see is what you hear").

    Do you use a 3rd party voice asset in parallel with Photon Voice?
    Do you use Audio Groups?
    Can you share the PhotonVoiceSettings with us?
  • Sorry, I immediately left town after writing my initial question. I agree it's weird, it's one of those occasional nightmare-bugs that's so confusing and hard to reproduce that it makes you want to throw your computer through the window. I wish I could just work around it somehow but obviously all sound cutting out is not something to work around :(

    - I don't have a recording of the pop. It doesn't sound like much, just a little pop like you'd hear plugging in headphones to a stereo. There might also be a faint repetitive ticking sound while the sound is out.

    - I don't think it's related to how long the voice has been on because it happens to everyone at the same moment even if they have been on the server for different amounts of time. We also have chats that last hours with only three people and have never had it come up.

    -By "reset" I mean restart the game and join the same room. And by "deaf" I mean a player whos sound is not working. So if the bug hits then all the player's sound dies. Then if someone quits the game and comes back to the same room they can hear everyone but no one can hear them.

    -We use a custom audio manager for playing back sound effects. We also created a callback in the PUN voice instanciation for manipulating distance falloff curves for the PUN voices as well as attaching a Phonon (Steam audio) spatializer plugin to each players Head AudioSource.

    -We do not use Audio Groups.

    -PhotonVoiceSettings:
    AutoConnect: yes
    AutoDisconnect: yes
    AutoTransmit:yes
    SamplingRate: 48000
    FrameDuration: 20ms
    Bitrate: 30000
    VoiceDetection: yes
    VoiceDetectionThreshold: .005
    PlayerDelayMs: 150
    DebugLostPercent: 0



    Obviously this is a horrible horrible problem for me I am continuing to try to debug. Any guesses would be greatly appreciated.

    Colin
  • hi Colin
    Photon Voice can produce "pop" or stop playing but it can't affects other sounds. Something is broken in Unity audio listener or maybe in audio driver. This failure may be triggered by "pop" from voice. Did you try to play audio from other programs while your app is in broken state?
    What hardware do you use? What "custom audio manager" does?
  • Can I save all the incoming voice data somehow?

    If I can capture the voice stream and play it back then I can determine what is breaking it without getting 10 people with Vives in the same place at once.
  • Never mind, I've written my own recording/playback system. I'm going to track this down!
  • ColinNorthway
    edited August 2017 Answer ✓
    ok, this problem has been resolved!

    I went to great lengths to reproduce it and capture the error but it looks like we accidentally fixed it when we made some changes to our net-code.

    My fault all along.

    I believe we were passing bad data into our spacializer because of a player with a scale of zero for one frame. If anyone else is having this problem it's likely being caused by a NaN, Inifnity or other bad data being passed into the audio engine.