Photon Voice native exception

Hi, Our app uses Photon Voice v2.16.1 (Photon mic type). In it's Unity dashboard we ran into an exception : Native Crash - Unknown Function. Stacktrace does not reveal much other than pointing to libunity.so but the logs had the following:

[VoiceScripts.Recorder] [PV] UnityAndroidAudioInAEC: UnityEngine.AndroidJavaException: java.lang.UnsupportedOperationException: Cannot create AudioRecord at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <00000000000000000000000000000000>:0 


[VoiceScripts.Recorder] Photon microphone input source creation failure: UnityEngine.AndroidJavaException: java.lang.UnsupportedOperationException: Cannot create AudioRecord at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <00000000000000000

[VoiceScripts.Recorder] Local input source setup and voice stream creation failed. No recording or transmission will be happening. See previous error log messages for more details.

FYI, Our app asks the audio permission just before the voice chat feature is used. The affected device runs on Android OS 6.0. Any help on this would be appreciated

Comments

  • Hi @GrimShady_,

    How often does this happen?
    Does this happen for more than one user / device?
    What is/are the device model(s)?
  • Hi @JohnTube ,

    According to the data, there have been 16 such occurrences across 7 users.
    These are the affected device models:

    LAVA International/Era 2X/XE2X
    LENOVO/Lenovo K50a40/K50a40
    LENOVO/Lenovo A7020a48/A7020a48
    vivo/vivo 1601/1601
    vivo/vivo 1609/1609
    lephone/lephone_W15/lephone_W15
  • Hi @JohnTube , Found this stacktrace. Hope it can be of use

    [VoiceScripts.Recorder] [PV] UnityAndroidAudioInAEC: UnityEngine.AndroidJavaException: java.lang.UnsupportedOperationException: Cannot create AudioRecord
    06-29 19:56:56.324 2906 2948 E Unity : at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <00000000000000000000000000000000>:0
    06-29 19:56:56.324 2906 2948 E Unity : at UnityEngine.AndroidJNISafe.CallBooleanMethod (System.IntPtr obj, System.IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in <00000000000000000000000000000000>:0
    06-29 19:56:56.324 2906 2948 E Unity : at Photon.Voice.Unity.UnityAndroidAudioInAEC..ctor (Photon.Voice.ILogger logger) [0x00000] in <00000000000000000000000000000000>:0
    06-29 19:56:56.324 2906 2948 E Unity : at Photon.Voice.Unity.Recorder.CreateLocalVoiceAudioAndSource () [0x00000] in <00000000000000000000000000000000>:0
    06-29 19:56:56.324 2906 2948 E Unity : at Photon.Voice.Unity.Recorder.Setup () [0x00000] in <00000000000000000000000000000000>:0
    06-29 19:56:56.324 2906 2948 E Unity : at PhotonVoiceChatLobby.OnEnable () [0x00000] in <00000000000000000000000000000000>:0
    06-29 19:56:56.324 2906 2948 E Unity : at UnityEngine.Object.Internal_InstantiateSingle (UnityEngine.Object data, UnityEngine.Vector3 pos, UnityEngine.Quaternion rot) [0x00000] in <000000000000000000
    06-29 19:56:56.329 2906 2948 E Unity : [VoiceScripts.Recorder] Photon microphone input source creation failure: UnityEngine.AndroidJavaException: java.lang.UnsupportedOperationException: Cannot create AudioRecord
    06-29 19:56:56.329 2906 2948 E Unity : at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <00000000000000000000000000000000>:0
    06-29 19:56:56.329 2906 2948 E Unity : at UnityEngine.AndroidJNISafe.CallBooleanMethod (System.IntPtr obj, System.IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in <00000000000000000000000000000000>:0
    06-29 19:56:56.329 2906 2948 E Unity : at Photon.Voice.Unity.UnityAndroidAudioInAEC..ctor (Photon.Voice.ILogger logger) [0x00000] in <00000000000000000000000000000000>:0
    06-29 19:56:56.329 2906 2948 E Unity : at Photon.Voice.Unity.Recorder.CreateLocalVoiceAudioAndSource () [0x00000] in <00000000000000000000000000000000>:0
    06-29 19:56:56.329 2906 2948 E Unity : at Photon.Voice.Unity.Recorder.Setup () [0x00000] in <00000000000000000000000000000000>:0
    06-29 19:56:56.329 2906 2948 E Unity : at PhotonVoiceChatLobby.OnEnable () [0x00000] in <00000000000000000000000000000000>:0
    06-29 19:56:56.329 2906 2948 E Unity : at UnityEngine.Object.Internal_InstantiateSingle (UnityEngine.Object data, UnityEngine.Vector3 pos, UnityEngine.Quaternion rot) [0x00000] in
    06-29 19:56:56.335 2906 2948 E Unity : [VoiceScripts.Recorder] Local input source setup and voice stream creation failed. No recording or transmission will be happening. See previous error log messages for more details.
    06-29 19:56:56.335 2906 2948 E Unity : UnityEngine.Logger:LogFormat(LogType, Object, String, Object[])
    06-29 19:56:56.335 2906 2948 E Unity : UnityEngine.Debug:LogErrorFormat(Object, String, Object[])
    06-29 19:56:56.335 2906 2948 E Unity : PhotonVoiceChatLobby:OnEnable()


    This is the method in PhotonVoiceChatLobby where mVoiceConnection is referenced in inspector.
    void OnEnable()
    {
    mVoiceConnection.Client.AddCallbackTarget(this);
    this.mVoiceConnection.SpeakerLinked += OnSpeakerCreated;
    this.mVoiceConnection.PrimaryRecorder.IsRecording = true;
    this.mVoiceConnection.MinimalTimeScaleToDispatchInFixedUpdate = 0f;
    }
Sign In or Register to comment.