Skip to content

xm-85h50ai: turn on majestic's autofocus out of the box - #142

Merged
openipc-ai merged 1 commit into
masterfrom
xm-85h50ai-autofocus
Aug 31, 2026
Merged

xm-85h50ai: turn on majestic's autofocus out of the box#142
openipc-ai merged 1 commit into
masterfrom
xm-85h50ai-autofocus

Conversation

@openipc-ai

Copy link
Copy Markdown
Contributor

One line, and it makes the 85H50AI the first OpenIPC camera with working autofocus on HiSilicon: the customizer enables majestic's new contrast AF engine (widgetii/majestic#522), which reads the ISP's BE AF zone statistics and drives this board's XM zoom block over the same UART the WebUI pad uses, serialised by the same port lock. The engine defaults to off everywhere — a lens without a focus motor must not grow an /autofocus endpoint — so the profile of the board it was proven on is exactly where the switch belongs. Port and speed defaults already match this board.

The WebUI side (majestic-webui#265) grows an AF button in the pad's focus group and books a settle-gated pass after each zoom step.

Verified end to end on the lab unit: from total blur to a tack-sharp frame, fv 30 → 5126 against a 5606 peak in 21 s; the zoom-then-auto-AF flow re-converges in one pass. ci-matrix.py --self-test green.

Ordering: merges after majestic#522 is in a release the builder image picks up; until then the flag is inert (majestic without the engine ignores unknown config keys and the WebUI probes majestic's config before showing the button).

The first camera with working autofocus on HiSilicon: majestic's
contrast AF engine (widgetii/majestic#522) reads the ISP's BE AF zone
statistics and drives this board's XM zoom block over the same UART
the pad uses, serialised by the same lock. The engine defaults to off
everywhere — a lens without a focus motor must not grow an /autofocus
endpoint — so enabling it here, on the board it was proven on, is the
whole change; port and speed defaults already match.

The WebUI grows an AF button and books a pass after each zoom step
(majestic-webui#265). Verified end to end on the lab unit: from total
blur to a tack-sharp frame, fv 30 -> 5126 against a 5606 peak in 21s.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Enable autofocus by default for XM-85H50AI cameras

✨ Enhancement ⚙️ Configuration changes 🕐 Less than 10 minutes

Grey Divider

AI Description

• Enables Majestic contrast autofocus for the XM-85H50AI board profile.
• Keeps autofocus disabled for cameras without motorized focus hardware.
• Reuses the board’s existing ISP statistics and UART-controlled zoom block.
Diagram

graph TD
  A["Board customizer"] -->|enables| B["Majestic AF"] -->|reads| C["ISP statistics"]
  B -->|drives| D["XM zoom block"]
Loading
High-Level Assessment

Enabling autofocus in the proven board profile is the optimal approach. A global default was considered implicitly but is inappropriate because cameras without focus motors must not expose autofocus functionality; the existing port and speed defaults already fit this hardware.

Files changed (1) +6 / -0

Other (1) +6 / -0
customizer.shEnable Majestic autofocus for XM-85H50AI +6/-0

Enable Majestic autofocus for XM-85H50AI

• Sets '.isp.autofocus.enabled' during board customization so supported cameras expose contrast autofocus out of the box. The adjacent comments document reuse of ISP focus statistics and the existing XM zoom/focus hardware defaults.

devices/hi3516ev300_lite_xm-85h50ai/general/overlay/usr/share/openipc/customizer.sh

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@openipc-ai
openipc-ai merged commit bac7c69 into master Aug 31, 2026
6 checks passed
@openipc-ai
openipc-ai deleted the xm-85h50ai-autofocus branch August 31, 2026 14:37
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