none
Cannot Access (User) Kinect DSS Service Page After posting to another service

    Question

  • Hello all,

    I can start my own custom service which partners with the (User) Kinect service, I can even view the Kinect sensor DSS homepage and post configuration changes to it. Very cool.

    HOWEVER: after posting config changes to my custom service, I can no longer access the (User) Kinect service page! Does anybody know why this might be? I get this same behavior with dsshost.exe and dsshost32.exe on my 64-bit Windows 7 machine. 

    As far as I can tell the Kinect sensor and the (User) kinect DSS service are still working, I just can't access the DSS webpage, which means I can't see the video, nor configure the frame rate / tilt!!!

    When I double click on the (User) Kinect Service after configuring my kinect-partnered service the page tries to load, but really doesn't go anywhere. I have put break points directly into the top of the HttpGet and HttpSet handlers for the (User) Kinect Service and found that while the service is running those break points are never reached, however, as soon as I press Ctrl + C in the DSS Node Command shell (to shutdown the service) THEN the break point at the top of the HttpGet handler is reached. This is why it seems like there is something wrong inside of DSS itself. Of course something could still be wrong with my custom service that partners (User) Kinect but I can't figure out what it is.

    Please help. Thank you.


    • Edited by Kobe1815 Monday, February 04, 2013 11:26 PM spelling error fixes
    Monday, January 28, 2013 3:06 AM

Answers

  • I think I have figured it out. The problem, not surprisingly, had nothing to do with the partnered service. 

    It looks like the problem is related to the Kinect service not properly disposing of it's resources, as was partially reported by Sergei Grichine  here

    After adding the following handler and being very mindful to always stop debugging by pressing Ctrl + C in the DSS node command window I have not had this problem.

    [ServiceHandler(ServiceHandlerBehavior.Teardown)]
            public virtual IEnumerator<ITask> DropHandler(DsspDefaultDrop drop)
            {
                this.kinectSensor.Stop();
                this.kinectSensor.Dispose();
     
                yield break;
            }
    
    


    Am I correct in saying that without this handler, the kinectSensor was not properly disposing of the Kinect resources? If so, I think we'd all like to see this change made in future distributions of MRDS. If my assumption is incorrect then I don't know why my services are working properly now, and I like to know how DSS knows to dispose of the kinectSensor object.

    Thank you!

    Friday, February 01, 2013 10:35 PM

All replies

  • Is there any way you could post the code to your custom service (Dropbox, SkyDrive, or pasted to the forum, ...)?

    I don't recognize it as a general, known issue and it's a bit difficult to diagnose without seeing code...

    Friday, February 01, 2013 8:44 PM
  • I think I have figured it out. The problem, not surprisingly, had nothing to do with the partnered service. 

    It looks like the problem is related to the Kinect service not properly disposing of it's resources, as was partially reported by Sergei Grichine  here

    After adding the following handler and being very mindful to always stop debugging by pressing Ctrl + C in the DSS node command window I have not had this problem.

    [ServiceHandler(ServiceHandlerBehavior.Teardown)]
            public virtual IEnumerator<ITask> DropHandler(DsspDefaultDrop drop)
            {
                this.kinectSensor.Stop();
                this.kinectSensor.Dispose();
     
                yield break;
            }
    
    


    Am I correct in saying that without this handler, the kinectSensor was not properly disposing of the Kinect resources? If so, I think we'd all like to see this change made in future distributions of MRDS. If my assumption is incorrect then I don't know why my services are working properly now, and I like to know how DSS knows to dispose of the kinectSensor object.

    Thank you!

    Friday, February 01, 2013 10:35 PM
  • I believe you are correct! This appears to be a bug in the service.

    The issue Sergei reports is similar in that it's a failure to properly dispose frames:

    ImageFrame.Dispose() should be called following each successful return from OpenNextFrame(...) which is being done in DoReadColorFrame(), DoReadDepthFrame(), and DoReadSkeletalFrame()

    The failure to dispose the KinectSensor as a whole I do believe explains the behavior you were seeing; essentially a failure to Start() the second time around.

    Excellent find! Hopefully we can post a fix (perhaps to http://mrdssamples.codeplex.com/ ) In the mean time, as a workaround, you can patch the Kinect.cs that comes with RDS.

    Thanks!

    Monday, February 04, 2013 11:14 PM
  • A correction to my correction is that a response needs to be sent to the drop message. Otherwise, shutting down the service takes a very long time since you have to wait for a timeout. Specifically, some kind of drop.ResponsePort.Post() line needs to be added right before the yield break line
    Monday, February 04, 2013 11:31 PM
  • Oh yes, usually just base.DefaultDropHandler(...);
    Tuesday, February 05, 2013 12:25 AM