i.MX 8M MIP CSI slow frame capture and "Skip frame 0" and FIFO overflow errors

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX 8M MIP CSI slow frame capture and "Skip frame 0" and FIFO overflow errors

1,680 Views
krzysztof_kozlo
Contributor II

Hi,

I am using I.MX 8M Mini with a MIPI CSI sensor (IMX258) in RAW10 mode. This is a 4.19.35 BSP. I extended the i.MX MIPI drivers to support RAW10 and in general it works. The problem I have is with performance - capturing a single frame takes around 1 second (4208x3118 so ~26 MB).

I see always four messages of "skip frame 0", every 100ms, maybe affecting the performance of image capture.

From time to time there is also error:  "mx6s-csi 32e20000.csi1_bridge: mx6s_csi_irq_handler Rx fifo overflow".

Any ideas why this is so slow and why there are "skip frame 0" messages? Why FIFO overflow errors?

Full dmesg log:

[ 1146.718873] mxc_mipi-csi.0: mipi_csis_pm_resume: flags: 0x0
[ 1146.740326] alloc_contig_range: [57b00, 59407) PFNs busy
[ 1146.747933] alloc_contig_range: [57c00, 59507) PFNs busy
[ 1146.755515] alloc_contig_range: [57c00, 59607) PFNs busy
[ 1146.762872] alloc_contig_range: [57c00, 59707) PFNs busy
[ 1146.770235] alloc_contig_range: [57c00, 59807) PFNs busy
[ 1146.777107] alloc_contig_range: [58000, 59907) PFNs busy
[ 1146.783431] alloc_contig_range: [58000, 59a07) PFNs busy
[ 1146.789722] alloc_contig_range: [58000, 59b07) PFNs busy
[ 1146.795861] alloc_contig_range: [58000, 59c07) PFNs busy
[ 1146.802141] alloc_contig_range: [58000, 59d07) PFNs busy
[ 1146.873595] mxc_mipi-csi.0: mipi_csis_s_stream: 1, state: 0x1
[ 1146.873627] mxc_mipi-csi.0: fmt: 0x300a, 4208 x 3118
[ 1147.246619] skip frame 0
[ 1147.346461] skip frame 0
[ 1147.446302] skip frame 0
[ 1147.461587] mx6s-csi 32e20000.csi1_bridge: mx6s_csi_irq_handler Rx fifo overflow
[ 1147.469035] mx6s-csi 32e20000.csi1_bridge: mx6s_csi_irq_handler Rx fifo overflow
[ 1147.512861] skip frame 0
[ 1147.574577] mxc_mipi-csi.0: mipi_csis_s_stream: 0, state: 0x3
[ 1147.575275] mxc_mipi-csi.0: Frame End events: 0
[ 1147.579814] mxc_mipi-csi.0: Frame Start events: 0
[ 1147.584515] mxc_mipi-csi.0: Non-image data after odd frame events: 0
[ 1147.590865] mxc_mipi-csi.0: Non-image data before odd frame events: 0
[ 1147.597303] mxc_mipi-csi.0: Non-image data after even frame events: 0
[ 1147.603739] mxc_mipi-csi.0: Non-image data before even frame events: 0
[ 1147.610263] mxc_mipi-csi.0: Unknown Error events: 0
[ 1147.615137] mxc_mipi-csi.0: CRC Error events: 0
[ 1147.619664] mxc_mipi-csi.0: ECC Error events: 0
[ 1147.624191] mxc_mipi-csi.0: FIFO Overflow Error events: 0
[ 1147.629586] mxc_mipi-csi.0: Lost Frame End Error events: 0
[ 1147.635068] mxc_mipi-csi.0: Lost Frame Start Error events: 0
[ 1147.640723] mxc_mipi-csi.0: SOT Error events: 0
[ 1147.645411] mxc_mipi-csi.0: mipi_csis_s_stream: 0, state: 0x1
[ 1147.845710] mxc_mipi-csi.0: mipi_csis_pm_suspend: flags: 0x1

DTS:

554 camera@1a {
555 compatible = "sony,imx258";
556 reg = <0x1a>;
557
558 clocks = <&imx258_clk>;
559 clock-names = "clk";
560
561 rotation = <180>;
562
563 /* Oscillator on camera board */
564 imx258_clk: clk {
565 compatible = "fixed-clock";
566 #clock-cells = <0>;
567 clock-frequency = <19200000>;
568 };
569
570 port {
571 sensor_ep: endpoint {
572 remote-endpoint = <&mipi1_sensor_ep>;
573 clock-lanes = <0>;
574 data-lanes = <1 2 3 4>;
575 link-frequencies = /bits/ 64 <633600000>;
576 };
577 };
578 };


634 &mipi_csi_1 {
635 #address-cells = <1>;
636 #size-cells = <0>;
637 status = "okay";
638 /*
639 * 500 MHz needed for 633 MHz link frequency.
640 * Otherwise capturing 4K picture causes FIFO overflows:
641 * [ 114.724349] mxc_mipi-csi.0: FIFO Overflow Error events: 43
642 */
643 clock-frequency = <500000000>;
644 port {
645 mipi1_sensor_ep: endpoint@1 {
646 remote-endpoint = <&sensor_ep>;
647 clock-lanes = <0>;
648 data-lanes = <1 2 3 4>;
649 /*
650 * Use hs-settle matching 633 MHz link frequency in
651 * DDR from "table for MIPI clock frequency and
652 * register setting of HSSETTLE[7:0] and
653 * CLKSETTLECTL[1:0]":
654 * https://community.nxp.com/t5/i-MX-Processors/Explenation-for-HS-SETTLE-parameter-in-MIPI-CSI-D-PHY-registers/m-p/764265
655 */
656 csis-hs-settle = <27>;
657 csis-clk-settle = <2>;
658 csis-wclk;
659 };
660
661 csi1_mipi_ep: endpoint@2 {
662 remote-endpoint = <&csi1_ep>;
663 };
664 };
665 };

 

Best regards,

Krzysztof

 

Tags (2)
0 Kudos
4 Replies

1,592 Views
krzysztof_kozlo
Contributor II

So what do I have to do to avoid the RX FIFO overflow? Why is it happening all the time and I get 20% of corrupted frames?

0 Kudos

1,504 Views
joanxie
NXP TechSupport
NXP TechSupport

fifo overflow should be system bandwidth issue, I found you use 4208x3118 for capture, how about lower resolution?

 

0 Kudos

273 Views
Udhay_
Contributor III

Hi @joanxie 
can you clear this doubt 

you mean to say IMX8MM doesn't capture higher resolution?

0 Kudos

1,658 Views
joanxie
NXP TechSupport
NXP TechSupport

got information:

“1. From before tests, even good parameters of bandwidth, there were also probability to meet overflow case in a month.
2. Overflow is not a big issue when it can be recovery, but it will cause CSI hangup on 850D, reset csi and it can't be recovery .
3. There is a interal register of CSI bridge , it's named FIFO_level watching register, offset is 0x4c, it's max value is 255, overflow will comming when fifo level bigger than 255.
4. Watch this register , Recovery the CSI bridge when when it close to 255.
5. from some tests, the better theshold value is 192.”

0 Kudos