Arducam 64MP HAT black images with libcamera on Raspberry Pi

I’m using the 64MP Autofocus Quad-Camera Kit for Raspberry Pi (#B0402). I need to capture 64MP images without native AWB correction, but libcamera-still keeps producing totally black images. The command I’ve been running is:

libcamera-still --width 80000 --height 40000 --gain 1 --awbgins 1,1 -o test.jpg --shutter 10000000 --immediate

I need the full 64M output, but everything comes out black. Has anyone run into this?

Let’s narrow it down. First, 80000x40000 is not a valid sensor resolution for this module—the 64MP sensor is 9152x6944, so that may already be part of the problem. Can you try removing --immediate and see if the image is still black? Also post your libcamera version and how the camera is registered (dmesg or libcamera-hello output).

Tried a few things:

  • At smaller resolutions, the first 1-2 captures are fine, then later ones go totally black again.
  • –width and --height seem to be ignored.
  • With --immediate the captured data is always black. Without --immediate, the data looks correct.
  • After re-installing libcamera, the first capture works, but every capture after that fails.
  • When a capture succeeds, I see v4l2-related info in the log. When it fails, there is no v4l2 log at all.

Thanks, that’s useful. Can you share your exact environment? Sensor model string, libcamera version, and the device nodes the camera is registered to would help.

Sensor is arducam_64mp. libcamera is v0.0.0+4186-d1dc0373. The camera is registered at /base/soc/i2c0mux/i2c@1/arducam_64mp@1a, connected to Unicam /dev/media3 and ISP /dev/media0. The highest sensor format reported is 9152x6944-SBGGR10. Also note 8000x4000 would be 32M, not 64M.

We tested a 64MP HAT here and reproduced an exposure problem. We also tested the 1-to-4 HAT configuration; I’ve sent you the test report in a private message. If the 1-to-4 result is acceptable for your setup, it can be used as an alternative.

So is the black frame caused by the HAT exposure issue? I still need to capture raw without AWB at the highest resolution—what should I use?

That’s part of it. The full picture is:

  • Your original resolution --width 80000 --height 40000 is wrong; the module max is 9152x6944 (64MP).
  • Using --immediate captures before exposure/AWB has settled, so frames can be completely black. Without --immediate the data is correct.
  • At full 9152x6944 raw, capture fails with V4L2 buffer allocation errors, which points to a Raspberry Pi hardware/memory limitation.

We reproduced it with:

libcamera-raw -o test.raw --gain 1 --awbgains 1,1 --rawfull --shutter 10000000

[1:07:46.040470684] [1855] INFO Camera camera_manager.cpp:299 libcamera v0.0.0+4186-d1dc0373
[1:07:46.043940695] [1856] WARN CameraSensorProperties camera_sensor_properties.cpp:205 No static properties available for ‘arducam_64mp’
[1:07:46.044024232] [1856] WARN CameraSensorProperties camera_sensor_properties.cpp:207 Please consider updating the camera sensor properties database
[1:07:46.095324954] [1856] WARN RPI raspberrypi.cpp:1308 Mismatch between Unicam and CamHelper for embedded data usage!
[1:07:46.096390526] [1856] INFO RPI raspberrypi.cpp:1425 Registered camera /base/soc/i2c0mux/i2c@1/arducam_64mp@1a to Unicam device /dev/media3 and ISP device /dev/media0
[1:07:46.097391635] [1855] INFO Camera camera.cpp:1028 configuring streams: (0) 640x480-YUV420 (1) 9152x6944-SBGGR10_CSI2P
[1:07:46.097703264] [1856] INFO RPI raspberrypi.cpp:805 Sensor: /base/soc/i2c0mux/i2c@1/arducam_64mp@1a - Selected sensor format: 9152x6944-SBGGR10_1X10 - Selected unicam format: 9152x6944-pBAA
[1:07:46.304545522] [1856] ERROR V4L2 v4l2_videodevice.cpp:1241 /dev/video0[12:cap]: Unable to request 1 buffers: Cannot allocate memory
[1:07:46.304607170] [1856] ERROR RPI raspberrypi.cpp:1069 Failed to allocate buffers
ERROR: *** failed to start camera ***

That matches what I saw—when it fails there’s no v4l2 log, which I guess means it dies at buffer allocation. So what do I do now?

For now, the workaround is:

  1. Use libcamera-raw instead of libcamera-still for raw capture with native AWB correction disabled.
  2. Avoid --immediate.
  3. Full 64MP raw (9152x6944) cannot be allocated on this Pi due to the V4L2 memory limitation, so use a reduced raw size such as:

libcamera-raw -o test.raw --gain 1 --awbgins 1,1 --rawfull --shutter 10000000 --width 8000 --height 4000

  1. Please run the firmware-version script from GitHub - edward-ardu/tools: Some small programs to help detect errors · GitHub and send me the output privately.
  2. Install the latest libcamera following libcamera and rpicam-apps - Arducam Wiki
  3. See the 64MP FAQ: How to use arducam_64mp & arducam_64mp FAQ - #2 by Edward

Also note the 64MP HAT itself has the exposure issue we reproduced, and the 1-to-4 HAT is the alternative we tested (report in private message).