Comments (9)
I found a temporary way to at least get the information, that the setOption command did crash. It's really hacki so maybe some does have a better way.
I changed the code for set_option in the rs.hpp file, so that a thread is used to send the cmd. After a given timeout the program throws an error ,if no result was returned.
bool set_option(option option, double value)
{
std::future<int> setOption = std::async(std::launch::async, [](rs_device * ref, rs_option option, double value) {
rs_error * e = nullptr;
rs_set_device_option(ref, (rs_option)option, value, &e);
error::handle(e);
return 1;
}, (rs_device *)this, (rs_option)option, value);
if (std::future_status::ready == setOption.wait_for(std::chrono::seconds(1))){
return true;
}else{
throw std::runtime_error("Could not set options");
return false;
}
}
from librealsense.
@Wollimayer std::async is actually the best solution here (we talked about this internally yesterday), and likely will appear beneath the library layer sometime soon
from librealsense.
The question is, what causes this error ? The program crashes after the error is thrown ( probably because there is a child thread in an unknown state still active without a parent thread ).
So this will not fix the underlying problem.
from librealsense.
@Wollimayer can you give the dev branch a test? std::async wasn't the right solution here and we implemented a workaround using a (potentially) unsafe Windows-specific mechanism: https://github.com/IntelRealSense/librealsense/blob/dev/src/uvc-wmf.cpp#l488
The root cause is still unknown, but assumed to be a firmware bug. The UVC spec states that a control get/set shouldn't block infinitely.
from librealsense.
@ddiakopoulos I tried to use the dev branch and was able to capture a setOption failure. However it seems that this causes another error to quit the program (not always but sometimes). ucrtbase.dll does request a termination of the program after leaving my setOptionWithRetry test method (Without an error being thrown) :
bool setOption(rs::device & dev, rs::option option, double value, int retry = 5) {
try {
dev.set_option(option, value);
return true;
}
catch (std::exception e) {
std::cout << e.what() << std::end;;
if (retry <= 0)
return false;
else
setOption(dev, option, value, --retry);
}
}
(An even strange effect was caused by multiple retries to start the capture process. After ~10 tries i receive two kinds of error when accessing the rs::context
opcodes do not match
and
calibration table is not compatible with this API
A reboot solved those problems, but this might be a side effect of the changes in the setOption part.
I got the feeling that the systems turns unstable the more often an error occurs, till it reaches a point where the devices are not responding correctly anymore.
Is there any way to bypass this complication by using another framework ( libuvc is available for windows , could this 'fix' the problem ?)
from librealsense.
I wonder if you are working with an unsupported USB controller. I have encountered certain machines that throw KSProperty errors inconsistently. Sometimes a reboot or plug/unplug of the hardware clears the issue, but usually until the app runs once, then won't reinitialize.
There's no comprehensive list of unsupported hardware, but can you list your machine, processor, and USB controller details? There might be a match with the ones I've found.
from librealsense.
Windows 8.1
i5-4460 core at 3.2GHz
8 Gig of ram
Intel(R) HD Graphics 4600
USB Controller:
2x Intel(R) 8 Series/C220 Series USB EHCI #1 - 8C26
4x Renesas USB 3.0 eXtensible-Hostcontroller
Hope that's the right information .
from librealsense.
@Wollimayer it's unlikely that switching backends will fix the problem (I also tried for a couple days a few months ago to get libuvc/libusb working with bulk transfers on Windows 8.1 with no luck). Renesas controllers should definitely work.
Can you isolate the bug to 1 camera (the one with 2.6 firmware) and attach a minimal app (as source-code) used to cause the error? One of the difficulties with your issue is that we are unable to replicate here.
from librealsense.
Closing for lack of new information.
from librealsense.
Related Issues (20)
- D455 - Stopped Working HOT 2
- Orin nano failed to read USB config descriptor HOT 10
- Realsense-viewer crashes while opening on MacOS sonoma HOT 3
- Announcement: RealSense SDK version 2.55.1 now available HOT 3
- 90 degree turn HOT 3
- How can I get an object's location coordinates with simple python code from D435i? HOT 3
- Some D455 not woring as slave in sync system HOT 13
- Left and Right RGB Images HOT 3
- How to use API to get internal and external parameters for depth map and color map alignment? HOT 2
- can I get depthmap from recorded bag file (left / right IR images) by using SDK? HOT 7
- USB 3 Hub bandwidth and power requirement for depth and tracking task
- How to map outdoor environment using realsense D455 camera HOT 4
- linux, using d435i in pycharm, possible usb issues HOT 3
- modprobe: FATAL: Module videodev is in use HOT 7
- How do i install Pyrealsense2-aarch64 into my Raspberry pi 4 8Gb version HOT 13
- Shallow depth information at edge of objects HOT 9
- D435i Low Framerate when using 2 or more USB-Cameras HOT 4
- Problem D345i HOT 4
- Process Killed RealSense SDK Mac M2 HOT 10
- I am working with Intel Realsense Lidar l515 camera. And after installing the Realsense Viewer on Win 10, it doesn't see my camera, with the next issue outputs: context.cpp:129 - Found 0 RealSense devices (0xfe requested & 0xff from device-mask in settings) HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from librealsense.