librealsense: Getting "terminate called after throwing an instance of 'rs2::backend_error'" error
Required Info | |
---|---|
Camera Model | D435i |
Firmware Version | 05.12.05.00 |
Operating System & Version | Linux (Ubuntu 18.04) |
Kernel Version (Linux Only) | 5.4.0-42-generic |
Platform | PC |
SDK Version | 2.0 (v2.36.0) |
Language | C++ |
Segment | others |
Minimum FW Version --> 05.12.05.00
Issue Description
I have been trying to execute pcl-color example by running the following command:
$ cd <librealsense>/build/wrappers/pcl/pcl-color
$ ./rs-pcl-color
But, every time, it give this error:
terminate called after throwing an instance of 'rs2::backend_error'
what(): set_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Device or resource busy
Aborted (core dumped)
- On the other hand, the camera seems working properly in realsense-viewer. I also don’t get this error while running other examples, e.g., rs-hello-realsense, rs-capture, etc.
- I tried building all the examples and pcl-wrapper-examples again but it didn’t work except only for once.
- One more thing is, after getting this error for the first time, I noticed that if the camera gets tilted by more than 90° then laptop display also gets rotated by right, left. or upside-down (Will create another issue for that). [Edit: that issue #6941 ]
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17
You are very welcome @milan-r-shah 😃
If it is a commercial project that requires stability and reliability then yes, using the kernel patching method would be the recommended action for the reasons described in the advantages / disadvantages section linked to earlier.
As you suggested, I will close this case now. As always, feel free to create new issues when you have new questions. Good luck!
If you use kernel 5.4 then you will not necessarily encounter problems. It just increases the risk a little that a problem might occur, since it is not officially validated for use with librealsense yet.
The RSUSB backend method does build from a source-code folder but it installs dependencies over an internet connection, avoiding the need for patching the source-code build. This can be very useful in situations such as installing librealsense on hardware that is experiencing conflicts with the Linux kernel.
There was an earlier installation method called libuvc backend that also uses an internet connection but has a different installation method, so some confusion is understandable. It still works and is still useful in some circumstances.
https://github.com/IntelRealSense/librealsense/blob/master/doc/libuvc_installation.md
For PC though, I would recommend using the RSUSB backend method described earlier in this discussion.
https://github.com/IntelRealSense/librealsense/issues/6940#issuecomment-665713929
The link below discusses the advantages and disadvantages of using the backend method compared to kernel patching. Scroll down the comment to the section of it headed What are the advantages and disadvantages of using libuvc vs patched kernel modules?
https://github.com/IntelRealSense/librealsense/issues/5212#issuecomment-552184604
RSUSB should be fine for use with a single camera and if your project is not a commercial one. As explained in the advantages / disadvantages information, for a project that will become a commercial product that requires high stability and updatability though or one in which multiple cameras will be used, kernel patching is recommended. There is also a higher risk of time-out errors when using RSUSB.
Sincere apologies for the delay in responding further. I have reviewed your case again from the beginning. I note that your installation of librealsense by the “backend” method, whose instructions you provided a link to, is more commonly known as building from source. Whilst doing so by this method has a number of advantages, it also has the disadvantage that you can end up with error messages if the kernel patching process does not go well.
There is another installation method that I refer to as backend, and it is performed over an internet connection. Because of the way that it installs dependencies, it is not dependent on Linux versions or kernel versions and does not require patching.
The first step in this process is to download the source code of librealsense from the Releases page as a zip file. The source code zip file can always be found in the “Assets” list at the bottom of the information listing for each SDK version on the Releases page.
https://github.com/IntelRealSense/librealsense/releases/
After downloading the zip file, its contents should be extracted so that you have a librealsense folder.At this point you can use the RSUSB installation method to install librealsense without dependence on Linux versions or kernel versions and without the need for patching. This makes this installation method particularly suited to Arm devices such as Jetson.
The backend installation method requires an internet connection. The steps are:
mkdir build && cd build
cmake …/ -DFORCE_RSUSB_BACKEND=true -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=true -DBUILD_GRAPHICAL_EXAMPLES=true
If you need to install the PCL bindings at the same time as building librealsense, add this condition to the build statement above:
- DBUILD_PCL_EXAMPLES=true
I had also never heard of the term “i86” before, but research found that it is just a collective term for x86 and x64 processors.
http://www.edm2.com/index.php/I86