OpenIMP is a reverse-engineered, open-source implementation of the Ingenic Media Platform (IMP) libraries. The goal is to provide API-compatible stub libraries that can be used for development and testing of applications that depend on IMP, particularly the prudynt-t camera streaming application.
-
Binary Analysis ✅
- Analyzed libimp.so (T31 v1.1.6) using Binary Ninja
- Extracted version information, function signatures, and data structures
- Documented internal implementation details (observer pattern, module registry, etc.)
- See:
BINARY_ANALYSIS.md
-
API Surface Analysis ✅
- Identified all 130+ IMP functions used by prudynt-t
- Organized functions by module (System, ISP, FrameSource, Encoder, Audio, OSD, IVS)
- Documented platform-specific differences (T20/T21/T23 vs T31/C100 vs T40/T41)
- See:
IMP_API_ANALYSIS.md
-
Header Files ✅
include/imp/imp_common.h- Common types and structuresinclude/imp/imp_system.h- System moduleinclude/imp/imp_isp.h- ISP module with tuning functionsinclude/imp/imp_framesource.h- Frame source moduleinclude/imp/imp_encoder.h- Encoder moduleinclude/imp/imp_audio.h- Audio input/output/encoding/decodinginclude/imp/imp_osd.h- On-screen displayinclude/imp/imp_ivs.h- Intelligent video systeminclude/imp/imp_ivs_move.h- Motion detection interfaceinclude/sysutils/su_base.h- Sysutils base module
-
Stub Implementations ✅
src/imp_system.c- System module with timestamp, version, bindingsrc/imp_isp.c- ISP module with tuning stubssrc/imp_framesource.c- Frame source stubssrc/imp_encoder.c- Encoder stubssrc/imp_audio.c- Audio input/output/encoding/decoding stubssrc/imp_osd.c- OSD stubssrc/imp_ivs.c- IVS stubssrc/su_base.c- Sysutils base implementation
-
Build System ✅
- Makefile with support for multiple platforms
- Builds both shared (.so) and static (.a) libraries
- Platform selection via
PLATFORM=variable (T21, T23, T31, C100, T40, T41) - Cross-compilation support via
CC=variable - Installation target with configurable
PREFIX=
-
Testing ✅
tests/api_test.c- API surface test- Verifies all major functions are present and callable
- Tests basic functionality of each module
- All tests passing ✅
# Build for T31 (default)
make
# Build for other platforms
make PLATFORM=T23
make PLATFORM=T40
# Cross-compile
make CC=mipsel-linux-gnu-gcc
# Install
make install PREFIX=/usr/local
# Run tests
make test
# Clean
make cleanlib/libimp.so- Shared librarylib/libimp.a- Static librarylib/libsysutils.so- Sysutils shared librarylib/libsysutils.a- Sysutils static library
OpenIMP API Surface Test
=========================
Testing IMP_System...
IMP_System_Init: OK
IMP_System_GetVersion: OK (version: IMP-1.1.6)
IMP_System_GetCPUInfo: T31
IMP_System_GetTimeStamp: 11 us
IMP_System_RebaseTimeStamp: OK
IMP_System_Bind: OK
IMP_System_UnBind: OK
Testing SU_Base...
SU_Base_GetVersion: OK (version: SU-1.0.0)
Testing IMP_ISP...
IMP_ISP_Open: OK
IMP_ISP_AddSensor: OK
IMP_ISP_EnableSensor: OK
IMP_ISP_EnableTuning: OK
IMP_ISP_Tuning_SetSensorFPS: OK
Testing IMP_FrameSource...
IMP_FrameSource_CreateChn: OK
IMP_FrameSource_EnableChn: OK
Testing IMP_Encoder...
IMP_Encoder_CreateGroup: OK
IMP_Encoder_SetDefaultParam: OK
IMP_Encoder_CreateChn: OK
IMP_Encoder_RegisterChn: OK
Testing IMP_Audio...
IMP_AI_Enable: OK
IMP_AI_SetPubAttr: OK
IMP_AI_EnableChn: OK
Testing IMP_OSD...
IMP_OSD_SetPoolSize: OK
IMP_OSD_CreateGroup: OK
IMP_OSD_CreateRgn: OK
Testing IMP_IVS...
IMP_IVS_CreateGroup: OK
All API tests completed!
-
System Module
- Initialization and cleanup
- Version reporting (IMP-1.1.6)
- CPU info (platform-specific)
- Timestamp functions using CLOCK_MONOTONIC
- Module binding/unbinding (stub)
-
ISP Module
- Sensor management (add/remove/enable/disable)
- Tuning functions (all stubbed but callable)
- Platform-specific variants (T40/T41 with IMPVI parameter)
-
FrameSource Module
- Channel creation/destruction
- Channel enable/disable
- Attribute get/set
- FIFO configuration
- Rotation support (T31-specific)
-
Encoder Module
- Group and channel management
- H264/H265/JPEG support
- Rate control modes (FIXQP, CBR, VBR, etc.)
- Default parameter setup
- Stream operations (stubbed)
-
Audio Module
- Audio input (AI) operations
- Audio output (AO) operations
- Audio encoding (AENC)
- Audio decoding (ADEC)
- Noise suppression, HPF, AGC
-
OSD Module
- Group and region management
- Multiple region types (LINE, RECT, BITMAP, COVER, PIC)
- Attribute management
-
IVS Module
- Group and channel management
- Motion detection interface
-
Hardware Interaction
- No actual ISP control
- No actual video encoding/decoding
- No actual audio capture/playback
- No actual OSD rendering
-
Data Flow
- Module binding is stubbed (no actual data flow)
- GetStream operations return "no data available"
- GetFrame operations return "no data available"
-
Memory Management
- No VBM (Video Buffer Manager) implementation
- No physical memory allocation
- No cache management
To make this a fully functional implementation, you would need to:
-
Kernel Driver Integration
- Interface with tx-isp kernel module for ISP control
- Interface with video encoder/decoder hardware
- Interface with audio hardware
-
Video Pipeline
- Implement actual frame capture from ISP
- Implement actual video encoding (could use software encoder initially)
- Implement buffer management and data flow
-
Audio Pipeline
- Implement actual audio capture (ALSA)
- Implement actual audio encoding (software codecs)
- Implement audio playback
-
OSD Rendering
- Implement bitmap/text rendering
- Implement overlay composition
-
Memory Management
- Implement VBM for buffer pooling
- Implement physical memory allocation (CMA/ION)
- Implement cache management
To use this stub library with prudynt-t:
-
Build the library:
make PLATFORM=T31
-
Install the library:
make install PREFIX=/path/to/install
-
Build prudynt-t against the stub library:
export PKG_CONFIG_PATH=/path/to/install/lib/pkgconfig cd prudynt-t make
-
Note: The application will link and run, but won't produce actual video/audio output since the hardware interaction is stubbed.
This is a reverse-engineered implementation for educational and development purposes. The API is compatible with Ingenic's IMP library, but the implementation is original.
Contributions are welcome! Areas that need work:
- Hardware integration (ISP, encoder, audio)
- Video buffer management
- Memory management
- Platform-specific implementations
- Testing on actual hardware
- Documentation improvements
- Ingenic IMP SDK Documentation
- prudynt-t source code: https://github.com/gtxaspec/prudynt-t
- Binary analysis:
BINARY_ANALYSIS.md - API analysis:
IMP_API_ANALYSIS.md