Can't close Kinect v2 in Windows Store app

I have a project built in Unity3D using Kinect v2. I can turn the Kinect on and off using the dlls provided by microsoft and calling

_Sensor = KinectSensor.GetDefault();
_Sensor.Open();

      

to turn on the Kinect, and

_Sensor.Close();

      

To turn off Kinect.

When it is on, two lights are on. When two lights are off. This is how it works on my windows 8.1 machine in Unity editor (using x86 dll), however when I run it on surface pro or as a windows store app on my windows 8.1 machine (using metro dll) only light off the camera turns off and the light on the right stays on, also the Kinect and surface protection get hot, so it is still processing the skeleton / depth data, which I want to avoid.

+3


source to share


1 answer


Kinect won't close in Windows Store apps. This is an SDK bug.

Windows Store applications use WindowsPreview.dll instead of Microsoft.Kinect.dll.

It looks like WindowsPreview.dll does not support closing the sensor.



I don't think you can do much.

Dispose of your resources and set everything to null when you need to close. ColorFrameReader, DepthFrameReader, InfraredFrameReader, BodyFrameReader should be removed. There is a Dispose method for each frame reader.

Also, unsubscribe from any FrameArrived events.

+2


source







All Articles