Skip to content

feat(camera): add Logitech webcam support#361

Open
davidbudnick wants to merge 2 commits into
AprilNEA:masterfrom
davidbudnick:feat/logitech-webcam
Open

feat(camera): add Logitech webcam support#361
davidbudnick wants to merge 2 commits into
AprilNEA:masterfrom
davidbudnick:feat/logitech-webcam

Conversation

@davidbudnick

@davidbudnick davidbudnick commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Context

OpenLogi only managed HID++ devices — Logitech UVC webcams were invisible. This adds first-class webcam support: enumeration, live preview, and device-level image controls written over USB to the camera's own registers, so adjustments carry into Google Meet, Zoom, and OBS rather than living only in our preview.

Note

Platform support: macOS has the full feature (AVFoundation preview + IOKit controls) and is verified end-to-end on a StreamCam. Windows matches it — DirectShow enumeration and controls (IAMVideoProcAmp / IAMCameraControl) plus a Media Foundation live preview/snapshot backend (IMFSourceReader, RGB32) — and compiles clean against x86_64-pc-windows-msvc, but has not yet been exercised on real Windows hardware. Linux builds against stubs and shows no cameras.

Demo

  • Plug in a Logitech webcam (tested end-to-end on a StreamCam) → it appears on the Devices page with its product render.
  • The Camera tab shows a 720p/30 fps live preview beside the controls: Lens (Zoom / Focus / Exposure) and Image (Brightness / Contrast / Saturation / Sharpness / White balance) sliders, Auto toggles, one-click profiles (Default / Streaming / Video call / custom), and double-click-to-reset on any row. Dragging an auto-gated slider (focus / exposure / white balance) takes the control over to manual in one device write, G HUB-style.
  • The camera streams only while its tab is visible (LED off otherwise); settings persist to config.toml and re-apply after unplug/reboot.
  • CLI: openlogi camera get, openlogi camera set brightness 140, openlogi snapshot
Screenshot 2026-07-06 at 4 46 24 PM Screenshot 2026-07-06 at 4 46 21 PM Screenshot 2026-07-06 at 4 46 14 PM Screenshot 2026-07-06 at 4 46 04 PM

Changes

  • openlogi-camera crate — AVFoundation capture plus IOKit UVC controls on macOS (Processing Unit and Camera Terminal, 4-byte exposure payloads, AE-mode bitmap, batched into a single device-seize); Media Foundation capture plus DirectShow enumeration/controls on Windows: capture.rs, capture_windows.rs, uvc.rs, uvc_windows.rs, controls.rs, capture_types.rs
  • Camera tab — zero-copy 720p preview beside a sectioned control panel with Auto chips and profiles: camera_preview.rs, camera_controls.rs, app.rs
  • Asset pipeline — cameras join the depot sync; the device_camera_image manifest key and base-model variants fetch and resolve; marker-less camera metadata parses: asset/sync.rs, asset/images.rs, openlogi-assets
  • ConfigCameraControls becomes a name-keyed map (existing TOML loads unchanged) with per-camera profiles and active selection: config.rs, state.rs
  • CLIopenlogi camera get/set for every control and auto toggle; openlogi snapshot writes a PNG: cmd/camera.rs, cmd/snapshot.rs
  • Carousel — fixed-width no-shrink cards, selection-tracked scrolling, floating arrows that stop click propagation: carousel.rs

Notes

  • The Camera permission row appears in Settings only when a webcam is present; strings are translated for all 21 locales.
  • Deferred follow-ups: pan/tilt (compound 8-byte control, needs motorized hardware), vibrance (Logitech vendor XU), filters, per-app persistence.

@davidbudnick davidbudnick marked this pull request as draft July 6, 2026 21:55
@davidbudnick davidbudnick force-pushed the feat/logitech-webcam branch from 48bc7d8 to f0ce600 Compare July 6, 2026 21:55
@greptile-apps

greptile-apps Bot commented Jul 6, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds first-class Logitech webcam support across the app. The main changes are:

  • New openlogi-camera crate for camera discovery, capture, and UVC controls.
  • Camera preview and control UI in the GUI.
  • Camera control persistence, profiles, and CLI commands.
  • Asset metadata handling for camera images.
  • Windows capture/control support and Linux stubs.

Confidence Score: 4/5

This is close, but these camera-control issues should be fixed before merging.

  • Ambiguous macOS camera matching can still write controls to the wrong Logitech webcam.
  • A partially applied auto-takeover write can leave the app state and camera hardware disagreeing.

crates/openlogi-camera/src/uvc.rs; crates/openlogi-gui/src/components/camera_controls.rs

Important Files Changed

Filename Overview
crates/openlogi-camera/src/uvc.rs Adds macOS UVC control matching and batched writes, but the fallback path can still target the wrong Logitech webcam.
crates/openlogi-gui/src/components/camera_controls.rs Adds the camera controls panel and improved write handling, but a partial batch can still leave UI/config out of sync with the device.

Comments Outside Diff (1)

  1. crates/openlogi-gui/src/components/camera_controls.rs, line 4723-4726 (link)

    P1 Partial Write Desyncs State

    apply_settings() now returns an error after attempting every write, so this early return no longer means the camera state was unchanged. In the auto-takeover path, the auto-off write can succeed and the manual value write can fail; this branch then leaves self.autos and saved config showing auto enabled while the camera is already in manual mode. The panel needs to reconcile from the live device state, or avoid treating a partially applied batch as a no-op.

    Fix in Codex Fix in Claude Code

Fix All in Codex Fix All in Claude Code

Reviews (3): Last reviewed commit: "Merge branch 'master' into feat/logitech..." | Re-trigger Greptile

Comment thread crates/openlogi-camera/src/uvc.rs
Comment thread crates/openlogi-gui/src/components/camera_controls.rs
Comment thread crates/openlogi-gui/src/components/camera_controls.rs Outdated
Comment thread crates/openlogi-camera/src/uvc.rs
@davidbudnick davidbudnick force-pushed the feat/logitech-webcam branch 5 times, most recently from 7a6ed85 to 0bb4827 Compare July 7, 2026 18:39
@davidbudnick davidbudnick force-pushed the feat/logitech-webcam branch from 0bb4827 to fdc8528 Compare July 7, 2026 18:45
@davidbudnick davidbudnick marked this pull request as ready for review July 7, 2026 20:08
Comment on lines +445 to +446
prev.into_device().close();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Ambiguous Fallback Remains

When location_hint(unique_id) is None, this branch still keeps the first Logitech UVC device as a fallback. The GUI passes the selected camera's AVFoundation ID into this backend, so an ID this parser cannot turn into a location hint can still make controls for one Logitech webcam write to whichever Logitech webcam IOKit enumerates first. With two attached Logitech cameras, this should fail closed instead of picking a best-effort device.

Fix in Codex Fix in Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant