[RDK X5] Integrating Sony IMX296 Global Shutter Sensor: VIN RAW capture OK, need guidance on HW ISP tuning profile, 54MHz MCLK configuration, and BPU zero-copy pipeline
Hello, We are integrating a Sony IMX296 (Global Shutter, 1440x1080 @ 30/60fps, RAW10, 1-lane MIPI CSI-2) sensor on the RDK X5 board. The primary use-case is real-time high-speed object detection and tracking with YOLO running on the BPU. Global Shutter is strictly required to eliminate rolling shutter distortion at high target velocities.
We have achieved raw data acquisition via the VIN block, but we are facing blockers with the Hardware ISP, MCLK configuration, and direct zero-copy feeding into the BPU.
- Hardware & System Setup
-
Board: D-Robotics RDK X5 (Horizon X5 SoC, BPU Platform v1.3.6, HBRT v3.15.55.0, DNN v1.24.5)
-
Sensor: Sony IMX296 (Mono/Color, 1440x1080, 1-lane MIPI CSI-2, Bayer RGGB)
-
Interface: I2C Bus 6 (Address
0x1a), MIPI RX PHY 0 -
Framework: Hobot Multimedia Framework (
multimedia_samples,libcam.so,libimx296.so,srcampy)What Works
-
I2C Communication & Initialization:
-
Custom sensor shared library (
libimx296.so) successfully built and loaded under index 47. -
I2C register writes/reads on bus 6 at
0x1aexecute without errors.
-
-
VIN DMA Capture:
- Direct acquisition via
get_vin_data -s 47captures raw frames stably (1440x1080, RAW10, 16-bit stride 2880, frame size 3110400 bytes).
- Direct acquisition via
-
Software Debayer & Stream:
- Software processing (manual BLC subtraction = 60 LSB, OpenCV
cv::cvtColor(..., COLOR_BayerRG2BGR)) yields valid, clean image frames and streams properly via HTTP.
- Software processing (manual BLC subtraction = 60 LSB, OpenCV
-
Issue A: Hardware ISP & VSE Pipeline Crash
When running single_pipe_vin_isp_vse -s 47, the pipeline fails to retrieve frames from VSE channels due to null memory buffers:
Using index:47 sensor_name:imx296-1440x1080-60fps config_file:linear_1440x1080_raw10_60fps_2lane.c
[INFO] RDK board_id is 302, so skip csi test for index 1 and index 3
mipi mclk is not configed.
Searching camera sensor on device: /proc/device-tree/soc/cam/vcon@0 i2c bus: 6 mipi rx phy: 0
INFO: Found sensor_name:imx296-1440x1080-60fps on mipi rx csi 0, i2c addr 0x1a, config_file:linear_1440x1080_raw10_60fps_2lane.c
csi0 ignore mclk ex attr, because not config mclk.
hbn_vnode_set_ochn_attr: 0, 1440x1080
hbn_vnode_set_ochn_attr: 1, 512x480
hbn_vnode_set_ochn_attr: 2, 224x224
hbn_vnode_set_ochn_attr: 3, 64x64
hbn_vnode_set_ochn_attr: 4, 480x480
hbn_vnode_set_ochn_attr: 5, 2880x2160
hbn_vnode_getframe VSE channel 0 failed
hbn_vnode_getframe VSE channel 1 failed
hbn_vnode_getframe VSE channel 2 failed
[ERROR][utils/mem_log.c:94] [MEM_ALLOCATOR] <hb_mem_invalidate_buf_with_vaddr:3470> Invalid NULL virtual address.
=== Frame Info ===
Frame ID: 0
Buffer Index: 0
=== Graphic Buffer ===
Virtual Addresses: (nil) (nil) (nil)
Physical Addresses: 0 0 0
Issue B: srcampy.Camera() Auto-Probe Failure
Running mipi_camera.py scans standard sensors (sc230ai, imx219, imx477, etc.) and aborts with:
ERROR [CamInitParam][0283] No camera sensor found, please check whether the camera connection or video_idx is correct.
ERROR [OpenCamera][0495] CamInitParam failed error(-1)
Issue C: Host MCLK Configuration (24 MHz vs 54 MHz)
The mainline Linux / Raspberry Pi reference driver for IMX296 uses fixed PLL configurations for INCK:
-
37.125 MHz (
INCKSEL = {0x80, 0x0b, 0x80, 0x08}, CTRL418C = 116) -
54.000 MHz (
INCKSEL = {0xb0, 0x0f, 0xb0, 0x0c}, CTRL418C = 168) -
74.250 MHz (
INCKSEL = {0x80, 0x0f, 0x80, 0x0c}, CTRL418C = 232)
The RDK X5 default VPF environment outputs 24 MHz MCLK by default or shows csi0 ignore mclk ex attr, because not config mclk.
4.Configuring MCLK Output to 54 MHz:
What is the correct way on RDK X5 to configure the hardware MCLK pin to output 54 MHz (or 37.125 MHz)? Is this configured via vin_attr_ex_t (mclk_ex_attr.mclk_freq = 54000000) or does it require modifying the device tree / clock provider node?
-
ISP Tuning Profile for Custom Sensors:
The Hardware ISP pipeline fails because there is no tuning profile in
/etc/cam/or/usr/hobot/lib/sensor/for IMX296. Is there a default/generic RAW10 Bayer profile available, or can we run the HW ISP in a basic bypass/linear mode without a full calibration binary? -
Recommended Zero-Copy Pipeline (VIN → BPU) without HW ISP:
If the Hardware ISP cannot be used without a proprietary tuning profile, what is the official, lowest-latency architecture to route VIN DMA buffers (
hb_mem/ ION) directly into the BPU model input (hbDNNInferwith NV12 or RAW tensor) with minimal CPU overhead?3.Recommended Zero-Copy Pipeline (VIN → BPU) without HW ISP:
If the Hardware ISP cannot be used without a proprietary tuning profile, what is the official, lowest-latency architecture to route VIN DMA buffers (
hb_mem/ ION) directly into the BPU model input (hbDNNInferwith NV12 or RAW tensor) with minimal CPU overhead?
Any reference examples, header configurations, or guidance would be greatly appreciated.