-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
rs-multicam sometimes crashes upon startup #4158
Comments
Hello, I am receiving this error too. The exact same hwmon error. Have you found a fix for this? |
I didn't, but my workaround is to use |
That would be very helpful if you could post your example. Thanks. |
Same problem here in Intel NUC running realsense packages v. 2.23 |
More details: |
several launches of rs-multicam. ^C marks successful launches. not sure why some text has line through it, please ignore line. cga@a1: |
This code seems to work. I removed the OpenCV display stuff. int main(int argc, char * argv[]) try // Create librealsense context for managing devices
int last_frame_count = 0; while ( 1 )
return EXIT_SUCCESS; |
Correction: above code sometimes gets error, but less than rs-multicam demo code. cga@nuc0:~/opencv-rs2$ ./multi-all cga@nuc0:~/opencv-rs2$ ./multi-all |
Here I create a // License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2015-2017 Intel Corporation. All Rights Reserved.
#include <librealsense2/rs.hpp> // Include RealSense Cross Platform API
#include "example.hpp" // Include short list of convenience functions for rendering
#include <map>
#include <vector>
int main(int argc, char * argv[]) try
{
// Create a simple OpenGL window for rendering:
window app(1280, 960, "CPP Multi-Camera Example");
rs2::context ctx; // Create librealsense context for managing devices
rs2::colorizer colorizer; // Utility class to convert depth data RGB colorspace
//std::vector<rs2::pipeline> pipelines;
rs2::syncer sync;
std::vector<rs2::sensor> sensors;
// Start a streaming pipe per each connected device
for (auto&& dev : ctx.query_devices())
{
/*rs2::pipeline pipe(ctx);
rs2::config cfg;
cfg.enable_device(dev.get_info(RS2_CAMERA_INFO_SERIAL_NUMBER));
pipe.start(cfg);
pipelines.emplace_back(pipe);*/
for (rs2::sensor sensor : dev.query_sensors()) {
auto sensor_stream_profiles = sensor.get_stream_profiles();
if(auto depth_sensor = sensor.as<rs2::depth_sensor>()) {
depth_sensor.open(sensor_stream_profiles[77]); // 640 x 480 60Hz
depth_sensor.start(sync);
sensors.push_back(sensor);
} else if (sensor_stream_profiles[0].stream_type() == RS2_STREAM_COLOR) { // "color sensor" doesn't have its own class
sensor.open(sensor_stream_profiles[85]); // 640 x 480 60Hz RGB8
sensor.start(sync);
sensors.push_back(sensor);
}
}
}
// We'll keep track for the last frame of each stream available to make the presentation persistent
std::map<int, rs2::frame> render_frames;
// Main app loop
while (app)
{
// Collect the new frames from all the connected devices
std::vector<rs2::frame> new_frames;
//for (auto &&pipe : pipelines)
{
rs2::frameset fs;
if (sync.poll_for_frames(&fs))
{
for (const rs2::frame& f : fs)
new_frames.emplace_back(f);
}
}
// Convert the newly-arrived frames to render-firendly format
for (const auto& frame : new_frames)
{
render_frames[frame.get_profile().unique_id()] = colorizer.process(frame);
}
// Present all the collected frames with openGl mosaic
app.show(render_frames);
}
for(auto sensor : sensors) {
sensor.stop();
sensor.close();
}
return EXIT_SUCCESS;
}
catch (const rs2::error & e)
{
std::cerr << "RealSense error calling " << e.get_failed_function() << "(" << e.get_failed_args() << "):\n " << e.what() << std::endl;
return EXIT_FAILURE;
}
catch (const std::exception & e)
{
std::cerr << e.what() << std::endl;
return EXIT_FAILURE;
} |
So the workaround is to use syncer instead of pipelines? How does this affect affect a hardware sync/ hardware trigger? I often find myself needing to unplug and replug these devices in order to solve the startup crashes also. |
It doesn't seem to affect hardware sync. Do you need to unplug/replug the cameras even for the example I posted above? I don't think that helped me with the original example. |
I am having the same problem, and my current solution is to unplug, try again, unplug, and try again. |
@kroq-gar7 @vhanded Sorry for late response! Is the issue resolved now? Looking forward to your update. Thanks! |
@kroq-gar7 @vhanded Do you still need support on this? Thanks! |
I have worked around it.
Thanks,
Chris
…On Sun, 29 Sep 2019, RealSense Customer Support wrote:
___________________________________________________________________________
@kroq-gar7 @vhanded Do you still need support on this? Thanks!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute thethread.[AAYIU7GBCTE4NLHVPWZMZE3QMB4MDA5CNFSM4HUTIQWKYY3PNVWWK3TUL52HS4DFVR
EXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD73PEVQ.gif]
|
@cga-cmu Thanks for update! Close the issue accordingly. |
I had a similar issue..... it went away just changing the order of device creation: using D435 and L515. |
2.22.0-0~realsense0.1106
Issue Description
I am trying to run the example
rs-multicam
with three D435's (without hardware sync). Most of the time, it crashes with the error:Other times, it crashes with this error:
I've gotten this once:
There is no other output.
Sometimes, it does run successfully and show the 6 streams (depth and color from each camera). I don't recall this happening with SDK version 2.18 (the last version I used). Anecdotally, it takes longer to reach a
hwmon 0x30
crash thanhwmon 0x10
. The crashes become less frequent if I use two cameras, and apparently non-existent if I only use one.The RealSense Viewer can stream depth+color from all cameras simultaneously, without error. I wrote another program to open streams individually (i.e. using
rs2::stream
and notrs2::pipeline
), and it also does not crash, so it appears the problem is with machinery specific tors2_pipeline_start_with_config
.For reference, I'm using the pre-compiled Ubuntu packages (version above), and my
librealsense2-dkms
is version1.3.5-0ubuntu1
.The text was updated successfully, but these errors were encountered: