{"action":"created","issue":{"url":"https://api.github.com/repos/code-iai/iai_kinect2/issues/75","labels_url":"https://api.github.com/repos/code-iai/iai_kinect2/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/code-iai/iai_kinect2/issues/75/comments","events_url":"https://api.github.com/repos/code-iai/iai_kinect2/issues/75/events","html_url":"https://github.com/code-iai/iai_kinect2/issues/75","id":67398206,"number":75,"title":"Reducing CPU load when num subscribers = 0","user":{"login":"linknum23","id":628667,"avatar_url":"https://avatars.githubusercontent.com/u/628667?v=3","gravatar_id":"","url":"https://api.github.com/users/linknum23","html_url":"https://github.com/linknum23","followers_url":"https://api.github.com/users/linknum23/followers","following_url":"https://api.github.com/users/linknum23/following{/other_user}","gists_url":"https://api.github.com/users/linknum23/gists{/gist_id}","starred_url":"https://api.github.com/users/linknum23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linknum23/subscriptions","organizations_url":"https://api.github.com/users/linknum23/orgs","repos_url":"https://api.github.com/users/linknum23/repos","events_url":"https://api.github.com/users/linknum23/events{/privacy}","received_events_url":"https://api.github.com/users/linknum23/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-09T16:25:21Z","updated_at":"2015-04-09T18:01:35Z","closed_at":null,"body":"Are any plans either to put the libfreekinect2 interface into a \"standby\" state when there are no subscribers? \r\nI have the (possibly odd) use case of only needing several Kinect2 frames every minute. The libfreekinect2 seems to use an entire processor just receiving Kinect2 data that doesn't go anywhere."},"comment":{"url":"https://api.github.com/repos/code-iai/iai_kinect2/issues/comments/91312204","html_url":"https://github.com/code-iai/iai_kinect2/issues/75#issuecomment-91312204","issue_url":"https://api.github.com/repos/code-iai/iai_kinect2/issues/75","id":91312204,"user":{"login":"linknum23","id":628667,"avatar_url":"https://avatars.githubusercontent.com/u/628667?v=3","gravatar_id":"","url":"https://api.github.com/users/linknum23","html_url":"https://github.com/linknum23","followers_url":"https://api.github.com/users/linknum23/followers","following_url":"https://api.github.com/users/linknum23/following{/other_user}","gists_url":"https://api.github.com/users/linknum23/gists{/gist_id}","starred_url":"https://api.github.com/users/linknum23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linknum23/subscriptions","organizations_url":"https://api.github.com/users/linknum23/orgs","repos_url":"https://api.github.com/users/linknum23/repos","events_url":"https://api.github.com/users/linknum23/events{/privacy}","received_events_url":"https://api.github.com/users/linknum23/received_events","type":"User","site_admin":false},"created_at":"2015-04-09T18:01:35Z","updated_at":"2015-04-09T18:01:35Z","body":"I tried adding some code to stop and start libfreekinect2 device in Kinect2Bridge run(). Sadly it looks like there is a problem (probably in libfreekinect2) where it doesn't handle multiple stop/start sequences properly. It looks like the depth processor gets out of sync from all of the messages like those below: **[DepthPacketStreamParser::handleNewData] working buffer full, resetting it!**\r\n**[DepthPacketStreamParser::handleNewData] remaining data should be 8 bytes, but is 5784**\r\n\r\nBelow is the attempted code. Does anyone have any ideas on how to do this properly?\r\n```c\r\nstd::vector<Status> status(COUNT, UNSUBCRIBED);\r\n\r\nfor(; running && ros::ok();)\r\n{\r\n    // lets keep the kinect running only when there are subscribers\r\n    bool hasSubscribers = updateStatus(status);\r\n    if(inStandby && hasSubscribers)\r\n    {\r\n\t     // start the kinect interface back up\r\n\t     std::cout << \"[kinect2_bridge] restarting kinect\"<< std::endl << std::flush;\r\n\t     device->start();\r\n\t     inStandby = false;\r\n    }\r\n    else if(!inStandby && !hasSubscribers)\r\n    {\r\n\t     // shut the kinect interface down\r\n\t     std::cout << \"[kinect2_bridge] stopping kinect\"<< std::endl << std::flush;\r\n\t     device->stop();\r\n\t     inStandby = true;\r\n    }\r\n\r\n     // loop code below...\r\n```"}}