This guide explains how to use the OpenIMP stub library with the prudynt-t project.
OpenIMP provides a stub implementation of the Ingenic Media Platform (IMP) libraries. While it doesn't provide actual hardware functionality, it allows you to:
- Compile prudynt-t without the proprietary IMP libraries
- Test API usage and verify function calls
- Debug application logic without hardware
- Develop on x86/ARM systems without Ingenic hardware
cd /home/matteius/openimp
make clean
makecd /home/matteius/openimp
make clean
make CC=mipsel-linux-gnu-gcc PLATFORM=T31This produces:
lib/libimp.solib/libimp.alib/libsysutils.solib/libsysutils.a
sudo make installThis installs to /usr/local/lib and /usr/local/include.
make install PREFIX=$HOME/.localYou can link directly against the libraries in the lib/ directory without installing.
If you installed OpenIMP to a standard location:
cd /home/matteius/openimp/prudynt-t
make clean
makeThe build system should automatically find the libraries in /usr/local.
cd /home/matteius/openimp/prudynt-t
export PKG_CONFIG_PATH=$HOME/.local/lib/pkgconfig
export LD_LIBRARY_PATH=$HOME/.local/lib
make clean
makeModify prudynt-t's Makefile to point to OpenIMP:
IMP_INC = /home/matteius/openimp/include
IMP_LIB = /home/matteius/openimp/lib
CFLAGS += -I$(IMP_INC)
LDFLAGS += -L$(IMP_LIB) -limp -lsysutilsexport LD_LIBRARY_PATH=/home/matteius/openimp/lib:$LD_LIBRARY_PATHcd /home/matteius/openimp/prudynt-t
./prudyntSince OpenIMP is a stub implementation, you'll see:
- Successful startup - All IMP initialization calls succeed
- Debug logging - OpenIMP logs all function calls to stderr
- No video/audio output - Hardware interaction is stubbed
- No crashes - All API calls return success or safe error codes
Example output:
[IMP_System] Initialized (stub implementation)
[IMP_ISP] Open
[IMP_ISP] AddSensor: jxf23
[IMP_ISP] EnableSensor
[IMP_FrameSource] CreateChn: chn=0, 1920x1080, fmt=10
[IMP_Encoder] CreateGroup: grp=0
[IMP_Encoder] CreateChn: chn=0
...
OpenIMP logs all function calls to stderr. Redirect to a file:
./prudynt 2> imp_calls.logThe log shows the exact sequence of IMP calls:
[IMP_System] Initialized (stub implementation)
[IMP_System] GetVersion: IMP-1.1.6
[IMP_ISP] Open
[IMP_ISP] AddSensor: jxf23
[IMP_ISP] EnableSensor
[IMP_ISP] EnableTuning
[IMP_ISP] SetSensorFPS: 25/1
[IMP_FrameSource] CreateChn: chn=0, 1920x1080, fmt=10
[IMP_FrameSource] EnableChn: chn=0
[IMP_Encoder] CreateGroup: grp=0
[IMP_Encoder] SetDefaultParam: 1920x1080, 25/1 fps, profile=1, rc=1
[IMP_Encoder] CreateChn: chn=0
[IMP_Encoder] RegisterChn: grp=0, chn=0
[IMP_System] Bind: [0,0,0] -> [1,0,0]
[IMP_Encoder] StartRecvPic: chn=0
This helps you understand:
- Initialization order
- Parameter values
- Module binding relationships
- Error conditions
Check that prudynt-t is using the API correctly:
- Initialization order: System → ISP → FrameSource → Encoder
- Binding: Proper cell connections
- Parameter validation: Correct values passed to functions
- Cleanup: Proper shutdown sequence
- ✅ All API functions are callable
- ✅ Proper return values (success/failure)
- ✅ Parameter validation
- ✅ Thread-safe operations
- ✅ Timestamp functions
- ✅ Version reporting
- ❌ No actual video capture
- ❌ No actual video encoding
- ❌ No actual audio capture/playback
- ❌ No actual OSD rendering
- ❌ GetStream() returns "no data"
- ❌ GetFrame() returns "no data"
- ❌ PollingStream() returns timeout
For testing video pipeline without hardware:
- Mock video source: Modify OpenIMP to generate test patterns
- File-based input: Read from video files instead of ISP
- Software encoding: Use libx264/libx265 instead of hardware encoder
When you're ready to use real hardware:
- Replace libraries: Use Ingenic's official libimp.so
- No code changes needed: prudynt-t code remains the same
- Update LD_LIBRARY_PATH: Point to official libraries
# Development (OpenIMP)
export LD_LIBRARY_PATH=/home/matteius/openimp/lib
# Production (Ingenic IMP)
export LD_LIBRARY_PATH=/usr/libProblem: Undefined references to IMP functions
Solution: Make sure you're linking against both libraries:
-limp -lsysutilsProblem: Header files not found
Solution: Add include path:
-I/home/matteius/openimp/includeProblem: Library not found
Solution: Set LD_LIBRARY_PATH:
export LD_LIBRARY_PATH=/home/matteius/openimp/lib:$LD_LIBRARY_PATHProblem: Wrong library version loaded
Solution: Check which library is being used:
ldd ./prudynt | grep libimpShould show:
libimp.so => /home/matteius/openimp/lib/libimp.so
Problem: Application waits forever for video data
Solution: OpenIMP's GetStream/GetFrame functions return "no data available" immediately. If prudynt-t hangs, it may be in a blocking wait loop. Check the polling timeout values.
If you want to add functionality to OpenIMP:
Edit src/imp_encoder.c:
int IMP_Encoder_GetStream(int encChn, IMPEncoderStream *stream, int block) {
// Generate a dummy H264 frame
static uint8_t dummy_frame[1024] = {0x00, 0x00, 0x00, 0x01, ...};
stream->pack[0].virAddr = dummy_frame;
stream->pack[0].length = sizeof(dummy_frame);
stream->packCount = 1;
return 0;
}Edit src/imp_framesource.c to read from video files.
Integrate libx264 or libx265 for actual encoding.
# 1. Build OpenIMP
cd /home/matteius/openimp
make clean
make PLATFORM=T31
# 2. Install OpenIMP
make install PREFIX=$HOME/.local
# 3. Build prudynt-t
cd /home/matteius/openimp/prudynt-t
export PKG_CONFIG_PATH=$HOME/.local/lib/pkgconfig
export LD_LIBRARY_PATH=$HOME/.local/lib
make clean
make
# 4. Run prudynt-t
./prudynt 2>&1 | tee imp_debug.log
# 5. Analyze the log
grep "IMP_" imp_debug.log | head -20For issues with:
- OpenIMP: Check BINARY_ANALYSIS.md and STATUS.md
- prudynt-t: See https://github.com/gtxaspec/prudynt-t
- Integration: Review this document and the test output
- Build OpenIMP for your target platform
- Compile prudynt-t against OpenIMP
- Analyze the function call sequence
- Verify API usage is correct
- When ready, switch to real IMP libraries for hardware testing