IMX477 Autofocus module stops working while adjusting focus during streaming

1.Which seller did you purchase the product(s) from?
Amazon
2.The Model number of the product(s) you have purchased?
PCB says UC517 revD
3.Which Platform are you using the product(s) on?
CAM1 connector on the RasPI CM4
4.Which instruction are you following?

5.Has your product ever worked properly?
Mostly
6.What problems are you experiencing?
I am using the IMX477 Autofocus module connected to a RasPI CM4 module on a custom motherboard that duplicates the CAM1 interface. The camera itself streams OK using gstreamer (which will be the end application). I am using the C-based autofocus library provided by ArduCAM in parallel with gstreamer. I am only running the manualFocusThread() part (without the thread) and removed raspistill to avoid the camera conflict wile running gstreamer.

What happens is that the combination works for a few seconds (I can see the focus adjust based on the keyboard input in the streamed video). After a few seconds, the video freezes and I cannot access the camera again until I do a hard power cycle (a restart of the system does not work).

 

When I try to run raspistill on the camera (with neither gstreamer nor the manualFocus program running) after the crash, I get this error:

mmal: mmal_vc_component_enable: failed to enable component: ENOSPC

mmal: camera component couldn’t be enabled

mmal: main: Failed to create camera component

mmal: Failed to run camera app. Please check for firmware updates

 
7.What attempts at troubleshooting have you already made?
Internet search and examining AF program
8.How would you like us to help you?
Help understand and solve problem

Hi,

It due to the conflict between the camera and motorized focus module.

They use the same i2c bus and we don’t know when the GPU will visit the camera, if both GPU and CPU visit the i2c at the same time, the GPU will hang up which will cause the video freeze.

At present we don’t have a better way to solve it. The way we advise is that you can stop the AE function, in which the GPU will not visit the camera’s i2c bus.

Feel free to let me know if you need more help.