Libcamera-still fails for 64MP Autofocus Camera (failed to allocate capture buffers)

  1. Where did you get the camera module(s)?
    Ordered from arducam website

  2. Model number of the product(s)?
    [email protected]

  3. What hardware/platform were you working on?
    Raspberry Pi 3 Model B Rev 1.2

  4. Instructions you have followed. (link/manual/etc.)
    https://www.arducam.com/downloads/arducam_64mp_pi_camera_manual.pdf

  5. Problems you were having?

[email protected]:~ $ libcamera-still -t 1000 -o test.jpg
Preview window unavailable
[0:07:03.920844419] [1523]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3572-e13ccdd5
[0:07:03.931162610] [1525]  WARN CameraSensorProperties camera_sensor_properties.cpp:163 No static properties available for 'arducam_64mp'
[0:07:03.931343393] [1525]  WARN CameraSensorProperties camera_sensor_properties.cpp:165 Please consider updating the camera sensor properties database
[0:07:03.932629234] [1525] ERROR CameraSensor camera_sensor.cpp:591 'arducam_64mp 10-001a': Camera sensor does not support test pattern modes.
[0:07:03.974721952] [1525]  WARN RPI raspberrypi.cpp:1263 Mismatch between Unicam and CamHelper for embedded data usage!
[0:07:03.976878424] [1525] ERROR DelayedControls delayed_controls.cpp:87 Delay request for control id 0x009a090a but control is not exposed by device /dev/v4l-subdev0
[0:07:03.977553116] [1525]  INFO RPI raspberrypi.cpp:1386 Registered camera /base/soc/i2c0mux/[email protected]/[email protected] to Unicam device /dev/media3 and ISP device /dev/media0
[0:07:03.979093647] [1523]  INFO Camera camera.cpp:1029 configuring streams: (0) 4624x3472-YUV420
[0:07:03.980241883] [1525]  INFO RPI raspberrypi.cpp:764 Sensor: /base/soc/i2c0mux/[email protected]/[email protected] - Selected sensor format: 4624x3472-SBGGR10_1X10 - Selected unicam format: 4624x3472-pBAA
[0:07:04.028585006] [1525] ERROR V4L2 v4l2_videodevice.cpp:1218 /dev/video14[16:cap]: Not enough buffers provided by V4L2VideoDevice
ERROR: *** failed to allocate capture buffers ***
  1. The dmesg log from your hardware?
[email protected]:~ $ dmesg 
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.15.32-v8+ ([email protected]) (aarch64-linux-gnu-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1538 SMP PREEMPT Thu Mar 31 19:40:39 BST 2022
[    0.000000] random: fast init done
[    0.000000] Machine model: Raspberry Pi 3 Model B Rev 1.2
[    0.000000] efi: UEFI not found.
[    0.000000] Reserved memory: created CMA memory pool at 0x0000000037400000, size 64 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000000000-0x000000003b3fffff]
[    0.000000]   DMA32    empty
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000003b3fffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000003b3fffff]
[    0.000000] percpu: Embedded 28 pages/cpu s77144 r8192 d29352 u114688
[    0.000000] pcpu-alloc: s77144 r8192 d29352 u114688 alloc=28*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: ARM erratum 843419
[    0.000000] CPU features: detected: ARM erratum 845719
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 238896
[    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1080 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  console=ttyS0,115200 console=tty1 root=PARTUUID=3151d8b6-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
[    0.000000] Unknown kernel command line parameters "splash", will be passed to user space.
[    0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 862276K/970752K available (11456K kernel code, 1962K rwdata, 4144K rodata, 3776K init, 964K bss, 42940K reserved, 65536K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 37889 entries in 149 pages
[    0.000000] ftrace: allocated 149 pages with 4 groups
[    0.000000] trace event string verifier disabled
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu: 	RCU event tracing is enabled.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
[    0.000000] 	Trampoline variant of Tasks RCU enabled.
[    0.000000] 	Rude variant of Tasks RCU enabled.
[    0.000000] 	Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] Root IRQ handler: bcm2836_arm_irqchip_handle_irq
[    0.000000] random: get_random_bytes called from start_kernel+0x510/0x6f8 with crng_init=1
[    0.000000] arch_timer: cp15 timer(s) running at 19.20MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
[    0.000001] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[    0.000303] Console: colour dummy device 80x25
[    0.000373] printk: console [tty1] enabled
[    0.000442] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=76800)
[    0.000478] pid_max: default: 32768 minimum: 301
[    0.000669] LSM: Security Framework initializing
[    0.000867] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.000910] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.002591] cgroup: Disabling memory control group subsystem
[    0.006109] rcu: Hierarchical SRCU implementation.
[    0.007520] EFI services will not be available.
[    0.008371] smp: Bringing up secondary CPUs ...
[    0.009871] Detected VIPT I-cache on CPU1
[    0.009963] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.011717] Detected VIPT I-cache on CPU2
[    0.011779] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.013495] Detected VIPT I-cache on CPU3
[    0.013553] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.013760] smp: Brought up 1 node, 4 CPUs
[    0.013788] SMP: Total of 4 processors activated.
[    0.013806] CPU features: detected: 32-bit EL0 Support
[    0.013820] CPU features: detected: 32-bit EL1 Support
[    0.013837] CPU features: detected: CRC32 instructions
[    0.053199] CPU: All CPU(s) started at EL2
[    0.053312] alternatives: patching kernel code
[    0.055300] devtmpfs: initialized
[    0.077262] Enabled cp15_barrier support
[    0.077314] Enabled setend support
[    0.077595] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.077639] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.081709] pinctrl core: initialized pinctrl subsystem
[    0.082881] DMI not present or invalid.
[    0.083540] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.094449] DMA: preallocated 1024 KiB GFP_KERNEL pool for atomic allocations
[    0.094956] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.096441] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.096604] audit: initializing netlink subsys (disabled)
[    0.097030] audit: type=2000 audit(0.096:1): state=initialized audit_enabled=0 res=1
[    0.097885] thermal_sys: Registered thermal governor 'step_wise'
[    0.098207] cpuidle: using governor menu
[    0.098828] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.099110] ASID allocator initialised with 65536 entries
[    0.099359] Serial: AMBA PL011 UART driver
[    0.112076] bcm2835-mbox 3f00b880.mailbox: mailbox enabled
[    0.136647] raspberrypi-firmware soc:firmware: Attached to firmware from 2022-03-24T13:20:54, variant start
[    0.140672] raspberrypi-firmware soc:firmware: Firmware hash is e5a963efa66a1974127860b42e913d2374139ff5
[    0.199420] bcm2835-dma 3f007000.dma: DMA legacy API manager, dmachans=0x1
[    0.204895] vgaarb: loaded
[    0.205596] SCSI subsystem initialized
[    0.205926] usbcore: registered new interface driver usbfs
[    0.206008] usbcore: registered new interface driver hub
[    0.206108] usbcore: registered new device driver usb
[    0.206603] usb_phy_generic phy: supply vcc not found, using dummy regulator
[    0.207224] pps_core: LinuxPPS API ver. 1 registered
[    0.207243] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]>
[    0.207280] PTP clock support registered
[    0.209740] clocksource: Switched to clocksource arch_sys_counter
[    0.346567] VFS: Disk quotas dquot_6.6.0
[    0.346705] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.346955] FS-Cache: Loaded
[    0.347266] CacheFiles: Loaded
[    0.362690] NET: Registered PF_INET protocol family
[    0.363002] IP idents hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.364923] tcp_listen_portaddr_hash hash table entries: 512 (order: 1, 8192 bytes, linear)
[    0.364981] TCP established hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.365110] TCP bind hash table entries: 8192 (order: 5, 131072 bytes, linear)
[    0.365315] TCP: Hash tables configured (established 8192 bind 8192)
[    0.365604] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.365670] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.366093] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.367324] RPC: Registered named UNIX socket transport module.
[    0.367344] RPC: Registered udp transport module.
[    0.367360] RPC: Registered tcp transport module.
[    0.367375] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.367401] PCI: CLS 0 bytes, default 64
[    0.370255] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available
[    0.370583] kvm [1]: IPA Size Limit: 40 bits
[    0.372307] kvm [1]: Hyp mode initialized successfully
[    1.869614] Initialise system trusted keyrings
[    1.870193] workingset: timestamp_bits=46 max_order=18 bucket_order=0
[    1.880841] zbud: loaded
[    1.883625] FS-Cache: Netfs 'nfs' registered for caching
3
[   17.838458] Bluetooth: HCI UART protocol H4 registered
[   17.838657] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   17.839107] Bluetooth: HCI UART protocol Broadcom registered
[   18.074423] ICMPv6: process `dhcpcd' is using deprecated sysctl (syscall) net.ipv6.neigh.wlan0.retrans_time - use net.ipv6.neigh.wlan0.retrans_time_ms instead
[   18.435362] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   18.435409] Bluetooth: BNEP filters: protocol multicast
[   18.435498] Bluetooth: BNEP socket layer initialized
[   18.483125] NET: Registered PF_ALG protocol family
[   20.704134] Bluetooth: RFCOMM TTY layer initialized
[   20.704250] Bluetooth: RFCOMM socket layer initialized
[   20.704339] Bluetooth: RFCOMM ver 1.11
[   33.757789] cam-dummy-reg: disabling
[   36.676793] cma: cma_alloc: linux,cma: alloc failed, req-size: 5941 pages, ret: -12
[   36.676892] ------------[ cut here ]------------
[   36.676903] WARNING: CPU: 0 PID: 1128 at mm/page_alloc.c:5380 __alloc_pages+0x2d0/0x330
[   36.676945] Modules linked in: rfcomm cmac algif_hash aes_arm64 algif_skcipher af_alg bnep hci_uart btbcm bluetooth ecdh_generic ecc hid_logitech_hidpp arducam_64mp(O) dw9807_vcm(O) 8021q garp stp llc hid_logitech_dj joydev brcmfmac brcmutil cfg80211 rfkill raspberrypi_hwmon i2c_mux_pinctrl i2c_mux bcm2835_unicam v4l2_dv_timings v4l2_fwnode v4l2_async bcm2835_codec(C) bcm2835_isp(C) bcm2835_v4l2(C) v4l2_mem2mem bcm2835_mmal_vchiq(C) snd_bcm2835(C) i2c_bcm2835 videobuf2_vmalloc snd_pcm videobuf2_dma_contig videobuf2_memops videobuf2_v4l2 snd_timer videobuf2_common snd vc_sm_cma(C) videodev mc uio_pdrv_genirq uio i2c_dev drm drm_panel_orientation_quirks backlight fuse ip_tables x_tables ipv6
[   36.677393] CPU: 0 PID: 1128 Comm: libcamera-still Tainted: G         C O      5.15.32-v8+ #1538
[   36.677413] Hardware name: Raspberry Pi 3 Model B Rev 1.2 (DT)
[   36.677424] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[   36.677441] pc : __alloc_pages+0x2d0/0x330
[   36.677459] lr : __dma_direct_alloc_pages+0x168/0x1b0
[   36.677479] sp : ffffffc00a67b880
[   36.677487] x29: ffffffc00a67b880 x28: ffffff8011ed5060 x27: ffffffc00a67bb58
[   36.677516] x26: 0000000000000001 x25: ffffffc008115144 x24: 0000000000000000
[   36.677544] x23: 0000000001735000 x22: 0000000000000cc1 x21: ffffffc008e8a9c8
[   36.677572] x20: ffffff8002a1b410 x19: ffffffc008e8a9c8 x18: 0000000000000001
[   36.677601] x17: 72202c7365676170 x16: 2031343935203a65 x15: 7a69732d71657220
[   36.677629] x14: 2c64656c69616620 x13: 32312d203a746572 x12: ffffffc0093a6670
[   36.677657] x11: 0000000000000003 x10: ffffffc00938e630 x9 : ffffffc008115788
[   36.677685] x8 : 0000000000017fe8 x7 : c0000000ffffefff x6 : ffffff803717a908
[   36.677712] x5 : 0000000000000001 x4 : 000000000000003f x3 : 0000000000000000
[   36.677738] x2 : 0000000000000000 x1 : 000000000000000d x0 : 0000000000000cc1
[   36.677765] Call trace:
[   36.677775]  __alloc_pages+0x2d0/0x330
[   36.677794]  __dma_direct_alloc_pages+0x168/0x1b0
[   36.677812]  dma_direct_alloc+0x7c/0x330
[   36.677828]  dma_alloc_attrs+0xac/0xc0
[   36.677844]  vb2_dc_alloc+0x70/0x130 [videobuf2_dma_contig]
[   36.677871]  __vb2_queue_alloc+0x220/0x488 [videobuf2_common]
[   36.677928]  vb2_core_reqbufs+0x288/0x480 [videobuf2_common]
[   36.677975]  vb2_ioctl_reqbufs+0x8c/0xc8 [videobuf2_v4l2]
[   36.678017]  v4l_reqbufs+0x54/0x68 [videodev]
[   36.678173]  __video_do_ioctl+0x188/0x410 [videodev]
[   36.678301]  video_usercopy+0x310/0x7d0 [videodev]
[   36.678431]  video_ioctl2+0x20/0x38 [videodev]
[   36.678561]  v4l2_ioctl+0x48/0x68 [videodev]
  1. Troubleshooting attempts you’ve made?
    I tried change /boot/config.txt, no luck. This is my /boot/config.txt right now
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

# Automatically load overlays for detected cameras
start_x=1

# Automatically load overlays for detected DSI displays
display_auto_detect=1

# Enable DRM VC4 V3D driver
#dtoverlay=vc4-kms-v3d
max_framebuffers=2

# Run in 64-bit mode
arm_64bit=1

# Disable compensation for displays with overscan
disable_overscan=1

[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1

[all]

[pi4]
# Run as fast as firmware / board allows
arm_boost=1
dtoverlay=vc4-fkms-v3d,cma-512

[all]
dtoverlay=arducam_64mp
gpu_mem=128

  1. What help do you need?
    The camera seems not working on my raspberry pi, please fix the bug.
1 Like

So one thing to be aware of - the preview window can only launch if operating terminal directly on the Raspberry Desktop itself (or if operating via VNC). It will not launch via a terminal on a different machine. Not sure if that is relevant to your case - but I had a hard time figuring that out

Also, the image will not be shown after saving - it merely writes it to the user’s home directory ~/

Not sure if that helps at all

I connected raspberry pi to TV with hdmi cable, and saw the same errors.

Hi! Just replying to keep track of this thread. I’m having the exact same issue. Any solution?