AP1302 MIPI CSI Streaming Issue on FRDM i.MX93 Hello, I am using an FRDM i.MX93 board with the X-RPI-CAM-MIPI A1 camera module. The issue I am facing is that I am unable to capture the MIPI CSI stream from this setup. I have placed the firmware binary ap1302_60fps_ar0144_27M_2Lane_awb_tuning.bin in the following location: "/lib/firmware" During boot, I see that the AP1302 is detected successfully, but when I attempt to start video streaming, VIDIOC_STREAMON fails with a "Broken pipe" error. Below are the relevant logs. Kernel log: root@imx93evk:~# dmesg | grep ap1302
[ 0.340980] /soc@0/bus@42000000/i2c@42530000/ap1302_mipi@3c: Fixed dependency cycle(s) with /soc@0/bus@42800000/csi@4ae00000
[ 0.371014] /soc@0/bus@42800000/csi@4ae00000: Fixed dependency cycle(s) with /soc@0/bus@42000000/i2c@42530000/ap1302_mipi@3c
...
[ 10.088832] ap1302 2-003c: AP1302 revision 0.2.6 detected Streaming test: root@imx93evk:~# v4l2-ctl -d /dev/video0 \
--verbose \
--stream-mmap=3 \
--stream-count=10
VIDIOC_QUERYCAP: ok
VIDIOC_REQBUFS returned 0 (Success)
VIDIOC_CREATE_BUFS returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_G_FMT returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_STREAMON returned -1 (Broken pipe) Could you please help me understand why VIDIOC_STREAMON is failing with a "Broken pipe" error? Is there any additional configuration required for the AP1302 firmware, device tree, media pipeline, or sensor initialization before streaming can start successfully? Furthermore, i am using "LF_v6.18.2-1.0.0_images_IMX93EVK" pre-built images for now. Please let me know if you need any additional logs or information. Thank you for your support. Re: AP1302 MIPI CSI Streaming Issue on FRDM i.MX93 Discussing with the AE team. Re: AP1302 MIPI CSI Streaming Issue on FRDM i.MX93 Hello @yipingwang Thank you for your response. Please find my answers below for your reference. 1. Firmware Location I tried both the recommended firmware locations as well as each location individually. The camera probe is successful only when using ap1302_ar0144_single_fw.bin. root@imx93evk:~# ls -la /lib/firmware/ap1302_ar0144_single_fw.bin
-rw-r--r-- 1 root root 80528 Aug 5 15:36 /lib/firmware/ap1302_ar0144_single_fw.bin
root@imx93evk:~# ls -la /lib/firmware/imx/camera/ap1302.fw
-rw-r--r-- 1 root root 80528 Aug 5 15:38 /lib/firmware/imx/camera/ap1302.fw The AP1302 is detected successfully during boot. root@imx93evk:~# dmesg | grep -i ap1302
...
[ 9.962705] ap1302 2-003c: AP1302 revision 0.2.6 detected However, I do not see any firmware loading messages related to AP1302 in the kernel log. 2. Software Environment I am using the pre-built images provided for the FRDM i.MX93 board. root@imx93evk:~# cat /proc/device-tree/model
NXP FRDM-IMX93
root@imx93evk:~# cat /proc/cmdline
console=ttyLP0,115200 earlycon root=/dev/mmcblk0p2 rootwait rw The AP1302 is detected successfully, and the CSI/ISI devices are also present. I have attached the complete logs for your reference. 3. Media Pipeline The media pipeline appears to be created correctly. root@imx93evk:~# ls /dev/media0
/dev/media0
root@imx93evk:~# ls /dev/video*
/dev/video0 /dev/video1 The outputs from media-ctl show that the AP1302, CSI, and ISI entities are enabled. The complete media-ctl output is attached for your reference. 4. Additional Information Please refer to the attached file fourth_point.txt for the requested information. 5. Streaming Failure I do not see any additional kernel messages when the streaming command fails. root@imx93evk:~# dmesg -c
root@imx93evk:~# v4l2-ctl -d /dev/video0 --stream-mmap=3 --stream-count=10
VIDIOC_STREAMON returned -1 (Broken pipe)
root@imx93evk:~# dmesg The dmesg output remains empty after the failure, so there are no additional kernel logs to help identify the root cause. Since the AP1302 is detected successfully, the media graph is created correctly, and no kernel errors are reported during VIDIOC_STREAMON, could you please suggest what additional checks or debugging steps I should perform to identify why streaming fails with a "Broken pipe" error? Thank you for your support. root@imx93evk:~# v4l2-ctl --list-devices
mxc-isi-cap (platform:4ae40000.isi):
/dev/video0
/dev/video1
/dev/media0
root@imx93evk:~# v4l2-ctl -d /dev/video0 --all
Driver Info:
Driver name : mxc-isi
Card type : mxc-isi-cap
Bus info : platform:4ae40000.isi
Driver version : 6.18.2
Capabilities : 0xa4201000
Video Capture Multiplanar
I/O MC
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x24201000
Video Capture Multiplanar
I/O MC
Streaming
Extended Pix Format
Media Driver Info:
Driver name : mxc-isi
Model : FSL Capture Media Device
Serial :
Bus info : platform:4ae40000.isi
Media version : 6.18.2
Hardware revision: 0x00000000 (0)
Driver version : 6.18.2
Interface Info:
ID : 0x0300000a
Type : V4L Video
Entity Info:
ID : 0x00000008 (8)
Name : mxc_isi.0.capture
Function : V4L2 I/O
Pad 0x01000009 : 0: Sink
Link 0x0200000c: from remote pad 0x1000007 of entity 'mxc_isi.0' (Video Pixel Formatter): Data, Enabled, Immutable
Priority: 2
Video input : 0 (mxc_isi.0.capture: ok)
Format Video Capture Multiplanar:
Width/Height : 1920/1080
Pixel Format : 'YUYV' (YUYV 4:2:2)
Field : None
Number of planes : 1
Flags :
Colorspace : sRGB
Transfer Function : sRGB
YCbCr/HSV Encoding: ITU-R 601
Quantization : Limited Range
Plane 0 :
Bytes per Line : 3840
Size Image : 4147200
User Controls
horizontal_flip 0x00980914 (bool) : default=0 value=0 flags=0x00001000
vertical_flip 0x00980915 (bool) : default=0 value=0 flags=0x00001000
alpha_component 0x00980929 (int) : min=0 max=255 step=1 default=0 value=0 flags=0x00001000
root@imx93evk:~# media-ctl -p
Media controller API version 6.18.2
Media device information
------------------------
driver mxc-isi
model FSL Capture Media Device
serial
bus info platform:4ae40000.isi
hw revision 0x0
driver version 6.18.2
Device topology
- entity 1: crossbar (3 pads, 3 links, 1 route)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev0
routes:
0/0 -> 2/0 [ACTIVE]
pad0: SINK,MUST_CONNECT
[stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
<- "csidev-4ae00000.csi":1 [ENABLED,IMMUTABLE]
pad1: SINK,MUST_CONNECT
<- "mxc_isi.output":0 [ENABLED,IMMUTABLE]
pad2: SOURCE
[stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
-> "mxc_isi.0":0 [ENABLED,IMMUTABLE]
- entity 5: mxc_isi.0 (2 pads, 2 links, 0 routes)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev1
pad0: SINK
[stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:jpeg xfer:srgb ycbcr:601 quantization:full-range
compose.bounds:(0,0)/1920x1080
compose:(0,0)/1920x1080]
<- "crossbar":2 [ENABLED,IMMUTABLE]
pad1: SOURCE
[stream:0 fmt:YUV8_1X24/1920x1080 field:none colorspace:jpeg xfer:srgb ycbcr:601 quantization:full-range
crop.bounds:(0,0)/1920x1080
crop:(0,0)/1920x1080]
-> "mxc_isi.0.capture":0 [ENABLED,IMMUTABLE]
- entity 8: mxc_isi.0.capture (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video0
pad0: SINK
<- "mxc_isi.0":1 [ENABLED,IMMUTABLE]
- entity 16: mxc_isi.output (1 pad, 1 link)
type Node subtype V4L flags 0
pad0: SOURCE
-> "crossbar":1 [ENABLED,IMMUTABLE]
- entity 23: csidev-4ae00000.csi (2 pads, 2 links, 1 route)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev2
routes:
0/0 -> 1/0 [ACTIVE]
pad0: SINK
[stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:smpte170m xfer:709 ycbcr:601 quantization:lim-range]
<- "ap1302 2-003c":2 [ENABLED]
pad1: SOURCE
[stream:0 fmt:UYVY8_1X16/1920x1080 field:none colorspace:smpte170m xfer:709 ycbcr:601 quantization:lim-range]
-> "crossbar":0 [ENABLED,IMMUTABLE]
- entity 28: ap1302 2-003c (3 pads, 2 links, 0 routes)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev4
pad0: SINK
[stream:0 fmt:SGRBG12_1X12/1280x800 field:none colorspace:srgb
crop.bounds:(0,0)/1280x800
crop:(0,0)/1280x800]
<- "ar0144 0":0 [ENABLED,IMMUTABLE]
pad1: SINK
[stream:0 fmt:SGRBG12_1X12/1280x800 field:none colorspace:srgb
crop.bounds:(0,0)/1280x800
crop:(0,0)/1280x800]
pad2: SOURCE
[stream:0 fmt:UYYVYY8_0_5X24/4224x4092 field:none colorspace:srgb
crop.bounds:(0,0)/1280x800
crop:(0,0)/1280x800]
-> "csidev-4ae00000.csi":0 [ENABLED]
- entity 32: ar0144 0 (1 pad, 1 link, 0 routes)
type V4L2 subdev subtype Sensor flags 0
device node name /dev/v4l-subdev3
pad0: SOURCE
[stream:0 fmt:SGRBG12_1X12/1280x800 field:none colorspace:srgb]
-> "ap1302 2-003c":0 [ENABLED,IMMUTABLE] Best regards, Milav Re: AP1302 MIPI CSI Streaming Issue on FRDM i.MX93 the AP1302 probe succeeding does not guarantee that the complete camera pipeline is configured and streaming. On i.MX93, a VIDIOC_STREAMON returned -1 (Broken pipe) typically means that one of the media pipeline components (AP1302 → MIPI CSI-2 receiver → ISI capture path) failed to start or negotiate a valid stream. Your log only confirms that the AP1302 I²C device was detected:
ap1302 2-003c: AP1302 revision 0.2.6 detected
but it does not confirm that:
the firmware was loaded successfully,
the correct DTB was used,
the media graph was created,
the CSI receiver is locked to incoming MIPI data,
the AP1302 has been configured with a matching output format.
First thing I would check: firmware location/name
For the FRDM-i.MX93 AP1302 support, NXP documentation indicates:
Download ap1302_60fps_ar0144_27M_2Lane_awb_tuning.bin
Rename it to ap1302.fw
Place it in:
/lib/firmware/imx/camera/ap1302.fw
not simply /lib/firmware.
Please verify:
ls -l /lib/firmware/imx/camera/ap1302.fw
and check boot log:
dmesg | grep -i firmware
dmesg | grep -i ap1302
Look for messages such as:
request firmware
firmware loaded
failed to load firmware
Second check: are you using the correct DTB?
The release notes indicate AP1302 support is associated with the i.MX93 EVK device tree support.
Check:
cat /proc/device-tree/model
cat /proc/cmdline
and determine the actual DTB being loaded.
Also check:
dmesg | grep -i ap1302
dmesg | grep -i csi
dmesg | grep -i isi
Third check: verify media topology
Before trying v4l2-ctl, verify that the media graph exists:
Shell
media-ctl -p
Show more lines
You should see entities similar to:
ap1302
csi
isi
videoX
If /dev/media0 does not exist, the camera pipeline is not being created correctly. A very similar FRDM-i.MX93 AP1302 case showed:
media-ctl -p
Failed to enumerate /dev/media0
which indicated the media pipeline was not instantiated.
Please check:
ls -l /dev/media*
Fourth check: inspect the negotiated formats
Run:
v4l2-ctl --list-devices
and
v4l2-ctl -d /dev/video0 --all
also:
media-ctl -p
The AP1302 firmware normally outputs processed YUV formats rather than RAW Bayer. Another common failure is:
AP1302 outputs format A
ISI configured for format B
causing stream startup failure. A format mismatch often surfaces as STREAMON failure or CSI pipeline errors.
Fifth check: inspect CSI errors during STREAMON
Open another terminal and monitor:
dmesg -w
then run:
v4l2-ctl -d /dev/video0 \
--stream-mmap=3 \
--stream-count=10
Look for messages such as:
CSI timeout
frame start timeout
no data received
FIFO overflow
MIPI error
link not enabled
These messages usually reveal the real reason behind the Broken pipe.
記事全体を表示