Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Face Capture app constantly loses connection to Unity Editor

Discussion in 'Virtual Production' started by dgoyette, Jul 9, 2023.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,203
    I'm using Unity 2021.3 LTS, with 4.0.0-pre.4 (The last version to support 2021.3). I'm finding that the Face Capture app works well initially, but after a couple of minutes, it shows a message in the app "Disconnected from server". It then takes maybe 30-60 seconds to reestablish a connect, as I close/reopen the app, stop and restart the App Server in Unity, and generally do a bunch of stuff that possibly has no impact on the problem. It seems I can't use the app for more than a couple of minutes before it disconnects like this.

    I do see some inconsistent error messages appearing in the console around the time the disconnect happens, but I'm not sure it's related. I'll include those messages here. But mostly I wanted to know if there was some other logging I could enable to better explain the cause of the disconnection?

    My iPhone is on the same local Wifi network as my PC, and I've made sure the firewall is open, and that the app has access to the local network. Is there anything else I can look at to make the connection more stable?


    Failed to send Tcp message with socket error: AddressNotAvailable (10049)
    0x00007ff71b03ec7d (Unity) StackWalker::GetCurrentCallstack
    0x00007ff71b045839 (Unity) StackWalker::ShowCallstack
    0x00007ff71bfde103 (Unity) GetStacktrace
    0x00007ff71c68f4ed (Unity) DebugStringToFile
    0x00007ff71a1a56c2 (Unity) DebugLogHandler_CUSTOM_Internal_Log
    0x000001e1ba4aa633 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
    0x000001e1ba4aa56b (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    0x000001e1ba4aa2f0 (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
    0x000001e3b7b6fbb5 (Mono JIT Code) UnityEngine.Debug:LogError (object)
    0x000001e3b7efdfd3 (Mono JIT Code) [NetworkSocket.cs:453] Unity.LiveCapture.Networking.NetworkSocket:HandleSendError (System.Net.Sockets.SocketError)
    0x000001e3b7efdce3 (Mono JIT Code) [NetworkSocket.cs:394] Unity.LiveCapture.Networking.NetworkSocket:SendComplete (object,System.Net.Sockets.SocketAsyncEventArgs)
    0x000001e3b7ec8181 (Mono JIT Code) System.Net.Sockets.SocketAsyncEventArgs:OnCompleted (System.Net.Sockets.SocketAsyncEventArgs)
    0x000001e3b7ec8135 (Mono JIT Code) System.Net.Sockets.SocketAsyncEventArgs:Complete_internal ()
    0x000001e3b7eca473 (Mono JIT Code) System.Net.Sockets.Socket/<>c:<.cctor>b__367_17 (System.IAsyncResult)
    0x000001e1ac0c82f5 (Mono JIT Code) System.Net.Sockets.SocketAsyncResult/<>c:<Complete>b__27_0 (object)
    0x000001e1a57e40d2 (Mono JIT Code) System.Threading.QueueUserWorkItemCallback:System.Threading.IThreadPoolWorkItem.ExecuteWorkItem ()
    0x000001e1a57e1f3a (Mono JIT Code) System.Threading.ThreadPoolWorkQueue:Dispatch ()
    0x000001e1a57e14bb (Mono JIT Code) System.Threading._ThreadPoolWaitCallback:performWaitCallback ()
    0x000001e1a57e1595 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_bool (object,intptr,intptr,intptr)
    0x00007ff96ef3feb4 (mono-2.0-bdwgc) [mini-runtime.c:3445] mono_jit_runtime_invoke
    0x00007ff96ee7e764 (mono-2.0-bdwgc) [object.c:3066] do_runtime_invoke
    0x00007ff96eebb847 (mono-2.0-bdwgc) [threadpool.c:386] worker_callback
    0x00007ff96eebe8e0 (mono-2.0-bdwgc) [threadpool-worker-default.c:502] worker_thread
    0x00007ff96eead2db (mono-2.0-bdwgc) [threads.c:1268] start_wrapper_internal
    0x00007ff96eead4b6 (mono-2.0-bdwgc) [threads.c:1344] start_wrapper
    0x00007ffa322326ad (KERNEL32) BaseThreadInitThunk
    0x00007ffa33e0a9f8 (ntdll) RtlUserThreadStart

    FormatException: Unrecognized Guid format.
    at System.Guid+GuidResult.SetFailure (System.Guid+ParseFailureKind failure, System.String failureMessageID, System.Object failureMessageFormatArgument, System.String failureArgumentName, System.Exception innerException) [0x00033] in <4a4789deb75f446a81a24a1a00bdd3f9>:0
    at System.Guid+GuidResult.SetFailure (System.Guid+ParseFailureKind failure, System.String failureMessageID) [0x00000] in <4a4789deb75f446a81a24a1a00bdd3f9>:0
    at System.Guid.TryParseGuid (System.ReadOnlySpan`1[T] guidString, System.Guid+GuidStyles flags, System.Guid+GuidResult& result) [0x00011] in <4a4789deb75f446a81a24a1a00bdd3f9>:0
    at System.Guid.Parse (System.ReadOnlySpan`1[T] input) [0x00010] in <4a4789deb75f446a81a24a1a00bdd3f9>:0
    at System.Guid.Parse (System.String input) [0x00014] in <4a4789deb75f446a81a24a1a00bdd3f9>:0
    at Unity.LiveCapture.SerializableGuid.FromString (System.String guid) [0x00000] in C:\Users\dango\GitHub\Gravia\LocalPackages_Versioned\com.unity.live-capture@4.0.0-pre.4\Runtime\Core\Communication\SerializableGuid.cs:32
    at Unity.LiveCapture.CompanionApp.TakeDescriptor.Create (Unity.LiveCapture.Take take) [0x0008e] in C:\Users\dango\GitHub\Gravia\LocalPackages_Versioned\com.unity.live-capture@4.0.0-pre.4\Runtime\CompanionApp\Data\TakeDescriptor.cs:181
    at Unity.LiveCapture.CompanionApp.ShotDescriptor+<>c.<Create>b__5_0 (Unity.LiveCapture.Take take) [0x00000] in C:\Users\dango\GitHub\Gravia\LocalPackages_Versioned\com.unity.live-capture@4.0.0-pre.4\Runtime\CompanionApp\Data\SlateDescriptor.cs:48
    at System.Linq.Enumerable+SelectListIterator`2[TSource,TResult].ToArray () [0x00034] in <d630687edd41403db17561f5afda04df>:0
    at System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0001f] in <d630687edd41403db17561f5afda04df>:0
    at Unity.LiveCapture.CompanionApp.ShotDescriptor.Create (System.Nullable`1[T] nShot) [0x00068] in C:\Users\dango\GitHub\Gravia\LocalPackages_Versioned\com.unity.live-capture@4.0.0-pre.4\Runtime\CompanionApp\Data\SlateDescriptor.cs:48
    at Unity.LiveCapture.CompanionApp.CompanionAppDevice`1[TClient].SendShotDescriptor (System.Nullable`1[T] shot) [0x0000a] in C:\Users\dango\GitHub\Gravia\LocalPackages_Versioned\com.unity.live-capture@4.0.0-pre.4\Runtime\CompanionApp\CompanionAppDevice.cs:419
    at Unity.LiveCapture.CompanionApp.CompanionAppDevice`1[TClient].UpdateClient () [0x0014c] in C:\Users\dango\GitHub\Gravia\LocalPackages_Versioned\com.unity.live-capture@4.0.0-pre.4\Runtime\CompanionApp\CompanionAppDevice.cs:268
    at Unity.LiveCapture.ARKitFaceCapture.FaceDevice.UpdateDevice () [0x00000] in C:\Users\dango\GitHub\Gravia\LocalPackages_Versioned\com.unity.live-capture@4.0.0-pre.4\Runtime\ARKitFaceCapture\FaceDevice.cs:219
    at Unity.LiveCapture.LiveCaptureDevice.InvokeUpdateDevice () [0x00000] in C:\Users\dango\GitHub\Gravia\LocalPackages_Versioned\com.unity.live-capture@4.0.0-pre.4\Runtime\Core\LiveCaptureDevice.cs:122
    UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    UnityEngine.Logger:LogException(Exception, Object)
    UnityEngine.Debug:LogException(Exception)
    Unity.LiveCapture.LiveCaptureDevice:InvokeUpdateDevice() (at LocalPackages_Versioned\com.unity.live-capture@4.0.0-pre.4\Runtime\Core\LiveCaptureDevice.cs:126)
    Unity.LiveCapture.LiveCaptureDeviceManager:UpdateDevice() (at LocalPackages_Versioned\com.unity.live-capture@4.0.0-pre.4\Runtime\Core\TakeRecorder\LiveCaptureDeviceManager.cs:57)
    Unity.LiveCapture.UpdateManager:UpdateCallback() (at LocalPackages_Versioned\com.unity.live-capture@4.0.0-pre.4\Runtime\Core\TakeRecorder\UpdateManager.cs:100)

    (Filename: LocalPackages_Versioned/com.unity.live-capture@4.0.0-pre.4/Runtime/Core/LiveCaptureDevice.cs Line: 126)
     
  2. unity_420E2F030C71A834B25B

    unity_420E2F030C71A834B25B

    Unity Technologies

    Joined:
    Aug 20, 2021
    Posts:
    7
    Hello, I have been able to successfully run the Face Capture sample using Unity Editor 2021.3.6 and LiveCapture package v4.0.0-pre.4 for an extended period without disconnect (using the iOS Unity Face Capture app v1.2.0). If you need to get more details about connection/disconnection issues from the LiveCapture app, there is a file in the package named CompanionAppServer.cs which contains an OnClientDisconnected() method where you could add a breakpoint in order to inspect what is happening during a disconnect. Here is some more general information on troubleshooting.
     
  3. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,203
    Thanks. I should have updated this post, but I believe the issue was actually with the wifi network I was using at the time of my post. Having switched to a different wifi network, I've seen no stability issues. So, I believe this was likely a legitimate issue of the phone losing network connectivity for a very brief period, which was enough to disconnect the app.