How to close the Kinect USB port descriptor to prevent VisualStudio from crashing?

I am working on Kinect and sporadically Kinect crashes in Visual Studio.

This happens when I call the method kinectSensor.Start()after debugging, I found that Kinect is already in use in another process .

But no other processes use Kinect! This happened one morning after loading my machine and launching the application. But in most cases, this happens when I launch the Kinect application (in debug mode in VisualStudio 2010), I stop the application, and after some modification of the code, I restart the application, and at this time it does not work, I have the above exception and after Visual Studio 2sec crashes.

In addition, I check if Kinect is running, and it is not (below the state of the Kinect sensor during debugging):

state of kinect sensor (debug mode)

The strangest thing, first of all, is that sometimes it works fine for several weeks, and after that it does it for two days every two / three starts of the application.

The only solution I found on this issue is one guy with very similar problems (the only one on the Internet?): Imad Elayyan

When I start Process Explorer , I found the same problem with processing the USB port (shown in the photo), a mutant process that does not end when we close the application.

mutant process for the USB handle of the Kinect

But his solution is not really a long-term solution: I need to manually kill the mutant and restart VisualStudio. Sometimes I have to reboot VS 20 times in the morning ...

usb ( ?), VS?

, , .

:

SDK1.5 + Kinect Windows, SDK1.0 + Kinect XBox360

VS VS.

+5
3

, , . , , .

:

  • 3 , : Kinect.dll , . KinectControls.dll (, , 3D...), . .

  • Kinect.dll Kinect + : ColorFrameReady, DepthFrameReady, GestureRecognised...

  • , .

  • ( ).

  • Kinect . KinectFacade KinectStop, .

:

, Application.Current.Shutdown(), KinectStop, Kinect . Kinect ( Application.Current.Shutdown()), "/". .

Kinect Kinect ( KinectSensor.stop()), () USB , , !! : (Kinect.Start() ), , , Visual studio, ( ).

,

KinectStop(), Kinect, .

, "" : FastSmartWeakEvent, . .

USB, Visual Studio .

, . , , .

, / KinectSensor.stop() SDK /// . , ?

, ?

0

, Kinect USB 2.0 USB 3.0.

Microsoft Kinect USB3.0, Kinect.

, , , USB2.0 .

0

Try the window collider. It easily solves your problem.

-2
source

All Articles