2026-05-28 update — deprecated. Root cause turned out to be four wrong fields in cv200's
ov2735_i2c_1080p.ini, not a majestic code bug. Master majestic (master+bcf6700and later) constructscombo_dev_attr_tcorrectly from the.iniwhen those fields are right. This shim is kept here as a downstream workaround for users still on pre-master majestic builds. See "Deprecation path" below.
Buildroot package that builds libfixmipi.so — an LD_PRELOAD shim for OpenIPC's majestic streaming daemon on HiSilicon Hi3518EV200 (cv200 family) cameras with an OV2735 MIPI sensor. Workaround for OpenIPC/majestic#278 until the upstream fix lands.
The shim was forcing two ioctls into a correct state at runtime. Both HI_MIPI_SET_DEV_ATTR and VIU_DEV_ATTR_SET were receiving garbled values because the .ini was wrong, not because majestic was constructing the struct wrong. Master majestic now has a SET_DEV_ATTR: input_mode=N raw_data_type=N lanes=[…] diagnostic log + a fail-fast that compares [mode] input_mode against [vi_dev] Input_mod, which made it possible to walk through the failure modes step-by-step.
The four wrong fields in cv200's ov2735_i2c_1080p.ini (all fixed in OpenIPC/firmware#2155):
| Field | Was | Now | Why |
|---|---|---|---|
[mode] input_mode |
4 |
0 (INPUT_MODE_MIPI) |
4 is unused; MIPI is 0. |
[mipi] data_type |
3 (RAW12) |
2 (RAW10) |
OV2735 outputs RAW10. |
[mipi] lane_id |
0|1|2|3|... |
0|1|-1|-1|... |
OV2735 cv200 = 2 lanes. |
[vi_dev] Input_mod |
2 (DIGITAL_CAMERA) |
5 (MIPI) |
Must agree with [mode] input_mode per master majestic's new check. |
Once those four fields are right, master majestic produces LaneNum=2 RAW10 MIPI in /proc/driver/hi_mipi, ISP/VENC IRQs climb, RTSP delivers clean H264 1080p — no shim needed. End-to-end verified on TP-Link Kasa KC110 (Hi3518EV200 + OV2735 2-lane RAW10).
libfixmipi.so intercepts ioctl() via LD_PRELOAD + RTLD_NEXT. When it sees HI_MIPI_SET_DEV_ATTR with input_mode == 0 (MIPI), it overwrites raw_data_type and lane_id[] with the correct values, then calls the real ioctl(). Same for VIU_DEV_ATTR_SET. Logs a one-liner to stderr on first patch so you can see it firing in dmesg / logread.
Source: src/libfixmipi.c — ~70 lines.
combo_dev_attr_t layout (32-bit ARM):
offset 0..3 : u32 input_mode_t input_mode
offset 4..7 : u32 mipi_dev_attr_t.raw_data_type
offset 8..23 : s16 mipi_dev_attr_t.lane_id[8]
The shim must be wired in by exporting LD_PRELOAD=/usr/lib/libfixmipi.so from /etc/init.d/S95majestic before majestic starts:
export LD_PRELOAD=/usr/lib/libfixmipi.soThis package ships only the .so. The activation lives in your firmware overlay's S95majestic (a 7-line addition on top of the upstream version).
- Drop this package under
general/package/kc110-mipi-shim/in yourOpenIPC/firmwarecheckout. - Add
source "$BR2_EXTERNAL_GENERAL_PATH/package/kc110-mipi-shim/Config.in"togeneral/package/Config.in. - Add
BR2_PACKAGE_KC110_MIPI_SHIM=yto your board's_defconfig. - Build as usual (
make BOARD=<your-board>).
Cross-compiled with the OpenIPC musl toolchain (arm-openipc-linux-musleabi-gcc -O2 -fPIC -shared -ldl). The resulting libfixmipi.so is ~5 KB stripped.
You need the shim if any of the below applies:
- Your
majesticbinary is older thanmaster+bcf6700(2026-05-28) — master with the diagnostic log + fail-fast. - Your
ov2735_i2c_1080p.inidoesn't have the four fields above set correctly. - You're using an OV2735 on cv200 hardware (Hi3518EV200, Hi3516CV200, etc.) AND not yet on a build that includes OpenIPC/firmware#2155.
If none of those apply, the shim does nothing useful — drop it.
Once both of these land:
- OpenIPC/firmware#2155 merges (4-field cv200
.inifix). BR2_PACKAGE_MAJESTICfetches a build at or pastmaster+bcf6700.
Then:
- Drop
BR2_PACKAGE_KC110_MIPI_SHIM=yfrom your defconfig. - Remove the
LD_PRELOADexport fromS95majestic. - Verify majestic starts without the shim.
- Delete this package.
- This repo can be archived.
- TP-Link Kasa KC110 — Hi3518EV200 + OV2735 (MIPI 2-lane, RAW10) + RTL8188FU. Builder device entry at OpenIPC/builder#99.
Probably also affects any other cv200 board using an OV2735 sensor with a pre-fixed .ini, but only KC110 verified.
MIT.