Known Issues

On this page, we will list known issues with Photon on the various platforms. The focus here is on issues which we can't fix or workaround. In some cases, this means we will simply list broken versions per platform and guide you to other versions.

Contents

Mobile Background Apps

On mobile platforms, if the app moves to background it pauses the main message loop which is responsible for keeping the client connected among other things.

Typical causes of this are:

  • Player hits "home button".
  • Phone call received.
  • Video ads.
  • Third party plugin that introduces an overlay view in the app (e.g. facebook, Google, etc.).

If the app stays paused for more than the client disconnect timeout (which should be 10 seconds by default) the client will be disconnected and you need to reconnect as soon as the app is "unpaused". A "timeout disconnect" callback will be triggered only when the app is no longer in the background.

If the game design can allow a player to return even after several seconds or minutes, then you could also reconnect and rejoin the game again. If you want to rejoin the same room with same actor number when the app is unpaused you need to take few things into consideration:

  • PlayerTTL: the room needs to be created with a PlayerTTL value high enough that permits a player to return after a while.
  • EmptyRoomTTL: the room needs to be created with an EmptyRoomTTL value high enough to keep the room alive for a while when the last joined player's app is in the background.

Back To Top

Unity

ArgumentException In Socket.SetSocketOption

There was a known Unity issue which caused IL2CPP builds to fail to connect with an "ArgumentException: Value does not fall within the expected range. at System.Net.Sockets.Socket.SetSocketOption". This happened when the Windows 10 SDK 10.0.19041.0 was installed.

Affected Unity versions: 2018.4.23f1, 2019.4.0f1, 2020.1.0b11, 2020.2.0a13. Many more minor Unity releases have been affected, too. All Unity LTS and Tech releases (2018.4 and up) are getting a fix for this.

Back To Top

Unity 2018.2 Sockets Freeze With .Net 4.x

Unity 2018.2 used a Mono version, which could freeze communication via sockets. Depending on the message size and frequency, this happened sooner or later.

Eventually 2019.2 got a fix for this and 2018.3 should also have it at some point.

When using Mono and .Net 4.x or .Net Standard 2.0, we recommend to use the 2018.4.x or 2019.4.x releases.

Back To Top

RunInBackground

Unity's Application.runInBackground is not supported on mobile platforms. Instead, the OnApplicationPause method is called whenever the app moves to or back from background:

void OnApplicationPause( bool pauseStatus )
{
    if (pauseStatus)
    {
        // app moved to background
    } else
    {
        // app is foreground again
    }
}

Back To Top

Windows Store Capabilities

If you target Windows Store (UWP) and you are having exceptions when you try to connect or you have this error:

A network capability is required to access this network resource

Make sure to enable the required capability from Unity's "Player Settings" -> "Publisher Settings" -> "Capabilities -> "InternetClient"

Required Capability for Windows Store Apps
Required Capability for Windows Store Apps. You also need the 'Microphone' capability, if you use Photon Voice.

Back To Top

UWP Exports

If you want to export your Unity application to UWP you can either use .NET or IL2CPP as scripting backend. Photon PUN or Photon Realtime Unity SDKs are already configured to choose the correct library in order to successfully export the application from Unity. If however something goes wrong while exporting please check and make sure that you are using the correct library for the certain scripting backend:

Back To Top

IOS IPv6

While Unity 5.x should support IPv6 on iOS in general, some versions (like 5.4) break this feature. Some of the supported versions are: 4.7.2, 5.1.5, 5.2.5, 5.3.4p4, 5.4.0p1 and newer (see Unity blog post).

Back To Top

Asset Store Package Update

Sometimes assets are not updated at all or not updated properly from the Assset Store in some Unity versions. Always verify Photon packages' versions either from the change log txt files or from PhotonServerSettings for PUN. This is a known Unity issue, sometimes old packages are stuck in the local offline cache and updates do not occur at all or not properly. To fix this, remove the Photon asset package locally first and try downloading / importing again. The paths for the local Unity assets store cache folder are listed here.

Back To Top

Photon Voice

Android 6.0 Permissions

Requesting Android permissions were added in Unity 2018.3. You can read about it here where you can find an example of how to request Microphone permission.

Usually, when building for the Android platform, most permissions will be added automatically by Unity to the manifest file. The two permissions required by Photon Voice are:

  • android.permission.INTERNET: automatically added via Unity's Player Settings.
  • android.permission.RECORD_AUDIO: automatically added when Unity's microphone API is used.

However, with Android Marshmallow there seems to be a problem due to the newly introduced permissions model. The generated APK will be missing android.permission.RECORD_AUDIO permission and the application will not be able to record your voice. To avoid such issues update to the latest Unity version when targeting Android SDK level 23.

Unity's default behaviour asks for all permissions as soon as the application is opened. You can disable this by adding a line to the "AndroidManifest.xml" file:

If you do so, you need to request the microphone permission by yourself. Otherwise, Photon Voice will not work. You could make use of this plugin.

Back To Top

IOS 10 Requirement

You need to add a "Microphone Usage Description" to your project's "Player Settings" under "Other Settings" -> "Configuration" section as shown in the screenshot below:

Microphone Usage Description in Player Settings for iOS
Microphone Usage Description in Player Settings for iOS.

Alternatively, you must add NSMicrophoneUsageDescription key to "Info.plist" in Xcode project exported by Unity. The string value should explain why your application uses a microphone. Failure to do so may result in:

  • Rejection of build submission by Apple.
  • Crashes.

Back To Top

Unity Microphone Issues

  • On some Unity versions, Microphone.Start() may throw a null pointer exception or return 0 channels. The latter may result in the following exception:

ArgumentOutOfRangeException: Must be Mono or Stereo

  • On some Unity versions, the reported sample rate could be 0 from the microphone clip. For more information check out this Unity issue tracker link.

  • On some Unity versions, input device switching is broken on Windows. For more information check out this Unity issue tracker link.

  • On some Unity versions, no matter what Unity microphone device you choose, only the default one is used for recording. For more information check out this Unity issue tracker link.

Back To Top

Frequency Warnings

In case you encountered a warning similar to this one:

MicWrapper does not support suggested frequency 48000 (min: 44100, max: 44100). Setting to 44100

It means that the sampling rate set can't be used due to hardware limitations.

Local voice #1 audio source frequency 44100 and encoder sampling rate 24000 do not match. Resampling will occur before encoding.

This other warning is about resampling (affecting performance in theory) which occurs when microphone frequency does not match encoder frequency. It's a good practice to set microphone frequency to the same value as the encoder's whenever possible.

Opus encoder supports a few fixed frequencies for the incoming signal. You should choose them when creating a local voice. It does not make sense to feed local voice with data of different frequency. So, when you set up the capture device, you set the same frequency for it. However, some devices do not allow arbitrary frequencies (e.g. Android). The closest available and supported frequency is set in this case.

Back To Top

Native Library Updates

Unity Editor Warning For Native Library Files
Unity Editor Warning For Native Library Files.

If a native library file is loaded using code when in play mode inside the Unity Editor it will not be unloaded unless you close the Editor. Unity Editor will throw an error (see screenshot below) when you try to import and update a native library file if the latter is already loaded in memory because you entered play mode at least once. Even if you manually delete it while the Editor is still open the issue persists whether you do it from within or outside the Editor itself. So make sure you restart the Unity Editor when updating Photon Voice and do not enter play mode before doing the update.

Unity Editor Native Library Import Error
Unity Editor Native Library Import Error.

Back To Top

Android 64-bit Support

Photon Voice provides Android 64-bit compatible libraries starting from versions 1.18 and 2.4. Minimum supported Unity versions are 2017.4 LTS and 2018.2. For the full list of Unity versions that support Android 64-bit and instructions go to this link.

Back To Top

IOS Speaker Issue

Unity has a known issue with iOS (mostly iPhone) where the "ear speaker" (the one on the top of the front of the device used for phone calls) is used as default audio output device instead of the loudspeaker (also called internal speaker) or any other plugged or connected headphones, headset or earpieces.

This issue is also sometimes referred to as "low volume".

Link to the Unity Issue Tracker.

To address this issue we recommend the following:

  1. If you are using Photon Voice 1 upgrade to Photon Voice 2.
  2. Use Photon as Recorder.MicrophoneType.
  3. If 1 and 2 are not possible:
    a. If you use Unity 2018.3 or newer, you can enable "Force iOS Speakers when Recording" from iOS Player Settings.
    b. Photon Voice already include the "UnitySpeakerFix". Add IOSAudioForceToSpeaker component to the same GameObject to the Recorder.
  4. Tweak iOS audio session parameters from Unity Editor or via code using Recorder.SetIosAudioSessionParameters methods. You can choose values from presets or define custom ones manually. Read about iOS audio session here. Using custom settings is advanced and should be last resort as it requires a lot of experimentation, tests, trials & errors. We recommend using presets VoIP or Game unless there is use case where those do not work or there is a tested combination that works better.

Back To Top

IOS Silent/Ring Switch And Muting

By design, most iOS audio session categories will not allow muting when configured. For more information check out Table B-1 here. For instance, using the default audio session category used is "PlayAndRecord" (AVAudioSessionCategoryPlayAndRecord) (set via "Game" preset), the hardware switch to "Silent" will not mute your application and also you cannot lower the volume to zero.

Back To Top

WebGL Support

WebGL is not a supported platform for the following reasons:

  • WebGL does not work well with threads and we use those in Photon Voice for encoding and decoding.
  • Unity Microphone does not work in WebGL.
  • We need an Opus codecs library build that works with WebGL.
  • Photon for WebGL supports WebSocketSecure protocol only. Photon Voice works better using UDP.

For all these reasons we decided to drop support for the WebGL platform.

Back To Top

Oculus OVR SDK

If you use the Oculus OVR SDK, you need to disable the "Can Own Microphone". This option gives exclusive microphone control to Oculus OVR SDK and it could be preventing Photon Voice Recorder from accessing the microphone properly.

You can find it here: "LocalAvatarWithGrab" or "(+)LocalAvatar" GameObject -> "Ovr Avatar (Script)" component -> "Can Own Microphone" checkbox, un-check it.

Back To Top

Echo Or Noise

First, always update to the latest Photon Voice 2.

Things that could cause echo:

  • testing using multiple devices that are not far enough from each other so the microphone input of one gets the output from the speaker of the other.
  • testing using debug echo: Recorder.DebugEchoMode set to true.
  • testing using multiple clients on the same machine.

Things to try to reduce echo or noise:

  • native audio input plugin: try Photon microphone type.
  • software audio processing (WebRTC based): try WebRtcAudioDsp component attached to the same GameObject as the Recorder, enable AEC / AEC Mobile and NoiseSuppression.

If the issue is resolved by the usage of headphones, we recommend adding a message to your users (e.g. after splashscreen) that the usage of headphones is recommended for a better audio experience like many apps do.

Back To Top

Low Volume

First you need to find out if the low volume issue is due to input or output. You can do so using an AudioClip file (that you know its loudness is OK) as input source + DebugEchoMode. If it's the output, you need to increase volume of the speakers or fix any issue related to the output audio device. If it's the input and the input source is microphone:

Depending on the platform you target you can choose to:

  1. use Photon microphone type
  2. add WebRtcAudioDsp component next to the Recorder component (at compile time or at runtime before recorder is started) being used and enable "AGC" (Automatic Gain Control)
  3. add MicAmplifier component next to the Recorder component (at compile time or at runtime before recorder is started) being used and tweak its values.

If the input source is AudioClip or factory you can either fix it by changing the AudioClip or updating the custom input source or these 1 options still apply:

  1. add WebRtcAudioDsp component next to the Recorder component (at compile time or at runtime before recorder is started) being used and enable "AGC" (Automatic Gain Control)
  2. add MicAmplifier component next to the Recorder component (at compile time or at runtime before recorder is started) being used and tweak its values.

To Document Top