I got error when I try to run the app with kinect SDK

Oct 19, 2012 at 1:12 PM

Error at line 23 of the file named "SDKDataSourceFactory.cs", the error code is:

 sensor.DepthStream.Enable(DepthImageFormat.Resolution640x480Fps30);

Error description is :

The feature is not supported by this version of the hardware

 

Any one can help me?

Oct 23, 2012 at 11:29 AM

The solution is very simple (but you either need the Candescent source or write your own IDataSourceFactory implementation, e.g. by simply copying the original one). In KinectSdkDataSourceFactory this is the original ctor:

            this.sensor = KinectSensor.KinectSensors.First();
            this.Adapter = new KinectSensorAdapter(this.sensor);
            this.sensor.Start();
            sensor.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
            sensor.DepthStream.Enable(DepthImageFormat.Resolution640x480Fps30);

But the order here is wrong. This works:

            this.sensor = KinectSensor.KinectSensors.First();
sensor.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
            sensor.DepthStream.Enable(DepthImageFormat.Resolution640x480Fps30);
            this.Adapter = new KinectSensorAdapter(this.sensor);
            this.sensor.Start();
            
Hope that helps.

Oct 23, 2012 at 11:54 AM

Hmm, actually this works in another WPF project of mine but still not in the original samples...

But the root of the problem is probably that I have a Kinect for XBox and it doesn't support near mode, however KinectSensorAdapter tries to set it in its ctor:

        public KinectSensorAdapter(KinectSensor sensor)
        {
            this.sensor = sensor;
            try
            {
                // If this is commented out it will work!
                //this.sensor.DepthStream.Range = DepthRange.Near;
            }
            catch { }

            this.sensor.ColorFrameReady += new EventHandler<ColorImageFrameReadyEventArgs>(sensor_ColorFrameReady);
            this.sensor.DepthFrameReady += new EventHandler<DepthImageFrameReadyEventArgs>(sensor_DepthFrameReady);
        }
Just remove the line above.

Coordinator
Oct 23, 2012 at 5:46 PM

The problem is using the near mode in combination with the Kinect for XBox hardware.

I thought catching the exception would prevent this from happening. But it's not thrown when setting the mode but later when activating the stream.

I'll make this configurable. But I can't recommend using Candescent NUI with Kinect SDK in combination with the Xbox hardware (it truncates all data closer than 80cm which happens to be the default range).

Oct 24, 2012 at 3:33 AM

Thanks for your help, this is a very helpful project.