Skip to content

Fix V4L2 nonui apply#13279

Open
GrantAbell wants to merge 6 commits into
obsproject:masterfrom
GrantAbell:fix/v4l2-nonui-apply
Open

Fix V4L2 nonui apply#13279
GrantAbell wants to merge 6 commits into
obsproject:masterfrom
GrantAbell:fix/v4l2-nonui-apply

Conversation

@GrantAbell
Copy link
Copy Markdown

Description

This is a patch which forces v4l2 camera property changes to always use VIDEOC_S_CTRL to make writes to V4L2 devices.

What this patch changes:

  • Adds a reusable v4l2_apply_controls() helper in v4l2-controls.c.
  • Enumerates valid controls, pulls desired values from OBS settings, compares against current device values with VIDIOC_G_CTRL, and only writes with VIDIOC_S_CTRL when needed.
  • Calls that helper from v4l2_update() so startup, websocket, Move, and any other non-UI setting updates all go through a real device apply step.

Motivation and Context

  • I kept running into issues where only the built in Camera Properties GUI for my OBS V4L2 source would apply changes, while websocket and plugins would not.

How Has This Been Tested?

  • Patched locally against flatpak upstream
  • OBS opens without error
  • WebSocket calls to adjust V4L2 camera property via SetInputSettings now works, whereas before it did not.
  • Manual UI updates still work

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@GrantAbell GrantAbell marked this pull request as draft April 2, 2026 19:40
@GrantAbell GrantAbell marked this pull request as ready for review April 2, 2026 19:41
@GrantAbell GrantAbell changed the title Fix/v4l2 nonui apply Fix V4L2 nonui apply Apr 2, 2026
@WizardCM WizardCM added kind/bug Categorizes issue or PR as related to a bug. platform/linux Categorizes issue or PR as affecting Linux specifically labels Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug. platform/linux Categorizes issue or PR as affecting Linux specifically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants