librealsense: Errors and Crashes in Unity when using multiple cameras
Required Info | |
---|---|
Camera Model | D435 |
Firmware Version | 05.10.13.00 |
Operating System & Version | Win 10 |
Platform | PC |
SDK Version | current librealsense } |
Language | C#/Unity } |
Segment | Desktop |
Issue Description
I’m using 4x D435 inside of Unity for color + depth streaming. Running 3 at the same time seems to work without issues, but adding a 4th one causes both errors inside of Unity as well as frequent crashes of the whole editor.
The crash message is an AccessViolation:
realsense2.dll caused an Access Violation (0xc0000005)
in module realsense2.dll at 0033:dd179b4b.
Stack Trace of Crashed Thread 12616:
0x00007FF9DD179B4B (realsense2) rs2_get_video_stream_intrinsics
0x00007FF9DCFD4B69 (realsense2) rs2_get_video_stream_intrinsics
0x00007FF9DCFD4CCD (realsense2) rs2_get_video_stream_intrinsics
0x00007FF9DCFD512D (realsense2) rs2_get_video_stream_intrinsics
0x00007FF9DCFD7AE3 (realsense2) rs2_get_video_stream_intrinsics
0x00007FF9DCFD7880 (realsense2) rs2_get_video_stream_intrinsics
0x00007FF9DD1831DD (realsense2) rs2_get_video_stream_intrinsics
0x000000005178FA71 (Intel.RealSense) Intel.RealSense.NativeMethods.rs2_process_frame()
0x0000000054E6C933 (Intel.RealSense) Intel.RealSense.ProcessingBlock.Process()
0x0000000054E69C73 (RealSense) RsPointCloud.Process()
0x0000000054E603E3 (RealSense) RsProcessingPipe.ProcessFrame()
0x000000005177F6E3 (Intel.RealSense) Intel.RealSense.CustomProcessingBlock.ProcessingBlockCallback()
When it works for a while in the Editor (before inevitably crashing at some point), there’s an occasional error message:
Exception: Frame didn't arrived within 5000
rs2_pipeline_wait_for_frames(pipe:00000000425835B0)
Intel.RealSense.Helpers+ErrorMarshaler.MarshalNativeToManaged (System.IntPtr pNativeData) (at <4fd4dfd1857e4955a500c05c5081d4c2>:0)
Intel.RealSense.Pipeline.WaitForFrames (System.UInt32 timeout_ms) (at <4fd4dfd1857e4955a500c05c5081d4c2>:0)
RsDevice.WaitForFrames () (at D:/GIT/temp/RealSenseTest/Assets/RealSenseSDK2.0/Scripts/RsDevice.cs:157)
System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
System.Threading.ThreadHelper.ThreadStart () (at <ac823e2bb42b41bda67924a45a0173c3>:0)
UnityEngine.UnhandledExceptionHandler:<RegisterUECatcher>m__0(Object, UnhandledExceptionEventArgs)
Intel.RealSense.NativeMethods:rs2_pipeline_wait_for_frames()
Intel.RealSense.Pipeline:WaitForFrames(UInt32)
RsDevice:WaitForFrames() (at D:/GIT/temp/RealSenseTest/Assets/RealSenseSDK2.0/Scripts/RsDevice.cs:157)
System.Threading.ThreadHelper:ThreadStart()
Also, sometimes
NullReferenceException: Object reference not set to an instance of an object
Intel.RealSense.FrameSetPool.Get (System.IntPtr ptr) (at <4fd4dfd1857e4955a500c05c5081d4c2>:0)
Intel.RealSense.FrameSource.AllocateCompositeFrame (System.Collections.Generic.IList`1[T] frames) (at <4fd4dfd1857e4955a500c05c5081d4c2>:0)
DepthCutoff.Process (Intel.RealSense.Frame frame, Intel.RealSense.FrameSource frameSource) (at D:/GIT/temp/RealSenseTest/Assets/RealSenseSDK2.0/Scripts/ProcessingBlocks/DepthCutoff.cs:67)
RsProcessingPipe.ProcessFrame (Intel.RealSense.Frame frame, Intel.RealSense.FrameSource src) (at D:/GIT/temp/RealSenseTest/Assets/RealSenseSDK2.0/Scripts/RsProcessingPipe.cs:94)
UnityEngine.Debug:LogException(Exception)
RsProcessingPipe:ProcessFrame(Frame, FrameSource) (at D:/GIT/temp/RealSenseTest/Assets/RealSenseSDK2.0/Scripts/RsProcessingPipe.cs:110)
Intel.RealSense.CustomProcessingBlock:ProcessingBlockCallback(IntPtr, IntPtr, IntPtr)
Intel.RealSense.NativeMethods:rs2_process_frame()
Intel.RealSense.CustomProcessingBlock:ProcessFrame(Frame)
RsDevice:RaiseSampleEvent(Frame) (at D:/GIT/temp/RealSenseTest/Assets/RealSenseSDK2.0/Scripts/RsDevice.cs:146)
RsDevice:WaitForFrames() (at D:/GIT/temp/RealSenseTest/Assets/RealSenseSDK2.0/Scripts/RsDevice.cs:159)
System.Threading.ThreadHelper:ThreadStart()
Any ideas? The cameras are running as a mix of USB2.1 and USB3.0, no issues in the Viewer.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15
[Realsense Customer Engineering Team Comment] @sorayu Sorry that we’re having some problem to sync github to our internal support platform so I didn’t notice your reply. Now I got your reply and will start looking at this.