The runtime error was:
[KernelIF] Failed to open /dev/framechan0: Operation not permitted
Frame channel0 is slake now, Please activate it firstly!
Root Cause: The ISP (Image Signal Processor) module was just a stub. The frame channels require the ISP device (/dev/tx-isp) to be opened and the sensor to be enabled before they can be accessed.
Created proper ISP device structure (0xe0 bytes) based on decompilation at 0x8b6ec:
typedef struct {
char dev_name[32]; /* 0x00: Device name "/dev/tx-isp" */
int fd; /* 0x20: File descriptor */
int opened; /* 0x24: Opened flag */
uint8_t data[0xb8]; /* 0x28-0xdf: Rest of data */
} ISPDevice;Decompilation: 0x8b6ec
What it does:
- Allocates ISP device structure (0xe0 bytes via calloc)
- Sets device name to "/dev/tx-isp"
- Opens
/dev/tx-ispwith O_RDWR | O_NONBLOCK - Sets opened flag to 1
Code:
gISPdev = (ISPDevice*)calloc(0xe0, 1);
strcpy(gISPdev->dev_name, "/dev/tx-isp");
gISPdev->fd = open(gISPdev->dev_name, O_RDWR | O_NONBLOCK);
gISPdev->opened = 1;Decompilation: 0x8bd6c
What it does:
- Checks ISP is opened and sensor not already enabled
- Calls ioctl 0x805056c1 to add sensor
- Copies sensor info to device structure at offset 0x28
Key ioctl:
0x805056c1- Add sensor to ISP
Decompilation: 0x98450
What it does:
- Gets sensor index via ioctl 0x40045626
- Starts ISP streaming via ioctl 0x80045612 (VIDIOC_STREAM_ON)
- Enables sensor via ioctl 0x800456d0
- Final enable via ioctl 0x800456d2
- Increments opened flag by 2 to mark sensor as enabled
Key ioctls:
0x40045626- Get sensor index0x80045612- Start ISP streaming (VIDIOC_STREAM_ON)0x800456d0- Enable sensor0x800456d2- Final sensor enable
Decompilation: 0x8b8d8
What it does:
- Checks sensor is disabled (opened < 2)
- Closes
/dev/tx-ispfile descriptor - Frees ISP device structure
The correct initialization sequence is now:
// 1. Open ISP device
IMP_ISP_Open(); // Opens /dev/tx-isp
// 2. Add sensor
IMP_ISP_AddSensor(&sensor_info); // Registers sensor with ISP
// 3. Enable sensor
IMP_ISP_EnableSensor(); // Activates sensor and starts ISP streaming
// 4. Now frame channels can be opened
IMP_FrameSource_CreateChn(0, &attr);
IMP_FrameSource_EnableChn(0); // This will now succeedWith the ISP properly initialized:
/dev/tx-ispis opened successfully- Sensor is registered and enabled
- ISP starts streaming
- Frame channels (
/dev/framechan0, etc.) become accessible - Frame capture can begin
Deploy the new library and test:
# Copy to device
scp lib/libimp.so root@device:/usr/lib/
scp lib/libsysutils.so root@device:/usr/lib/
# Run prudynt
prudynt &
# Check for errors
dmesg | tail -20You should now see:
[IMP_ISP] Open: opened /dev/tx-isp (fd=X)
[IMP_ISP] AddSensor: gc2053
[IMP_ISP] EnableSensor: sensor enabled (idx=0)
[FrameSource] CreateChn: chn=0
[FrameSource] EnableChn: chn=0 enabled successfully
Instead of:
[KernelIF] Failed to open /dev/framechan0: Operation not permitted
src/imp_isp.c: Implemented real ISP device management- IMP_ISP_Open: Opens
/dev/tx-isp - IMP_ISP_Close: Closes ISP device
- IMP_ISP_AddSensor: Registers sensor via ioctl
- IMP_ISP_EnableSensor: Enables sensor with 4 ioctls
- IMP_ISP_Open: Opens
✅ Compiles successfully
- Library size: 145KB (libimp.a), 136KB (libimp.so stripped)
- Total code: 6,100+ lines
- Ready for deployment
- Deploy and test on device
- Verify frame capture works
- Check encoder receives frames
- Test video streaming through prudynt
If frame channels still don't work:
- Check
/dev/tx-isppermissions - Verify sensor info structure is correct
- Check if additional ISP configuration is needed
- Look for other ioctls in the decompilation
- ISP Open: 0x8b6ec
- ISP Close: 0x8b8d8
- ISP AddSensor: 0x8bd6c
- ISP EnableSensor: 0x98450
- Binary:
/home/matteius/ingenic-lib-new/T31/lib/1.1.6/uclibc/5.4.0/libimp.so