Skip to content

D401 GMSL: route RGB controls to dedicated color v4l2 node - #15320

Merged
remibettan merged 5 commits into
realsenseai:developmentfrom
remibettan:d401-gmsl-color-controls
Jul 1, 2026
Merged

remibettan merged 5 commits into
realsenseai:developmentfrom
remibettan:d401-gmsl-color-controls

Conversation

@remibettan

@remibettan remibettan commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Tracked by: RSDSO-21631

Overview: On D401 GMSL, RGB controls (Saturation, Sharpness, White Balance, Auto WB) failed to take effect because they were being applied to the wrong v4l2 node.

Why

D401 GMSL exposes color through the depth sensor (_separate_color = false), but color actually streams from a dedicated video-rs-color node that also owns the RGB controls — the depth/front node does not. The depth sensor wraps all mi0 nodes in a multi_pins_uvc_device that routes every control to the front (depth) node, so RGB controls never reached the color node.

Summary

  • In d400_color::create_color_device, when the device is MIPI with RS401_GMSL_PID, locate the color entry in color_devs_info_mi0 and build a dedicated uvc_sensor (_raw_color_ep) bound to that node.
  • In register_options, use _raw_color_ep (when set) as the target for Saturation and Sharpness — switching from register_pu to an explicit uvc_pu_option on the right endpoint — and for the existing White Balance / Auto WB options. Other devices keep using get_raw_color_sensor().
  • Adds the _raw_color_ep member to d400_color.h with a comment pointing back to create_color_device.
  • pytest-rgb-options-metadata-consistency.py: drops device_exclude for D405 and D401, and falls back to first_depth_sensor() when first_color_sensor() throws — D405 and D401 GMSL expose color through the depth sensor.
  • pytest-advanced-mode.py: drops device_exclude("D401") — advanced-mode is now expected to work on D401.
  • pytest-presets.py: drops device_exclude("D401") and updates the first_color_sensor() fallback — D401 falls back to first_depth_sensor(), D405 skips with a hue-preservation reason (default_405 in presets.cpp deliberately does not reset color hue on preset apply), D421 keeps its explicit "no color sensor" skip. On D401 GMSL the test skips cleanly at the supports(rs.option.hue) guard since HUE isn't registered on MIPI.

Test plan

  • D401 GMSL: realsense-viewer — adjust Saturation/Sharpness/White Balance and confirm the streamed image responds.
  • D401 GMSL: toggle Auto White Balance on/off and confirm behavior.
  • D400 USB (e.g. D435): verify Saturation/Sharpness/WB still work (no regression — _raw_color_ep stays null, fallback path unchanged).
  • D401 GMSL: run pytest-rgb-options-metadata-consistency.py (nightly) — passes.
  • D405: run pytest-rgb-options-metadata-consistency.py (nightly) — passes.
  • D401 GMSL: run pytest-advanced-mode.py (nightly) — passes.
  • D401 GMSL: run pytest-presets.py (nightly) — passes.
  • D405: run pytest-presets.py (nightly) — test_setting_color_options skips with the hue-preservation reason; other tests in the file pass.
  • D401 GMSL: run pytest-uvc-power-stress-test.py (weekly, with -r) — passes.

@remibettan
remibettan requested a review from Nir-Az June 30, 2026 07:36
Comment thread src/ds/d400/d400-color.cpp Resolved
Comment thread src/ds/d400/d400-color.cpp Resolved

@sysrsbuild-gh-agentic sysrsbuild-gh-agentic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[rs-agentic bot] Automated review of synchronize event — new commit: pytest-advanced-mode: enable D401

Comment thread src/ds/d400/d400-color.cpp Resolved
Comment thread src/ds/d400/d400-color.cpp Resolved
Comment thread src/ds/d400/d400-color.cpp Resolved
@remibettan
remibettan requested a review from Nir-Az July 1, 2026 08:55

@Nir-Az Nir-Az left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great!

@remibettan
remibettan merged commit d4c2f7f into realsenseai:development Jul 1, 2026
31 checks passed
@remibettan
remibettan deleted the d401-gmsl-color-controls branch July 1, 2026 12:45
remibettan added a commit that referenced this pull request Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants