Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to re-start the rs2 pipeline. #6272

Closed
piotr-tanski opened this issue Apr 20, 2020 · 2 comments
Closed

Unable to re-start the rs2 pipeline. #6272

piotr-tanski opened this issue Apr 20, 2020 · 2 comments
Labels
T260 series Intel® T265 library

Comments

@piotr-tanski
Copy link

piotr-tanski commented Apr 20, 2020

Required Info
Camera Model Intel RealSense T265
Firmware Version 0.2.0.926
Operating System & Version Win 10 Pro
Platform PC
SDK Version 2.33.1
Language C++
Segment Other

Hi.
I've got a following problem with Realsense T265 device: after the call to rs2::pipeline::close() method, either next call to rs2::pipeline::start() or manipulating the rs2::config (by disable_all_streams() or enable_stream()) hangs forever. The only way to make the program work again is to unplug the usb cable of t265 device and plug it again. The issue is reproducible every time.
To show that, I've prepared a simple C++ program which opens and closes the rs2::pipeline multiple times.

Could you please advise, how to properly re-start the device without closing the app or unplugging the usb?

int main(int, char**)
{
    constexpr std::chrono::seconds timeout{10};
    while (true)
    {
        // Start
        rs2::config config{};
        config.enable_stream(RS2_STREAM_POSE, RS2_FORMAT_6DOF);
        rs2::pipeline pipeline{};
        pipeline.start(config);

       std::this_thread::sleep_for(timeout);

        // Stop
        pipeline.stop();
    }
    return 0;
}
@Alnilam1305
Copy link

For me your example seems to work, but it is unstable. It differs on every try, and hangs up after 5 to 20 rounds in the endless loop.

krazycoder2k added a commit to krazycoder2k/librealsense that referenced this issue Mar 12, 2021
This PR is effectively the suggested fix in the GH issue below. Thank you @ankyur.
  
IntelRealSense#7276 

I've validated the fix works using the following code:

// Reproduces T265 Hand on Exit.
int main(int, char**)
{
	constexpr std::chrono::seconds timeout{ 1 };

	while (true)
	{
		// Start
		rs2::config config;
		rs2::pipeline pipeline;

		std::cout << "Entering pipeline.start()" << std::endl;
		pipeline.start();
		std::cout << "Exiting pipeline.start()" << std::endl;

		std::cout << "Sleeping for 1 second..." << std::endl;
		std::this_thread::sleep_for(timeout);
		
		std::cout << "Entering pipeline.stop()" << std::endl;
		pipeline.stop();
		std::cout << "Exiting pipeline.stop()" << std::endl;
	}

	return 0;
}

Suspect this fix potentially addresses the following open T265 issues as well:

IntelRealSense#7553
IntelRealSense#5807
IntelRealSense#6272
IntelRealSense#7555
IntelRealSense#7750
@RealSenseSupport
Copy link
Collaborator

The PR 8561 could be used in order to see if it fixes your issue. Incorporate the PR code in your build and give it a try.

@RealSenseSupport RealSenseSupport added the T260 series Intel® T265 library label Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T260 series Intel® T265 library
Projects
None yet
Development

No branches or pull requests

3 participants