Skip to content
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

Fix D457 RGB sensor exposure control range issue #12251

Merged
merged 6 commits into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<p align="center"><img src="doc/img/realsense.png" width="70%" /><br><br></p>

-----------------
[![License](https://img.shields.io/github/license/IntelRealSense/librealsense.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[![Release](https://img.shields.io/github/v/release/IntelRealSense/librealsense?sort=semver)](https://github.com/IntelRealSense/librealsense/releases/latest)
[![Commits](https://img.shields.io/github/commits-since/IntelRealSense/librealsense/master/development?label=commits%20since)](https://github.com/IntelRealSense/librealsense/compare/master...development)
[![Issues](https://img.shields.io/github/issues/IntelRealSense/librealsense.svg)](https://github.com/IntelRealSense/librealsense/issues)
[![GitHub CI](../../actions/workflows/buildsCI.yaml/badge.svg?branch=development)](../../actions/workflows/buildsCI.yaml)
[![Forks](https://img.shields.io/github/forks/IntelRealSense/librealsense.svg)](https://github.com/IntelRealSense/librealsense/network/members)



## Overview
**Intel® RealSense™ SDK 2.0** is a cross-platform library for Intel® RealSense™ depth cameras.
Expand Down
18 changes: 15 additions & 3 deletions src/linux/backend-v4l2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2055,9 +2055,9 @@ namespace librealsense
return range;
}

struct v4l2_queryctrl query = {};
struct v4l2_query_ext_ctrl query = {};
query.id = get_cid(option);
if (xioctl(_fd, VIDIOC_QUERYCTRL, &query) < 0)
if (xioctl(_fd, VIDIOC_QUERY_EXT_CTRL, &query) < 0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this affect other controls as well?

Does this means this comment will be no longer relevant?

// Some controls (exposure, auto exposure, auto hue) do not seem to work on V4L2
                // Instead of throwing an error, return an empty range. This will cause this control to be omitted on our UI sample.
                // TODO: Figure out what can be done about these options and make this work

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hsuys ?

@dmipx can you review this change as well?
It should work with Ubuntu and JetPack w/o any regressions

{
// Some controls (exposure, auto exposure, auto hue) do not seem to work on V4L2
// Instead of throwing an error, return an empty range. This will cause this control to be omitted on our UI sample.
Expand Down Expand Up @@ -2814,7 +2814,19 @@ namespace librealsense

control_range v4l_mipi_device::get_pu_range(rs2_option option) const
{
return v4l_uvc_device::get_pu_range(option);
struct v4l2_query_ext_ctrl query = {};
query.id = get_cid(option);
if (xioctl(_fd, VIDIOC_QUERY_EXT_CTRL, &query) < 0)
{
// Some controls (exposure, auto exposure, auto hue) do not seem to work on V4L2
// Instead of throwing an error, return an empty range. This will cause this control to be omitted on our UI sample.
// TODO: Figure out what can be done about these options and make this work
query.minimum = query.maximum = 0;
}

control_range range(query.minimum, query.maximum, query.step, query.default_value);

return range;
}

uint32_t v4l_mipi_device::get_cid(rs2_option option) const
Expand Down
Loading