Skip to content
opensensorPublic

About

An open implementation replacement of libimp

Resources

Stars

15 stars

Watchers

2 watching

Forks

Repository files navigation

OpenIMP - OSS stack for Ingenic SoCs

OpenIMP

license SoCs status branch aperto thingino platform last commit PRs welcome

OpenIMP is an open replacement for Ingenic's closed libimp.so (the IMP video, encoder, OSD, IVS and audio API). Together with open-tx-isp (the open ISP kernel driver) and a camera application it forms an open camera stack for Ingenic T10, T20, T21, T23, T30, T31, T40 and T41 SoCs. The public API is the vendor IMP API, so existing camera applications link against it unchanged.

The aperto branch carries the released open stack (RC3 v2026.11.07-rc3, device-tested on T10/T20/T21/T23/T30/T31/T40/T41) on top of the original main line; see Branches and releases.

Status

Open stack = open-tx-isp + OpenIMP. Newest release candidate: RC3 v2026.11.07-rc3 (OpenIMP and open-tx-isp tag v2026.11.07-rc3, timps v1.12.0; RC3 gate green): release note docs/releases/RC3.md, GitHub release, rendered feature matrix: https://lu-fi.github.io/openimp/feature-matrix.html. Previous: RC2 v2026.10.25-rc2 (docs/RELEASE_NOTES_RC2.md), RC1 v2026.10.11-rc1: openimp fe9307c (agg-35 687a68e4 + docs), open-tx-isp 191be6c5 (agg-35 6e464ac7 + docs). RC3 gate SoCs: T10, T20, T21, T23, T30, T31, T40, T41 (T32/T33 planned). The agg-35 soak of 2026-10-10/11 on 10 cameras was clean (0 oopses, 0 unexplained reboots, 0 application restarts). Release notes and known issues: CHANGELOG.md. The per-SoC table below is a short summary as of RC3 (2026-11-07); the authoritative per-feature state is the matrix.

SoC Status
T10 Runs the open stack from a flashed image (H.264, hardware JPEG/MJPEG, second stream, OSD, motion detection, day/night, image controls, AE/AWB); RC3 gate: all 228 streamer-used function cells work, OEM rate controller and SetChnRcTrigLevel checked against the vendor library.
T20 Fully open from a flashed image; RC3 gate (228/228 streamer-used function cells work); OEM rate controller default with macroblock rate control, A/B against the vendor stack measured.
T21 Fully open from a flashed image; RC3 gate (252/252 streamer-used function cells work); vendor-identical rate controller, reference-buffer sharing on.
T23 Fully open, native Helix H.264 encoder, no vendor helper (2 h 34 min soak). Frequent Helix frame drops fixed (residual interrupt 0x100, kernel patch merged upstream); the rare single Helix encode error (errno 5) has not recurred since the kernel fix (0 errors in 6 days, provisionally closed); software rotation 90/270 up to 1280x720 (beyond vendor); no real WDR yet. RC3 gate.
T30 Runs the open stack on the T30X lab camera (since 2026-11-03, gate SoC for RC3): H.264 at 2048x1536/1080p/720p + sub-stream, H.265 on the Radix encoder with vendor-equal CBR and live rate-control changes, OEM picture rate controller (bit-exact), calm first stream window, software rotation, ISP bypass graph (RAW). Device tests per issue (#208, #209, #216, #218, #228).
T31 Reference SoC. H.264, HEVC, hardware JPEG, OSD, rotation, AEC; RC3 gate; optional ISP bypass graph (default off).
T40 Runs the open stack (open-tx-isp driver + OpenIMP) from a flashed image on the T40XP test camera (sc830ai): H.264/H.265, day/night, AE/AWB and the tuning API with device tests. Vendor-equal picture in a fair light-box comparison against the vendor stack (2026-11-07, #84): same brightness and white balance at the same exposure, luma and chroma noise vendor-equal, AE target and metering from the hardware statistics like the OEM (ae_compensation 40..200: Y 94..137 vs vendor 92..142, #232), night floor per tuning bank; streamer CPU 0.34 % vs 2.26 % on the vendor stack. Only the sc830ai board is device-tested.
T41 Runs from a flashed image with H.264 and H.265 on the test cameras, with day/night and AE/AWB; RC3 gate (all 253 streamer-used function cells work); the API coverage is strict (every vendor function has a case). Open items are tracked in the GitHub issues (label soc:T41).

Completeness

Vendor IMP/SU functions per SoC on 2026-11-07, RC3 v2026.11.07-rc3 (from the "All areas" coverage summary of FEATURE_MATRIX; rendered: https://lu-fi.github.io/openimp/feature-matrix.html). "Works" = device-tested or vendor no-op (a round trip counts as working); "implemented" = exists but not device-tested; gaps = error, missing, stub or cache-only. All streamer-used functions work on every gate SoC (RC3 gate).

SoC Vendor functions Works Implemented, not device-tested Gaps ? Status
T10 329 304 (92.4 %) 25 0 0 RC3 gate
T20 329 304 (92.4 %) 25 0 0 RC3 gate
T21 333 308 (92.5 %) 25 0 0 RC3 gate
T23 457 419 (91.7 %) 33 5 0 RC3 gate
T30 350 286 (81.7 %) 44 19 1 RC3 gate
T31 406 365 (89.9 %) 34 7 0 RC3 gate
T40 389 349 (89.7 %) 28 12 0 RC3 gate
T41 427 392 (91.8 %) 32 3 0 RC3 gate
T32, T33 – – – – – planned (QEMU)

The counts follow next and are refreshed by hand after each merge round (the generated source is the FEATURE_MATRIX). Release notes (index: docs/releases/): docs/releases/RC3.md (RC3), docs/RELEASE_NOTES_RC2.md (RC2), docs/RELEASE-v2026.10.11-rc1.md (RC1).

Details per feature and SoC: FEATURE_MATRIX. History: CHANGELOG.md and the full OPEN_STACK_CHANGELOG. Only device-tested behaviour is listed as working; everything else is marked as pending.

Where it is better than the vendor stack

Measured on a T20 at night, same scene, same application, only libimp and the ISP driver differ:

Metric Vendor Open
application CPU (all threads) 25.2 % 10.5 %
snapshot latency (mean of 10) 0.45 s 0.20 s
application RSS 6.8 MB 3.7 MB

Other points, all device-tested:

  • T20 and T10: about 8 MB more free RAM after the unused V4L2 frame pool was switched off.
  • libimp is about 0.5-0.6 MB instead of 1.0-1.3 MB; T21 has 2.76 MB instead of ~1.2 MB free video memory.
  • Reference-frame sharing on T21/T23 saves ~1.5 MB.
  • Reload and stop robustness: 10 stop/start and reload cycles without an oops.
  • Controls and noise reduction that the vendor ignores act on T10/T20/T21; real motion detection on T20/T21/T30; HEVC fails cleanly on SoCs without HEVC hardware.
  • Motion detection v2 (per-cell background model, suppression after IR/gain jumps, bounding boxes and strength through the versioned OpenIMP_IVS_MoveGetResultEx API) is on by default; OPENIMP_MOTION_V2=0 restores the vendor algorithm. Device-tested on T20 and T23 over one night.
  • Memory diagnostics: rmem peak logging and a shortfall message with a concrete rmem=<n>M suggestion instead of silent degradation (see the wiki page Memory).

Integration notes for application authors, env switches and defaults: OPENIMP_BEYOND_VENDOR.

Build

OpenIMP is cross-built for MIPS against a Thingino firmware checkout that already built the target (toolchain and headers come from its output/ tree).

export THINGINO_DIR=/path/to/thingino-firmware      # checkout with a built target
make t31                    # or t20 t21 t23 t30 t40 t41; equivalent: ./build-for-device.sh T31
  • Each build-<soc>.sh takes the toolchain from THINGINO_DIR (override with TOOLCHAIN_PREFIX, <SOC>_TARGET, <SOC>_OUTPUT_DIR; T20 reuses the T21 script). T40/T41 additionally need the vendor header root (T41_HEADERS, auto-detected in the Thingino build tree via thingino-raptor-hal).
  • Output: build/<soc>/libimp.so and build/<soc>/openimp-tuningd. A build is rejected if the library depends on an OEM libimp.so.
  • make t21 OPENIMP_SW_JPEG=1 builds the software JPEG fallback for T20/T21/T23/T30.
  • make install PLATFORM=T31 PREFIX=... installs headers, library and tuning daemon.
  • make check runs the host tests (rate-control oracles, T23/T30/T31/T40/T41 checks).
  • BUILD.md describes an older host build and is outdated; the scripts above are authoritative.

Integration in Thingino

The packages openimp (this repository) and open-tx-isp (kernel driver) are in the upstream thingino-firmware branch aperto (#1756), selected with BR2_PACKAGE_THINGINO_ISP_OPEN (menu "ISP stack"). The Lu-Fi aperto branch of thingino-firmware pins both packages to the tag v2026.11.07-rc3 (sources Lu-Fi/openimp and Lu-Fi/open-tx-isp) and timps to v1.12.0; the upstream pull request for RC3 is #1945 (until it is merged, the upstream aperto branch pins v2026.10.25-rc2). Both replace the proprietary libimp.so and tx-isp-<soc>.ko; the SDK sensor, audio and AVPU modules stay; T23 runs fully on OpenIMP without any vendor helper. The kernel VPU/rmem stability patches (#1748, #1752) and the optional boot guard BR2_PACKAGE_THINGINO_ISP_GUARD (#1749, default off) are merged there as well. The camera application is built with USE_OPENIMP=1 to enable features that exist only in OpenIMP. thingino pins a release tag, not a commit SHA.

Branches and releases

  • main: the original author's line (opensensor). It is left untouched and is a strict ancestor of aperto.
  • aperto: the open stack release line: OpenIMP + open-tx-isp, as used by the thingino aperto branch. Fast-forward only; every commit was flashed and checked on cameras. Releases are tagged vYYYY.MM.DD on this branch, and thingino pins a tag instead of a SHA.
  • Development and the device-test campaign happen in the Lu-Fi forks (branch next = integration, claude/<topic> = topic branches); tested work reaches aperto from next after a clean soak.
  • Companion repository: opensensor/open-tx-isp (branch aperto). Both repositories are released together; use matching tags.

Architecture

The public encoder graph is shared by T23, T30, T31, T40 and T41; the hardware backend is selected only where the SoC ABI differs.

  • src/t40/openimp_p2_encoder.c: public encoder lifecycle; src/t40/codec-t40.c: shared AVPU backend.
  • include/openimp/openimp_avc.h: that backend without the IMP graph, for contiguous NV12 producers such as V4L2 DMA-BUF.
  • include/openimp/openimp_tuning.h and openimp-tuningd: image policy and gain feedback, see docs/TUNING_DAEMON.md.
  • src/al_avpu.c, src/device_pool.c, src/fifo.c, src/hw_encoder.c: common hardware path.
  • src/t30/: Helix descriptor and /dev/soc_vpu adapter (T20/T21/T23/T30 Helix encoder, native T23 encoder).
  • src/t31/, src/framesource/framesource_tseries.c, src/isp/isp_tseries.c, src/kernel_interface.c, src/dma_alloc.c: T31 stock-driver ABI seam.
  • src/t40/openimp_p1.c, src/t40/openimp_p2_dma.c: T40/T41 seam.

Platform conditionals are limited to real ABI differences (structure sizes, ioctl layouts, device behaviour, cache maintenance). Status notes per SoC: docs/T30_STATUS.md, docs/T40_STATUS.md, docs/T41_STATUS.md, profiling: docs/PROFILING.md, unexplained reboots: docs/RESET_DIAGNOSTICS.md.

Audio processing belongs to libaudioProcess-neo, logging and system libraries to ingenic-system-libs-neo. OpenIMP provides the native IMP audio I/O layer on T31 and T40/T41; HPF, noise suppression and AGC are loaded at runtime from libaudioProcess-neo. Acoustic echo cancellation uses the bundled WebRTC AECM.

Documentation

How status and issues are tracked

  • Status data: the implementation status per feature and SoC lives in structured files, docs/status/features.yaml (symbol, detail text, issue numbers per cell) and docs/status/history.md (update log), plus docs/api_evidence.json for the per-function API coverage. docs/FEATURE_MATRIX.md and docs/feature-matrix.html are generated from them (python3 tools/gen_feature_matrix_html.py; needs PyYAML) and published with GitHub Pages; do not edit them by hand. make check validates the data (unknown symbols, missing SoCs, dangling issue numbers).
  • Gaps, bugs and progress are public GitHub Issues of this repository, labelled soc:T.., area:.., type:gap|bug|wip, prio:release-gate|streamer|long-term and repo:openimp|open-tx-isp (the kernel driver is open-tx-isp). An open issue with the label type:wip shows as the construction sign on the linked matrix cell; cells link to their issues. The cached issue state is docs/status/issues.json (python3 tools/status_data.py --refresh-issues, also done by the Pages workflow). The RC3 release gate is red while an open issue is labelled severity:critical or severity:high or sits in the milestone RC3 (current state: section "Release gates" of docs/FEATURE_MATRIX.md). The issues are collected on the GitHub Project "OpenIMP / open-tx-isp status" (Todo / In progress / Review / Done).

Reporting problems

Open an issue at opensensor/openimp (library, encoder, application integration) or opensensor/open-tx-isp (kernel driver, ISP, memory). Please include the SoC and sensor, the revisions of open-tx-isp, OpenIMP and the camera application, dmesg, the application log (including the rmem peak and "effective rate control" lines), the stream set and the rmem/ispmem values. Do not post addresses, credentials or location names. Details: Troubleshooting.

Credits

OpenIMP started as opensensor/openimp. It builds on the Thingino and Ingenic reverse-engineering community: thingino-firmware, ingenic-sdk, libaudioProcess-neo and ingenic-system-libs-neo (gtxaspec). Vendored third-party code: WebRTC AECM (BSD-3-Clause), x264 bitstream helpers (GPL-2.0-or-later).

Licensing

Licensing is per file, and there is no project-wide license yet. See NOTICE for the files that carry a license (LGPL-2.1-or-later, GPL-2.0-or-later x264-derived src/t30/h264enc/, and others) and the "Third-party code" section. The vendored WebRTC AECM in src/audio/webrtc/ is BSD-3-Clause with its own LICENSE, PATENTS and LICENSE_THIRD_PARTY. Files without a header carry no explicit grant.


Not affiliated with or endorsed by Ingenic Semiconductor. "Ingenic" is used only to name the SoCs this project supports.

About

An open implementation replacement of libimp

Resources

Stars

15 stars

Watchers

2 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages