Photon microphone (no sound) vs Unity microphone (sound)

@JohnTube Using Photon Voice 2.1.1 on Unity 2018.2.18f1 on an MSI Dominator Laptop with Realtek High Definition Audio driver. Microphones include built in mic, HTC Vive.

Running the DemoVoiceUI demo, the Unity microphone successfully detects sound, while the Photon microphone does not.

Condensed log below from DemoVoiceUI where Unity mic is active first, then switch to Photon mic:

Load scene 'Temp/__Backupscenes/0.backup' time: 1.081285 ms
ConnectAndJoin.ConnectNow() will now call: VoiceConnection.ConnectUsingSettings().
...
Photon.Voice.Unity.UtilityScripts.ConnectAndJoin:ConnectNow() (at Assets\Photon\PhotonVoice\Code\UtilityScripts\ConnectAndJoin.cs:66)
Photon.Voice.Unity.UtilityScripts.ConnectAndJoin:OnEnable() (at Assets\Photon\PhotonVoice\Code\UtilityScripts\ConnectAndJoin.cs:55)

(Filename: Assets/Photon/PhotonVoice/Code/UtilityScripts/ConnectAndJoin.cs Line: 66)

Refresh Mics
...
(Filename: Assets/Photon/PhotonVoice/Demos/DemoVoiceUI/MicrophoneDropdownFiller.cs Line: 121)

[PV] Remote voices cleared
...
(Filename: Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs Line: 1834)

[Scripts.Recorder] Type Convertion set to Short. Audio samples will be converted if source samples type differs.
...
(Filename: Assets/Photon/PhotonVoice/Code/VoiceLogger.cs Line: 92)

[Scripts.Recorder] Setting recorder's source to Unity microphone device Microphone (Realtek High Definition Audio)
...
(Filename: Assets/Photon/PhotonVoice/Code/VoiceLogger.cs Line: 92)

[Scripts.Recorder] [PV] MicWrapper: initializing microphone 'Microphone (Realtek High Definition Audio)', suggested
...
(Filename: Assets/Photon/PhotonVoice/Code/VoiceLogger.cs Line: 92)

[Scripts.Recorder] [PV] MicWrapper: microphone 'Microphone (Realtek High Definition Audio)' initialized, frequency = 48000, channels = 1.
...
(Filename: Assets/Photon/PhotonVoice/Code/VoiceLogger.cs Line: 92)

PUNVoice: Creating local voice with source samples type conversion from float to short.
...
(Filename: Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs Line: 1834)

[PV] Local v#1 ch#1 Sending info: c=AudioOpus f=48000 ch=1 d=10000 s=480 b=30000 w=0 h=0 ud= ev=0
...
(Filename: Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs Line: 1834)

[PV] Local v#1 ch#1 added enc: c=AudioOpus f=48000 ch=1 d=10000 s=480 b=30000 w=0 h=0 ud=
...
(Filename: Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs Line: 1834)

[WebRTCAudioProcessor] WebRTCAudioProcessor create sampling rate 48000, frame samples 480
...
(Filename: Assets/Photon/PhotonVoice/Code/VoiceLogger.cs Line: 92)

[PV] Local v#1 ch#1: Starting data encode thread
...
(Filename: Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs Line: 1834)

[Scripts.Recorder] Recorder.MicrophoneType changed, Recorder requires reinitialization for this to take effect.
...
(Filename: Assets/Photon/PhotonVoice/Code/VoiceLogger.cs Line: 92)

[PV] Local v#1 ch#1 remove sent
...
(Filename: Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs Line: 1834)

[PV] Local v#1 ch#1: Exiting data encode thread
...
(Filename: Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs Line: 1834)

[PV] Local v#1 ch#1 removed
...
(Filename: Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs Line: 1834)

[Scripts.Recorder] Setting recorder's source to Photon microphone device 0
...
(Filename: Assets/Photon/PhotonVoice/Code/VoiceLogger.cs Line: 92)

[Scripts.Recorder] Setting recorder's source to WindowsAudioInPusher
...
(Filename: Assets/Photon/PhotonVoice/Code/VoiceLogger.cs Line: 92)

[PV] Local voice #2 audio source frequency 16000 and encoder sampling rate 48000 do not match. Resampling will occur ...
(Filename: Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs Line: 1830)

[PV] Local v#2 ch#1 Sending info: c=AudioOpus f=48000 ch=1 d=10000 s=480 b=30000 w=0 h=0 ud= ev=0
...
(Filename: Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs Line: 1834)

[PV] Local v#2 ch#1 added enc: c=AudioOpus f=48000 ch=1 d=10000 s=480 b=30000 w=0 h=0 ud=
...
(Filename: Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs Line: 1834)

[WebRTCAudioProcessor] WebRTCAudioProcessor create sampling rate 48000, frame samples 480
...
(Filename: Assets/Photon/PhotonVoice/Code/VoiceLogger.cs Line: 92)

Comments

  • Hi @john__primitive,

    I appreciate your efforts and thanks for all your reports and help :)

    Just to make sure:

    - This happens on both Unity Editor and on a build? build platform? is it "HTC Vive"?
    - The logs are from Unity Editor I assume, and nothing useful after "[WebRTCAudioProcessor] WebRTCAudioProcessor create sampling rate 48000, frame samples 480"
    - how do you test this? using DebugEchoMode or from two clients?
    - did you try disabling or fiddling with VoiceAudioPreprocessor component? also deactivating Voice Activity Detection everywhere?
    - what speakers do you use and expect sound from?
  • @JohnTube
    1 - yes, for this particular laptop the Photon mic is inactive in the editor and on a build and it's the same issue for all mics that the laptop uses
    2 - yes, logs are from the editor and the last log is the last one that the Photon logger outputs
    3 - I'm watching the level meter on the recorder in the scene for activity (which does not appear at all when the Photon mic is selected). The debug audio is silent as well, and running the scene on two separate clients also reveals that the laptop with Photon mic is inactive
    4 - VAD is deactivated
    5 - the speakers on the laptop work fine

    I hope this all helps. This very well may be an issue with this specific model of laptop (MSI Dominator GT 72VR) since the audio drivers are not great, but it's just weird that the Unity mic works and the Photon mic does not. Again, if there is a good way to switch between the two in scripting when one isn't working that would be a great temporary solution.
  • Hi @john__primitive,

    Does the Unity Editor show the same number and names of devices for both Unity and Photon microphone types?
    Could you try Photon Voice 2.1.2? we didn't change much but...
    This very well may be an issue with this specific model of laptop (MSI Dominator GT 72VR) since the audio drivers are not great
    So on other machines it works fine?
    it's just weird that the Unity mic works and the Photon mic does not
    yes
    Again, if there is a good way to switch between the two in scripting when one isn't working that would be a great temporary solution.
    There is no good way to detect that one microphone input source is not working. What I can think of as a workaround if you really need this is to have a timer, with both recorder VAD and VoiceAudioPreprocessor altogether disabled, that starts when you enable transmission on the recorder and checks after some time that Recorder.IsCurrentlyTransmitting is true.
Sign In or Register to comment.