IPU Error when switching CSI video source

cancel
Showing results for 
Search instead for 
Did you mean: 

IPU Error when switching CSI video source

Jump to solution
879 Views
tw_imx53_
Contributor II

Hi,

I have a setup where I can switch between video sources connected to the camera port (CSI0). Switching between sources that are in sync is ok, but switching to a source not in sync often generates an IPU panic with report "mxc_ipu mxc_ipu: IPU Error - IPU_INT_STAT_10 = 0x01000000" (IC_VF_FRM_LOST_ERR) and the IPU "hangs". This applies also for the test application mxc_v4l2_overlay.

How can I from user space prevent this from happening? I would like to suspend/resume the IPU processing during source switching, but I am not sure how to reach those driver functions. Or is there any way to setup IPU to automatically continue/restart processing after being interrupted by this error?

Thanks,

Trond

Labels (2)
0 Kudos
1 Solution
198 Views
JayTu
NXP Employee
NXP Employee

streamoff will also free the buffer in the current implementation.

In the mxc_v4l2_tvin.c, when it finds standard changes (PAL, NTSC), it will streamoff and setup everything to complete changing.

Maybe you can refer to it.

View solution in original post

0 Kudos
5 Replies
198 Views
JayTu
NXP Employee
NXP Employee

What do you mean switch between video source here? And what is the meaning "switching between sources that are in sync"?

If you want control IPU in userspace, there are ioctl in driver. You can add or find one suits for your case.

0 Kudos
198 Views
tw_imx53_
Contributor II

Hi,

The video signal is coming from an output of a video switch which is converted to parallel format and fed into the camera port in addition to the pixel clock/vsync/hsync signals. Basically this setup works fine. But the video switch has several sources/inputs and we experience often IPU error when switching to a different source, which is understandable since the switch occurs in a random place in the stream causing a sudden change in the sync signals which now follows the new source. It is ok if we get a short period of flickering video while the IPU syncs up with the new source, but it is problematic that it stops processing with the result of a frozen image in the framebuffer.

With "switching between sources that are in sync" I mean that the sources connected to the video router can be in sync so their frames are aligned to common vsync/hsync signals and when switching between these, the IPU most often won't detect it because there is no glitch in the video flow. But the video sources are usually not in sync for this particular project.

Regards,

Trond

0 Kudos
198 Views
JayTu
NXP Employee
NXP Employee

Can the video router detect the change? We have stream on/off API but CSI still need be told to do this.

0 Kudos
198 Views
tw_imx53_
Contributor II

Yes. Well, the router is managed from i.MX which tells when to do the switching so I have full control of when a signal change occurs. The job for this application is to switch through up to 16 video sources one at a time and grab an image from each for monitoring through the web interface. Switching should occur as fast as possible to minimize the delay between update of each of the individual sources.

I have now done a small change by adding the VIDIOC_OVERLAY on/off ioctl before and after each switch, which works except from I get "mxc_ipu mxc_ipu: IPU Error - IPU_INT_STAT_5 = 0x00200000" after almost every second "on" call. This is an IDMAC_NFB4EOF_ERR_21 error (New Frame before end-of-frame error indication of Channel interrupt). This error does not make the IPU to freeze up which is a step in the right direction, but I have a feeling that there is better ways to do this to properly turn on/off the IPU processing. I have tried using VIDIOC_STREAMON/VIDIOC_STREAMOFF instead of VIDIOC_OVERLAY on/off ioctl, but just get a "Bad address" error and I assume it needs a different setup.

0 Kudos
199 Views
JayTu
NXP Employee
NXP Employee

streamoff will also free the buffer in the current implementation.

In the mxc_v4l2_tvin.c, when it finds standard changes (PAL, NTSC), it will streamoff and setup everything to complete changing.

Maybe you can refer to it.

View solution in original post

0 Kudos