Solvedlibrealsense xioctl(UVCIOC_CTRL_QUERY) Device or resource busy errors with kernel 4.19.5

sh0
24
Required Info
Camera Model D430
Firmware Version 5.10.13.0
Operating System & Version Linux (Gentoo)
Kernel Version (Linux Only) 4.19.5
Platform PC
SDK Version master branch at 79dda7f
Language C++
Segment N/A

Issue Description

On Linux kernel 4.19.5 errors are generated when some commands are sent to camera in too quick succession. The error message is: ERROR [139644039424128] (types.h:188) get_xu(...). xioctl(UVCIOC_CTRL_QUERY) failed Last Error: Device or resource busy

Most reliable way to trigger this error is to create an rs2::pipeline, start it with start() and immediately use stream1.get_extrinsics_to(stream2) with appropriate streams. The get_extrinsics_to will throw with above error.

Current workaround is to wait around 3 seconds after starting the pipeline so that the camera can settle and then run get_extrinsics_to without issues.

17 Answers

✔️Accepted Answer

Here's a VERY VERY cheap and dirty workaround:

diff --git a/src/linux/backend-v4l2.cpp b/src/linux/backend-v4l2.cpp
index 3366845e..8eca827d 100644
--- a/src/linux/backend-v4l2.cpp
+++ b/src/linux/backend-v4l2.cpp
@@ -1058,8 +1058,11 @@ namespace librealsense
         {
             uvc_xu_control_query q = {static_cast<uint8_t>(xu.unit), control, UVC_GET_CUR,
                                       static_cast<uint16_t>(size), const_cast<uint8_t *>(data)};
+            retry:
             if(xioctl(_fd, UVCIOC_CTRL_QUERY, &q) < 0)
             {
+                if(errno == EBUSY)
+                    goto retry;
                 if (errno == EIO || errno == EAGAIN) // TODO: Log?
                     return false;

Related Issues:

38
librealsense Installing pyrealsense2 on MacOS?
Okay I got it Required Info Camera Model { D435 } Operating System & Version {MacOS Catalina } Issue...
31
librealsense module 'pyrealsense2' has no attribute 'pipeline'
For me I hade to do import pyrealsense2.pyrealsense2 as rs I apologize I wasn't active here for a lo...
24
librealsense IMU data stream (Python)
Hi @tRosenflanz Many thanks for your suggestion I wrote the following script that can perhaps be mad...
5
librealsense POINT CLOUD OF A PREDEFINED REGION USING PYREALSENSE2
You could find bounding boxes on the RGB aligned to depth image use the rs.pointcloud processing blo...
5
librealsense Unable to import pyrealsense2 on python
If you have multiple versions of python on your machine: From python/readme.md: Note: To force compi...
4
librealsense xioctl(UVCIOC_CTRL_QUERY) Device or resource busy errors with kernel 4.19.5
Here's a VERY VERY cheap and dirty workaround: Required Info Camera Model D430 Firmware Version 5.10...
3
librealsense Playback from bag files - direct access to frames by index
it seems like repeated calls to rs2::playback::resume and rs2::playback::pause crash the program Her...
3
librealsense "No Frames Received!" on RealSense Viewer on Ubuntu 16.04
I have a very similar issue except that I have only one D435 camera When I open realsense viewer for...
101
ssd.pytorch ValueError: not enough values to unpack (expected 2, got 0)
I changed the code as follows and worked for me In detection.py of line 62 from to ...
81
vision Downloading MNIST dataset with torchvision gives HTTP Error 403
@eduardo4jesus You could patch your model script at the top using: It will use that user agent for t...
70
pytorch CycleGAN and pix2pix any suggestion on how to get rid of the checkered effect
@AllAwake Cool results! Here is the implementation of resize-conv I used It remove the checkerboard ...
62
opencv opencv3.10 does not support cuda8.0rc?
For those people who find this page looking for a way to fix this in their build but can't deal with...
59
opencv Cannot make install opencv from origin/master on ubuntu 17.10
@zapcity @Guilmort you may have to manually execute the generator script (gen2.py) Assuming you call...
54
vision New Pillow version (7.0.0) breaks torchvision (ImportError: cannot import name 'PILLOW_VERSION' from 'PIL')
Until the new torchvision release is out the workaround is either to use the master version of torch...
51
colmap Undefined reference to libtiff4.0 on compile (Ubuntu 16.04)
Tried all of the above what finally worked for me was I have all the dependencies installed on Ubunt...
50
opencv cv2.rectangle() TypeError: an integer is required (got type tuple)
The error message is completely wrong as always I think the cause of this error may be the case when...
41
vision Failed in fine-tuning inception_v3
@jamiechoi1995 @MichaelLiang12 @TiRune is correct inception_v3 has an aux branch ...
39
loam_velodyne loam_velodyne failed
You can try removing the line: loam_velodyne/CMakeLists.txt Line 35 in 25db5dd add_definitions( -mar...
35
openpose How hard would it be to port to mobile? (iOS/Android)
I'm trying to convert the .caffemodel to CoreML to see if I can run it on iOS 11 I will report more ...
31
facenet triplet training did not converged
Hi @davidsandberg I chose these parameters carefully and run a new experiment (20 days) The result i...
31
vision pyinstaller interaction with torchvision
Here are the workarounds I found to make things work Solution 1: patch torchvision 0.2.2 (dirty and ...
30
carla Invalid pixelmap or window parameter
@jbeck9 I actually got this working by switching to the latest Nvidia driver 470 and running Carla w...
30
facenet error when running Validate_on_lfw
@farimani thank you~ I am new to the machine learning @davidsandberg I am trying to run the (Validat...
27
facenet Error loading a frozen graph ( float incompatible with float_ref )
my code I froze the 20170131-234652 model using the freeze_graph.py but I cannot load it in C++ I fi...
25
opencv Incorrect error message for non-integer points in rectangle draw function: TypeError: function takes exactly 4 arguments (2 given)
I got the same issue I resolved it by converting all the coordinate of the bounding box into int ins...
25
opencv GCC 6.0/6.x build problems
This workaround works in some cases (see #6541): cmake -DENABLE_PRECOMPILED_HEADERS=OFF ... ...
24
openpose Python API error: Cannot import name pyopenpose
My environment - UBUNTU 18.04 CUDA 9.2 CUDNN 7.2.1 Openpose current version 1.4 (Jan 2019) I did the...
23
openpose CMake Error at CMakeLists.txt:929 (add_subdirectory):
Temporary workaround Clone pybind11 separately into the folder The configure generate and build all ...
23
openpose macOS - protobuf compilation errors
@soulslicer installing Caffe separately and setting BUILD_CAFFE to false in the cmake config seems t...
23
opencv BUG:TypeError: Expected Ptr<cv::UMat> for argument 'img'
Somehow img = np.array(img) still doesn't work for me but img = img.copy() works. ...
22
scikit image Getting "ImportError: DLL load failed: The specified module could not be found."
Very likely the C++ runtime library is missing As a workaround try to install the Microsoft Visual C...
22
FCOS How to train my own datasets (format is like coco datasets)
@EDG-Zola You do not need to change this code In order to train FCOS on your own dataset you need to...
20
gluon cv OSError: libcudart.so.9.0: cannot open shared object file: No such file or directory
make sure you cuda version is 9.0 And add below to ~/.bashrc run Add below to /etc/ld.so.conf.d/cuda...
20
opencv ‘memcpy’ was not declared in this scope (Ubuntu 16.04)
Simple replace in opencv/cmake/OpencvDetectCuda.cmake to it's work for me! Please state the informat...
19
vision Origin of the means and stds used for preprocessing?
You need to go deeper ;) https://github.com/facebook/fb.resnet.torch/blob/master/datasets/imagenet.l...
17
javacv Duplicated files copied in APK
This worked for me with gradle:2.0.0 ... After updating to gradle 2.10 I started getting the followi...
17
facenet pre-trained model unable to load because of tensorflow saver format :(
Hi I'm not sure which file you are trying to load I recently tried loading a pretrained model with t...
16
pcl Mojave Xcode 10.1; pcl 1.8 make: cmath: no member named isinf
I encounter this problem too Problem The system uses a wrong toolchain path Hi I want to build and i...
15
crnn The issue of creating a dataset with create_dataset.py with python3.5
In python3 the text (str) and bytes can no longer be used in the same way The function txn.put(...) ...
14
mediapipe How do you use MediaPipe on the web in your own web app?
We will be releasing MP solutions Javascript API during week of 9 Dec. I don't need the visualizer I...
14
pytorch CycleGAN and pix2pix Error(s) in loading state_dict for ResnetGenerator
I've had similar issue while trying to test CycleGAN (--model test) on my own dataset Default --norm...
13
dlib ImportError: libmkl_rt.so: cannot open shared object file
pip install mkl it works to me I have installed dlib using pip install dlib but ...
13
mediapipe Accessing landmarks, tracking multiple hands, and enabling depth on desktop
I created a gist showing how to do this for retrieve hand landmarks (Based on @mgyong example ...
12
mAP Is there any way to calculate log-average miss rate?
@ZHANGHeng19931123 @nguyendu392 Done! You will now find a plot in the results/ with the log-average ...
12
dlib detector too slow on the TK1 board
My test code and compiler settings are here Updated RPI3 measurements: Raspberry Pi 3 Model B [rev ...
12
opencv Undefined reference to __atomic_xxx
@MKK-a try this workaround: System information (version) OpenCV => 4.1.1 OS => Raspbian Buster (Debi...
12
opencv I am having problems trying to build opencv-3.2.0 using the text module from opencv-contrib-3.2.0
I found bug is completely related to opencv and opencv_contrib branch System information (version) O...
12
opencv Error from STL library while compiling for Android with ANDROID_STL=c++_static(shared)
Android NDK provides own CMake toolchain file since r15 So solution is very simple - use it instead ...
12
cvat Unable to remote connect
To help anyone out there with complete solution: Create in cvat home directory file docker-compose.o...
11
pytorch CycleGAN and pix2pix Any idea about dealing with large image size ?
It's possible to run CycleGAN on 1024p images The model is fully convolutional This means that even ...