-
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
Device or resource busy on set_option #12986
Comments
Hi @FrederikVinter Did you install the RealSense SDK from source code with CMake using the -DFORCE_RSUSB_BACKEND=TRUE flag, please? If you did then then when the value of settings is changed with set_option instructions, the SDK may occasionally not be ready to respond to a setting change request if it has been built in RSUSB = true mode. This issue is described at #6952 A solution that has been suggested in the past at #6921 (comment) is to customize the value of a setting called cancellable_timer.try_sleep that can now be found in a file in the SDK source code called polling-device-watcher.h. For example, change this line:
to:
in order to poll settings for changes every 1 second ('1000' milliseconds) instead of only every 5 seconds. If the SDK is built from source code in RSUSB = false mode (i.e a kernel patch script has been applied to the kernel) then the SDK should poll for changes in settings more often than an RSUSB = true build, meaning that the above edit would not need to be made to the source code. #5212 (comment) has a good comparison of the advantages and disadvantages of a libuvc-based install vs kernel patching. Scroll down to the section of the linked-to comment headed What are the advantages and disadvantages of using libuvc vs patched kernel modules? |
Thanks for the rapid response. I have installed realsense using this guide. Is it correct that this places us in the second catagory (RSUSB = false + kernel patch)? If so based on the listed advantages/disadvantages I would think that the current install method is the right - reliability is key in my use case. Any ideas on why i experience the issue with this install method? |
The distribution_linux package instructions install the SDK from packages. The kernel patch is included within the packages, so there is no need to apply a kernel patch. This type of build is RSUSB = false. So it does not appear as though your set-option problem is related to response delay from RSUSB. Next, I would recommend looking at the line Setting a custom queue size value can be risky as some values may break the streams. If you are using two streams (depth and color) then setting the queue size to '2' should be sufficient. If you feel that you need a larger value then '50' has worked in the past for other RealSense users. |
Would 3 then be recommended if the infrared stream is also enabled? |
If you have 3 streams enabled then using '3' would be reasonable and logical. '5' should also be okay. |
I have made the proposed change and removed calls to set_option that sets the default values. I have not seen the problem for some time now but I do not think is an ideal solution. |
The approach of not setting options to their default values when they are already using the default is a reasonable one in my opinion. And if the solution provides long-term stability then it is a good fix. Code does not always have to be perfect so long as it achieves its goal and is not messy. |
Hi @FrederikVinter Do you require further assistance with this case, please? Thanks! |
No thanks, the issue is solved for now |
Thanks very much @FrederikVinter for the update! As you do not requre further assistance at this time, I will close this case. Please feel free to re-open it at a future date if you need to do so. Thanks again! |
Before opening a new issue, we wanted to provide you with some useful suggestions (Click "Preview" above for a better view):
All users are welcomed to report bugs, ask questions, suggest or request enhancements and generally feel free to open new issue, even if they haven't followed any of the suggestions above :)
Issue Description
I have a sporadic issue with the set_option function causing:
'rs2::invalid_value_error' what(): get_xu(ctrl=1) failed! Last Error: Device or resource busy
(A full coredump can be seen at the end of the message)
Note that the value is within the valid range. The issue will show up sporadically, and is not fixed by hardware resets. I set a range of different settings using the following approach:
Note that the error will show up at different calls to set_option. Also the camera is able to capture images, only changing the settings is not possible.
The error has occured on multiple realsense devices and multiple desktop computers. But >99% of the time it runs as intended.
I have tried
Any suggestions are highly appreciated.
The following coredump is generated:
The text was updated successfully, but these errors were encountered: