package/majestic-af: build the out-of-core autofocus plugin from source - #2357
Conversation
majestic's autofocus engine now lives out of core in the OpenIPC/majestic-af plugin — a single shared object majestic dlopen()s. Compile it from source the way motors is: fetch the repo, build plugin.c/engine.c/af2.c into majestic-af.so, install to /usr/lib. The HAL seams it calls (sdk_get_focus_value, ...) resolve against the majestic executable at dlopen (majestic built WITH_PLUGINS_SUPPORT), so it links nothing from majestic — only its own vendored headers. depends on BR2_PACKAGE_MAJESTIC; a board's defconfig selects it (the hi3516ev300 85H50AI profile does), and the engine only loads where autofocus is enabled, so shipping the .so where it isn't used is harmless.
PR Summary by QodoBuild Majestic autofocus plugin from source
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
1. majestic-af lacks hardware evidence
|
…are board The selector requires every general/package to be built by some board in ALL_BOARDS or listed in NOT_BUILT. majestic-af's BR2_PACKAGE selection lives in the OpenIPC/builder device defconfig (hi3516ev300_lite_xm-85h50ai), so no firmware defconfig builds it — add it to NOT_BUILT, like matter and the other device/overlay-selected packages.
|
Thanks — responses to the review:
|
Per PR-compliance rule 2 (new sources wired into the build) a defconfig must
select the package, and rule ('one board, one file') prefers a generic SoC
defconfig over device-only selection. hi3516ev300_lite is the hi3516ev200-family
build whose majestic is compiled WITH_PLUGINS_SUPPORT, so the plugin's HAL seams
resolve at dlopen there. Selecting it here builds and installs it under firmware
CI; drop the ci-matrix NOT_BUILT exception accordingly. The .so only loads where
isp.autofocus is enabled, so shipping it on other ev300-lite images is harmless.
PR-compliance: a new package should pin a full 40-character SHA for reproducible builds. Bump this when the plugin cuts fixes/releases.
) Select BR2_PACKAGE_MAJESTIC_AF in the device defconfig so the test board's firmware carries /usr/lib/majestic-af.so out of the box. The package is defined in the firmware external tree (OpenIPC/firmware#2357, merged first); builder.sh clones firmware master, and the device build compiles the plugin from source (7caebdc6) and installs it — verified end-to-end in CI after the firmware merge.
Problem
majestic's autofocus engine moved out of the core binary into the open-source
OpenIPC/majestic-af plugin
(widgetii/majestic#553). Nothing in firmware builds or ships that plugin, so the
engine is unavailable. This adds a Buildroot package that compiles it from
source (like
motors) and selects it forhi3516ev300_lite, so the 85H50AIboard — whose builder profile enables autofocus (OpenIPC/builder#142) — gets
working autofocus out of the box.
Hardware tested on
hi3516ev300+ XiongMai 85H50AI (motorized 2.8–12 mm lens) — the board theengine was developed and proven on.
Evidence
The
.sofrom this package was built and installed into a real image by thebuilder companion (OpenIPC/builder#145): its full
hi3516ev300_lite_xm-85h50aidevice firmware build compiled
majestic-af.sofrom source and installed it —passed (5m18s).
Runtime behaviour was validated on the target with the same sources + same
hi3516ev200toolchain during widgetii/majestic#553:Before (no plugin
.so):After (
/usr/lib/majestic-af.sopresent, autofocus enabled):Scope
general/package/all-patches/linux/general/overlay/or a sharedload_<vendor>hardcodes a board valueOpenIPC/majestic-af), pinned to a full 40-character SHALD_PRELOAD, and no binaries that cannot be rebuilt from source (compiled from source here)hi3516ev300_lite), so CI builds it