Comments (10)
Hmm. We already have an inline comment for this as well https://github.com/IntelRealSense/librealsense/blob/master/src/uvc-v4l2.cpp#L459
It works for F200, R200, and SR300 on our Windows backend, so we'll look into it more deeply.
from librealsense.
I'll also give it a try on my Arch laptop this weekend and let you know about the results.
from librealsense.
Confirming this works fine on Windows but throws an error on Ubuntu 14.04.
from librealsense.
UVC controls across the backends have slightly inconsistent interfaces when it comes to exposure. There is some additional logic that will need to be added to the V4L2 backend. Just noting here that we acknowledge color exposure is broken on Linux but at the moment it's lower priority to fix.
from librealsense.
I aslo can not set this option in Windows10,but I can get it,I used:
dev->set_option(rs::option::color_exposure, 100);
but it is not worked
from librealsense.
I confirm this happens on 14.04 when using the Realsense ROS package and setting R200_LR_AUTO_EXPOSURE_ENABLED to 1. That makes the IR and depth images stall until I reconnect the device.
What's also interesting: the cpp-enumerate-devices example shows the following:
COLOR_ENABLE_AUTO_EXPOSURE : 0 .. 0, 1
Which I understand as the color auto exposure having range 0-0. That's strange.
from librealsense.
As I noted before, it is possible to toggle auto exposure and adjust exposure time using v4l2-ctl
command-line tool. I had a look inside the source code, and it turns out they use different control IDs. For auto exposure it is V4L2_CID_EXPOSURE_AUTO
, and for exposure time it is V4L2_CID_EXPOSURE_ABSOLUTE
.
So this patch fixes the issue for me:
diff --git a/src/uvc-v4l2.cpp b/src/uvc-v4l2.cpp
index 9c1b01b..05a94f5 100644
--- a/src/uvc-v4l2.cpp
+++ b/src/uvc-v4l2.cpp
@@ -462,14 +462,14 @@ namespace rsimpl
case RS_OPTION_COLOR_BACKLIGHT_COMPENSATION: return V4L2_CID_BACKLIGHT_COMPENSATION;
case RS_OPTION_COLOR_BRIGHTNESS: return V4L2_CID_BRIGHTNESS;
case RS_OPTION_COLOR_CONTRAST: return V4L2_CID_CONTRAST;
- case RS_OPTION_COLOR_EXPOSURE: return V4L2_CID_EXPOSURE; // Is this actually valid? I'm getting a lot of VIDIOC error 22s...
+ case RS_OPTION_COLOR_EXPOSURE: return V4L2_CID_EXPOSURE_ABSOLUTE;
case RS_OPTION_COLOR_GAIN: return V4L2_CID_GAIN;
case RS_OPTION_COLOR_GAMMA: return V4L2_CID_GAMMA;
case RS_OPTION_COLOR_HUE: return V4L2_CID_HUE;
case RS_OPTION_COLOR_SATURATION: return V4L2_CID_SATURATION;
case RS_OPTION_COLOR_SHARPNESS: return V4L2_CID_SHARPNESS;
case RS_OPTION_COLOR_WHITE_BALANCE: return V4L2_CID_WHITE_BALANCE_TEMPERATURE;
- case RS_OPTION_COLOR_ENABLE_AUTO_EXPOSURE: return V4L2_CID_AUTOGAIN; // Automatic gain/exposure control
+ case RS_OPTION_COLOR_ENABLE_AUTO_EXPOSURE: return V4L2_CID_EXPOSURE_AUTO;
case RS_OPTION_COLOR_ENABLE_AUTO_WHITE_BALANCE: return V4L2_CID_AUTO_WHITE_BALANCE;
default: throw std::runtime_error(to_string() << "no v4l2 cid for option " << option);
}
Tested with all (R200, F200, SR300) cameras. Note that V4L2_CID_EXPOSURE_AUTO
encodes modes with enum, where 1 is manual mode, and 3 is aperture priority. This means that to disable auto exposure one needs to call device->set_option(rs::options::color_enable_auto_exposure, 1)
, and to enable it device->set_option(rs::options::color_enable_auto_exposure, 3)
.
from librealsense.
I've been using librealsense
with this patch for over a month now on Ubuntu 14.04 and 16.04 without any problems. Should I submit a pull request?
from librealsense.
Thank you, this does seem to solve the problem.
This fix is also available on the development branch and will be merged to master.
from librealsense.
Auto exposure should be functional now on all platforms
from librealsense.
Related Issues (20)
- D430 module not detected by realsense viewer HOT 10
- fhjfyhu
- RS2_OPTION_AUTO_EXPOSURE_LIMIT HOT 1
- Issue using realsense-color stream on Raspberry Pi 4 HOT 9
- Failing to run/launch D435i while D435 works fine HOT 9
- RuntimeError: Frames didn't arrive within 10000 HOT 3
- Announcement: RealSense SDK (librealsense) version 2.56.1 Beta PRE-RELEASE now available
- how to uninstall permanently HOT 2
- Showing a reduced FoV for RS 435 HOT 3
- Use C++ to write a program: extract the timestamp information of color and depth in multi-frame(at least 100 frames) data HOT 2
- RealSense D435 image doesn't take the entire secondary display width and height using cv2 HOT 4
- IMU in Realsense d455 does not work on Android OS examples HOT 4
- Multi-camera pointcloud-stitching HOT 1
- Feature Request: nuget package HOT 7
- Manually installing SDK possible for Debian 12.6? HOT 5
- Selecting a display for Intel RealSense D435 camera so there would be no lag HOT 3
- RealSense D435 drivers for SEEED Studio NVIDIA Jetson ORIN NX 16G -- ModuleNotFoundError: No module named 'pyrealsense2' HOT 11
- No Frames Received for Intel RealSense D435 via RealSense Viewer HOT 6
- Missing depth pixels HOT 6
- help HOT 1
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.