Setup IMX519 with any Raspberry Pi OS

  1. Where did you get the camera module(s)?
    Kickstarter

  2. Model number of the product(s)?
    IMX519

  3. What hardware/platform were you working on?
    I tried Bullseye and Buster tried also a lot of different builds as the guide mentions

  4. Instructions you have followed. (link/manual/etc.)
    The ones from the guides arducam com/docs/cameras-for-raspberry-pi/pivariety/comparing-pivariety-camera-and-raspberry-pi-camera/ and arducam com/docs/cameras-for-raspberry-pi/pivariety/how-to-access-and-program-the-pivariety-camera-using-command-line-python-opencv-and-gstreamer/

  5. Problems you were having?
    Whatever I do, I am able at the end, to take pictures with libcamera. In the best case, I can have autofocus. My ultimate goal is to make it compatible with python and OpenCV. I am unable to have pivariety installed correctly. At least, dmesg | grep arducam shows only… and has only been showing probe issues and I have been trying all the flavors of raspberry versions… :frowning:

Right now, 2022.04.04 freshly deployed using raspberry imager 1.7, as suggested in the guide. I installed the pivariety kernel and that’s all…

  1. The dmesg log from your hardware?
    i2cdetect -y 0 > nothing shown… only dashes. ------
    dmesg in the next post… (too long here)

  2. Troubleshooting attempts you’ve made?
    I have been trying buster, bullseye, and different versions mentioned in the guides, downloads raspberrypi.org/raspios_full_armhf/images/raspios_full_armhf-2022-04-07/, but as well the one from early january, from 2021 … I am blocked… not sure why. As said, I can in the best case, take pictures with libcamera-still and use autofocus, but the dmesg has never been able to visualize the sensor… blocking the python access if I understood.

  3. What help do you need?
    A guide from scratch, that works… should I install both imx519 then pivariety… but ultimately, have python and opencv to control the camera with autofocus… would make my experience awesomely better.

[email protected]:~/Git $ dmesg | grep arducam
[ 11.071618] arducam: loading out-of-tree module taints kernel.
[ 11.083400] arducam-pivariety 10-000c: probe failed

[email protected]:~/Git $ dmesg

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.15.32-v7+ ([email protected]) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1538 SMP Thu Mar 31 19:38:48 BST 2022
[ 0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: Raspberry Pi 3 Model A Plus Rev 1.0
[ 0.000000] random: fast init done
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] Reserved memory: created CMA memory pool at 0x0bc00000, size 256 MiB
[ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000000000000-0x000000001bffffff]
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x000000001bffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000001bffffff]
[ 0.000000] percpu: Embedded 16 pages/cpu s35660 r8192 d21684 u65536
[ 0.000000] pcpu-alloc: s35660 r8192 d21684 u65536 alloc=16*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 113680
[ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 video=HDMI-A-1:[email protected] vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 console= ttyS0,115200 console=tty1 root=PARTUUID=da0b5c15-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: 65536 (order: 6, 262144 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 175004K/458752K available (10240K kernel code, 1341K rwdata, 3060K rodata, 1024K init, 568K bss, 21604K reserved, 262144K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] ftrace: allocating 33185 entries in 98 pages
[ 0.000000] ftrace: allocated 98 pages with 3 groups
[ 0.000000] trace event string verifier disabled
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 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 10 jiffies.
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] random: get_random_bytes called from start_kernel+0x538/0x71c 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.000022] Switching to timer-based delay loop, resolution 52ns
[ 0.000361] Console: colour dummy device 80x30
[ 0.000437] printk: console [tty1] enabled
[ 0.000502] Calibrating delay loop (skipped), value calculated using timer frequency… 38.40 BogoMIPS (lpj=192000)
[ 0.000535] pid_max: default: 32768 minimum: 301
[ 0.000706] LSM: Security Framework initializing
[ 0.000882] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.000910] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.002512] cgroup: Disabling memory control group subsystem
[ 0.002821] CPU: Testing write buffer coherency: ok
[ 0.003379] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.004633] Setting up static identity map for 0x100000 - 0x10003c
[ 0.004833] rcu: Hierarchical SRCU implementation.
[ 0.005799] smp: Bringing up secondary CPUs …
[ 0.007023] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.008347] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[ 0.009575] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[ 0.009725] smp: Brought up 1 node, 4 CPUs
[ 0.009750] SMP: Total of 4 processors activated (153.60 BogoMIPS).
[ 0.009769] CPU: All CPU(s) started in HYP mode.
[ 0.009780] CPU: Virtualization extensions available.
[ 0.010771] devtmpfs: initialized
[ 0.030058] VFP support v0.3: implementor 41 architecture 3 part 40 variant 3 rev 4
[ 0.030350] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.030390] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[ 0.043090] pinctrl core: initialized pinctrl subsystem
[ 0.044604] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[ 0.049373] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[ 0.055221] audit: initializing netlink subsys (disabled)
[ 0.055533] audit: type=2000 audit(0.050:1): state=initialized audit_enabled=0 res=1
[ 0.056201] thermal_sys: Registered thermal governor ‘step_wise’
[ 0.057312] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.057333] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.057627] Serial: AMBA PL011 UART driver
[ 0.068817] bcm2835-mbox 3f00b880.mailbox: mailbox enabled
[ 0.100167] raspberrypi-firmware soc:firmware: Attached to firmware from 2022-03-24T13:21:51, variant start_x
[ 0.110183] raspberrypi-firmware soc:firmware: Firmware hash is e5a963efa66a1974127860b42e913d2374139ff5
[ 0.160399] Kprobes globally optimized
[ 0.165558] bcm2835-dma 3f007000.dma: DMA legacy API manager, dmachans=0x1
[ 0.167927] SCSI subsystem initialized
[ 0.168206] usbcore: registered new interface driver usbfs
[ 0.168275] usbcore: registered new interface driver hub
[ 0.168349] usbcore: registered new device driver usb
[ 0.168749] usb_phy_generic phy: supply vcc not found, using dummy regulator
[ 0.169193] pps_core: LinuxPPS API ver. 1 registered
[ 0.169208] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti [email protected]
[ 0.169240] PTP clock support registered
[ 0.171992] clocksource: Switched to clocksource arch_sys_counter
[ 0.242815] VFS: Disk quotas dquot_6.6.0
[ 0.242948] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.243164] FS-Cache: Loaded
[ 0.243469] CacheFiles: Loaded
[ 0.244533] simple-framebuffer 1e402000.framebuffer: framebuffer at 0x1e402000, 0x7f8000 bytes
[ 0.244559] simple-framebuffer 1e402000.framebuffer: format=a8r8g8b8, mode=1920x1080x32, linelength=7680
[ 0.245205] Console: switching to colour frame buffer device 240x67
[ 0.280165] simple-framebuffer 1e402000.framebuffer: fb0: simplefb registered!
[ 0.291209] NET: Registered PF_INET protocol family
[ 0.291453] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
[ 0.292870] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[ 0.292926] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[ 0.293006] TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 0.293116] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.293283] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.293344] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.293630] NET: Registered PF_UNIX/PF_LOCAL protocol family
[ 0.303033] RPC: Registered named UNIX socket transport module.
[ 0.303052] RPC: Registered udp transport module.
[ 0.303065] RPC: Registered tcp transport module.
[ 0.303078] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 1.911133] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 7 counters available
[ 1.915361] Initialise system trusted keyrings
[ 1.915686] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[ 1.925883] zbud: loaded
[ 1.928177] FS-Cache: Netfs ‘nfs’ registered for caching
[ 1.929202] NFS: Registering the id_resolver key type
[ 1.929266] Key type id_resolver registered
[ 1.929280] Key type id_legacy registered
[ 1.929435] nfs4filelayout_init: NFSv4 File Layout Driver Registering…
[ 1.929451] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering…
[ 1.930764] Key type asymmetric registered
[ 1.930780] Asymmetric key parser ‘x509’ registered
[ 1.930882] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[ 1.930900] io scheduler mq-deadline registered
[ 1.930914] io scheduler kyber registered
[ 1.942780] bcm2835-rng 3f104000.rng: hwrng registered
[ 1.943413] vc-mem: phys_addr:0x00000000 mem_base=0x1ec00000 mem_size:0x20000000(512 MiB)
[ 1.944794] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[ 1.957542] brd: module loaded
[ 1.968079] loop: module loaded
[ 1.968901] Loading iSCSI transport class v2.0-870.
[ 1.970939] usbcore: registered new interface driver lan78xx
[ 1.971012] usbcore: registered new interface driver smsc95xx
[ 1.971037] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[ 2.699358] Core Release: 2.80a
[ 2.699380] Setting default values for core params
[ 2.699414] Finished setting default values for core params
[ 2.899788] Using Buffer DMA mode
[ 2.899801] Periodic Transfer Interrupt Enhancement - disabled
[ 2.899814] Multiprocessor Interrupt Enhancement - disabled
[ 2.899828] OTG VER PARAM: 0, OTG VER FLAG: 0
[ 2.899879] Dedicated Tx FIFOs mode

[ 2.901129] WARN::dwc_otg_hcd_init:1074: FIQ DMA bounce buffers: virt = 8bd04000 dma = 0xcbd04000 len=9024
[ 2.901176] FIQ FSM acceleration enabled for :
Non-periodic Split Transactions
Periodic Split Transactions
High-Speed Isochronous Endpoints
Interrupt/Control Split Transaction hack enabled
[ 2.901195] dwc_otg: Microframe scheduler enabled

[ 2.901332] WARN::hcd_init_fiq:457: FIQ on core 1

[ 2.901351] WARN::hcd_init_fiq:458: FIQ ASM at 807f3124 length 36

[ 2.901374] WARN::hcd_init_fiq:497: MPHI regs_base at 9c810000
[ 2.901400] dwc_otg 3f980000.usb: DWC OTG Controller
[ 2.901462] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
[ 2.901525] dwc_otg 3f980000.usb: irq 89, io mem 0x00000000
[ 2.901587] Init: Port Power? op_state=1
[ 2.901600] Init: Power Port (0)
[ 2.901987] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15
[ 2.902011] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 2.902031] usb usb1: Product: DWC OTG Controller
[ 2.902047] usb usb1: Manufacturer: Linux 5.15.32-v7+ dwc_otg_hcd
[ 2.902064] usb usb1: SerialNumber: 3f980000.usb
[ 2.902891] hub 1-0:1.0: USB hub found
[ 2.902959] hub 1-0:1.0: 1 port detected
[ 2.903943] dwc_otg: FIQ enabled
[ 2.903958] dwc_otg: NAK holdoff enabled
[ 2.903970] dwc_otg: FIQ split-transaction FSM enabled
[ 2.903992] Module dwc_common_port init
[ 2.904371] usbcore: registered new interface driver usb-storage
[ 2.904611] mousedev: PS/2 mouse device common for all mice
[ 2.908480] sdhci: Secure Digital Host Controller Interface driver
[ 2.908496] sdhci: Copyright(c) Pierre Ossman
[ 2.909046] sdhci-pltfm: SDHCI platform and OF driver helper
[ 2.911908] ledtrig-cpu: registered to indicate activity on CPUs
[ 2.912295] hid: raw HID events driver (C) Jiri Kosina
[ 2.912455] usbcore: registered new interface driver usbhid
[ 2.912471] usbhid: USB HID core driver
[ 2.918258] Initializing XFRM netlink socket
[ 2.918310] NET: Registered PF_PACKET protocol family
[ 2.918483] Key type dns_resolver registered
[ 2.919242] Registering SWP/SWPB emulation handler
[ 2.920027] registered taskstats version 1
[ 2.920069] Loading compiled-in X.509 certificates
[ 2.921000] Key type ._fscrypt registered
[ 2.921015] Key type .fscrypt registered
[ 2.921029] Key type fscrypt-provisioning registered
[ 2.934139] uart-pl011 3f201000.serial: cts_event_workaround enabled
[ 2.934328] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 114, base_baud = 0) is a PL011 rev2
[ 2.937190] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer
[ 2.937637] bcm2835-power bcm2835-power: Broadcom BCM2835 power domains driver
[ 2.939444] mmc-bcm2835 3f300000.mmcnr: mmc_debug:0 mmc_debug2:0
[ 2.939465] mmc-bcm2835 3f300000.mmcnr: DMA channel allocated
[ 2.966461] sdhost: log_buf @ (ptrval) (cbd03000)
[ 3.016543] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[ 3.032177] Indeed it is in host mode hprt0 = 00021501
[ 3.039521] of_cfs_init
[ 3.039819] of_cfs_init: OK
[ 3.041189] Waiting for root device PARTUUID=da0b5c15-02…
[ 3.076410] mmc0: host does not support reading read-only switch, assuming write-enable
[ 3.081334] mmc0: new high speed SDXC card at address 59b4
[ 3.082576] mmcblk0: mmc0:59b4 USD00 58.9 GiB
[ 3.086657] mmcblk0: p1 p2
[ 3.087405] mmcblk0: mmc0:59b4 USD00 58.9 GiB
[ 3.098924] mmc1: new high speed SDIO card at address 0001
[ 3.107873] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[ 3.107996] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[ 3.115917] devtmpfs: mounted
[ 3.124703] Freeing unused kernel image (initmem) memory: 1024K
[ 3.132505] Run /sbin/init as init process
[ 3.132523] with arguments:
[ 3.132534] /sbin/init
[ 3.132547] splash
[ 3.132558] with environment:
[ 3.132568] HOME=/
[ 3.132579] TERM=linux
[ 3.242038] usb 1-1: new full-speed USB device number 2 using dwc_otg
[ 3.242279] Indeed it is in host mode hprt0 = 00021501
[ 3.483096] usb 1-1: New USB device found, idVendor=0e8f, idProduct=0016, bcdDevice= 1.00
[ 3.483142] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3.483162] usb 1-1: Product: USB Hub
[ 3.483179] usb 1-1: Manufacturer: GASIA Semi.
[ 3.484120] hub 1-1:1.0: USB hub found
[ 3.484281] hub 1-1:1.0: 4 ports detected
[ 3.638843] systemd[1]: System time before build time, advancing clock.
[ 3.791819] NET: Registered PF_INET6 protocol family
[ 3.793692] Segment Routing with IPv6
[ 3.793748] In-situ OAM (IOAM) with IPv6
[ 3.802039] usb 1-1.2: new full-speed USB device number 3 using dwc_otg
[ 3.892397] systemd[1]: systemd 247.3-7+rpi1 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=unified)
[ 3.893579] systemd[1]: Detected architecture arm.
[ 3.895542] systemd[1]: Set hostname to .
[ 3.943074] usb 1-1.2: not running at top speed; connect to a high speed hub
[ 3.944252] usb 1-1.2: New USB device found, idVendor=9710, idProduct=7830, bcdDevice= 2.00
[ 3.944420] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 4.042145] usb 1-1.4: new full-speed USB device number 4 using dwc_otg
[ 4.174717] usb 1-1.4: New USB device found, idVendor=046d, idProduct=c52b, bcdDevice=12.10
[ 4.174765] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 4.174784] usb 1-1.4: Product: USB Receiver
[ 4.174802] usb 1-1.4: Manufacturer: Logitech
[ 4.179749] input: Logitech USB Receiver as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/0003:046D:C52B.0001/input/input0
[ 4.243190] hid-generic 0003:046D:C52B.0001: input,hidraw0: USB HID v1.11 Keyboard [Logitech USB Receiver] on usb-3f980000.usb-1.4/input0
[ 4.249245] input: Logitech USB Receiver Mouse as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.1/0003:046D:C52B.0002/input/input1
[ 4.249996] input: Logitech USB Receiver Consumer Control as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.1/0003:046D:C52B.0002/input/input2
[ 4.312498] input: Logitech USB Receiver System Control as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.1/0003:046D:C52B.0002/input/input3
[ 4.313156] hid-generic 0003:046D:C52B.0002: input,hiddev96,hidraw1: USB HID v1.11 Mouse [Logitech USB Receiver] on usb-3f980000.usb-1.4/input1
[ 4.318631] hid-generic 0003:046D:C52B.0003: hiddev97,hidraw2: USB HID v1.11 Device [Logitech USB Receiver] on usb-3f980000.usb-1.4/input2
[ 4.835345] systemd[1]: /lib/systemd/system/plymouth-start.service:16: Unit configured to use KillMode=none. This is unsafe, as it disables systemd’s process lifecycle management for the service. Please update your se rvice to use a safer KillMode=, such as ‘mixed’ or ‘control-group’. Support for KillMode=none is deprecated and will eventually be removed.
[ 5.107543] systemd[1]: Queued start job for default target Graphical Interface.
[ 5.110013] random: systemd: uninitialized urandom read (16 bytes read)
[ 5.115514] systemd[1]: Created slice system-getty.slice.
[ 5.115983] random: systemd: uninitialized urandom read (16 bytes read)
[ 5.117328] systemd[1]: Created slice system-modprobe.slice.
[ 5.117491] random: systemd: uninitialized urandom read (16 bytes read)
[ 5.118732] systemd[1]: Created slice system-systemd\x2dfsck.slice.
[ 5.119739] systemd[1]: Created slice User and Session Slice.
[ 5.120450] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[ 5.121870] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[ 5.123206] systemd[1]: Reached target Slices.
[ 5.123595] systemd[1]: Reached target Swap.
[ 5.125038] systemd[1]: Listening on Syslog Socket.
[ 5.125942] systemd[1]: Listening on fsck to fsckd communication Socket.
[ 5.126428] systemd[1]: Listening on initctl Compatibility Named Pipe.
[ 5.127906] systemd[1]: Listening on Journal Audit Socket.
[ 5.128762] systemd[1]: Listening on Journal Socket (/dev/log).
[ 5.129808] systemd[1]: Listening on Journal Socket.
[ 5.139587] systemd[1]: Listening on udev Control Socket.
[ 5.140723] systemd[1]: Listening on udev Kernel Socket.
[ 5.142156] systemd[1]: Condition check resulted in Huge Pages File System being skipped.
[ 5.147577] systemd[1]: Mounting POSIX Message Queue File System…
[ 5.153968] systemd[1]: Mounting RPC Pipe File System…
[ 5.160958] systemd[1]: Mounting Kernel Debug File System…
[ 5.168466] systemd[1]: Mounting Kernel Trace File System…
[ 5.169546] systemd[1]: Condition check resulted in Kernel Module supporting RPCSEC_GSS being skipped.
[ 5.181432] systemd[1]: Starting Restore / save the current clock…
[ 5.191536] systemd[1]: Starting Set the console keyboard layout…
[ 5.198788] systemd[1]: Starting Create list of static device nodes for the current kernel…
[ 5.206823] systemd[1]: Starting Load Kernel Module configfs…
[ 5.214346] systemd[1]: Starting Load Kernel Module drm…
[ 5.222885] systemd[1]: Starting Load Kernel Module fuse…
[ 5.229488] systemd[1]: Condition check resulted in Set Up Additional Binary Formats being skipped.
[ 5.237018] systemd[1]: Starting File System Check on Root Device…
[ 5.264961] systemd[1]: Starting Journal Service…
[ 5.285923] fuse: init (API version 7.34)
[ 5.306983] systemd[1]: Starting Load Kernel Modules…
[ 5.315614] systemd[1]: Starting Coldplug All udev Devices…
[ 5.331186] systemd[1]: Mounted POSIX Message Queue File System.
[ 5.332737] systemd[1]: Mounted RPC Pipe File System.
[ 5.335584] systemd[1]: Mounted Kernel Debug File System.
[ 5.338233] systemd[1]: Mounted Kernel Trace File System.
[ 5.346516] systemd[1]: Finished Create list of static device nodes for the current kernel.
[ 5.350165] systemd[1]: Finished Restore / save the current clock.
[ 5.352410] systemd[1]: [email protected]: Succeeded.
[ 5.353997] systemd[1]: Finished Load Kernel Module configfs.
[ 5.356310] systemd[1]: [email protected]: Succeeded.
[ 5.357743] systemd[1]: Finished Load Kernel Module fuse.
[ 5.366948] systemd[1]: Mounting FUSE Control File System…
[ 5.375021] systemd[1]: Mounting Kernel Configuration File System…
[ 5.381611] systemd[1]: Started File System Check Daemon to report status.
[ 5.405523] systemd[1]: Mounted FUSE Control File System.
[ 5.418386] systemd[1]: Mounted Kernel Configuration File System.
[ 5.427941] systemd[1]: [email protected]: Succeeded.
[ 5.429406] systemd[1]: Finished Load Kernel Module drm.
[ 5.450290] i2c_dev: i2c /dev entries driver
[ 5.457509] systemd[1]: Finished Load Kernel Modules.
[ 5.464472] systemd[1]: Starting Apply Kernel Variables…
[ 5.565105] systemd[1]: Finished Apply Kernel Variables.
[ 5.665076] systemd[1]: Started Journal Service.
[ 5.979621] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null). Quota mode: none.
[ 6.054264] systemd-journald[124]: Received client request to flush runtime journal.
[ 6.093221] systemd-journald[124]: File /var/log/journal/7da095ba2d71462ebe5774d31527fb23/system.journal corrupted or uncleanly shut down, renaming and replacing.
[ 7.600489] mc: Linux media interface: v0.10
[ 7.630177] vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned.
[ 7.633029] bcm2835_vc_sm_cma_probe: Videocore shared memory driver
[ 7.633088] [vc_sm_connected_init]: start
[ 7.648010] videodev: Linux video capture interface: v2.00
[ 7.652792] [vc_sm_connected_init]: installed successfully
[ 7.684246] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned.
[ 7.691039] bcm2835_audio bcm2835_audio: card created with 8 channels
[ 7.720749] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[ 7.720749] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[ 7.736171] bcm2835_isp: module is from the staging directory, the quality is unknown, you have been warned.
[ 7.748839] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.
[ 7.757354] bcm2835_codec: module is from the staging directory, the quality is unknown, you have been warned.
[ 7.808746] bcm2835-isp bcm2835-isp: Device node output[0] registered as /dev/video13
[ 7.809530] bcm2835-isp bcm2835-isp: Device node capture[0] registered as /dev/video14
[ 7.810125] bcm2835-isp bcm2835-isp: Device node capture[1] registered as /dev/video15
[ 7.811269] bcm2835-isp bcm2835-isp: Device node stats[2] registered as /dev/video16
[ 7.811314] bcm2835-isp bcm2835-isp: Register output node 0 with media controller
[ 7.811348] bcm2835-isp bcm2835-isp: Register capture node 1 with media controller
[ 7.811371] bcm2835-isp bcm2835-isp: Register capture node 2 with media controller
[ 7.811393] bcm2835-isp bcm2835-isp: Register capture node 3 with media controller
[ 7.836795] bcm2835-isp bcm2835-isp: Device node output[0] registered as /dev/video20
[ 7.837322] bcm2835-isp bcm2835-isp: Device node capture[0] registered as /dev/video21
[ 7.837726] bcm2835-isp bcm2835-isp: Device node capture[1] registered as /dev/video22
[ 7.838062] bcm2835-isp bcm2835-isp: Device node stats[2] registered as /dev/video23
[ 7.838100] bcm2835-isp bcm2835-isp: Register output node 0 with media controller
[ 7.838127] bcm2835-isp bcm2835-isp: Register capture node 1 with media controller
[ 7.838150] bcm2835-isp bcm2835-isp: Register capture node 2 with media controller
[ 7.838172] bcm2835-isp bcm2835-isp: Register capture node 3 with media controller
[ 7.838400] bcm2835-isp bcm2835-isp: Loaded V4L2 bcm2835-isp
[ 7.873643] bcm2835-codec bcm2835-codec: Device registered as /dev/video10
[ 7.873719] bcm2835-codec bcm2835-codec: Loaded V4L2 decode
[ 7.890751] bcm2835-codec bcm2835-codec: Device registered as /dev/video11
[ 7.895094] bcm2835-codec bcm2835-codec: Loaded V4L2 encode
[ 7.932631] bcm2835-codec bcm2835-codec: Device registered as /dev/video12
[ 7.932705] bcm2835-codec bcm2835-codec: Loaded V4L2 isp
[ 7.990923] bcm2835-codec bcm2835-codec: Device registered as /dev/video18
[ 7.990991] bcm2835-codec bcm2835-codec: Loaded V4L2 image_fx
[ 8.018047] bcm2835-codec bcm2835-codec: Device registered as /dev/video31
[ 8.018131] bcm2835-codec bcm2835-codec: Loaded V4L2 encode_image
[ 8.278243] i2c i2c-11: Added multiplexed i2c bus 0
[ 8.279450] i2c 10-000c: Fixing up cyclic dependency with 3f801000.csi
[ 8.280109] i2c i2c-11: Added multiplexed i2c bus 10
[ 8.632079] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 8.734985] usb 1-1.2: applying rev.C fixup
[ 8.763223] usb 1-1.2: applying rev.C fixup
[ 8.793805] MOSCHIP usb-ethernet driver 1-1.2:1.0 eth0: register ‘MOSCHIP usb-ethernet driver’ at usb-3f980000.usb-1.2, MOSCHIP 7830/7832/7730 usb-NET adapter, 00:50:c5:00:47:b5
[ 8.794163] usbcore: registered new interface driver MOSCHIP usb-ethernet driver
[ 8.850436] cfg80211: Loaded X.509 cert ‘sforshee: 00b28ddf47aef9cea7’
[ 8.868370] cfg80211: loaded regulatory.db is malformed or signature is missing/invalid
[ 8.889592] checking generic (1e402000 7f8000) vs hw (0 ffffffff)
[ 8.889643] fb0: switching to vc4 from simple
[ 8.890709] Console: switching to colour dummy device 80x30
[ 8.919388] brcmfmac: F1 signature read @0x18000000=0x15264345
[ 8.926845] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[ 8.928641] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.raspberrypi,3-model-b-plus.bin failed with error -2
[ 8.936030] usbcore: registered new interface driver brcmfmac
[ 8.945555] vc4-drm soc:gpu: bound 3f400000.hvs (ops vc4_hvs_ops [vc4])
[ 8.946719] Registered IR keymap rc-cec
[ 8.946997] rc rc0: vc4 as /devices/platform/soc/3f902000.hdmi/rc/rc0
[ 8.947271] input: vc4 as /devices/platform/soc/3f902000.hdmi/rc/rc0/input5
[ 9.189003] vc4-drm soc:gpu: bound 3f400000.hvs (ops vc4_hvs_ops [vc4])
[ 9.202832] Registered IR keymap rc-cec
[ 9.203328] rc rc0: vc4 as /devices/platform/soc/3f902000.hdmi/rc/rc0
[ 9.203757] input: vc4 as /devices/platform/soc/3f902000.hdmi/rc/rc0/input6
[ 9.206543] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[ 9.206720] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[ 9.212361] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Nov 1 2021 00:37:25 version 7.45.241 (1a2f2fa CY) FWID 01-703fd60
[ 9.242068] random: crng init done
[ 9.242097] random: 7 urandom warning(s) missed due to ratelimiting
[ 9.730128] logitech-djreceiver 0003:046D:C52B.0003: hiddev96,hidraw0: USB HID v1.11 Device [Logitech USB Receiver] on usb-3f980000.usb-1.4/input2
[ 9.877840] vc4-drm soc:gpu: bound 3f400000.hvs (ops vc4_hvs_ops [vc4])
[ 9.883256] input: Logitech Wireless Device PID:408a Keyboard as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.2/0003:046D:C52B.0003/0003:046D:408A.0004/input/input7
[ 9.885946] input: Logitech Wireless Device PID:408a Mouse as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.2/0003:046D:C52B.0003/0003:046D:408A.0004/input/input8
[ 9.889399] hid-generic 0003:046D:408A.0004: input,hidraw1: USB HID v1.11 Keyboard [Logitech Wireless Device PID:408a] on usb-3f980000.usb-1.4/input2:1
[ 9.895128] input: Logitech Wireless Device PID:4082 Keyboard as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.2/0003:046D:C52B.0003/0003:046D:4082.0005/input/input13
[ 9.902625] Registered IR keymap rc-cec
[ 9.904414] rc rc0: vc4 as /devices/platform/soc/3f902000.hdmi/rc/rc0
[ 9.904753] input: vc4 as /devices/platform/soc/3f902000.hdmi/rc/rc0/input12
[ 9.905241] input: Logitech Wireless Device PID:4082 Mouse as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.2/0003:046D:C52B.0003/0003:046D:4082.0005/input/input14
[ 9.906118] hid-generic 0003:046D:4082.0005: input,hidraw2: USB HID v1.11 Keyboard [Logitech Wireless Device PID:4082] on usb-3f980000.usb-1.4/input2:2
[ 10.029075] vc4-drm soc:gpu: bound 3f400000.hvs (ops vc4_hvs_ops [vc4])
[ 10.052728] Registered IR keymap rc-cec
[ 10.053034] rc rc0: vc4 as /devices/platform/soc/3f902000.hdmi/rc/rc0
[ 10.053392] input: vc4 as /devices/platform/soc/3f902000.hdmi/rc/rc0/input18
[ 10.152143] hwmon hwmon1: Undervoltage detected!
[ 10.719247] vc4-drm soc:gpu: bound 3f400000.hvs (ops vc4_hvs_ops [vc4])
[ 10.720692] Registered IR keymap rc-cec
[ 10.720979] rc rc0: vc4 as /devices/platform/soc/3f902000.hdmi/rc/rc0
[ 10.721266] input: vc4 as /devices/platform/soc/3f902000.hdmi/rc/rc0/input19
[ 10.734347] vc4-drm soc:gpu: bound 3f902000.hdmi (ops vc4_hdmi_ops [vc4])
[ 10.734960] vc4-drm soc:gpu: bound 3f004000.txp (ops vc4_txp_ops [vc4])
[ 10.735414] vc4-drm soc:gpu: bound 3f206000.pixelvalve (ops vc4_crtc_ops [vc4])
[ 10.735823] vc4-drm soc:gpu: bound 3f207000.pixelvalve (ops vc4_crtc_ops [vc4])
[ 10.736332] vc4-drm soc:gpu: bound 3f807000.pixelvalve (ops vc4_crtc_ops [vc4])
[ 10.736686] vc4-drm soc:gpu: bound 3fc00000.v3d (ops vc4_v3d_ops [vc4])
[ 10.783898] [drm] Initialized vc4 0.0.0 20140616 for soc:gpu on minor 0
[ 10.884185] Console: switching to colour frame buffer device 240x67
[ 10.884265] vc4-drm soc:gpu: [drm] fb0: vc4drmfb frame buffer device
[ 11.071618] arducam: loading out-of-tree module taints kernel.
[ 11.083400] arducam-pivariety 10-000c: probe failed
[ 11.480516] input: Logitech MX Keys as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.2/0003:046D:C52B.0003/0003:046D:408A.0004/input/input20
[ 11.482170] logitech-hidpp-device 0003:046D:408A.0004: input,hidraw1: USB HID v1.11 Keyboard [Logitech MX Keys] on usb-3f980000.usb-1.4/input2:1
[ 11.857222] input: Logitech MX Master 3 as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.2/0003:046D:C52B.0003/0003:046D:4082.0005/input/input21
[ 11.859701] logitech-hidpp-device 0003:046D:4082.0005: input,hidraw2: USB HID v1.11 Keyboard [Logitech MX Master 3] on usb-3f980000.usb-1.4/input2:2
[ 12.109932] uart-pl011 3f201000.serial: no DMA platform data
[ 12.225585] 8021q: 802.1Q VLAN Support v1.8
[ 12.280429] Adding 102396k swap on /var/swap. Priority:-2 extents:4 across:6361520k SSFS
[ 12.869542] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled
[ 18.934386] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 19.437025] Bluetooth: Core ver 2.22
[ 19.437218] NET: Registered PF_BLUETOOTH protocol family
[ 19.437234] Bluetooth: HCI device and connection manager initialized
[ 19.438133] Bluetooth: HCI socket layer initialized
[ 19.438165] Bluetooth: L2CAP socket layer initialized
[ 19.438208] Bluetooth: SCO socket layer initialized
[ 19.458525] Bluetooth: HCI UART driver ver 2.3
[ 19.458572] Bluetooth: HCI UART protocol H4 registered
[ 19.458746] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 19.459191] Bluetooth: HCI UART protocol Broadcom registered
[ 20.234537] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 20.234585] Bluetooth: BNEP filters: protocol multicast
[ 20.234626] Bluetooth: BNEP socket layer initialized
[ 20.314156] NET: Registered PF_ALG protocol family
[ 20.412285] cryptd: max_cpu_qlen set to 1000
[ 21.588168] Bluetooth: RFCOMM TTY layer initialized
[ 21.588224] Bluetooth: RFCOMM socket layer initialized
[ 21.588270] Bluetooth: RFCOMM ver 1.11
[ 33.112139] cam-dummy-reg: disabling

[email protected]:~/Git $ cat /boot/config.txt

For more options and information see

Raspberry Pi Documentation - Configuration

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=off

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

#camera_auto_detect=1

Automatically load overlays for detected DSI displays

display_auto_detect=1

Enable DRM VC4 V3D driver

#dtoverlay=vc4-fkms-v3d
max_framebuffers=2

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

[pi4]

Run as fast as firmware / board allows

arm_boost=1

[all]
dtoverlay=arducam
start_x=1
[all]
dtoverlay=vc4-kms-v3d

[email protected]:~/Git $ uname -a
Linux raspberrypi 5.15.32-v7+ #1538 SMP Thu Mar 31 19:38:48 BST 2022 armv7l GNU/Linux

Thank you very much for your information,
I think we can solve problems one by one,
What you need to know before this is that only one of the IMX519 and Pivariety drivers can be enabled at the same time (by adding dtoverlay=imx519 or dtoverlay=arducam to /boot/config.txt)

From the current log, you have enabled the Pivariety driver in /boot/config.txt, but the camera is not detected (probe failed), this may be caused by the cable connection, can you tell me the Pivariety you purchased What model is the mod? Please also attach a photo of the cable connection.

Hi Wong.

Thank you for your fast reply and showing the path…

I bought two packs of Kickstarter 16MP Autofocus Arducam. Raspberry Pi is 3B+

You are right, it’s ambiguous… for newbees that both IMX519 and Pivariety can’t be used simultaneously. I hence, commented the dtoverlay line for imx519 in /boot/config.txt.
I also added cma=128 to overlay=vc4-fkms-vc3d

In regards to the cable, this may be the problem, though, I tried almost lal the cables I have (ref 20861, ref 20624, ref 20706) and can’t find a good solution where the dmseg | grep arducam would result in a version ID

Here is the picture requested.

From the picture, you are using IMX519, but pivariety is configured in /boot/config.txt?
You should comment out: dtoverlay=arducam, turn on dtoverlay=imx519

Thank you Wong.
I then followed your suggestion and commented dtoverlay=arducam and uncommented dtoverlay=imx519 gave it a reboot.

Picture attached of tail /boot/config and libcamera-jpeg.

From here, I can take pictures, with libcamera-jpeg -o img.jpg

Though, when I run dmesg | grep arducam, it’s an empty line… nothing maybe because arducam is not loaded :slight_smile:

My end goal being, using the arducam through python and opencv, to capture frames with opencv.
As we are, I think this is a on the way to . success using python3.9 and libcamera whl plugin (version 1.0.2) and provided examples run flawlessly (decreasing the resolution to 1280 x 780)

Indeed… v4l2 works as well (Some days ago, I faced some errors trying to make Use of v4l2loopback on line cd ~/libcamera # Installation using deb does not need to be executed.
Re-reading the page I understood today that the git libcamera needed to be done upfront.

What I just did :

Download kernel source code
sudo apt install git bc bison flex libssl-dev
sudo wget https://raw.githubusercontent.com/RPi-Distro/rpi-source/master/rpi-source -O /usr/local/bin/rpi-source && sudo chmod +x /usr/local/bin/rpi-source && /usr/local/bin/rpi-source -q --tag-update
rpi-source -d $(uname -r)
Compile driver
git clone https://github.com/umlaeute/v4l2loopback.git
cd v4l2loopback
make clean && make
make && sudo make install
sudo depmod -a

Use v4l2loopback

git clone git://linuxtv.org/libcamera.git
sudo modprobe v4l2loopback video_nr=3
cd libcamera  # Installation using deb does not need to be executed
export GST_PLUGIN_PATH=$(pwd)/build/src/gstreamer # Installation using deb does not need to be executed
gst-launch-1.0 libcamerasrc ! 'video/x-raw,width=1920,height=1080' ! videoconvert ! tee ! v4l2sink device=/dev/video3

I was able to create the v4l2loopback in one thread and use the camera in another thread with opencv

import cv2
cap = cv2.VideoCapture(3)
while True:
	ret, frame = cap.read()
	cv2.imshow("Arducam", frame)
	key = cv2.waitKey(1)
	if key == ord('q'):
		break

That leads me into a good direction for my project… as I reached one of the points, I then have probably simple questions…
1- With this setup, it seems that either python libcamera 1.0.2 or opencv have no autofocus enabled… is that correct ? Can it be fixed with somethign I missed ?
2- When to use or, what is the goal of enabling dtoverlay=arducam (when disabling imx519 in /boot/config.txt) ?
3- Looks like I need to learn more about the v4l2 to use it better in my python camera app … this is another topic :smiley:

Thanks

There doesn’t seem to be a good way at the moment, libcamera gstreamer doesn’t have any controls to set, and no controls can be set when working with v4l2loopback.
To achieve this goal requires a lot of modification.

dtoverlay will choose to load different drivers. For arducam, it loads the Pivariety driver, which is not suitable for imx519, so you need to increase dtoverlay=imx519 to load the imx519 driver.

That explains a lot. Thank you Wong

Is there a way to say, set the focus manualy to a value that would make it the same, that could be relaunched at boot … prior to running libcamera from python for instance?

try:

v4l2-ctl -c focus_absolute=300 -d /dev/v4l-subdev1
1 Like

So, turns out that it makes no sense to use the rpi-source script - installing the “raspberrypi-kernel-headers” instead works

@surak
We have a version that works.We are using the 2022-01-28 version,we have not adapted to the latest version.

Below is an example I wrote.

How to use?

You need to get your hash first.

cd /usr/share/doc/raspberrypi-bootloader/
sudo gzip -df changelog.Debian.gz
sudo cat changelog.Debian | head -n 10 

image

# Do not copy, fill in according to your own system
# --disablecrosscompile : use in raspberrypi
# -p you raspberrypi version
# -b bit of your  raspberrypi,like 32 or 64
# --hash First step you earn 
# example:
python3 setup_rpi_source.py --disablecrosscompile 1 -p Pi4 -b 32 --hash 1e138de65a13c28c04fa4abf37f4c21e231e41b7

Then,

Compile driver
git clone https://github.com/umlaeute/v4l2loopback.git
cd v4l2loopback
make clean && make
make && sudo make install
sudo depmod -a

Use v4l2loopback

git clone git://linuxtv.org/libcamera.git
sudo modprobe v4l2loopback video_nr=3
cd libcamera  # Installation using deb does not need to be executed
export GST_PLUGIN_PATH=$(pwd)/build/src/gstreamer # Installation using deb does not need to be executed
gst-launch-1.0 libcamerasrc ! 'video/x-raw,width=1920,height=1080' ! videoconvert ! tee ! v4l2sink device=/dev/video3

I was able to create the v4l2loopback in one thread and use the camera in another thread with opencv

import cv2
cap = cv2.VideoCapture(3)
while True:
	ret, frame = cap.read()
	cv2.imshow("Arducam", frame)
	key = cv2.waitKey(1)
	if key == ord('q'):
		break

I have some questions:

  1. how do I know which one I am running? It seems like you picked up the second from your list, but I don’t know which one is right for me

  2. don’t we have a raspberrypi-kernel-headers package with the right kernel being used at the moment, or am I missing something here?

  3. I am using the 64 bit version of the OS. Does it work there?

Meanwhile, I am trying your method, and I get:

raspberrypi-firmware (1:1.20220331-1) bullseye; urgency=medium

  * firmware as of 61966732d03de9b71baf561f920e018b54c241ac
  * Linux version 5.15.32

 -- Serge Schneider <[email protected]>  Fri, 01 Apr 2022 07:57:07 +0100

raspberrypi-firmware (1:1.20220328-1) bullseye; urgency=medium

  * firmware as of 69277bc713133a54a1d20554d79544da1ae2b6ca

Everything seems to go on well, the module loads fine. But then I try to run, and I get this

gst-launch-1.0 libcamerasrc ! 'video/x-raw,width=1920,height=1080' ! videoconvert ! tee ! v4l2sink device=/dev/video3
Setting pipeline to PAUSED ...
[27:10:11.700063089] [35176] ERROR IPAModule ipa_module.cpp:286 ipa_rpi.so: IPA module is not an ELF file
[27:10:11.700239111] [35176]  WARN IPAManager ipa_manager.cpp:149 No IPA found in '/usr/local/lib/aarch64-linux-gnu/libcamera'
[27:10:11.700462967] [35176]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3667-1c9dc0fd
[27:10:11.707141062] [35179]  WARN CameraSensorProperties camera_sensor_properties.cpp:174 No static properties available for 'imx519'
[27:10:11.707510087] [35179]  WARN CameraSensorProperties camera_sensor_properties.cpp:176 Please consider updating the camera sensor properties database
[27:10:11.707931446] [35179] ERROR RPI raspberrypi.cpp:1236 Failed to load a suitable IPA library
[27:10:11.708544883] [35179] ERROR RPI raspberrypi.cpp:1167 Failed to register camera imx519 10-001a: -22
ERROR: from element /GstPipeline:pipeline0/GstLibcameraSrc:libcamerasrc0: Could not find any supported camera on this system.
Additional debug info:
../src/gstreamer/gstlibcamerasrc.cpp(232): gst_libcamera_src_open (): /GstPipeline:pipeline0/GstLibcameraSrc:libcamerasrc0:
libcamera::CameraMananger::cameras() is empty
ERROR: pipeline doesn't want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...

I see this on dmesg:

[    6.398965] imx519 0-001a: failed to read chip id 519, with error -5
[97758.650312] v4l2loopback: loading out-of-tree module taints kernel.
[97758.653730] v4l2loopback driver version 0.12.5 (v0.12.5-260-g56cca90) loaded

I don’t know what I am doing wrong anymore.

@surak
Are you using a pi3?

No, a pi4 8gb. I need a 64bit system for pytorch.

This is really lacking.

I downloaded this old version of raspbian, and started doing it. Obviously I need more than that. For a start, flex and bison and openssl-dev, which are not on the system by default.

Will we be ever able to simply use these cameras? I’m not by far a beginner, but this is driving me mad.

@surak

okey , i’m sorry to hear it’s still doesn’t work now.
if you just want to let camera drawing.The link below is very easy.

At present, the Raspberry Pi has fully used the libcamera camera stack and framework. If you just want to use v4l2loopback:

  1. it’s not easy and we no longer maintain.
  2. But i can make an image of the installed environment for you.
  3. you can try picamera2 https://github.com/raspberrypi/picamera2

hope this will help you.

Your solution writes -b 32, which I didn’t notice - and I mentioned I was using a 64-bit kernel.

Those missing functions are related to that.

The post here: https://github.com/aircrack-ng/rtl8812au/issues/933#issuecomment-1105499408 helped me see that.

v4l2loopback compiles cleanly when using the -b 64. Thanks.

So, from zero to running it in opencv:

First: Download this version of Raspbian and DO NOT UPDATE THE KERNEL: https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2022-01-28/2022-01-28-raspios-bullseye-arm64.zip

sudo apt install openssl-dev \
     flex \
     bison \
     libgstreamer1.0-dev \
     libgstreamer-plugins-base1.0-dev \
     libgstreamer-plugins-bad1.0-dev \
     gstreamer1.0-plugins-ugly \
     gstreamer1.0-tools \
     gstreamer1.0-gl \
     gstreamer1.0-gtk3 

wget -O install_pivariety_pkgs.sh https://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver/releases/download/install_script/install_pivariety_pkgs.sh
chmod +x install_pivariety_pkgs.sh
./install_pivariety_pkgs.sh -p libcamera_dev
./install_pivariety_pkgs.sh -p libcamera_apps
./install_pivariety_pkgs.sh -p imx519_kernel_driver

Here it will reboot.

After reboot,

git clone https://github.com/umlaeute/v4l2loopback.git # I am using the tag 0.12.5
cd v4l2loopback
make clean && make
make && sudo make install
sudo depmod -a

cd

git clone git://linuxtv.org/libcamera.git
sudo modprobe v4l2loopback video_nr=3
cd libcamera  # Installation using deb does not need to be executed
export GST_PLUGIN_PATH=$(pwd)/build/src/gstreamer # Installation using deb does not need to be executed
gst-launch-1.0 libcamerasrc ! 'video/x-raw,width=1920,height=1080' ! videoconvert ! tee ! v4l2sink device=/dev/video3

This will be running on a window. You need a second terminal to do something else.

For python:

cd
python3 -m venv py3-cv2
source py3-cv2/bin/activate
pip install opencv-contrib-python

For every python code one should activate the previous virtual environment with a source ~/py3-cv2/bin/activate, so the opencv is found. I prefer to not install random stuff on .local.

This is what worked for me from scratch to having the camera running as I need on Raspbian 64… THANKS A LOT!!!

@surak
Thanks for sharing, I think this is a great write up and I’m sure it will help more people.