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)
- Use d435 on linux,The usb is not recognized HOT 5
- d435i IMU calibration: fixing accelerometer inaccuracies and calibrating twice. HOT 8
- Record .bag file from RealSense camera with Python HOT 4
- RealSense D456 not working on Jetson Orin Nano with ROS2 packages HOT 4
- Layer stuctured of PCD of scan using Intel D415 HOT 8
- 软件打不开 HOT 1
- Program terminated due to an unrecoverable SEH exception:Access Violation! HOT 2
- JetPack 5.10 and ubuntu 20 on xavier nx board
- Launching multiple L515 cameras at once take time to start the camera HOT 31
- Segment tree (foreground) from background with RGB and **complicated** depth data HOT 5
- how to enable firmware logs through c++? HOT 4
- RealSense Can't list camera, D435 for windows 11 HOT 13
- can't open camera HOT 2
- Windows connects to D435i over ethernet HOT 7
- How to generate a solid (not just a surface) after 3D scanning and reconstruction with realsense D405 camera? HOT 2
- Flickering Issue on realsense d450 HOT 6
- How to read through a bag file ONCE HOT 2
- Jfrog repo is not available HOT 9
- IMU - roll can fluctuate between 10 degree difference. Is that normal? HOT 5
- Distorsion Correction HOT 3
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.