Hi, I use Unity2021.3.31f1 for development, and the Nuitrack version is 0.37.24. In my project, I turn off Nuitrack when I am in standby mode, and I will not turn on Nuitrack until I need to respond. I use the Pro version. However, I found that this problem occurred from time to time when the project looped more than 250 times during the operation of Window, which troubled me very much. May I ask what the problem is? I come from China, these words are from the machine translation, if the reading trouble is very sorry
Hi @OPH,
-
As we have to figure out what’s the particular problem is - do you have any screenshot or full error message ?
-
Please also describe how this problematic stop / start loop is implemented (is Nuitrack fully released or only stopped).
It really would be the fastest resolution option if you could share a minimal reproducible Unity example with this problematic behavior.
Okay, so this time it’s 341 switches, this time it’s running smoothly
<color=green><b>第341次测试
Time:12/30/2024 4:51:51 PM</b></color>
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:LogFormat (UnityEngine.LogType,string,object[])
UnityEngine.Debug:LogErrorFormat (string,object[])
OPH.Logger.UnityLoggerHandler:LogError (string,object[]) (at D:/UnityProject/UnityProject/G303/Assets/Scripts/程序/OPH/Utilities/Debug/UnityLoggerHandler.cs:22)
OPH.DebugUtility:LogError (string,object[]) (at D:/UnityProject/UnityProject/G303/Assets/Scripts/程序/OPH/Utilities/Debug/DebugUtility.cs:75)
GS_StandbyNew:StateWorking () (at D:/UnityProject/UnityProject/G303/Assets/Scripts/程序/GameState/GS_StandbyNew.cs:71)
StateWorkerMonoSingleton`2<GameWorker, GameState>:StateWorking ()
GameWorker:StateWorking () (at D:/UnityProject/UnityProject/G303/Assets/Scripts/GameStates/GameWorker.cs:96)
StateWorkerMonoSingleton`2<GameWorker, GameState>:Update ()
(Filename: D:/UnityProject/UnityProject/G303/Assets/Scripts/程序/OPH/Utilities/Debug/UnityLoggerHandler.cs Line: 22)
Unloading 3 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 13.365500 ms
Unloading 3781 unused Assets / (116.5 MB). Loaded Objects now: 20918.
Memory consumption went from 0.61 GB to 508.3 MB.
Total: 33.953000 ms (FindLiveObjects: 1.340400 ms CreateObjectMapping: 1.807600 ms MarkObjects: 11.918200 ms DeleteObjects: 18.886400 ms)
Nuitrack Init OK
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:Log (object)
NuitrackManager:NuitrackInit () (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:439)
NuitrackManager:WorkingThread () (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:774)
System.Threading.ThreadHelper:ThreadStart_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
System.Threading.ThreadHelper:ThreadStart ()
(Filename: D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs Line: 439)
Nuitrack Run OK
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:Log (object)
NuitrackManager:NuitrackInit () (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:456)
NuitrackManager:WorkingThread () (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:774)
System.Threading.ThreadHelper:ThreadStart_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
System.Threading.ThreadHelper:ThreadStart ()
(Filename: D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs Line: 456)
Update onNewRGBFrame callback
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:Log (object)
SensorData:HandleOnColorSensorUpdateEvent (nuitrack.ColorFrame) (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/SensorData.cs:180)
nuitrack.ColorSensor:SignalOnUpdate (nuitrack.ColorFrame)
nuitrack.NativeColorSensor:OnColorSensorUpdateCallback (intptr)
nuitrack.NativeNuitrack:Update ()
nuitrack.Nuitrack:Update ()
NuitrackManager:Update () (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:705)
(Filename: D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/SensorData.cs Line: 180)
Update onNewDepthFrame callback
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:Log (object)
SensorData:HandleOnDepthSensorUpdateEvent (nuitrack.DepthFrame) (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/SensorData.cs:157)
nuitrack.DepthSensor:SignalOnUpdate (nuitrack.DepthFrame)
nuitrack.NativeDepthSensor:OnDepthSensorUpdateCallback (intptr)
nuitrack.NativeNuitrack:Update ()
nuitrack.Nuitrack:Update ()
NuitrackManager:Update () (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:705)
(Filename: D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/SensorData.cs Line: 157)
Unloading 1 Unused Serialized files (Serialized files now loaded: 0)
Unloading 0 unused Assets / (0 B). Loaded Objects now: 21286.
Memory consumption went from 506.0 MB to 506.0 MB.
Total: 15.486700 ms (FindLiveObjects: 1.426000 ms CreateObjectMapping: 1.558800 ms MarkObjects: 12.454000 ms DeleteObjects: 0.047200 ms)
Unloading 7 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 1.326200 ms
Particle system meshes will only work with exactly one (1) sub mesh
Unloading 6 unused Assets / (6.0 MB). Loaded Objects now: 267343.
Memory consumption went from 0.79 GB to 0.79 GB.
Total: 70.672500 ms (FindLiveObjects: 23.732000 ms CreateObjectMapping: 3.858500 ms MarkObjects: 42.746500 ms DeleteObjects: 0.335100 ms)
Unloading 0 Unused Serialized files (Serialized files now loaded: 0)
Unloading 0 unused Assets / (0 B). Loaded Objects now: 267343.
Memory consumption went from 0.79 GB to 0.79 GB.
Total: 52.536300 ms (FindLiveObjects: 23.357000 ms CreateObjectMapping: 3.283400 ms MarkObjects: 25.415700 ms DeleteObjects: 0.479300 ms)
Unloading 5 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 135.388100 ms
Reduced additional punctual light shadows resolution by 2 to make 2 shadow maps fit in the 512x512 shadow atlas. To avoid this, increase shadow atlas size, decrease big shadow resolutions, or reduce the number of shadow maps active in the same frame
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:Log (object)
UnityEngine.Rendering.Universal.Internal.AdditionalLightsShadowCasterPass:AtlasLayout (int,int,int) (at D:/UnityProject/UnityProject/G303/Library/PackageCache/com.unity.render-pipelines.universal@12.1.12/Runtime/Passes/AdditionalLightsShadowCasterPass.cs:399)
UnityEngine.Rendering.Universal.Internal.AdditionalLightsShadowCasterPass:Setup (UnityEngine.Rendering.Universal.RenderingData&) (at D:/UnityProject/UnityProject/G303/Library/PackageCache/com.unity.render-pipelines.universal@12.1.12/Runtime/Passes/AdditionalLightsShadowCasterPass.cs:605)
UnityEngine.Rendering.Universal.UniversalRenderer:Setup (UnityEngine.Rendering.ScriptableRenderContext,UnityEngine.Rendering.Universal.RenderingData&) (at D:/UnityProject/UnityProject/G303/Library/PackageCache/com.unity.render-pipelines.universal@12.1.12/Runtime/UniversalRenderer.cs:506)
UnityEngine.Rendering.Universal.UniversalRenderPipeline:RenderSingleCamera (UnityEngine.Rendering.ScriptableRenderContext,UnityEngine.Rendering.Universal.CameraData,bool) (at D:/UnityProject/UnityProject/G303/Library/PackageCache/com.unity.render-pipelines.universal@12.1.12/Runtime/UniversalRenderPipeline.cs:426)
UnityEngine.Rendering.Universal.UniversalRenderPipeline:RenderSingleCamera (UnityEngine.Rendering.ScriptableRenderContext,UnityEngine.Camera) (at D:/UnityProject/UnityProject/G303/Library/PackageCache/com.unity.render-pipelines.universal@12.1.12/Runtime/UniversalRenderPipeline.cs:339)
UnityEngine.Rendering.Universal.UniversalRenderPipeline:Render (UnityEngine.Rendering.ScriptableRenderContext,System.Collections.Generic.List`1<UnityEngine.Camera>) (at D:/UnityProject/UnityProject/G303/Library/PackageCache/com.unity.render-pipelines.universal@12.1.12/Runtime/UniversalRenderPipeline.cs:294)
UnityEngine.Rendering.RenderPipeline:InternalRender (UnityEngine.Rendering.ScriptableRenderContext,System.Collections.Generic.List`1<UnityEngine.Camera>)
UnityEngine.Rendering.RenderPipelineManager:DoRenderLoop_Internal (UnityEngine.Rendering.RenderPipelineAsset,intptr,System.Collections.Generic.List`1<UnityEngine.Camera/RenderRequest>)
UnityEngine.Experimental.Rendering.BuiltinRuntimeReflectionSystem:TickRealtimeProbes ()
UnityEngine.Experimental.Rendering.ScriptableRuntimeReflectionSystemWrapper:Internal_ScriptableRuntimeReflectionSystemWrapper_TickRealtimeProbes (bool&)
(Filename: D:/UnityProject/UnityProject/G303/Library/PackageCache/com.unity.render-pipelines.universal@12.1.12/Runtime/Passes/AdditionalLightsShadowCasterPass.cs Line: 399)
Unloading 2572 unused Assets / (111.4 MB). Loaded Objects now: 52002.
Memory consumption went from 0.82 GB to 0.71 GB.
Total: 56.385000 ms (FindLiveObjects: 4.342200 ms CreateObjectMapping: 2.558700 ms MarkObjects: 27.452900 ms DeleteObjects: 22.030600 ms)
Nuitrack Stop OK
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:Log (object)
NuitrackManager:StopNuitrack () (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:676)
Nui_BoneManager:StopSensor () (at D:/UnityProject/UnityProject/G303/Assets/Scripts/程序/Manager/Camera/Nui_BoneManager.cs:156)
GS_StandbyNew:StateStart () (at D:/UnityProject/UnityProject/G303/Assets/Scripts/程序/GameState/GS_StandbyNew.cs:27)
StateWorkerMonoSingleton`2<GameWorker, GameState>:SetState<GS_StandbyNew> ()
PS_EndResultNew/GN_GetPhoto:Update () (at D:/UnityProject/UnityProject/G303/Assets/Scripts/程序/PanelState/PS_EndResultNew.cs:717)
StateMachine.StateMachine`1<PS_EndResultNew>:Update () (at D:/UnityProject/UnityProject/G303/Assets/Scripts/程序/StateMachine/StateMachine.cs:28)
PS_EndResultNew:StateWorking () (at D:/UnityProject/UnityProject/G303/Assets/Scripts/程序/PanelState/PS_EndResultNew.cs:109)
StateWorkerMonoSingleton`2<UIWorker, PanelState>:StateWorking ()
StateWorkerMonoSingleton`2<UIWorker, PanelState>:Update ()
(Filename: D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs Line: 676)
But like this one, he’s going to fail, and strangely, I wonder if I can keep him working all the time and not shut down so often. But the matting effect of the product is still a little inferior, maybe I will consider using AI, which will cause me to need to switch devices frequently
<color=green><b>第279次测试
Time:12/30/2024 3:35:25 PM</b></color>
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:LogFormat (UnityEngine.LogType,string,object[])
UnityEngine.Debug:LogErrorFormat (string,object[])
OPH.Logger.UnityLoggerHandler:LogError (string,object[]) (at D:/UnityProject/UnityProject/G303/Assets/Scripts/程序/OPH/Utilities/Debug/UnityLoggerHandler.cs:22)
OPH.DebugUtility:LogError (string,object[]) (at D:/UnityProject/UnityProject/G303/Assets/Scripts/程序/OPH/Utilities/Debug/DebugUtility.cs:75)
GS_StandbyNew:StateWorking () (at D:/UnityProject/UnityProject/G303/Assets/Scripts/程序/GameState/GS_StandbyNew.cs:71)
StateWorkerMonoSingleton`2<GameWorker, GameState>:StateWorking ()
GameWorker:StateWorking () (at D:/UnityProject/UnityProject/G303/Assets/Scripts/GameStates/GameWorker.cs:96)
StateWorkerMonoSingleton`2<GameWorker, GameState>:Update ()
(Filename: D:/UnityProject/UnityProject/G303/Assets/Scripts/程序/OPH/Utilities/Debug/UnityLoggerHandler.cs Line: 22)
Unloading 3 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 13.539600 ms
Unloading 3781 unused Assets / (116.7 MB). Loaded Objects now: 19700.
Memory consumption went from 0.61 GB to 505.3 MB.
Total: 33.881800 ms (FindLiveObjects: 1.296900 ms CreateObjectMapping: 1.643100 ms MarkObjects: 12.238000 ms DeleteObjects: 18.703200 ms)
Attention! Mirror doesn't work with enabled Rotate Angle
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:LogWarning (object)
NuitrackConfigHandler:set_RotateAngle (NuitrackManager/RotationDegree) (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackConfigHandler.cs:100)
NuitrackManager:NuitrackInit () (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:369)
NuitrackManager:WorkingThread () (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:774)
System.Threading.ThreadHelper:ThreadStart_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
System.Threading.ThreadHelper:ThreadStart ()
(Filename: D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackConfigHandler.cs Line: 100)
RealSense used custom RGB resolution: 1280X720
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:Log (object)
NuitrackManager:ChangeResolution (int,int,string,string) (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:752)
NuitrackManager:NuitrackInit () (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:387)
NuitrackManager:WorkingThread () (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:774)
System.Threading.ThreadHelper:ThreadStart_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
System.Threading.ThreadHelper:ThreadStart ()
(Filename: D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs Line: 752)
RealSense used custom Depth resolution: 1280X720
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:Log (object)
NuitrackManager:ChangeResolution (int,int,string,string) (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:752)
NuitrackManager:NuitrackInit () (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:393)
NuitrackManager:WorkingThread () (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:774)
System.Threading.ThreadHelper:ThreadStart_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
System.Threading.ThreadHelper:ThreadStart ()
(Filename: D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs Line: 752)
Unloading 1 Unused Serialized files (Serialized files now loaded: 0)
Unloading 0 unused Assets / (0 B). Loaded Objects now: 20068.
Memory consumption went from 505.0 MB to 505.0 MB.
Total: 15.071000 ms (FindLiveObjects: 1.117100 ms CreateObjectMapping: 1.219200 ms MarkObjects: 12.689100 ms DeleteObjects: 0.045200 ms)
Unloading 8 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 1.126700 ms
Unloading 9 unused Assets / (7.9 MB). Loaded Objects now: 92880.
Memory consumption went from 0.85 GB to 0.84 GB.
Total: 27.177100 ms (FindLiveObjects: 6.976800 ms CreateObjectMapping: 2.345300 ms MarkObjects: 17.504200 ms DeleteObjects: 0.347800 ms)
Unloading 1 Unused Serialized files (Serialized files now loaded: 0)
CommandBuffer: temporary render texture not found while executing (SetRenderTarget)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.Rendering.ScriptableRenderContext:Submit_Internal ()
UnityEngine.Rendering.ScriptableRenderContext:Submit ()
UnityEngine.Rendering.Universal.UniversalRenderPipeline:RenderSingleCamera (UnityEngine.Rendering.ScriptableRenderContext,UnityEngine.Rendering.Universal.CameraData,bool) (at D:/UnityProject/UnityProject/G303/Library/PackageCache/com.unity.render-pipelines.universal@12.1.12/Runtime/UniversalRenderPipeline.cs:446)
UnityEngine.Rendering.Universal.UniversalRenderPipeline:RenderCameraStack (UnityEngine.Rendering.ScriptableRenderContext,UnityEngine.Camera) (at D:/UnityProject/UnityProject/G303/Library/PackageCache/com.unity.render-pipelines.universal@12.1.12/Runtime/UniversalRenderPipeline.cs:587)
UnityEngine.Rendering.Universal.UniversalRenderPipeline:Render (UnityEngine.Rendering.ScriptableRenderContext,System.Collections.Generic.List`1<UnityEngine.Camera>) (at D:/UnityProject/UnityProject/G303/Library/PackageCache/com.unity.render-pipelines.universal@12.1.12/Runtime/UniversalRenderPipeline.cs:280)
UnityEngine.Rendering.RenderPipeline:InternalRender (UnityEngine.Rendering.ScriptableRenderContext,System.Collections.Generic.List`1<UnityEngine.Camera>)
UnityEngine.Rendering.RenderPipelineManager:DoRenderLoop_Internal (UnityEngine.Rendering.RenderPipelineAsset,intptr,System.Collections.Generic.List`1<UnityEngine.Camera/RenderRequest>)
[D:/UnityProject/UnityProject/G303/Library/PackageCache/com.unity.render-pipelines.universal@12.1.12/Runtime/UniversalRenderPipeline.cs line 446]
Unloading 1 unused Assets / (2.0 MB). Loaded Objects now: 92961.
Memory consumption went from 0.85 GB to 0.85 GB.
Total: 28.206000 ms (FindLiveObjects: 7.252200 ms CreateObjectMapping: 2.275400 ms MarkObjects: 18.462500 ms DeleteObjects: 0.215400 ms)
Unloading 5 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 32.861700 ms
Reduced additional punctual light shadows resolution by 2 to make 2 shadow maps fit in the 512x512 shadow atlas. To avoid this, increase shadow atlas size, decrease big shadow resolutions, or reduce the number of shadow maps active in the same frame
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:Log (object)
UnityEngine.Rendering.Universal.Internal.AdditionalLightsShadowCasterPass:AtlasLayout (int,int,int) (at D:/UnityProject/UnityProject/G303/Library/PackageCache/com.unity.render-pipelines.universal@12.1.12/Runtime/Passes/AdditionalLightsShadowCasterPass.cs:399)
UnityEngine.Rendering.Universal.Internal.AdditionalLightsShadowCasterPass:Setup (UnityEngine.Rendering.Universal.RenderingData&) (at D:/UnityProject/UnityProject/G303/Library/PackageCache/com.unity.render-pipelines.universal@12.1.12/Runtime/Passes/AdditionalLightsShadowCasterPass.cs:605)
UnityEngine.Rendering.Universal.UniversalRenderer:Setup (UnityEngine.Rendering.ScriptableRenderContext,UnityEngine.Rendering.Universal.RenderingData&) (at D:/UnityProject/UnityProject/G303/Library/PackageCache/com.unity.render-pipelines.universal@12.1.12/Runtime/UniversalRenderer.cs:506)
UnityEngine.Rendering.Universal.UniversalRenderPipeline:RenderSingleCamera (UnityEngine.Rendering.ScriptableRenderContext,UnityEngine.Rendering.Universal.CameraData,bool) (at D:/UnityProject/UnityProject/G303/Library/PackageCache/com.unity.render-pipelines.universal@12.1.12/Runtime/UniversalRenderPipeline.cs:426)
UnityEngine.Rendering.Universal.UniversalRenderPipeline:RenderSingleCamera (UnityEngine.Rendering.ScriptableRenderContext,UnityEngine.Camera) (at D:/UnityProject/UnityProject/G303/Library/PackageCache/com.unity.render-pipelines.universal@12.1.12/Runtime/UniversalRenderPipeline.cs:339)
UnityEngine.Rendering.Universal.UniversalRenderPipeline:Render (UnityEngine.Rendering.ScriptableRenderContext,System.Collections.Generic.List`1<UnityEngine.Camera>) (at D:/UnityProject/UnityProject/G303/Library/PackageCache/com.unity.render-pipelines.universal@12.1.12/Runtime/UniversalRenderPipeline.cs:294)
UnityEngine.Rendering.RenderPipeline:InternalRender (UnityEngine.Rendering.ScriptableRenderContext,System.Collections.Generic.List`1<UnityEngine.Camera>)
UnityEngine.Rendering.RenderPipelineManager:DoRenderLoop_Internal (UnityEngine.Rendering.RenderPipelineAsset,intptr,System.Collections.Generic.List`1<UnityEngine.Camera/RenderRequest>)
UnityEngine.Experimental.Rendering.BuiltinRuntimeReflectionSystem:TickRealtimeProbes ()
UnityEngine.Experimental.Rendering.ScriptableRuntimeReflectionSystemWrapper:Internal_ScriptableRuntimeReflectionSystemWrapper_TickRealtimeProbes (bool&)
(Filename: D:/UnityProject/UnityProject/G303/Library/PackageCache/com.unity.render-pipelines.universal@12.1.12/Runtime/Passes/AdditionalLightsShadowCasterPass.cs Line: 399)
Unloading 2125 unused Assets / (126.5 MB). Loaded Objects now: 50737.
Memory consumption went from 0.92 GB to 0.79 GB.
Total: 53.016900 ms (FindLiveObjects: 3.882500 ms CreateObjectMapping: 2.543900 ms MarkObjects: 12.798000 ms DeleteObjects: 33.792200 ms)
Unloading 0 Unused Serialized files (Serialized files now loaded: 0)
Unloading 0 unused Assets / (37.0 KB). Loaded Objects now: 50734.
Memory consumption went from 0.71 GB to 0.71 GB.
Total: 18.880500 ms (FindLiveObjects: 3.388400 ms CreateObjectMapping: 1.860300 ms MarkObjects: 13.574700 ms DeleteObjects: 0.056700 ms)
Unloading 0 Unused Serialized files (Serialized files now loaded: 0)
Unloading 0 unused Assets / (0 B). Loaded Objects now: 50734.
Memory consumption went from 0.63 GB to 0.63 GB.
Total: 19.242200 ms (FindLiveObjects: 3.613200 ms CreateObjectMapping: 1.961100 ms MarkObjects: 13.593300 ms DeleteObjects: 0.074000 ms)
Nuitrack Init OK
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:Log (object)
NuitrackManager:NuitrackInit () (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:439)
NuitrackManager:WorkingThread () (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:774)
System.Threading.ThreadHelper:ThreadStart_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
System.Threading.ThreadHelper:ThreadStart ()
(Filename: D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs Line: 439)
Nuitrack Run OK
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:Log (object)
NuitrackManager:NuitrackInit () (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:456)
NuitrackManager:WorkingThread () (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:774)
System.Threading.ThreadHelper:ThreadStart_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
System.Threading.ThreadHelper:ThreadStart ()
(Filename: D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs Line: 456)
Perhaps the sensor is already being used in other program. Or some unexpected error.
Does this example work? C:\Program Files\Nuitrack\nuitrack\nuitrack\bin\bin\nuitrack_sample.exe.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:LogError (object)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (string,bool,bool) (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:95)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (System.Exception,bool,bool) (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:75)
NuitrackManager:Update () (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:718)
(Filename: D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs Line: 95)
It is recommended to test on AllModulesScene
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:LogError (object)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (string,bool,bool) (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:98)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (System.Exception,bool,bool) (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:75)
NuitrackManager:Update () (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:718)
(Filename: D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs Line: 98)
nuitrack.Exception
at nuitrack.NativeImporter.throwException (nuitrack.NativeImporter+ExceptionType type) [0x00096] in <0dba52d8ba4c458ab12d583e381918b5>:0
at nuitrack.NativeNuitrack.Update () [0x00006] in <0dba52d8ba4c458ab12d583e381918b5>:0
at nuitrack.Nuitrack.Update () [0x0000a] in <0dba52d8ba4c458ab12d583e381918b5>:0
at NuitrackManager.Update () [0x00058] in D:\UnityProject\UnityProject\G303\Assets\NuitrackSDK\Nuitrack\Scripts\NuitrackManager.cs:705
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:LogError (object)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (string,bool,bool) (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:104)
NuitrackSDK.ErrorSolver.NuitrackErrorSolver:CheckError (System.Exception,bool,bool) (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs:75)
NuitrackManager:Update () (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:718)
(Filename: D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/ErrorSolver/NuitrackErrorSolver.cs Line: 104)
Nuitrack Stop OK
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:Log (object)
NuitrackManager:StopNuitrack () (at D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs:676)
Nui_BoneManager:StopSensor () (at D:/UnityProject/UnityProject/G303/Assets/Scripts/程序/Manager/Camera/Nui_BoneManager.cs:156)
GS_StandbyNew:StateStart () (at D:/UnityProject/UnityProject/G303/Assets/Scripts/程序/GameState/GS_StandbyNew.cs:27)
StateWorkerMonoSingleton`2<GameWorker, GameState>:SetState<GS_StandbyNew> ()
PS_EndResultNew/GN_GetPhoto:Update () (at D:/UnityProject/UnityProject/G303/Assets/Scripts/程序/PanelState/PS_EndResultNew.cs:717)
StateMachine.StateMachine`1<PS_EndResultNew>:Update () (at D:/UnityProject/UnityProject/G303/Assets/Scripts/程序/StateMachine/StateMachine.cs:28)
PS_EndResultNew:StateWorking () (at D:/UnityProject/UnityProject/G303/Assets/Scripts/程序/PanelState/PS_EndResultNew.cs:109)
StateWorkerMonoSingleton`2<UIWorker, PanelState>:StateWorking ()
StateWorkerMonoSingleton`2<UIWorker, PanelState>:Update ()
(Filename: D:/UnityProject/UnityProject/G303/Assets/NuitrackSDK/Nuitrack/Scripts/NuitrackManager.cs Line: 676)
Just to get some additional information:
- As we could see Nuitrack is only stopped, without call of Nuitrack::release(), is that right?
- Did you test this workflow directly in Editor (Play mode) or with a compiled application? What OS is used ?
- Do you observe increasing memory consumption during this numerous restarts of application/Nuitrack ?
As a general concept for possible workarounds:
- not stopping Nuitrack is more stable than
- stopping/starting without fully releasing, and this is more stable than
- fully releasing and re-initting inside the same application process
Anyway Nuitrack is generally should be stable also in third case, so we have to do some internal engineering to reproduce your scenario to fully ensure its stability.
cc @Stepan.Reuk
I found that in the management class of NuitrackManager, StartNuitrack and StopNuititrack are called Nuitrack.Init and Nuitrack.Release.
I packed it straight out and hung it on the test machine.The development environment is windows64.
I’ll take a look at it later. Thanks for your advice.
public void StartNuitrack()
{
nuitrackError = false;
if (!IsNuitrackLibrariesInitialized())
return;
if (asyncInit)
StartThread();
else
NuitrackInit();
}
void NuitrackInit() {
// ...
try {
// ...
if (wifiConnect != WifiConnect.none) {
// ...
}
else {
Nuitrack.Init();
}
// ...
}
catch {
// ...
}
}
void StopNuitrack() {
if (!IsNuitrackLibrariesInitialized() || !NuitrackInitialized)
return;
try {
for (int i = 0; i < devices.Count; i++)
sensorsData[i].StopProcessing();
if (colorModuleOn)
sensorsData[0].onColorUpdate -= HandleOnColorSensorUpdateEvent;
if (depthModuleOn)
sensorsData[0].onDepthUpdate -= HandleOnDepthSensorUpdateEvent;
if (userTrackerModuleOn)
sensorsData[0].onUserTrackerUpdate -= HandleUserTrackerUpdateEvent;
Nuitrack.Release();
DebugUtility.Log("Nuitrack Stop OK");
NuitrackInitialized = false;
}
catch (System.Exception ex) {
DebugUtility.LogError(ex.ToString());
}
}