- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello
When I start the pipe using start() without a configuration, everything works fine. But if I start the pipe with the following configuratopn, it fails
// Camera D415
// platform: linux on jetson
rs2::config cfg;
cfg.enable_stream(RS2_STREAM_INFRARED, 0);
cfg.enable_stream(RS2_STREAM_INFRARED, 1);
printf("starting pipe\n");
pipe.start(cfg);
printf("pipe started\n");
Output
starting pipe
terminate called after throwing an instance of 'rs2::wrong_api_call_sequence_error'
what(): Device already streaming!
Aborted (core dumped)
I made sure no other program is using the camera
Any ideas what could be wrong ?
- Tags:
- Include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My understanding is that rs2::pipeline pipe and the pipe start instruction should always be declared after the cfg lines are completed, like in the example code quoted.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Following through the sequence of your code and the debug statements that are printed, it looks as though the program is failing when the pipe.start(cfg) line is reached, meaning that it never reaches the debug print statement "pipe started".
In the SDK's example script in its API How To doc, there is an rs2::pipeline pipe; statement preceding the pipeline start instruction, which your script doesn't have.
rs2::config cfg;
cfg.enable_stream(RS2_STREAM_INFRARED, 0);
cfg.enable_stream(RS2_STREAM_INFRARED, 1);
rs2::pipeline pipe;
pipe.start(cfg);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@MartyG The pipe was declared before the snippet. Otherwise the code wouldn't have compiled. I made a bare-bones version of the project and verified that the rs2::config is what is causing the exception. I have pasted below the test program in its entirely
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <librealsense2/rs.hpp> // Include RealSense Cross Platform API
bool signal_recieved = false;
void sig_handler(int signo)
{
if( signo == SIGINT )
{
printf("received SIGINT\n");
signal_recieved = true;
}
}
int main( int argc, char** argv )
{
if( signal(SIGINT, sig_handler) == SIG_ERR )
printf("\ncan't catch SIGINT\n");
rs2::pipeline pipe;
// Start streaming with only right and left IR imagers
rs2::config cfg;
cfg.enable_stream(RS2_STREAM_INFRARED, 0);
cfg.enable_stream(RS2_STREAM_INFRARED, 1);
printf("starting pipe\n");
pipe.start(cfg); // Doesn't work
// pipe.start(); // works
printf("pipe started\n");
return 0;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My understanding is that rs2::pipeline pipe and the pipe start instruction should always be declared after the cfg lines are completed, like in the example code quoted.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page