IMX519, Bookworm, CM4

Hello,

I’m trying to get an IMX519 working on a CM4 with the autofocus capability through libcamera2 using pivariety. However we can’t seem to find a combination to make it work; we’ve have bullseye working but we’re making the next generation of products with the IMX519 camera from Arducam.

Is the IMX529 with autofocus supported on the CM4 with bookworm as yet; if so can you point to a guide on how to make it work and if not do you have a timeline as to when it will be supported please?

Cheers,

Neil

Hi Neil,
Of course imx519 can work on CM4 bookworm OS. You can follow the guide below:
https://docs.arducam.com/Raspberry-Pi-Camera/Native-camera/Quick-Start-Guide/#software-guide-for-imx519-autofocus-camera

Hello,

Thanks for that your response and I can capture an image. When running in the main thread I can capture an image using the camera - ‘libcamera-still -t 0 and with PiCamera2’.

However I can’t seem to access the LensPosition; the message returned is ‘No AF algorithm’; note that I’m actually setting focus to manual (cam_controls.AfMode = controls.AfModeEnum.Manual) and then manyally setting the LensPosition. When I retrieve the metadata from the camera through PiCamera2 I get:

camera.capture_metadata()
{‘SensorTimestamp’: 80055268663000, ‘ColourCorrectionMatrix’: (1.397643804550171, -0.23691518604755402, -0.16072867810726166, -0.27060550451278687, 1.4644911289215088, -0.19389083981513977, -0.017623217776417732, -0.5389555096626282, 1.5565739870071411), ‘FocusFoM’: 5143, ‘ColourTemperature’: 4000, ‘ColourGains’: (1.740691900253296, 1.8989555835723877), ‘AeLocked’: False, ‘Lux’: 2739.787353515625, ‘FrameDuration’: 111092, ‘SensorBlackLevels’: (4096, 4096, 4096, 4096), ‘DigitalGain’: 1.0016303062438965, ‘AnalogueGain’: 1.1191257238388062, ‘ScalerCrop’: (0, 0, 4656, 3496), ‘ExposureTime’: 9991}

Not that LensPosition isn’t on the list of parameters of the metadata.

When using the libcamera apps I get something similar:

(env) pi@m2-test:~/tupperware-reader $ libcamera-still -t 0 --autofocus-mode manual --lens-position 5
[22:20:10.399656388] [26729] INFO Camera camera_manager.cpp:284 libcamera v0.2.0+46-075b54d5
[22:20:10.458710381] [26732] WARN RPiSdn sdn.cpp:39 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise
[22:20:10.460829142] [26732] INFO RPI vc4.cpp:447 Registered camera /base/soc/i2c0mux/i2c@1/imx519@1a to Unicam device /dev/media2 and ISP device /dev/media3
[22:20:10.460939362] [26732] INFO RPI pipeline_base.cpp:1144 Using configuration file ‘/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml’
Preview window unavailable
Mode selection for 2328:1748:12:P
SRGGB10_CSI2P,1280x720/0 - Score: 5319.24
SRGGB10_CSI2P,1920x1080/0 - Score: 3319.24
SRGGB10_CSI2P,2328x1748/0 - Score: 1000
SRGGB10_CSI2P,3840x2160/0 - Score: 1648.24
SRGGB10_CSI2P,4656x3496/0 - Score: 2019
Stream configuration adjusted
[22:20:10.463052215] [26729] INFO Camera camera.cpp:1183 configuring streams: (0) 2328x1748-YUV420 (1) 2328x1748-SRGGB10_CSI2P
[22:20:10.463439671] [26732] INFO RPI vc4.cpp:611 Sensor: /base/soc/i2c0mux/i2c@1/imx519@1a - Selected sensor format: 2328x1748-SRGGB10_1X10 - Selected unicam format: 2328x1748-pRAA
[22:20:10.482727843] [26736] WARN IPARPI ipa_base.cpp:725 Could not set AF_MODE - no AF algorithm
[22:20:10.483149928] [26736] WARN IPARPI ipa_base.cpp:1182 Could not set LENS_POSITION - no AF algorithm
[22:20:10.483448349] [26736] WARN IPARPI ipa_base.cpp:1089 Could not set AF_RANGE - no focus algorithm
[22:20:10.483662530] [26736] WARN IPARPI ipa_base.cpp:1107 Could not set AF_SPEED - no focus algorithm

Can I confirm that the focusing is available on Bookworm and if not when it will be available please?

Cheers,

Neil

Hello,

I followed the instructions as IMX519 is confusing · Issue #47 · ArduCAM/Arducam-Pivariety-V4L2-Driver (github.com) - it worked just fine. However I’m on a CM4 with the Waveshare board so the config.txt needed

[all]
dtoverlay=imx519

The details in the instructions didn’t work.

Cheers,

Neil

Hi Neil,
May I get the libcamera version of yours? Please post the output of the command below:

dpkg -l | grep libcamera