raspberrypi / rpicam-apps

BSD 2-Clause "Simplified" License
389 stars 212 forks source link

[BUG] libcamera apps cannot detect camera(imx219) when running in a docker container using balenaOS #270

Closed rahul-thakoor closed 2 years ago

rahul-thakoor commented 2 years ago

Describe the bug Any utility in libcamera-apps is not able to detect the camera. All exit with

INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3406-e96d0201
No cameras available!

Here is the config.txt content:

camera_auto_detect=1
dtoverlay=vc4-kms-v3d,cma-512
gpu_mem=256
disable_touchscreen=1
max_framebuffers=2
avoid_warnings=1
disable_splash=1
dtparam=i2c_arm=on
dtparam=spi=on
dtparam=audio=on

I have tried several configs, e.g

camera_auto_detect=0
dtoverlay=vc4-kms-v3d
max_framebuffers=2
dtoverlay=imx219

Bug report

--------------------------------------------------------------------------------
libcamera-apps Bug Report
--------------------------------------------------------------------------------
Date: 03-03-2022 (17:33:51)
Command: /usr/bin/camera-bug-report -t 10 -o bug.txt -c libcamera-hello --list-cameras

--------------------------------------------------------------------------------
Hardware information
--------------------------------------------------------------------------------
** hostname **
271fb53dbf73

** cat /proc/cpuinfo **
processor       : 0
BogoMIPS        : 108.00
Features        : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd08
CPU revision    : 3

processor       : 1
BogoMIPS        : 108.00
Features        : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd08
CPU revision    : 3

processor       : 2
BogoMIPS        : 108.00
Features        : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd08
CPU revision    : 3

processor       : 3
BogoMIPS        : 108.00
Features        : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd08
CPU revision    : 3

Hardware        : BCM2835
Revision        : c03111
Serial          : 10000000f7fb0057
Model           : Raspberry Pi 4 Model B Rev 1.1

--------------------------------------------------------------------------------
Configuration
--------------------------------------------------------------------------------
** cat /boot/cmdline.txt **
cat: /boot/cmdline.txt: No such file or directory

** cat /boot/config.txt **
cat: /boot/config.txt: No such file or directory

--------------------------------------------------------------------------------
Logs
--------------------------------------------------------------------------------
** dmesg **
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]
[    0.000000] Linux version 5.10.95-v8 (oe-user@oe-host) (aarch64-poky-linux-gcc (GCC) 11.2.0, GNU ld (GNU Binutils) 2.37.20210721) #1 SMP PREEMPT Thu Feb 17 11:43:01 UTC 2022
[    0.000000] random: fast init done
[    0.000000] Machine model: Raspberry Pi 4 Model B Rev 1.1
[    0.000000] efi: UEFI not found.
[    0.000000] Reserved memory: created CMA memory pool at 0x000000000ec00000, size 512 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000000000-0x000000003fffffff]
[    0.000000]   DMA32    [mem 0x0000000040000000-0x00000000fbffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000002fffffff]
[    0.000000]   node   0: [mem 0x0000000040000000-0x00000000fbffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x00000000fbffffff]
[    0.000000] On node 0 totalpages: 966656
[    0.000000]   DMA zone: 3072 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 196608 pages, LIFO batch:63
[    0.000000]   DMA32 zone: 12032 pages used for memmap
[    0.000000]   DMA32 zone: 770048 pages, LIFO batch:63
[    0.000000] percpu: Embedded 32 pages/cpu s92376 r8192 d30504 u131072
[    0.000000] pcpu-alloc: s92376 r8192 d30504 u131072 alloc=32*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Detected PIPT I-cache on CPU0
[    0.000000] CPU features: detected: Spectre-v2
[    0.000000] CPU features: detected: Spectre-v4
[    0.000000] CPU features: detected: ARM errata 1165522, 1319367, or 1530923
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 951552
[    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1  smsc95xx.macaddr=DC:A6:32:28:31:95 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 rootfstype=ext4 rootwait dwc_otg.lpm_enable=0 rootwait vt.global_cursor_default=0 console=null cgroup_enable=memory root=UUID=ba1eadef-26d3-4e6a-a44f-4d2b5339b45b rootwait
[    0.000000] cgroup: Enabling memory control group subsystem
[    0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
[    0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] software IO TLB: mapped [mem 0x000000000ac00000-0x000000000ec00000] (64MB)
[    0.000000] Memory: 3162800K/3866624K available (11392K kernel code, 2022K rwdata, 4460K rodata, 14208K init, 1284K bss, 179536K reserved, 524288K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 44248 entries in 173 pages
[    0.000000] ftrace: allocated 173 pages with 5 groups
[    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] GIC: Using split EOI/Deactivate mode
[    0.000000] irq_brcmstb_l2: registered L2 intc (/soc/interrupt-controller@7ef00100, parent irq: 10)
[    0.000000] random: get_random_bytes called from start_kernel+0x3a4/0x570 with crng_init=1
[    0.000000] arch_timer: cp15 timer(s) running at 54.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xc743ce346, max_idle_ns: 440795203123 ns
[    0.000007] sched_clock: 56 bits at 54MHz, resolution 18ns, wraps every 4398046511102ns
[    0.000321] Console: colour dummy device 80x25
[    0.000395] Calibrating delay loop (skipped), value calculated using timer frequency.. 108.00 BogoMIPS (lpj=216000)
[    0.000433] pid_max: default: 32768 minimum: 301
[    0.000627] LSM: Security Framework initializing
[    0.000910] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.000982] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.004999] rcu: Hierarchical SRCU implementation.
[    0.006301] EFI services will not be available.
[    0.006931] smp: Bringing up secondary CPUs ...
[    0.008317] Detected PIPT I-cache on CPU1
[    0.008406] CPU1: Booted secondary processor 0x0000000001 [0x410fd083]
[    0.009838] Detected PIPT I-cache on CPU2
[    0.009903] CPU2: Booted secondary processor 0x0000000002 [0x410fd083]
[    0.011334] Detected PIPT I-cache on CPU3
[    0.011396] CPU3: Booted secondary processor 0x0000000003 [0x410fd083]
[    0.011633] smp: Brought up 1 node, 4 CPUs
[    0.011689] SMP: Total of 4 processors activated.
[    0.011711] CPU features: detected: 32-bit EL0 Support
[    0.011731] CPU features: detected: CRC32 instructions
[    0.011752] CPU features: detected: 32-bit EL1 Support
[    0.016561] CPU: All CPU(s) started at EL2
[    0.016641] alternatives: patching kernel code
[    0.018315] devtmpfs: initialized
[    0.034641] Enabled cp15_barrier support
[    0.034693] Enabled setend support
[    0.035133] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.035173] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.053328] pinctrl core: initialized pinctrl subsystem
[    0.054299] DMI not present or invalid.
[    0.054745] NET: Registered protocol family 16
[    0.058744] DMA: preallocated 1024 KiB GFP_KERNEL pool for atomic allocations
[    0.059058] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.060152] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.060298] audit: initializing netlink subsys (disabled)
[    0.060749] audit: type=2000 audit(0.060:1): state=initialized audit_enabled=0 res=1
[    0.061477] thermal_sys: Registered thermal governor 'step_wise'
[    0.062064] cpuidle: using governor menu
[    0.062584] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.062831] ASID allocator initialised with 65536 entries
[    0.063001] Serial: AMBA PL011 UART driver
[    0.114667] bcm2835-mbox fe00b880.mailbox: mailbox enabled
[    0.120628] raspberrypi-firmware soc:firmware: Attached to firmware from 2022-01-20T13:56:48, variant start
[    0.124645] raspberrypi-firmware soc:firmware: Firmware hash is bd88f66f8952d34e4e0613a85c7a6d3da49e13e2
[    0.173597] bcm2835-dma fe007000.dma: DMA legacy API manager, dmachans=0x1
[    0.179304] vgaarb: loaded
[    0.179878] SCSI subsystem initialized
[    0.180163] usbcore: registered new interface driver usbfs
[    0.180241] usbcore: registered new interface driver hub
[    0.180329] usbcore: registered new device driver usb
[    0.180782] usb_phy_generic phy: supply vcc not found, using dummy regulator
[    0.182135] Advanced Linux Sound Architecture Driver Initialized.
[    0.183701] clocksource: Switched to clocksource arch_sys_counter
[    1.604091] VFS: Disk quotas dquot_6.6.0
[    1.604237] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    1.604431] FS-Cache: Loaded
[    1.604742] CacheFiles: Loaded
[    1.620116] NET: Registered protocol family 2
[    1.620679] IP idents hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    1.624356] tcp_listen_portaddr_hash hash table entries: 2048 (order: 3, 32768 bytes, linear)
[    1.624431] TCP established hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    1.624798] TCP bind hash table entries: 32768 (order: 7, 524288 bytes, linear)
[    1.625295] TCP: Hash tables configured (established 32768 bind 32768)
[    1.625591] UDP hash table entries: 2048 (order: 4, 65536 bytes, linear)
[    1.625676] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes, linear)
[    1.626009] NET: Registered protocol family 1
[    1.627155] RPC: Registered named UNIX socket transport module.
[    1.627178] RPC: Registered udp transport module.
[    1.627196] RPC: Registered tcp transport module.
[    1.627214] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.627244] PCI: CLS 0 bytes, default 64
[    1.738519] hw perfevents: enabled with armv8_cortex_a72 PMU driver, 7 counters available
[    1.738877] kvm [1]: IPA Size Limit: 44 bits
[    1.740401] kvm [1]: vgic interrupt IRQ9
[    1.740741] kvm [1]: Hyp mode initialized successfully
[    1.744312] Initialise system trusted keyrings
[    1.744727] workingset: timestamp_bits=46 max_order=20 bucket_order=0
[    1.753887] zbud: loaded
[    1.756118] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    1.756491] FS-Cache: Netfs 'nfs' registered for caching
[    1.757368] NFS: Registering the id_resolver key type
[    1.757417] Key type id_resolver registered
[    1.757437] Key type id_legacy registered
[    1.757602] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.757625] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    1.759198] Key type asymmetric registered
[    1.759223] Asymmetric key parser 'x509' registered
[    1.759288] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 248)
[    1.759629] io scheduler mq-deadline registered
[    1.759651] io scheduler kyber registered
[    1.765089] brcm-pcie fd500000.pcie: host bridge /scb/pcie@7d500000 ranges:
[    1.765132] brcm-pcie fd500000.pcie:   No bus range found for /scb/pcie@7d500000, using [bus 00-ff]
[    1.765216] brcm-pcie fd500000.pcie:      MEM 0x0600000000..0x063fffffff -> 0x00c0000000
[    1.765310] brcm-pcie fd500000.pcie:   IB MEM 0x0000000000..0x00bfffffff -> 0x0400000000
[    1.813825] brcm-pcie fd500000.pcie: link up, 5.0 GT/s PCIe x1 (SSC)
[    1.814287] brcm-pcie fd500000.pcie: PCI host bridge to bus 0000:00
[    1.814316] pci_bus 0000:00: root bus resource [bus 00-ff]
[    1.814354] pci_bus 0000:00: root bus resource [mem 0x600000000-0x63fffffff] (bus address [0xc0000000-0xffffffff])
[    1.814455] pci 0000:00:00.0: [14e4:2711] type 01 class 0x060400
[    1.814719] pci 0000:00:00.0: PME# supported from D0 D3hot
[    1.819140] pci 0000:01:00.0: [1106:3483] type 00 class 0x0c0330
[    1.819274] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x00000fff 64bit]
[    1.819825] pci 0000:01:00.0: PME# supported from D0 D3cold
[    1.835313] pci 0000:00:00.0: BAR 8: assigned [mem 0x600000000-0x6000fffff]
[    1.835347] pci 0000:01:00.0: BAR 0: assigned [mem 0x600000000-0x600000fff 64bit]
[    1.835394] pci 0000:00:00.0: PCI bridge to [bus 01]
[    1.835425] pci 0000:00:00.0:   bridge window [mem 0x600000000-0x6000fffff]
[    1.846523] iproc-rng200 fe104000.rng: hwrng registered
[    1.847014] vc-mem: phys_addr:0x00000000 mem_base=0x3ec00000 mem_size:0x40000000(1024 MiB)
[    1.848832] gpiomem-bcm2835 fe200000.gpiomem: Initialised: Registers at 0xfe200000
[    1.862242] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
[    1.863339] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    1.878485] brd: module loaded
[    1.893664] loop: module loaded
[    1.894429] zram: Added device: zram0
[    1.896669] Loading iSCSI transport class v2.0-870.
[    1.902611] tun: Universal TUN/TAP device driver, 1.6
[    1.903737] bcmgenet fd580000.ethernet: GENET 5.0 EPHY: 0x0000
[    1.967904] unimac-mdio unimac-mdio.-19: Broadcom UniMAC MDIO bus
[    1.970966] pci 0000:00:00.0: enabling device (0000 -> 0002)
[    1.971013] xhci_hcd 0000:01:00.0: enabling device (0000 -> 0002)
[    1.971145] xhci_hcd 0000:01:00.0: xHCI Host Controller
[    1.971192] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 1
[    1.972099] xhci_hcd 0000:01:00.0: hcc params 0x002841eb hci version 0x100 quirks 0x00001e0000000890
[    1.973230] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
[    1.973256] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.973278] usb usb1: Product: xHCI Host Controller
[    1.973298] usb usb1: Manufacturer: Linux 5.10.95-v8 xhci-hcd
[    1.973318] usb usb1: SerialNumber: 0000:01:00.0
[    1.974205] hub 1-0:1.0: USB hub found
[    1.974329] hub 1-0:1.0: 1 port detected
[    1.975261] xhci_hcd 0000:01:00.0: xHCI Host Controller
[    1.975302] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 2
[    1.975349] xhci_hcd 0000:01:00.0: Host supports USB 3.0 SuperSpeed
[    1.976023] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.10
[    1.976048] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.976068] usb usb2: Product: xHCI Host Controller
[    1.976088] usb usb2: Manufacturer: Linux 5.10.95-v8 xhci-hcd
[    1.976107] usb usb2: SerialNumber: 0000:01:00.0
[    1.976980] hub 2-0:1.0: USB hub found
[    1.977092] hub 2-0:1.0: 4 ports detected
[    1.979182] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    1.979576] dwc_otg: FIQ enabled
[    1.979590] dwc_otg: NAK holdoff enabled
[    1.979603] dwc_otg: FIQ split-transaction FSM enabled
[    1.979620] Module dwc_common_port init
[    1.980328] usbcore: registered new interface driver uas
[    1.980472] usbcore: registered new interface driver usb-storage
[    1.980610] usbcore: registered new interface driver usbserial_generic
[    1.980660] usbserial: USB Serial support registered for generic
[    1.980932] mousedev: PS/2 mouse device common for all mice
[    1.984664] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer
[    1.988596] sdhci: Secure Digital Host Controller Interface driver
[    1.988619] sdhci: Copyright(c) Pierre Ossman
[    1.989603] mmc-bcm2835 fe300000.mmcnr: could not get clk, deferring probe
[    1.991439] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.993767] ledtrig-cpu: registered to indicate activity on CPUs
[    1.993972] hid: raw HID events driver (C) Jiri Kosina
[    1.994071] usbcore: registered new interface driver usbhid
[    1.994079] usbhid: USB HID core driver
[    1.994293] ashmem: initialized
[    2.000911] IPVS: Registered protocols (TCP, UDP, SCTP, AH, ESP)
[    2.000960] IPVS: Connection hash table configured (size=4096, memory=64Kbytes)
[    2.001326] IPVS: ipvs loaded.
[    2.001656] Initializing XFRM netlink socket
[    2.002107] NET: Registered protocol family 10
[    2.003026] Segment Routing with IPv6
[    2.003112] NET: Registered protocol family 17
[    2.003154] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    2.003231] Key type dns_resolver registered
[    2.003785] registered taskstats version 1
[    2.003808] Loading compiled-in X.509 certificates
[    2.004141] Key type ._fscrypt registered
[    2.004152] Key type .fscrypt registered
[    2.004162] Key type fscrypt-provisioning registered
[    2.013404] uart-pl011 fe201000.serial: there is not valid maps for state default
[    2.013601] uart-pl011 fe201000.serial: cts_event_workaround enabled
[    2.013680] fe201000.serial: ttyAMA0 at MMIO 0xfe201000 (irq = 23, base_baud = 0) is a PL011 rev2
[    2.028215] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
[    2.029098] bcm2835-power bcm2835-power: Broadcom BCM2835 power domains driver
[    2.032309] mmc-bcm2835 fe300000.mmcnr: mmc_debug:0 mmc_debug2:0
[    2.032330] mmc-bcm2835 fe300000.mmcnr: DMA channel allocated
[    2.063773] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
[    2.073945] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
[    2.075840] of_cfs_init
[    2.075917] of_cfs_init: OK
[    2.084709] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[    2.086327] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    2.087943] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    2.090867] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[    2.092527] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    2.096436] mmc0: SDHCI controller on fe340000.mmc [fe340000.mmc] using ADMA
[    2.097627] ALSA device list:
[    2.097647]   No soundcards found.
[    2.097737] Warning: unable to open an initial console.
[    2.104706] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
[    2.117554] Freeing unused kernel memory: 14208K
[    2.119820] Run /init as init process
[    2.119830]   with arguments:
[    2.119835]     /init
[    2.119840]   with environment:
[    2.119846]     HOME=/
[    2.119850]     TERM=linux
[    2.159776] mmc1: new high speed SDIO card at address 0001
[    2.199051] mmc0: new ultra high speed DDR50 SDHC card at address aaaa
[    2.199783] mmcblk0: mmc0:aaaa SE32G 29.7 GiB
[    2.202610]  mmcblk0: p1 p2 p3 p4 < p5 p6 >
[    2.206844] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
[    2.231750] usb 1-1: new high-speed USB device number 2 using xhci_hcd
[    2.382393] usb 1-1: New USB device found, idVendor=2109, idProduct=3431, bcdDevice= 4.21
[    2.382413] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    2.382425] usb 1-1: Product: USB2.0 Hub
[    2.384204] hub 1-1:1.0: USB hub found
[    2.384489] hub 1-1:1.0: 4 ports detected
[    2.396807] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
[    2.814932] zram0: detected capacity change from 0 to 1895063552
[    3.979313] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    4.009195] EXT4-fs (mmcblk0p5): mounted filesystem with ordered data mode. Opts: (null)
[    4.412168] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    4.478033] EXT4-fs (mmcblk0p6): mounted filesystem with ordered data mode. Opts: (null)
[    4.741225] systemd[1]: System time before build time, advancing clock.
[    5.070336] systemd[1]: /lib/systemd/system/balena-host.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/balena-host.sock → /run/balena-host.sock; please update the unit file accordingly.
[    5.090453] systemd[1]: /lib/systemd/system/balena-engine.socket:6: ListenStream= references a path below legacy directory /var/run/, updating /var/run/balena-engine.sock → /run/balena-engine.sock; please update the unit file accordingly.
[    5.249504] systemd[1]: /lib/systemd/system/plymouth-start.service:17: Unit configured to use KillMode=none. This is unsafe, as it disables systemd's process lifecycle management for the service. Please update your service to use a safer KillMode=, such as 'mixed' or 'control-group'. Support for KillMode=none is deprecated and will eventually be removed.
[    5.285236] random: systemd: uninitialized urandom read (16 bytes read)
[    5.322128] random: systemd: uninitialized urandom read (16 bytes read)
[    5.323972] random: systemd: uninitialized urandom read (16 bytes read)
[    5.411856] fuse: init (API version 7.32)
[    6.487808] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
[    6.519062] rpivid-mem feb00000.hevc-decoder: rpivid-hevcmem initialised: Registers at 0xfeb00000 length 0x00010000
[    6.521695] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
[    6.522530] rpivid-mem feb10000.rpivid-local-intc: rpivid-intcmem initialised: Registers at 0xfeb10000 length 0x00001000
[    6.525043] rpivid-mem feb20000.h264-decoder: rpivid-h264mem initialised: Registers at 0xfeb20000 length 0x00010000
[    6.525367] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
[    6.525497] rpivid-mem feb30000.vp9-decoder: rpivid-vp9mem initialised: Registers at 0xfeb30000 length 0x00010000
[    6.528422] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
[    6.574894] vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned.
[    6.580216] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned.
[    6.582714] bcm2835_vc_sm_cma_probe: Videocore shared memory driver
[    6.582729] [vc_sm_connected_init]: start
[    6.583208] [vc_sm_connected_init]: installed successfully
[    6.585928] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
[    6.587540] mc: Linux media interface: v0.10
[    6.589504] bcm2835_audio bcm2835_audio: card created with 8 channels
[    6.592671] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
[    6.606895] videodev: Linux video capture interface: v2.00
[    6.645830] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
[    6.650307] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[    6.651493] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[    6.659156] bcm2835_codec: module is from the staging directory, the quality is unknown, you have been warned.
[    6.663194] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.
[    6.667618] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
[    6.668525] bcm2835_isp: module is from the staging directory, the quality is unknown, you have been warned.
[    6.676871] bcm2835-isp bcm2835-isp: Device node output[0] registered as /dev/video13
[    6.677182] bcm2835-isp bcm2835-isp: Device node capture[0] registered as /dev/video14
[    6.677426] bcm2835-isp bcm2835-isp: Device node capture[1] registered as /dev/video15
[    6.677607] bcm2835-isp bcm2835-isp: Device node stats[2] registered as /dev/video16
[    6.677635] bcm2835-isp bcm2835-isp: Register output node 0 with media controller
[    6.677649] bcm2835-isp bcm2835-isp: Register capture node 1 with media controller
[    6.677658] bcm2835-isp bcm2835-isp: Register capture node 2 with media controller
[    6.677668] bcm2835-isp bcm2835-isp: Register capture node 3 with media controller
[    6.678043] bcm2835-codec bcm2835-codec: Device registered as /dev/video10
[    6.678071] bcm2835-codec bcm2835-codec: Loaded V4L2 decode
[    6.684555] brcmstb-i2c fef04500.i2c:  @97500hz registered in polling mode
[    6.688105] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops)
[    6.689355] brcmstb-i2c fef09500.i2c:  @97500hz registered in polling mode
[    6.695315] bcm2835-isp bcm2835-isp: Device node output[0] registered as /dev/video20
[    6.696278] bcm2835-isp bcm2835-isp: Device node capture[0] registered as /dev/video21
[    6.697096] bcm2835-isp bcm2835-isp: Device node capture[1] registered as /dev/video22
[    6.697465] bcm2835-codec bcm2835-codec: Device registered as /dev/video11
[    6.697498] bcm2835-codec bcm2835-codec: Loaded V4L2 encode
[    6.697543] bcm2835-isp bcm2835-isp: Device node stats[2] registered as /dev/video23
[    6.697561] bcm2835-isp bcm2835-isp: Register output node 0 with media controller
[    6.697574] bcm2835-isp bcm2835-isp: Register capture node 1 with media controller
[    6.697584] bcm2835-isp bcm2835-isp: Register capture node 2 with media controller
[    6.697594] bcm2835-isp bcm2835-isp: Register capture node 3 with media controller
[    6.697918] bcm2835-isp bcm2835-isp: Loaded V4L2 bcm2835-isp
[    6.702429] Registered IR keymap rc-cec
[    6.702599] rc rc0: vc4 as /devices/platform/soc/fef00700.hdmi/rc/rc0
[    6.702812] input: vc4 as /devices/platform/soc/fef00700.hdmi/rc/rc0/input0
[    6.705274] bcm2835-codec bcm2835-codec: Device registered as /dev/video12
[    6.705304] bcm2835-codec bcm2835-codec: Loaded V4L2 isp
[    6.707815] vc4-drm gpu: bound fef00700.hdmi (ops vc4_hdmi_ops)
[    6.719643] i2c i2c-22: Added multiplexed i2c bus 0
[    6.720414] i2c i2c-22: Added multiplexed i2c bus 10
[    6.720773] bcm2835-codec bcm2835-codec: Device registered as /dev/video18
[    6.720802] bcm2835-codec bcm2835-codec: Loaded V4L2 image_fx
[    6.723855] Registered IR keymap rc-cec
[    6.724046] rc rc1: vc4 as /devices/platform/soc/fef05700.hdmi/rc/rc1
[    6.724273] input: vc4 as /devices/platform/soc/fef05700.hdmi/rc/rc1/input1
[    6.728995] vc4-drm gpu: bound fef05700.hdmi (ops vc4_hdmi_ops)
[    6.729198] vc4-drm gpu: bound fe004000.txp (ops vc4_txp_ops)
[    6.729353] vc4-drm gpu: bound fe206000.pixelvalve (ops vc4_crtc_ops)
[    6.729475] vc4-drm gpu: bound fe207000.pixelvalve (ops vc4_crtc_ops)
[    6.729603] vc4-drm gpu: bound fe20a000.pixelvalve (ops vc4_crtc_ops)
[    6.729698] vc4-drm gpu: bound fe216000.pixelvalve (ops vc4_crtc_ops)
[    6.729818] vc4-drm gpu: bound fec12000.pixelvalve (ops vc4_crtc_ops)
[    6.737266] [drm] Initialized vc4 0.0.0 20140616 for gpu on minor 0
[    6.737422] vc4-drm gpu: [drm] Cannot find any crtc or sizes
[    6.778932] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    6.786181] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    6.832063] [drm] Initialized v3d 1.0.0 20180419 for fec00000.v3d on minor 1
[    6.836071] brcmfmac: F1 signature read @0x18000000=0x15264345
[    6.855217] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    6.857496] usbcore: registered new interface driver brcmfmac
[    6.879193] zram: Can't change algorithm for initialized device
[    7.083566] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    7.083762] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    7.093419] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Jan  4 2021 19:56:29 version 7.45.229 (617f1f5 CY) FWID 01-2dbd9d2e
[    7.208987] imx219 10-0010: Consider updating driver imx219 to match on endpoints
[    7.567773] random: crng init done
[    7.567791] random: 7 urandom warning(s) missed due to ratelimiting
[    7.759888] Adding 1850644k swap on /dev/zram0.  Priority:-2 extents:1 across:1850644k SSFS
[    8.049022] uart-pl011 fe201000.serial: no DMA platform data
[    9.780903] i2c /dev entries driver
[   10.874659] bcmgenet fd580000.ethernet: configuring instance for external RGMII (RX delay)
[   10.880499] bcmgenet fd580000.ethernet eth0: Link is Down
[   10.935504] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save disabled
[   11.462050] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save disabled
[   12.595107] Bridge firewalling registered
[   14.799563] Bluetooth: Core ver 2.22
[   14.800327] NET: Registered protocol family 31
[   14.800343] Bluetooth: HCI device and connection manager initialized
[   14.800368] Bluetooth: HCI socket layer initialized
[   14.800380] Bluetooth: L2CAP socket layer initialized
[   14.800414] Bluetooth: SCO socket layer initialized
[   14.810614] Bluetooth: HCI UART driver ver 2.3
[   14.810629] Bluetooth: HCI UART protocol H4 registered
[   14.810728] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   14.810974] Bluetooth: HCI UART protocol Broadcom registered
[   14.824377] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save disabled
[   15.160397] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   15.160411] Bluetooth: BNEP filters: protocol multicast
[   15.160432] Bluetooth: BNEP socket layer initialized
[   15.183482] NET: Registered protocol family 38
[   15.402862] br-8e87b4c9b0ad: port 1(veth726df25) entered blocking state
[   15.402876] br-8e87b4c9b0ad: port 1(veth726df25) entered disabled state
[   15.403122] device veth726df25 entered promiscuous mode
[   15.435280] br-8e87b4c9b0ad: port 2(vethe0089d8) entered blocking state
[   15.435297] br-8e87b4c9b0ad: port 2(vethe0089d8) entered disabled state
[   15.435579] device vethe0089d8 entered promiscuous mode
[   15.436837] br-8e87b4c9b0ad: port 2(vethe0089d8) entered blocking state
[   15.436855] br-8e87b4c9b0ad: port 2(vethe0089d8) entered forwarding state
[   15.437151] br-8e87b4c9b0ad: port 2(vethe0089d8) entered disabled state
[   16.674784] cgroup: cgroup: disabling cgroup2 socket matching due to net_prio or net_cls activation
[   18.280756] eth0: renamed from veth523aa4d
[   18.308970] IPv6: ADDRCONF(NETDEV_CHANGE): veth726df25: link becomes ready
[   18.309122] br-8e87b4c9b0ad: port 1(veth726df25) entered blocking state
[   18.309132] br-8e87b4c9b0ad: port 1(veth726df25) entered forwarding state
[   18.309300] IPv6: ADDRCONF(NETDEV_CHANGE): br-8e87b4c9b0ad: link becomes ready
[   18.392260] eth0: renamed from vethbc6bd2a
[   18.432125] IPv6: ADDRCONF(NETDEV_CHANGE): vethe0089d8: link becomes ready
[   18.432267] br-8e87b4c9b0ad: port 2(vethe0089d8) entered blocking state
[   18.432278] br-8e87b4c9b0ad: port 2(vethe0089d8) entered forwarding state
[   20.266045] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   31.999615] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
[   33.760144] cam-dummy-reg: disabling
[   33.760163] cam1-reg: disabling

** sudo vcdbg log msg **
sudo: vcdbg: command not found

** sudo vcdbg log assert **
sudo: vcdbg: command not found

** sudo vcdbg log ex **
sudo: vcdbg: command not found

--------------------------------------------------------------------------------
Memory
--------------------------------------------------------------------------------
** cat /proc/meminfo **
MemTotal:        3701296 kB
MemFree:         3068480 kB
MemAvailable:    3403428 kB
Buffers:           19608 kB
Cached:           317736 kB
SwapCached:            0 kB
Active:           124800 kB
Inactive:         384912 kB
Active(anon):        940 kB
Inactive(anon):   156908 kB
Active(file):     123860 kB
Inactive(file):   228004 kB
Unevictable:        3156 kB
Mlocked:               0 kB
SwapTotal:       1850644 kB
SwapFree:        1850644 kB
Dirty:                 4 kB
Writeback:             0 kB
AnonPages:        175692 kB
Mapped:           146188 kB
Shmem:              8644 kB
KReclaimable:      34148 kB
Slab:              69272 kB
SReclaimable:      34148 kB
SUnreclaim:        35124 kB
KernelStack:        4576 kB
PageTables:         4720 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     3701292 kB
Committed_AS:    1712312 kB
VmallocTotal:   262930368 kB
VmallocUsed:       18648 kB
VmallocChunk:          0 kB
Percpu:             2032 kB
CmaTotal:         524288 kB
CmaFree:          510100 kB

** sudo cat /sys/kernel/debug/dma_buf/bufinfo **
cat: /sys/kernel/debug/dma_buf/bufinfo: No such file or directory

** sudo cat /sys/kernel/debug/vcsm-cma/state **
cat: /sys/kernel/debug/vcsm-cma/state: No such file or directory

--------------------------------------------------------------------------------
Media Devices
--------------------------------------------------------------------------------
** media-ctl -d 0 -p **
Media controller API version 5.10.95

Media device information
------------------------
driver          bcm2835-isp
model           bcm2835-isp
serial          
bus info        platform:bcm2835-isp
hw revision     0x0
driver version  5.10.95

Device topology
- entity 1: bcm2835_isp0 (4 pads, 4 links)
            type Node subtype Unknown flags 0
        pad0: Sink
                <- "bcm2835-isp0-output0":0 [ENABLED,IMMUTABLE]
        pad1: Source
                -> "bcm2835-isp0-capture1":0 [ENABLED,IMMUTABLE]
        pad2: Source
                -> "bcm2835-isp0-capture2":0 [ENABLED,IMMUTABLE]
        pad3: Source
                -> "bcm2835-isp0-capture3":0 [ENABLED,IMMUTABLE]

- entity 6: bcm2835-isp0-output0 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video13
        pad0: Source
                -> "bcm2835_isp0":0 [ENABLED,IMMUTABLE]

- entity 12: bcm2835-isp0-capture1 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video14
        pad0: Sink
                <- "bcm2835_isp0":1 [ENABLED,IMMUTABLE]

- entity 18: bcm2835-isp0-capture2 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video15
        pad0: Sink
                <- "bcm2835_isp0":2 [ENABLED,IMMUTABLE]

- entity 24: bcm2835-isp0-capture3 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video16
        pad0: Sink
                <- "bcm2835_isp0":3 [ENABLED,IMMUTABLE]

** media-ctl -d 1 -p **
Media controller API version 5.10.95

Media device information
------------------------
driver          unicam
model           unicam
serial          
bus info        platform:fe801000.csi
hw revision     0x0
driver version  5.10.95

Device topology
- entity 1: imx219 10-0010 (2 pads, 2 links)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev0
        pad0: Source
                [fmt:SRGGB10_1X10/3280x2464 field:none colorspace:raw xfer:none ycbcr:601 quantization:full-range
                 crop.bounds:(8,8)/3280x2464
                 crop:(8,8)/3280x2464]
                -> "unicam-image":0 [ENABLED,IMMUTABLE]
        pad1: Source
                [fmt:unknown/16384x1 field:none
                 crop.bounds:(8,8)/3280x2464
                 crop:(8,8)/3280x2464]
                -> "unicam-embedded":0 [ENABLED,IMMUTABLE]

- entity 4: unicam-image (1 pad, 1 link)
            type Node subtype V4L flags 1
            device node name /dev/video0
        pad0: Sink
                <- "imx219 10-0010":0 [ENABLED,IMMUTABLE]

- entity 10: unicam-embedded (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video1
        pad0: Sink
                <- "imx219 10-0010":1 [ENABLED,IMMUTABLE]

** media-ctl -d 2 -p **
Media controller API version 5.10.95

Media device information
------------------------
driver          bcm2835-isp
model           bcm2835-isp
serial          
bus info        platform:bcm2835-isp
hw revision     0x0
driver version  5.10.95

Device topology
- entity 1: bcm2835_isp0 (4 pads, 4 links)
            type Node subtype Unknown flags 0
        pad0: Sink
                <- "bcm2835-isp0-output0":0 [ENABLED,IMMUTABLE]
        pad1: Source
                -> "bcm2835-isp0-capture1":0 [ENABLED,IMMUTABLE]
        pad2: Source
                -> "bcm2835-isp0-capture2":0 [ENABLED,IMMUTABLE]
        pad3: Source
                -> "bcm2835-isp0-capture3":0 [ENABLED,IMMUTABLE]

- entity 6: bcm2835-isp0-output0 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video20
        pad0: Source
                -> "bcm2835_isp0":0 [ENABLED,IMMUTABLE]

- entity 12: bcm2835-isp0-capture1 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video21
        pad0: Sink
                <- "bcm2835_isp0":1 [ENABLED,IMMUTABLE]

- entity 18: bcm2835-isp0-capture2 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video22
        pad0: Sink
                <- "bcm2835_isp0":2 [ENABLED,IMMUTABLE]

- entity 24: bcm2835-isp0-capture3 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video23
        pad0: Sink
                <- "bcm2835_isp0":3 [ENABLED,IMMUTABLE]

** media-ctl -d 3 -p **
Media controller API version 5.10.95

Media device information
------------------------
driver          bcm2835-codec
model           bcm2835-codec
serial          0000
bus info        platform:bcm2835-codec
hw revision     0x1
driver version  5.10.95

Device topology
- entity 1: bcm2835-codec-decode-source (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video10
        pad0: Source
                -> "bcm2835-codec-decode-proc":0 [ENABLED,IMMUTABLE]

- entity 3: bcm2835-codec-decode-proc (2 pads, 2 links)
            type Node subtype Unknown flags 0
        pad0: Sink
                <- "bcm2835-codec-decode-source":0 [ENABLED,IMMUTABLE]
        pad1: Source
                -> "bcm2835-codec-decode-sink":0 [ENABLED,IMMUTABLE]

- entity 6: bcm2835-codec-decode-sink (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video10
        pad0: Sink
                <- "bcm2835-codec-decode-proc":1 [ENABLED,IMMUTABLE]

- entity 15: bcm2835-codec-encode-source (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video11
        pad0: Source
                -> "bcm2835-codec-encode-proc":0 [ENABLED,IMMUTABLE]

- entity 17: bcm2835-codec-encode-proc (2 pads, 2 links)
             type Node subtype Unknown flags 0
        pad0: Sink
                <- "bcm2835-codec-encode-source":0 [ENABLED,IMMUTABLE]
        pad1: Source
                -> "bcm2835-codec-encode-sink":0 [ENABLED,IMMUTABLE]

- entity 20: bcm2835-codec-encode-sink (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video11
        pad0: Sink
                <- "bcm2835-codec-encode-proc":1 [ENABLED,IMMUTABLE]

- entity 29: bcm2835-codec-isp-source (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video12
        pad0: Source
                -> "bcm2835-codec-isp-proc":0 [ENABLED,IMMUTABLE]

- entity 31: bcm2835-codec-isp-proc (2 pads, 2 links)
             type Node subtype Unknown flags 0
        pad0: Sink
                <- "bcm2835-codec-isp-source":0 [ENABLED,IMMUTABLE]
        pad1: Source
                -> "bcm2835-codec-isp-sink":0 [ENABLED,IMMUTABLE]

- entity 34: bcm2835-codec-isp-sink (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video12
        pad0: Sink
                <- "bcm2835-codec-isp-proc":1 [ENABLED,IMMUTABLE]

- entity 43: bcm2835-codec-image_fx-source (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video18
        pad0: Source
                -> "bcm2835-codec-image_fx-proc":0 [ENABLED,IMMUTABLE]

- entity 45: bcm2835-codec-image_fx-proc (2 pads, 2 links)
             type Node subtype Unknown flags 0
        pad0: Sink
                <- "bcm2835-codec-image_fx-source":0 [ENABLED,IMMUTABLE]
        pad1: Source
                -> "bcm2835-codec-image_fx-sink":0 [ENABLED,IMMUTABLE]

- entity 48: bcm2835-codec-image_fx-sink (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video18
        pad0: Sink
                <- "bcm2835-codec-image_fx-proc":1 [ENABLED,IMMUTABLE]

** media-ctl -d 4 -p **
Failed to enumerate /dev/media4 (-2)

--------------------------------------------------------------------------------
Cameras
--------------------------------------------------------------------------------
** libcamera-hello --list-cameras **
[0:03:23.724241882] [331]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3406-e96d0201
No cameras available!

--------------------------------------------------------------------------------
Versions
--------------------------------------------------------------------------------
** uname -a **
Linux 271fb53dbf73 5.10.95-v8 #1 SMP PREEMPT Thu Feb 17 11:43:01 UTC 2022 aarch64 GNU/Linux

** cat /etc/os-release **
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

** vcgencmd version **
Jan 20 2022 13:56:48 
Copyright (c) 2012 Broadcom
version bd88f66f8952d34e4e0613a85c7a6d3da49e13e2 (clean) (release) (start)

** libcamera-hello --version **
libcamera-apps build: 7ac5197216ea 01-02-2022 (14:49:21)
libcamera build: v0.0.0+3406-e96d0201

--------------------------------------------------------------------------------
libcamera-hello --list-cameras
--------------------------------------------------------------------------------
[0:03:23.281825683] [294]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3406-e96d0201
No cameras available!

Any help is much appreciated :pray:

rahul-thakoor commented 2 years ago

v4l2-ctl --list-devices
bcm2835-codec-decode (platform:bcm2835-codec):
        /dev/video10
        /dev/video11
        /dev/video12
        /dev/video18
        /dev/media1

bcm2835-isp (platform:bcm2835-isp):
        /dev/video13
        /dev/video14
        /dev/video15
        /dev/video16
        /dev/video20
        /dev/video21
        /dev/video22
        /dev/video23
        /dev/media2
        /dev/media3

unicam (platform:fe801000.csi):
        /dev/video0
        /dev/video1
        /dev/media0
naushir commented 2 years ago

Firstly, does your setup work correctly in a standard Raspberry Pi OS?

I'm not familiar with balenaOS, can you provide some further details? Do the apps work when running outside a docker environment?

rahul-thakoor commented 2 years ago

Hi, Yes, my setup works with Raspberry Pi OS 2022-01-28

BalenaOS is a minimal linux OS with services needed to run Docker on boards like the Raspberry Pi.

I am able to use le legacy camera stack in a container environment. libcamera-apps on the other hand do not work.

I can try to run the app using docker on Raspberry Pi OS.

Are there known issues in running the app without X11? I am using libcamera-apps-lite and also tried with --no-preview option.

Thanks

naushir commented 2 years ago

Are there known issues in running the app without X11? I am using libcamera-apps-lite and also tried with --no-preview option.

libcamera-apps run fine without X11. I doubt your problems are related to preview either. The error thrown says there are no cameras detected, but from the logs you posted, a camera has clearly been probed. This is most likely due to the BalenaOS/docker environment problem. Perhaps there is a permissions issue trying to access the /dev/video device nodes? I'm afraid I am not going to be able to help much since I am not familiar with this environment.

kbingham commented 2 years ago

The required devices will need to be passed through into the container. This include /dev/v4l-subdev /dev/video and /dev/media*

Those devices will have to have the correct permissions or group to be able to access those devices too.

rahul-thakoor commented 2 years ago

thanks @naushir @kbingham

i am running a privileged container and the hostOS has

cat /etc/group | grep -i video
video:x:44:

I am also using

    group_add:
      - video

for the service.

in the container, the root user is part of the video group.

 root@4deb13f05908:/usr/src/app# cat /etc/group | grep -i video
video:x:44:root

The container has access to all devices in /dev:

ls -l /dev/video*
crw-rw---- 1 root video 81, 12 Mar  4 11:47 /dev/video0
crw-rw---- 1 root video 81, 13 Mar  4 11:47 /dev/video1
crw-rw---- 1 root video 81,  5 Mar  4 11:47 /dev/video10
crw-rw---- 1 root video 81,  9 Mar  4 11:47 /dev/video11
crw-rw---- 1 root video 81, 10 Mar  4 11:47 /dev/video12
crw-rw---- 1 root video 81,  0 Mar  4 11:47 /dev/video13
crw-rw---- 1 root video 81,  1 Mar  4 11:47 /dev/video14
crw-rw---- 1 root video 81,  2 Mar  4 11:47 /dev/video15
crw-rw---- 1 root video 81,  3 Mar  4 11:47 /dev/video16
crw-rw---- 1 root video 81, 11 Mar  4 11:47 /dev/video18
crw-rw---- 1 root video 81,  4 Mar  4 11:47 /dev/video20
crw-rw---- 1 root video 81,  6 Mar  4 11:47 /dev/video21
crw-rw---- 1 root video 81,  7 Mar  4 11:47 /dev/video22
crw-rw---- 1 root video 81,  8 Mar  4 11:47 /dev/video23
ls -l /dev/v4l-subdev* 
crw-rw---- 1 root video 81, 14 Mar  4 11:47 /dev/v4l-subdev0
ls -l /dev/media*
crw-rw---- 1 root video 235, 0 Mar  4 11:47 /dev/media0
crw-rw---- 1 root video 235, 1 Mar  4 11:47 /dev/media1
crw-rw---- 1 root video 235, 2 Mar  4 11:47 /dev/media2
crw-rw---- 1 root video 235, 3 Mar  4 11:47 /dev/media3

Not sure what is missing at this point 🤔

kbingham commented 2 years ago

Can you run your libcamera hello command again but prefix with LIBCAMERA_LOG_LEVELS=*:0 And paste the output please?

kbingham commented 2 years ago

I am actually suspecting it will be due to udev or lack thereof in the container.

Enforcing sysfs enumeration might identify or resolve it

rahul-thakoor commented 2 years ago

@kbingham

LIBCAMERA_LOG_LEVELS=*:0 libcamera-hello -v -n
Options:
    verbose: 1
    info_text:#%frame (%fps fps) exp %exp ag %ag dg %dg
    timeout: 5000
    width: 0
    height: 0
    output: 
    post_process_file: 
    rawfull: 0
    preview: none
    qt-preview: 0
    transform: identity
    roi: all
    metering: centre
    exposure: normal
    ev: 0
    awb: auto
    flush: false
    wrap: 0
    brightness: 0
    contrast: 1
    saturation: 1
    sharpness: 1
    framerate: 30
    denoise: auto
    viewfinder-width: 0
    viewfinder-height: 0
    tuning-file: (libcamera)
    lores-width: 0
    lores-height: 0
    mode: unspecified
    viewfinder-mode: unspecified
Running without preview window
Opening camera...
[1:01:25.599608812] [42] DEBUG IPAModule ipa_module.cpp:329 ipa_rpi.so: IPA module /usr/lib/arm-linux-gnueabihf/libcamera/ipa_rpi.so is signed
[1:01:25.599808230] [42] DEBUG IPAManager ipa_manager.cpp:240 Loaded IPA module '/usr/lib/arm-linux-gnueabihf/libcamera/ipa_rpi.so'
[1:01:25.600143902] [42] DEBUG IPAModule ipa_module.cpp:329 ipa_vimc.so: IPA module /usr/lib/arm-linux-gnueabihf/libcamera/ipa_vimc.so is signed
[1:01:25.600521054] [42] DEBUG IPAManager ipa_manager.cpp:240 Loaded IPA module '/usr/lib/arm-linux-gnueabihf/libcamera/ipa_vimc.so'
[1:01:25.600797673] [42]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3406-e96d0201
[1:01:25.601405039] [43] DEBUG Camera camera_manager.cpp:106 Starting camera manager
[1:01:25.612516130] [43] DEBUG Camera camera_manager.cpp:149 Found registered pipeline handler 'PipelineHandlerRPi'
[1:01:25.612613070] [43] DEBUG RPI raspberrypi.cpp:1114 Unable to acquire a Unicam instance
[1:01:25.612661180] [43] DEBUG Camera camera_manager.cpp:149 Found registered pipeline handler 'SimplePipelineHandler'
[1:01:25.612743528] [43] DEBUG Camera camera_manager.cpp:149 Found registered pipeline handler 'PipelineHandlerUVC'
[1:01:25.612788860] [43] DEBUG Camera camera_manager.cpp:149 Found registered pipeline handler 'PipelineHandlerVimc'
Closing Libcamera application(frames displayed 0, dropped 0)
Camera stopped!
Tearing down requests, buffers and configuration
Camera closed
ERROR: *** no cameras available ***

raspberrypi.cpp:1114 Unable to acquire a Unicam instance looks like the cause?

also thanks for the debugging tip :)

rahul-thakoor commented 2 years ago

I also have udev enabled in the container with the same result. are there any specific udev rules to be added?

rahul-thakoor commented 2 years ago

btw, I just found this https://forums.raspberrypi.com/viewtopic.php?t=325755

kbingham commented 2 years ago

[1:01:25.612613070] [43] DEBUG RPI raspberrypi.cpp:1114 Unable to acquire a Unicam instance

That looks like the starting point for debug. No unicam means no camera.

naushir commented 2 years ago

Can you access /dev/media* within the docker container? From you last set of logs, it seems maybe not.

This is my output for LIBCAMERA_LOG_LEVELS=*:0 libcamera-hello --list-cameras showing libcamera enumerating /dev/media* which seems to be missing from your logs:

pi@pi4~ $ LIBCAMERA_LOG_LEVELS=*:0 libcamera-hello --list-cameras
[6:10:59.840809600] [3201] DEBUG IPAModule ipa_module.cpp:329 ipa_rpi.so: IPA module /usr/local/lib/arm-linux-gnueabihf/libcamera/ipa_rpi.so is signed
[6:10:59.841173485] [3201] DEBUG IPAManager ipa_manager.cpp:240 Loaded IPA module '/usr/local/lib/arm-linux-gnueabihf/libcamera/ipa_rpi.so'
[6:10:59.841341114] [3201]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0
[6:10:59.841611389] [3202] DEBUG Camera camera_manager.cpp:106 Starting camera manager
[6:10:59.841843128] [3202] DEBUG DeviceEnumerator device_enumerator.cpp:224 New media device "unicam" created from /dev/media0
[6:10:59.842110958] [3202] DEBUG DeviceEnumerator device_enumerator.cpp:252 Added device /dev/media0: unicam
[6:10:59.842245309] [3202] DEBUG DeviceEnumerator device_enumerator.cpp:224 New media device "bcm2835-isp" created from /dev/media3
[6:10:59.842476918] [3202] DEBUG DeviceEnumerator device_enumerator.cpp:252 Added device /dev/media3: bcm2835-isp
[6:10:59.842587899] [3202] DEBUG DeviceEnumerator device_enumerator.cpp:224 New media device "bcm2835-isp" created from /dev/media1
[6:10:59.842803656] [3202] DEBUG DeviceEnumerator device_enumerator.cpp:252 Added device /dev/media1: bcm2835-isp
[6:10:59.842942655] [3202] DEBUG DeviceEnumerator device_enumerator.cpp:224 New media device "bcm2835-codec" created from /dev/media2
[6:10:59.843305281] [3202] DEBUG DeviceEnumerator device_enumerator.cpp:252 Added device /dev/media2: bcm2835-codec
[6:10:59.843344762] [3202] DEBUG Camera camera_manager.cpp:149 Found registered pipeline handler 'PipelineHandlerRPi'
kbingham commented 2 years ago

Ok - that really makes me think this is an issue with UDev, ... as the DeviceEnumerator is run by udev by default. If udev is available but doesn't return anything you can end up with ... no devices.

Check in: https://git.libcamera.org/libcamera/libcamera.git/tree/src/libcamera/device_enumerator.cpp#n141

std::unique_ptr<DeviceEnumerator> DeviceEnumerator::create()
{
    std::unique_ptr<DeviceEnumerator> enumerator;

#ifdef HAVE_LIBUDEV
    enumerator = std::make_unique<DeviceEnumeratorUdev>();
    if (!enumerator->init())
        return enumerator;
#endif

    /*
     * Either udev is not available or udev initialization failed. Fall back
     * on the sysfs enumerator.
     */
    enumerator = std::make_unique<DeviceEnumeratorSysfs>();
    if (!enumerator->init())
        return enumerator;

    return nullptr;
}

Can you try removing the code between HAVE_LIBUDEV and rebuilding libcamera? (or otherwise forcing the enumerator to be constructed from the DeviceEnumeratorSysfs.

If this finds it, then we might want to make it easier to fallback to sysfs enumeration at runtime... or otherwise establish how to get libudev to operate in a container.

kbingham commented 2 years ago

https://forums.docker.com/t/docker-not-passing-udev-events-to-container-even-after-using-net-host/92394/2

Seems to indicate you might need to pass /run/udev/control through as a volume to the container.

or : -v /run/udev:/run/udev:ro

from https://stackoverflow.com/questions/41753218/udevadm-does-not-show-all-attributes-inside-a-docker-container

rahul-thakoor commented 2 years ago

Hey @kbingham i managed to get it to work. it was indeed related to udev.

i ran udevadm control --reload in the container

root@060f98f:/usr/src/app# libcamera-hello 
Preview window unavailable
[0:26:33.094118765] [84]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3406-e96d0201
[0:26:33.140931186] [85]  WARN RPI raspberrypi.cpp:1211 Mismatch between Unicam and CamHelper for embedded data usage!
[0:26:33.142138824] [85]  INFO RPI raspberrypi.cpp:1326 Registered camera /base/soc/i2c0mux/i2c@1/imx219@10 to Unicam device /dev/media0 and ISP device /dev/media1
[0:26:33.143402331] [84]  INFO Camera camera.cpp:1028 configuring streams: (0) 1640x1232-YUV420
[0:26:33.143898868] [85]  INFO RPI raspberrypi.cpp:747 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected sensor format: 1640x1232-SBGGR10_1X10 - Selected unicam format: 1640x1232-pBAA
[0:26:33.167839650] [89]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Saturation = 1.000000
[0:26:33.167991644] [89]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Contrast = 1.000000
[0:26:33.168391129] [89]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Brightness = 0.000000
[0:26:33.168476144] [89]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AwbMode = 0
[0:26:33.168542290] [89]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Sharpness = 1.000000
[0:26:33.168610046] [89]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: ExposureValue = 0.000000
[0:26:33.168764837] [89]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeExposureMode = 0
[0:26:33.169005124] [89]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
[0:26:33.169079139] [89]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeMeteringMode = 0
[0:26:33.169142693] [89]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: NoiseReductionMode = 3

Thanks a lot. I set up a sample app to make this easier and post here.

🙏

rahul-thakoor commented 2 years ago

Here is a sample app to get it to work on balenaOS: https://github.com/balena-io-playground/libcamera-apps Tested on Pi4 with Pi camera v1.2(imx219)

bugsyb commented 2 years ago

Seems like am running into same lack of knowledge, though applying all what seems to be required proven to be not enough still. Host OS arm64 Raspberry PI OS debian:Bullseye Container Ubuntu:20.04

docker run -it --rm --name devfull --hostname devfull --network=host --privileged -v /dev/:/dev/ -v /run/udev:/run/udev -v /run/dbus/:/run/dbus 

In the container:

# udevadm control --reload 
# libcamera-hello --list-cameras -n -v
[11:32:55.075806365] [384]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3424-e68e0f1e
[11:32:55.147222672] [385]  WARN RPI raspberrypi.cpp:1202 Mismatch between Unicam and CamHelper for embedded data usage!
[11:32:55.149524163] [385] ERROR RPI raspberrypi.cpp:1230 Unicam driver does not use the MediaController, please update your kernel!
[11:32:55.151257234] [385] ERROR RPI raspberrypi.cpp:1129 Failed to register camera imx219 10-0010: -22
Available cameras
-----------------
0 : USB 2.0 Camera: USB Camera [1920x1080] (/base/scb/pcie@7d500000/pci@1,0/usb@1,0-1.2:1.0-0c45:6366)
    Modes: 'MJPEG' : 320x240 640x480 1280x720 1920x1080 1920x1080 
           'YUYV' : 320x240 640x480 640x480 
Closing Libcamera application(frames displayed 0, dropped 0)
Camera stopped!
Tearing down requests, buffers and configuration
Camera closed

End of strace look as:

openat(AT_FDCWD, "/usr/lib/aarch64/libdebuginfod.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libdebuginfod.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/dev/video0", O_RDWR) = 3
**openat(AT_FDCWD, "", O_RDONLY)          = -1 ENOENT (No such file or directory)**
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/libcamera", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/libcamera/ipa_rpi.so", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/libcamera/ipa_rpi.so.sign", O_RDONLY) = 4
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/libcamera/ipa_vimc.so", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/libcamera/ipa_vimc.so.sign", O_RDONLY) = 4

Interesting is openat "" - could this be the case? All volumes are mapped and all devices under /dev seem to be accessible.

Would you have any suggestions? The referred solution just runs container in privileged mode - and it loosk like something else might be wrong here?

kbingham commented 2 years ago

the error message tells you the fault

[11:32:55.147222672] [385] WARN RPI raspberrypi.cpp:1202 Mismatch between Unicam and CamHelper for embedded data usage! [11:32:55.149524163] [385] ERROR RPI raspberrypi.cpp:1230 Unicam driver does not use the MediaController, please update your kernel! [11:32:55.151257234] [385] ERROR RPI raspberrypi.cpp:1129 Failed to register camera imx219 10-0010: -22

You need to make sure your on the latest kernel updates from raspberry pi

bugsyb commented 2 years ago

Thank you @kbingham. I did hold on with pi kernel upgrades as there was recently a problem with libcamera apps which prohibited the two from working hence kept version from default installation (which worked). Not sure though why docker container would be complaining about it.

kbingham commented 2 years ago

Does it work outside the container?

meawoppl commented 2 years ago

For me at least (RasPi 4b + IMX477), I got to this page because I didn't have the camera_auto_detect flag set.

To do this you either have to set the flag in the config.txt BEFORE THE FIRST BOOT. Or use the balena bashboard to set it on the device. Navigate the menus: Device Configuration >> Custom Configuration >> Add Custom Configuration Name: BALENA_HOST_CONFIG_camera_auto_detect Value: 1

Or set it fleetwide in a menu above that with a similar flow.

bjajoh commented 1 year ago

Seems like am running into same lack of knowledge, though applying all what seems to be required proven to be not enough still. Host OS arm64 Raspberry PI OS debian:Bullseye Container Ubuntu:20.04

docker run -it --rm --name devfull --hostname devfull --network=host --privileged -v /dev/:/dev/ -v /run/udev:/run/udev -v /run/dbus/:/run/dbus 

In the container:

# udevadm control --reload 
# libcamera-hello --list-cameras -n -v
[11:32:55.075806365] [384]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3424-e68e0f1e
[11:32:55.147222672] [385]  WARN RPI raspberrypi.cpp:1202 Mismatch between Unicam and CamHelper for embedded data usage!
[11:32:55.149524163] [385] ERROR RPI raspberrypi.cpp:1230 Unicam driver does not use the MediaController, please update your kernel!
[11:32:55.151257234] [385] ERROR RPI raspberrypi.cpp:1129 Failed to register camera imx219 10-0010: -22
Available cameras
-----------------
0 : USB 2.0 Camera: USB Camera [1920x1080] (/base/scb/pcie@7d500000/pci@1,0/usb@1,0-1.2:1.0-0c45:6366)
    Modes: 'MJPEG' : 320x240 640x480 1280x720 1920x1080 1920x1080 
           'YUYV' : 320x240 640x480 640x480 
Closing Libcamera application(frames displayed 0, dropped 0)
Camera stopped!
Tearing down requests, buffers and configuration
Camera closed

End of strace look as:

openat(AT_FDCWD, "/usr/lib/aarch64/libdebuginfod.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libdebuginfod.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/dev/video0", O_RDWR) = 3
**openat(AT_FDCWD, "", O_RDONLY)          = -1 ENOENT (No such file or directory)**
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/libcamera", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/libcamera/ipa_rpi.so", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/libcamera/ipa_rpi.so.sign", O_RDONLY) = 4
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/libcamera/ipa_vimc.so", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/libcamera/ipa_vimc.so.sign", O_RDONLY) = 4

Interesting is openat "" - could this be the case? All volumes are mapped and all devices under /dev seem to be accessible.

Would you have any suggestions? The referred solution just runs container in privileged mode - and it loosk like something else might be wrong here?

For everyone still looking, this actually works!!! For me ubuntu 22.04 as host and image.

Pepslee commented 9 months ago

Seems like am running into same lack of knowledge, though applying all what seems to be required proven to be not enough still. Host OS arm64 Raspberry PI OS debian:Bullseye Container Ubuntu:20.04

docker run -it --rm --name devfull --hostname devfull --network=host --privileged -v /dev/:/dev/ -v /run/udev:/run/udev -v /run/dbus/:/run/dbus 

In the container:

# udevadm control --reload 
# libcamera-hello --list-cameras -n -v
[11:32:55.075806365] [384]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3424-e68e0f1e
[11:32:55.147222672] [385]  WARN RPI raspberrypi.cpp:1202 Mismatch between Unicam and CamHelper for embedded data usage!
[11:32:55.149524163] [385] ERROR RPI raspberrypi.cpp:1230 Unicam driver does not use the MediaController, please update your kernel!
[11:32:55.151257234] [385] ERROR RPI raspberrypi.cpp:1129 Failed to register camera imx219 10-0010: -22
Available cameras
-----------------
0 : USB 2.0 Camera: USB Camera [1920x1080] (/base/scb/pcie@7d500000/pci@1,0/usb@1,0-1.2:1.0-0c45:6366)
    Modes: 'MJPEG' : 320x240 640x480 1280x720 1920x1080 1920x1080 
           'YUYV' : 320x240 640x480 640x480 
Closing Libcamera application(frames displayed 0, dropped 0)
Camera stopped!
Tearing down requests, buffers and configuration
Camera closed

End of strace look as:

openat(AT_FDCWD, "/usr/lib/aarch64/libdebuginfod.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libdebuginfod.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/dev/video0", O_RDWR) = 3
**openat(AT_FDCWD, "", O_RDONLY)          = -1 ENOENT (No such file or directory)**
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/libcamera", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/libcamera/ipa_rpi.so", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/libcamera/ipa_rpi.so.sign", O_RDONLY) = 4
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/libcamera/ipa_vimc.so", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/libcamera/ipa_vimc.so.sign", O_RDONLY) = 4

Interesting is openat "" - could this be the case? All volumes are mapped and all devices under /dev seem to be accessible. Would you have any suggestions? The referred solution just runs container in privileged mode - and it loosk like something else might be wrong here?

For everyone still looking, this actually works!!! For me ubuntu 22.04 as host and image.

Hi, can you provide the example of the Dockerfile ?

nbaldy commented 6 months ago

Seems like am running into same lack of knowledge, though applying all what seems to be required proven to be not enough still. Host OS arm64 Raspberry PI OS debian:Bullseye Container Ubuntu:20.04

docker run -it --rm --name devfull --hostname devfull --network=host --privileged -v /dev/:/dev/ -v /run/udev:/run/udev -v /run/dbus/:/run/dbus 

In the container:

# udevadm control --reload 
# libcamera-hello --list-cameras -n -v
[11:32:55.075806365] [384]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3424-e68e0f1e
[11:32:55.147222672] [385]  WARN RPI raspberrypi.cpp:1202 Mismatch between Unicam and CamHelper for embedded data usage!
[11:32:55.149524163] [385] ERROR RPI raspberrypi.cpp:1230 Unicam driver does not use the MediaController, please update your kernel!
[11:32:55.151257234] [385] ERROR RPI raspberrypi.cpp:1129 Failed to register camera imx219 10-0010: -22
Available cameras
-----------------
0 : USB 2.0 Camera: USB Camera [1920x1080] (/base/scb/pcie@7d500000/pci@1,0/usb@1,0-1.2:1.0-0c45:6366)
    Modes: 'MJPEG' : 320x240 640x480 1280x720 1920x1080 1920x1080 
           'YUYV' : 320x240 640x480 640x480 
Closing Libcamera application(frames displayed 0, dropped 0)
Camera stopped!
Tearing down requests, buffers and configuration
Camera closed

End of strace look as:

openat(AT_FDCWD, "/usr/lib/aarch64/libdebuginfod.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libdebuginfod.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/dev/video0", O_RDWR) = 3
**openat(AT_FDCWD, "", O_RDONLY)          = -1 ENOENT (No such file or directory)**
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/libcamera", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/libcamera/ipa_rpi.so", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/libcamera/ipa_rpi.so.sign", O_RDONLY) = 4
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/libcamera/ipa_vimc.so", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/libcamera/ipa_vimc.so.sign", O_RDONLY) = 4

Interesting is openat "" - could this be the case? All volumes are mapped and all devices under /dev seem to be accessible. Would you have any suggestions? The referred solution just runs container in privileged mode - and it loosk like something else might be wrong here?

For everyone still looking, this actually works!!! For me ubuntu 22.04 as host and image.

Hi, can you provide the example of the Dockerfile ?

I suspect your issue might be the boot config. I don't have anything in my dockerfile special to this to this; I install v4l-utils because I'll need it later, and the libcamera dependencies (script below).

sudo apt install -y libcamera-dev libepoxy-dev libjpeg-dev libtiff5-dev libpng-dev python3 python3-dev
sudo apt install -y libcamera-tools g++

###########################################################
# libcamera
sudo apt install -y python3-pip git python3-jinja2
sudo apt install -y libboost-dev
sudo apt install -y libgnutls28-dev openssl libtiff5-dev pybind11-dev liblttng-ust-dev
sudo apt install -y qtbase5-dev libqt5core5a libqt5gui5 libqt5widgets5
# sudo apt install -y meson cmake
sudo apt install -y cmake # ONLY cmake! Pip installs meson
sudo apt install -y python3-yaml python3-ply python3-pip libyaml-dev
sudo pip3 install --user meson # needs sudo to be on sudo pythonpath
PATH=$PATH:/home/$USER/.local/bin/
sudo apt install -y libglib2.0-dev libgstreamer-plugins-base1.0-dev

###########################################################
# rpi-apps
sudo apt install -y cmake libboost-program-options-dev libdrm-dev libexif-dev
sudo apt install -y meson ninja-build

Dockerfile:

FROM arm64v8/ros:humble-ros-base

RUN apt-get update && apt-get install -y v4l-utils

# Runtime volume will be created here for libcam caching
RUN mkdir -p /opt/installs/src
COPY install_libcam_deps.sh   /opt/installs/src/
RUN cd /opt/installs/src && ./install_libcam_deps.sh

# Runtime volume will be created here for build caching
WORKDIR /opt/colcon_ws/

Note that it's important, as said above, that you detect the correct cameras in config.txt as this loads the correct device tree overlays, as I understand it. If you're running raspbian as a host, you should be able to see the cameras on the host. Then, the connections mentioned above while running should be enough, I think.

For instance, my run is:

docker run -it -v ${PWD}/colcon_ws:/opt/colcon_ws -v ${PWD}/installs/:/opt/installs/src/ --privileged --network=host -v /dev/:/dev/ --env UDEV=1 --device /dev:/dev -v /run/udev:/run/udev:ro  libcam-ros /bin/bash

My run command is a combination of the advice above with my specific setup - unsure if every volume/udev instruction is necessary, but it works for me.