Photon voice and UWP Win10

I try to compile a Unity project for UWP Win10 target (Hololens), but i've got an error during building.
Assets\Plugins\PhotonVoiceApi\Core\VoiceClient.cs(949,25): error CS1729: 'Thread' does not contain a constructor that takes 1 arguments

I've try differentes answers find on net, but nothing works. Someone have an idea to correct this error;
Thanks in advance

Unity 5.6.1
Photon PUN free 1.84 (latest version on asset store)
Photon voice ver 1.91 (latest version on asset store)

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Softelectro,

    Thank you for choosing Photon and I apologize about the delay!

    We are aware of this issue and we are working on it. Hopefully it will be fixed in an upcoming version soon.
  • Any workarounds?
  • Easy workaround might be to compile all into a dll and set IL2CPP target?
  • vadim
    vadim mod
    edited June 2017
    IL2CPP may be a workaround but we did not succeed when tried it. Visual studio linked exported project endlessly.
    We already fixed the issue. Please wait for package update.
  • Bump!


    moments ago
    UWP Hololens does not build...
    (0 of 0 found this review helpful)
    Attempting to build for HoloLens UWP getting the following:

    - Assets\Plugins\PhotonVoiceApi\Core\VoiceClient.cs(949,25): error CS1729: 'Thread' does not contain a constructor that takes 1 arguments

    - Assets\Plugins\PhotonVoiceApi\Core\VoiceClient.cs(950,15): error CS1061: 'Thread' does not contain a definition for 'Name' and no extension method 'Name' accepting a first argument of type 'Thread' could be found (are you missing a using directive or an assembly reference?)

    - Assets\Plugins\PhotonVoiceApi\Core\VoiceClient.cs(951,15): error CS1061: 'Thread' does not contain a definition for 'Start' and no extension method 'Start' accepting a first argument of type 'Thread' could be found (are you missing a using directive or an assembly reference?)

    - Assets\Plugins\PhotonVoiceApi\Core\VoiceClient.cs(817,29): error CS1729: 'Thread' does not contain a constructor that takes 1 arguments

    - Assets\Plugins\PhotonVoiceApi\Core\VoiceClient.cs(850,19): error CS1061: 'Thread' does not contain a definition for 'Start' and no extension method 'Start' accepting a first argument of type 'Thread' could be found (are you missing a using directive or an assembly reference?)

    - Assets\Plugins\PhotonVoiceApi\Core\VoiceClient.cs(851,19): error CS1061: 'Thread' does not contain a definition for 'Name' and no extension method 'Name' accepting a first argument of type 'Thread' could be found (are you missing a using directive or an assembly reference?)

    Switching Project Scripting Backend to IL2CPP from .NET is NOT an option as a majority of the HoloToolKit implements the .NET Subset.

    Tried building out a .dll to target IL2CPP and this pretty much failed as there are many dependencies involving multiple targets.... sigh.

    Devs, you advertise VR & AR.... please fix!
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Athalos,

    As @vadim stated an update will be released soon.
    Please be patient.
    We apologize about the inconvenience.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Athalos,

    Try this quick fix:

    Here are updated files "VoiceClient.cs" and "VPxCodec.cs" that should overwrite the old ones under "Assets\Plugins\PhotonVoiceApi\Core".
    And delete folder: "Assets\Plugins\Metro".

    Test this and let us know if it works for you.
  • Thanks @JohnTube and @vadim ! Do you happen to have an ETA for the new update? I only ask because I have a client who is anxious for this feature, thanks!

  • @JohnTube Tried the fixes, issues as follows:
    1) I did not have a VPxCodec.cs in Assets\Plugins\PhotonVoiceApi\Core or anywhere else in the project.

    2) Now have the following errors (assuming this is because of VPxCodec):

    - Assets/Plugins/PhotonVoiceApi/Core/AudioVoice.cs(181,22): error CS0535: `ExitGames.Client.Photon.Voice.AudioUtil.Resampler' does not implement interface member `System.IDisposable.Dispose()'

    - Assets/Plugins/PhotonVoiceApi/Core/AudioVoice.cs(181,22): error CS0535: `ExitGames.Client.Photon.Voice.AudioUtil.Resampler' does not implement interface member `ExitGames.Client.Photon.Voice.LocalVoiceFramed.IProcessor.Process(T[])'

    - Assets/Plugins/PhotonVoiceApi/Core/AudioVoice.cs(234,31): error CS0535: `ExitGames.Client.Photon.Voice.AudioUtil.LevelMeter' does not implement interface member `ExitGames.Client.Photon.Voice.LocalVoiceFramed.IProcessor.Process(T[])'

    - Assets/Plugins/PhotonVoiceApi/Core/AudioVoice.cs(234,31): error CS0535: `ExitGames.Client.Photon.Voice.AudioUtil.LevelMeter' does not implement interface member `System.IDisposable.Dispose()'

    - Assets/Plugins/PhotonVoiceApi/Core/AudioVoice.cs(345,22): error CS0535: `ExitGames.Client.Photon.Voice.AudioUtil.VoiceDetectorCalibration' does not implement interface member `ExitGames.Client.Photon.Voice.LocalVoiceFramed.IProcessor.Process(T[])'

    - Assets/Plugins/PhotonVoiceApi/Core/AudioVoice.cs(345,22): error CS0535: `ExitGames.Client.Photon.Voice.AudioUtil.VoiceDetectorCalibration' does not implement interface member `System.IDisposable.Dispose()'

    - Assets/Plugins/PhotonVoiceApi/Core/AudioVoice.cs(389,31): error CS0535: `ExitGames.Client.Photon.Voice.AudioUtil.VoiceDetector' does not implement interface member `ExitGames.Client.Photon.Voice.LocalVoiceFramed.IProcessor.Process(T[])'

    - Assets/Plugins/PhotonVoiceApi/Core/AudioVoice.cs(389,31): error CS0535: `ExitGames.Client.Photon.Voice.AudioUtil.VoiceDetector' does not implement interface member `System.IDisposable.Dispose()'

    - Assets/Plugins/PhotonVoiceApi/Core/VoiceClient.cs(1855,32): error CS0246: The type or namespace name `VPxCodec' could not be found. Are you missing an assembly reference?

    - Assets/Plugins/PhotonVoiceApi/Core/VoiceClient.cs(1871,32): error CS0246: The type or namespace name `VPxCodec' could not be found. Are you missing an assembly reference?

    Am I missing something?

    THANKS!!
  • Tried adding the VPxCodec.cs under "Assets\Plugins\PhotonVoiceApi\Core". This made the previous errors go away, but now there are 17 new errors all regarding VPxCodec.cs. Tried looking for a compiled libVPX dll to no avail.... I am FAR from a *nix guy, so building this would be time consuming for me. Anyone have an x86 libVPX.dll file handy? :tired_face:
  • 1. VPxCodec.cs is not required in fact. Please delete it.
    2. Some files are missing in previous fix we sent. Copy files from https://www.dropbox.com/s/0b8sc3md2a4ie1n/PhotonVoice-uwp_fix-2.zip
    3. Remove Assets\PUNVoice\TestVoice\DelayProcessor.cs
  • Manjia
    Manjia
    edited June 2017
    Hi guys,
    I somehow managed to build the DemoVoice-Scene for UWP and Hololens, it works like a charm by the way, tested on notebook connected on a thetered hotspot and an Hololens connected to our work WiFi, your plugin is great! :D
    I actually am a rookie with Unity as well as with UWPs/C# themselves and I succeeded in doing it just by instinct after reading this thread, that's why I do care posting my solution here.

    What I did was basically to replace Threads with System.Threading.Tasks.Task in the VoiceClient.cs (since .NET recently removed Threads in favour of Tasks)
    like this:

    #if NETFX_CORE
    using System.Threading.Tasks;
    #endif

    and I commented the lines where there was the instruction "thread.Name" since tasks don't have a Name property, like this:

    #if NETFX_CORE
    var t = new Task(decodeThread);
    // t.Name = LogPrefix + " decode";
    t.Start();
    if (this.options.Decoder != null)
    {
    this.options.Decoder.Open(info);
    }
    #endif

    I had to download the System.Threading.Tasks package trough nuget as it was not included in standard .NET

    Also I did remove the folder: "Assets\Plugins\Metro" since it was causing a duplicate plugin issue but I did not add the VPxCodec.cs script (it caused some compile errors, I did not investigate about it)

    Anyway I am now able to correctly build and deploy a standard UWP as well as an Hololens specific one, using scripting backend .NET and Api Compatibility Level ".Net 2.0 Subset", oh and targeting UWP SDK 10.0.14393.0 (just because I'm using Visual studio 2015 and that is the highest SDK I can target with that, maybe using VS2017 it would work even on higher targets)

    Since as I said I'm a rookie and also it was late night when I succeeded doing it yesterday, I don't remember well if I did some other trick or not, so here's my empty project that just implements a freshly downloaded PhotonVoice plugin with my edits and with the DemoVoice-Scene ready to deploy:

    https://www.dropbox.com/s/quo21n1rnp8op0x/PhotonForUwpAndHololens.zip?dl=0

    I removed my AppId and Voice AppId so before building it get yours! ;)

    Hope it helps!
  • JohnTube
    JohnTube ✭✭✭✭✭
    The last fix we sent has some issues (extra file added, compile condition "#define PHOTON_VOICE_VIDEO_ENABLE" not commented).
    With help from my colleague and main Voice developer @vadim we prepared a new one with clear instructions.
    We tested a UWP build using these steps:

    1. Preferably start with fresh project and import clean Photon Voice package.
    2. In case you used previous fix: "VPxCodec.cs" is not required in fact. Please delete "Assets\Plugins\PhotonVoiceAPI\Core\VPxCodec.cs" if found.
    3. Copy1 files from https://www.dropbox.com/s/0b8sc3md2a4ie1n/PhotonVoice-uwp_fix-2.zip
    3.1. Overwrite "Assets\Plugins\PhotonVoiceAPI\Core\AudioVoice.cs"
    3.2. Overwrite "Assets\Plugins\PhotonVoiceAPI\Core\VoiceClient.cs"
    4. Remove "Assets\PUNVoice\TestVoice\DelayProcessor.cs" if found.
    5. Remove "Assets\Plugins\Metro" folder if found.

    The Photon Voice package update is delayed due to Unite.
    I apologize about the hassle.
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited June 2017
    Hi @Manjia

    Thank you for choosing Photon and for sharing your solution.
    Indeed what you suggested should work. We chose ThreadPool instead of Tasks.
  • @JohnTube Last solution BUILDS!!! Thank you and @vadim very much! Will implement and test on device but I am sure all is well now, thanks again guys!!
  • Hmm... Now getting the following:
    [PV] MicWrapper does not support suggested frequency 24000 (min: 48000, max: 48000). Setting to 48000

    (Filename: C:/buildslave/unity/build/artifacts/generated/Metro/runtime/DebugBindings.gen.cpp Line: 51)


    Exception thrown: 'System.DllNotFoundException' in Assembly-CSharp-firstpass.dll
    DllNotFoundException: Unable to load DLL 'opus_egpv': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
    at POpusCodec.Wrapper.opus_encoder_get_size(Channels channels)
    at POpusCodec.Wrapper.opus_encoder_create(SamplingRate Fs, Channels channels, OpusApplicationType application)
    at POpusCodec.OpusEncoder..ctor(SamplingRate inputSamplingRateHz, Channels numChannels, Int32 bitrate, OpusApplicationType applicationType, Delay encoderDelay)
    at ExitGames.Client.Photon.Voice.OpusCodec.Encoder`1..ctor(VoiceInfo i)
    at ExitGames.Client.Photon.Voice.OpusCodec.EncoderFactory.Create(VoiceInfo i, LocalVoice localVoice)
    at ExitGames.Client.Photon.Voice.VoiceClient.CreateEncoder(VoiceInfo info, LocalVoice localVoice)
    at ExitGames.Client.Photon.Voice.LocalVoiceAudio`1..ctor(VoiceClient voiceClient, IEncoderDataFlow`1 encoder, Byte id, VoiceInfo voiceInfo, Int32 channelId)
    at ExitGames.Client.Photon.Voice.LocalVoiceAudio.Create[T](VoiceClient voiceClient, Byte voiceId, IEncoder encoder, VoiceInfo voiceInfo, Int32 channelId)
    at ExitGames.Client.Photon.Voice.VoiceClient.<>c__DisplayClass48_0`1.b__0(Byte vId, Int32 chId)
    at ExitGames.Client.Photon.Voice.VoiceClient.createLocalVoice(VoiceInfo voiceInfo, Int32 channelId, IEncoder encoder, Func`3 voiceFactory)
    at ExitGames.Client.Photon.Voice.VoiceClient.CreateLocalVoiceAudio[T](VoiceInfo voiceInfo, Int32 channelId, IEncoderDataFlow`1 encoder)
    at PhotonVoiceNetwork.CreateLocalVoice(VoiceInfo voiceInfo, IBufferReader`1 reader)
    at PhotonVoiceRecorder.Start()
    at PhotonVoiceRecorder.$Invoke17(Int64 instance, Int64* args)
    at UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64* args, IntPtr method)
    (Filename: Line: 0)


    Even though the opus_egpv.dll is there, targeting WSA and x86

  • NM guys, this works on device as well.... had to roll back to a commit before I attempted to implement any of the voice functionality and start fresh.... but it works and is AWESOME! THANKS!!!!!!!