raspberrypi / linux

Kernel source tree for Raspberry Pi-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://forums.raspberrypi.com/
Other
11.22k stars 5.02k forks source link

OV5647 not activated on Zero 2 W #4887

Open christianrauch opened 2 years ago

christianrauch commented 2 years ago

Describe the bug

I am unable to use the OV5647 with libcamera on a Zero 2 W with and up-to-date bullseye.

Steps to reproduce the behaviour

  1. install 2022-01-28-raspios-bullseye-armhf-lite
  2. run libcamera-still -o img.jpg

The program will get stuck and never return an image.

Device (s)

Raspberry Pi Zero 2 W

System

Raspberry Pi reference 2022-01-28
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, f01430c9d8f67a4b9719cc00e74a2079d3834d5d, stage2
Jan 20 2022 13:58:22 
Copyright (c) 2012 Broadcom
version bd88f66f8952d34e4e0613a85c7a6d3da49e13e2 (clean) (release) (start)
Linux raspberrypi 5.10.92-v7+ #1514 SMP Mon Jan 17 17:36:39 GMT 2022 armv7l GNU/Linux

Logs

$ dmesg
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.10.92-v7+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1514 SMP Mon Jan 17 17:36:39 GMT 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 Zero 2 W 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] On node 0 totalpages: 114688
[    0.000000]   DMA zone: 1008 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 114688 pages, LIFO batch:31
[    0.000000] percpu: Embedded 20 pages/cpu s50828 r8192 d22900 u81920
[    0.000000] pcpu-alloc: s50828 r8192 d22900 u81920 alloc=20*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=Composite-1:720x480@60i smsc95xx.macaddr=B8:27:EB:6A:C9:D6 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000  console=ttyS0,115200 console=tty1 root=PARTUUID=0caf208c-02 rootfstype=ext4 fsck.repair=yes rootwait
[    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: 174692K/458752K available (10240K kernel code, 1312K rwdata, 2952K rodata, 1024K init, 862K bss, 21916K reserved, 262144K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 32087 entries in 95 pages
[    0.000000] ftrace: allocated 95 pages with 6 groups
[    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+0x3ac/0x580 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.000008] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[    0.000026] Switching to timer-based delay loop, resolution 52ns
[    0.000324] Console: colour dummy device 80x30
[    0.001151] printk: console [tty1] enabled
[    0.001219] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[    0.001279] pid_max: default: 32768 minimum: 301
[    0.001489] LSM: Security Framework initializing
[    0.001750] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001797] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.003289] cgroup: Disabling memory control group subsystem
[    0.003596] CPU: Testing write buffer coherency: ok
[    0.004123] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.005370] Setting up static identity map for 0x100000 - 0x10003c
[    0.005579] rcu: Hierarchical SRCU implementation.
[    0.006525] smp: Bringing up secondary CPUs ...
[    0.007727] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.009050] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.010391] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.010549] smp: Brought up 1 node, 4 CPUs
[    0.010605] SMP: Total of 4 processors activated (153.60 BogoMIPS).
[    0.010636] CPU: All CPU(s) started in HYP mode.
[    0.010664] CPU: Virtualization extensions available.
[    0.011568] devtmpfs: initialized
[    0.029627] VFP support v0.3: implementor 41 architecture 3 part 40 variant 3 rev 4
[    0.029963] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.030076] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.040759] pinctrl core: initialized pinctrl subsystem
[    0.041991] NET: Registered protocol family 16
[    0.046176] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[    0.052018] audit: initializing netlink subsys (disabled)
[    0.052330] audit: type=2000 audit(0.050:1): state=initialized audit_enabled=0 res=1
[    0.052923] thermal_sys: Registered thermal governor 'step_wise'
[    0.053906] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.053970] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.054310] Serial: AMBA PL011 UART driver
[    0.080491] bcm2835-mbox 3f00b880.mailbox: mailbox enabled
[    0.100217] raspberrypi-firmware soc:firmware: Attached to firmware from 2022-01-20T13:58:22, variant start
[    0.110228] raspberrypi-firmware soc:firmware: Firmware hash is bd88f66f8952d34e4e0613a85c7a6d3da49e13e2
[    0.154695] Kprobes globally optimized
[    0.159817] bcm2835-dma 3f007000.dma: DMA legacy API manager, dmachans=0x1
[    0.162143] SCSI subsystem initialized
[    0.162434] usbcore: registered new interface driver usbfs
[    0.162523] usbcore: registered new interface driver hub
[    0.162616] usbcore: registered new device driver usb
[    0.164635] clocksource: Switched to clocksource arch_sys_counter
[    1.885216] VFS: Disk quotas dquot_6.6.0
[    1.885372] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    1.885604] FS-Cache: Loaded
[    1.885871] CacheFiles: Loaded
[    1.886754] simple-framebuffer 1eaa9000.framebuffer: framebuffer at 0x1eaa9000, 0x151800 bytes, mapped to 0x(ptrval)
[    1.886807] simple-framebuffer 1eaa9000.framebuffer: format=a8r8g8b8, mode=720x480x32, linelength=2880
[    1.893006] Console: switching to colour frame buffer device 90x30
[    1.901772] simple-framebuffer 1eaa9000.framebuffer: fb0: simplefb registered!
[    1.914967] NET: Registered protocol family 2
[    1.918475] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    1.923468] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    1.930339] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    1.933919] TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    1.937500] TCP: Hash tables configured (established 4096 bind 4096)
[    1.941080] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    1.944587] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    1.948394] NET: Registered protocol family 1
[    1.952617] RPC: Registered named UNIX socket transport module.
[    1.956120] RPC: Registered udp transport module.
[    1.959600] RPC: Registered tcp transport module.
[    1.963037] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.968320] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 7 counters available
[    1.979148] Initialise system trusted keyrings
[    1.982887] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    1.996167] zbud: loaded
[    2.001791] FS-Cache: Netfs 'nfs' registered for caching
[    2.006275] NFS: Registering the id_resolver key type
[    2.009739] Key type id_resolver registered
[    2.013066] Key type id_legacy registered
[    2.016513] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    2.019804] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    2.024290] Key type asymmetric registered
[    2.027551] Asymmetric key parser 'x509' registered
[    2.030761] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    2.033958] io scheduler mq-deadline registered
[    2.037070] io scheduler kyber registered
[    2.049535] bcm2835-rng 3f104000.rng: hwrng registered
[    2.053130] vc-mem: phys_addr:0x00000000 mem_base=0x1ec00000 mem_size:0x20000000(512 MiB)
[    2.060501] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[    2.075881] brd: module loaded
[    2.091160] loop: module loaded
[    2.096289] Loading iSCSI transport class v2.0-870.
[    2.101088] libphy: Fixed MDIO Bus: probed
[    2.104562] usbcore: registered new interface driver lan78xx
[    2.107907] usbcore: registered new interface driver smsc95xx
[    2.110947] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    2.842260] Core Release: 2.80a
[    2.845270] Setting default values for core params
[    2.848249] Finished setting default values for core params
[    3.051606] Using Buffer DMA mode
[    3.054542] Periodic Transfer Interrupt Enhancement - disabled
[    3.057573] Multiprocessor Interrupt Enhancement - disabled
[    3.060645] OTG VER PARAM: 0, OTG VER FLAG: 0
[    3.063712] Dedicated Tx FIFOs mode

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

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

[    3.095887] WARN::hcd_init_fiq:458: FIQ ASM at 807cc05c length 36

[    3.101090] WARN::hcd_init_fiq:497: MPHI regs_base at 9c810000
[    3.106369] dwc_otg 3f980000.usb: DWC OTG Controller
[    3.109164] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
[    3.112017] dwc_otg 3f980000.usb: irq 89, io mem 0x00000000
[    3.114848] Init: Port Power? op_state=1
[    3.117587] Init: Power Port (0)
[    3.120610] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
[    3.126161] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.129099] usb usb1: Product: DWC OTG Controller
[    3.131987] usb usb1: Manufacturer: Linux 5.10.92-v7+ dwc_otg_hcd
[    3.134953] usb usb1: SerialNumber: 3f980000.usb
[    3.138696] hub 1-0:1.0: USB hub found
[    3.141605] hub 1-0:1.0: 1 port detected
[    3.145636] dwc_otg: FIQ enabled
[    3.145649] dwc_otg: NAK holdoff enabled
[    3.145661] dwc_otg: FIQ split-transaction FSM enabled
[    3.145679] Module dwc_common_port init
[    3.146031] usbcore: registered new interface driver usb-storage
[    3.149092] mousedev: PS/2 mouse device common for all mice
[    3.153336] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer
[    3.158738] sdhci: Secure Digital Host Controller Interface driver
[    3.161702] sdhci: Copyright(c) Pierre Ossman
[    3.165479] mmc-bcm2835 3f300000.mmcnr: could not get clk, deferring probe
[    3.169184] sdhost-bcm2835 3f202000.mmc: could not get clk, deferring probe
[    3.172524] sdhci-pltfm: SDHCI platform and OF driver helper
[    3.176656] ledtrig-cpu: registered to indicate activity on CPUs
[    3.180065] hid: raw HID events driver (C) Jiri Kosina
[    3.183291] usbcore: registered new interface driver usbhid
[    3.186418] usbhid: USB HID core driver
[    3.194868] Initializing XFRM netlink socket
[    3.197947] NET: Registered protocol family 17
[    3.201074] Key type dns_resolver registered
[    3.204723] Registering SWP/SWPB emulation handler
[    3.207906] registered taskstats version 1
[    3.210839] Loading compiled-in X.509 certificates
[    3.214520] Key type ._fscrypt registered
[    3.217308] Key type .fscrypt registered
[    3.219988] Key type fscrypt-provisioning registered
[    3.235521] uart-pl011 3f201000.serial: cts_event_workaround enabled
[    3.238396] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 114, base_baud = 0) is a PL011 rev2
[    3.246548] bcm2835-power bcm2835-power: Broadcom BCM2835 power domains driver
[    3.251315] mmc-bcm2835 3f300000.mmcnr: mmc_debug:0 mmc_debug2:0
[    3.254350] mmc-bcm2835 3f300000.mmcnr: DMA channel allocated
[    3.274796] Indeed it is in host mode hprt0 = 00021501
[    3.339669] sdhost: log_buf @ (ptrval) (cbd03000)
[    3.380632] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[    3.385205] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    3.389636] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    3.392339] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[    3.397962] of_cfs_init
[    3.400776] of_cfs_init: OK
[    3.404475] Waiting for root device PARTUUID=0caf208c-02...
[    3.418008] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[    3.422245] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    3.460027] mmc0: host does not support reading read-only switch, assuming write-enable
[    3.465925] mmc0: new high speed SDHC card at address 0007
[    3.469614] mmcblk0: mmc0:0007 SD4GB 3.71 GiB
[    3.475293]  mmcblk0: p1 p2
[    3.484701] usb 1-1: new full-speed USB device number 2 using dwc_otg
[    3.487636] Indeed it is in host mode hprt0 = 00021501
[    3.512734] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    3.518532] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[    3.532888] devtmpfs: mounted
[    3.552291] Freeing unused kernel memory: 1024K
[    3.595137] Run /sbin/init as init process
[    3.597802]   with arguments:
[    3.597815]     /sbin/init
[    3.597826]   with environment:
[    3.597838]     HOME=/
[    3.597850]     TERM=linux
[    3.601288] mmc1: new high speed SDIO card at address 0001
[    3.725948] usb 1-1: New USB device found, idVendor=05e3, idProduct=0606, bcdDevice= 7.02
[    3.731589] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    3.734567] usb 1-1: Product: USB Hub 2.0
[    3.737602] usb 1-1: Manufacturer: ALCOR
[    3.741453] hub 1-1:1.0: USB hub found
[    3.744645] hub 1-1:1.0: 4 ports detected
[    4.064695] usb 1-1.2: new full-speed USB device number 3 using dwc_otg
[    4.195557] usb 1-1.2: New USB device found, idVendor=0fe6, idProduct=9700, bcdDevice= 1.01
[    4.201820] usb 1-1.2: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[    4.205231] usb 1-1.2: Product: USB 2.0 10/100M Ethernet Adaptor
[    4.346876] systemd[1]: System time before build time, advancing clock.
[    4.543381] NET: Registered protocol family 10
[    4.548228] Segment Routing with IPv6
[    4.655304] systemd[1]: systemd 247.3-6+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)
[    4.666961] systemd[1]: Detected architecture arm.
[    4.696482] systemd[1]: Set hostname to <raspberrypi>.
[    5.828981] systemd[1]: Queued start job for default target Graphical Interface.
[    5.834945] random: systemd: uninitialized urandom read (16 bytes read)
[    5.841343] systemd[1]: Created slice system-getty.slice.
[    5.849015] random: systemd: uninitialized urandom read (16 bytes read)
[    5.853722] systemd[1]: Created slice system-modprobe.slice.
[    5.861490] random: systemd: uninitialized urandom read (16 bytes read)
[    5.866443] systemd[1]: Created slice system-systemd\x2dfsck.slice.
[    5.875339] systemd[1]: Created slice User and Session Slice.
[    5.883483] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[    5.891848] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    5.901184] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[    5.913497] systemd[1]: Reached target Local Encrypted Volumes.
[    5.922161] systemd[1]: Reached target Paths.
[    5.930633] systemd[1]: Reached target Slices.
[    5.938872] systemd[1]: Reached target Swap.
[    5.958638] systemd[1]: Listening on Syslog Socket.
[    5.967444] systemd[1]: Listening on fsck to fsckd communication Socket.
[    5.975910] systemd[1]: Listening on initctl Compatibility Named Pipe.
[    5.985270] systemd[1]: Listening on Journal Audit Socket.
[    5.993971] systemd[1]: Listening on Journal Socket (/dev/log).
[    6.002984] systemd[1]: Listening on Journal Socket.
[    6.022906] systemd[1]: Listening on udev Control Socket.
[    6.031407] systemd[1]: Listening on udev Kernel Socket.
[    6.039822] systemd[1]: Condition check resulted in Huge Pages File System being skipped.
[    6.051296] systemd[1]: Mounting POSIX Message Queue File System...
[    6.064058] systemd[1]: Mounting RPC Pipe File System...
[    6.077906] systemd[1]: Mounting Kernel Debug File System...
[    6.091631] systemd[1]: Mounting Kernel Trace File System...
[    6.100262] systemd[1]: Condition check resulted in Kernel Module supporting RPCSEC_GSS being skipped.
[    6.116467] systemd[1]: Starting Restore / save the current clock...
[    6.141811] systemd[1]: Starting Set the console keyboard layout...
[    6.156192] systemd[1]: Starting Create list of static device nodes for the current kernel...
[    6.176195] systemd[1]: Starting Load Kernel Module configfs...
[    6.191137] systemd[1]: Starting Load Kernel Module drm...
[    6.206084] systemd[1]: Starting Load Kernel Module fuse...
[    6.228717] systemd[1]: Condition check resulted in Set Up Additional Binary Formats being skipped.
[    6.242577] systemd[1]: Starting File System Check on Root Device...
[    6.267782] systemd[1]: Starting Journal Service...
[    6.272403] fuse: init (API version 7.32)
[    6.305384] systemd[1]: Starting Load Kernel Modules...
[    6.320675] systemd[1]: Starting Coldplug All udev Devices...
[    6.346395] systemd[1]: Mounted POSIX Message Queue File System.
[    6.355764] systemd[1]: Mounted RPC Pipe File System.
[    6.365445] systemd[1]: Mounted Kernel Debug File System.
[    6.374053] systemd[1]: Mounted Kernel Trace File System.
[    6.384082] systemd[1]: Finished Restore / save the current clock.
[    6.396665] systemd[1]: Finished Create list of static device nodes for the current kernel.
[    6.410609] systemd[1]: modprobe@configfs.service: Succeeded.
[    6.426312] systemd[1]: Finished Load Kernel Module configfs.
[    6.436663] systemd[1]: modprobe@drm.service: Succeeded.
[    6.441661] systemd[1]: Finished Load Kernel Module drm.
[    6.451834] systemd[1]: modprobe@fuse.service: Succeeded.
[    6.462946] systemd[1]: Finished Load Kernel Module fuse.
[    6.472881] systemd[1]: Finished Load Kernel Modules.
[    6.488402] systemd[1]: Mounting FUSE Control File System...
[    6.501712] systemd[1]: Mounting Kernel Configuration File System...
[    6.516213] systemd[1]: Started File System Check Daemon to report status.
[    6.529791] systemd[1]: Starting Apply Kernel Variables...
[    6.548423] systemd[1]: Mounted FUSE Control File System.
[    6.580670] systemd[1]: Mounted Kernel Configuration File System.
[    6.629852] systemd[1]: Started Journal Service.
[    7.177927] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    7.273868] systemd-journald[133]: Received client request to flush runtime journal.
[    7.790991] systemd-journald[133]: File /var/log/journal/58b56f8966af4928ba629c50a71afe08/system.journal corrupted or uncleanly shut down, renaming and replacing.
[    8.878720] mc: Linux media interface: v0.10
[    8.920280] vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned.
[    8.922840] bcm2835_vc_sm_cma_probe: Videocore shared memory driver
[    8.922866] [vc_sm_connected_init]: start
[    8.923753] [vc_sm_connected_init]: installed successfully
[    8.930525] videodev: Linux video capture interface: v2.00
[    9.010901] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[    9.010908] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[    9.011812] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[    9.026733] bcm2835_isp: module is from the staging directory, the quality is unknown, you have been warned.
[    9.035600] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.
[    9.040473] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned.
[    9.051818] bcm2835_audio bcm2835_audio: there is not valid maps for state default
[    9.061068] bcm2835_codec: module is from the staging directory, the quality is unknown, you have been warned.
[    9.080006] bcm2835-codec bcm2835-codec: Device registered as /dev/video10
[    9.080070] bcm2835-codec bcm2835-codec: Loaded V4L2 decode
[    9.085645] bcm2835-isp bcm2835-isp: Device node output[0] registered as /dev/video13
[    9.086872] bcm2835-isp bcm2835-isp: Device node capture[0] registered as /dev/video14
[    9.087326] bcm2835-isp bcm2835-isp: Device node capture[1] registered as /dev/video15
[    9.088628] bcm2835-isp bcm2835-isp: Device node stats[2] registered as /dev/video16
[    9.088681] bcm2835-isp bcm2835-isp: Register output node 0 with media controller
[    9.088713] bcm2835-isp bcm2835-isp: Register capture node 1 with media controller
[    9.088740] bcm2835-isp bcm2835-isp: Register capture node 2 with media controller
[    9.088764] bcm2835-isp bcm2835-isp: Register capture node 3 with media controller
[    9.089561] bcm2835-codec bcm2835-codec: Device registered as /dev/video11
[    9.089619] bcm2835-codec bcm2835-codec: Loaded V4L2 encode
[    9.110971] bcm2835-codec bcm2835-codec: Device registered as /dev/video12
[    9.111047] bcm2835-codec bcm2835-codec: Loaded V4L2 isp
[    9.112862] bcm2835-isp bcm2835-isp: Device node output[0] registered as /dev/video20
[    9.113460] bcm2835-isp bcm2835-isp: Device node capture[0] registered as /dev/video21
[    9.113907] bcm2835-isp bcm2835-isp: Device node capture[1] registered as /dev/video22
[    9.114273] bcm2835-isp bcm2835-isp: Device node stats[2] registered as /dev/video23
[    9.114305] bcm2835-isp bcm2835-isp: Register output node 0 with media controller
[    9.114349] bcm2835-isp bcm2835-isp: Register capture node 1 with media controller
[    9.114371] bcm2835-isp bcm2835-isp: Register capture node 2 with media controller
[    9.114391] bcm2835-isp bcm2835-isp: Register capture node 3 with media controller
[    9.114600] bcm2835-isp bcm2835-isp: Loaded V4L2 bcm2835-isp
[    9.128942] bcm2835-codec bcm2835-codec: Device registered as /dev/video18
[    9.129043] bcm2835-codec bcm2835-codec: Loaded V4L2 image_fx
[    9.395099] i2c i2c-11: Added multiplexed i2c bus 0
[    9.395972] i2c i2c-11: Added multiplexed i2c bus 10
[    9.713854] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    9.868159] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    9.933813] dm9601 1-1.2:1.0 eth0: register 'dm9601' at usb-3f980000.usb-1.2, Davicom DM96xx USB 10/100 Ethernet, 00:e0:4c:53:44:58
[    9.934082] usbcore: registered new interface driver dm9601
[    9.949474] checking generic (1eaa9000 151800) vs hw (0 ffffffff)
[    9.949499] fb0: switching to vc4drmfb from simple
[    9.954308] usbcore: registered new interface driver sr9700
[    9.956149] Console: switching to colour dummy device 80x30
[    9.970254] vc4-drm soc:gpu: bound 3f400000.hvs (ops vc4_hvs_ops [vc4])
[    9.971420] Registered IR keymap rc-cec
[    9.971683] rc rc0: vc4 as /devices/platform/soc/3f902000.hdmi/rc/rc0
[    9.971952] input: vc4 as /devices/platform/soc/3f902000.hdmi/rc/rc0/input0
[   10.010831] cfg80211: loaded regulatory.db is malformed or signature is missing/invalid
[   10.034087] brcmfmac: F1 signature read @0x18000000=0x1542a9a6
[   10.065022] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43436-sdio for chip BCM43430/2
[   10.065679] usbcore: registered new interface driver brcmfmac
[   10.137995] vc4-drm soc:gpu: bound 3f400000.hvs (ops vc4_hvs_ops [vc4])
[   10.142001] Registered IR keymap rc-cec
[   10.142264] rc rc0: vc4 as /devices/platform/soc/3f902000.hdmi/rc/rc0
[   10.142580] input: vc4 as /devices/platform/soc/3f902000.hdmi/rc/rc0/input1
[   10.382020] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43436-sdio for chip BCM43430/2
[   10.382167] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43436-sdio for chip BCM43430/2
[   10.403172] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/2 wl0: Oct  9 2020 14:44:32 version 9.88.4.65 (test) (f149b32@shgit)  (r679549) FWID 01-f40f3270
[   10.748619] vc4-drm soc:gpu: bound 3f400000.hvs (ops vc4_hvs_ops [vc4])
[   10.762355] Registered IR keymap rc-cec
[   10.762637] rc rc0: vc4 as /devices/platform/soc/3f902000.hdmi/rc/rc0
[   10.762954] input: vc4 as /devices/platform/soc/3f902000.hdmi/rc/rc0/input2
[   10.772595] vc4-drm soc:gpu: bound 3f902000.hdmi (ops vc4_hdmi_ops [vc4])
[   10.773006] vc4-drm soc:gpu: bound 3f004000.txp (ops vc4_txp_ops [vc4])
[   10.773364] vc4-drm soc:gpu: bound 3f206000.pixelvalve (ops vc4_crtc_ops [vc4])
[   10.773665] vc4-drm soc:gpu: bound 3f207000.pixelvalve (ops vc4_crtc_ops [vc4])
[   10.773972] vc4-drm soc:gpu: bound 3f807000.pixelvalve (ops vc4_crtc_ops [vc4])
[   10.774236] vc4-drm soc:gpu: bound 3fc00000.v3d (ops vc4_v3d_ops [vc4])
[   10.812413] [drm] Initialized vc4 0.0.0 20140616 for soc:gpu on minor 0
[   10.812683] vc4-drm soc:gpu: [drm] Cannot find any crtc or sizes
[   10.948369] ov5647 10-0036: Consider updating driver ov5647 to match on endpoints
[   11.474722] random: crng init done
[   11.474745] random: 7 urandom warning(s) missed due to ratelimiting
[   12.609069] uart-pl011 3f201000.serial: no DMA platform data
[   12.626364] 8021q: 802.1Q VLAN Support v1.8
[   12.974808] Adding 102396k swap on /var/swap.  Priority:-2 extents:2 across:110588k SSFS
[   13.429787] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled
[   13.856061] dm9601 1-1.2:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xFFFF
[   13.902744] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   15.014975] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   17.523812] ICMPv6: process `dhcpcd' is using deprecated sysctl (syscall) net.ipv6.neigh.wlan0.retrans_time - use net.ipv6.neigh.wlan0.retrans_time_ms instead
[   19.509538] Bluetooth: Core ver 2.22
[   19.509650] NET: Registered protocol family 31
[   19.509658] Bluetooth: HCI device and connection manager initialized
[   19.510238] Bluetooth: HCI socket layer initialized
[   19.510255] Bluetooth: L2CAP socket layer initialized
[   19.510282] Bluetooth: SCO socket layer initialized
[   19.523787] Bluetooth: HCI UART driver ver 2.3
[   19.523803] Bluetooth: HCI UART protocol H4 registered
[   19.523886] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   19.524104] Bluetooth: HCI UART protocol Broadcom registered
[   20.163412] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   20.163426] Bluetooth: BNEP filters: protocol multicast
[   20.163447] Bluetooth: BNEP socket layer initialized
[   20.185327] NET: Registered protocol family 38
[   20.225143] cryptd: max_cpu_qlen set to 1000
[   20.954883] vc4-drm soc:gpu: [drm] Cannot find any crtc or sizes
[  158.269251] dwc_otg: DEVICE:003 : update_urb_state_xfer_comp:751:trimming xfer length

Additional context

This issue does not appear on a Raspberry Pi 2 and Zero (1) W. I've noticed that on those devices the camera LED turns red immediately after booting and I can consecutively use all the libcamera apps. The LED does not turn on on the Zero 2 W.

pelwell commented 2 years ago

@naushir We have tested cameras on Zero 2 W, haven't we?

naushir commented 2 years ago

@davidplowman i beloved your test plan covers this?

6by9 commented 2 years ago

Pi02 does not have a GPIO controlling the LED, so it won't ever come on (nor does Pi4).

[   20.954883] vc4-drm soc:gpu: [drm] Cannot find any crtc or sizes

Implies you're running headless (intentionally or not), but you haven't told libcamera-hello not to try displaying the preview. (-n option).

There was an early issue with Pi02 with a DT mismatch in the firmware not defining the camera shutdown line correctly due to the change to using cam1_reg, but that was fixed a fair while back.

[   10.948369] ov5647 10-0036: Consider updating driver ov5647 to match on endpoints

implies that the module is getting at least loaded. Does /dev/video0 exist?

christianrauch commented 2 years ago

but you haven't told libcamera-hello not to try displaying the preview

I am running via an ssh session without X forwarding. Using -n will have the same effect. If I enable X forwarding (ssh -X) then it will show a windows with black content, but it will get stuck too.

Does /dev/video0 exist?

Yes, the device list looks the same as on the Zero (1):

$ v4l2-ctl --list-devices
unicam (platform:3f801000.csi):
    /dev/video0
    /dev/media3

bcm2835-codec-decode (platform:bcm2835-codec):
    /dev/video10
    /dev/video11
    /dev/video12
    /dev/video18
    /dev/media2

bcm2835-isp (platform:bcm2835-isp):
    /dev/video13
    /dev/video14
    /dev/video15
    /dev/video16
    /dev/video20
    /dev/video21
    /dev/video22
    /dev/video23
    /dev/media0
    /dev/media1
pelwell commented 2 years ago

Have you tried more than one Zero 2 W (asking, not expecting)?

christianrauch commented 2 years ago

Have you tried more than one Zero 2 W (asking, not expecting)?

No. I only got the Zero 2 W recently, so I expect that it has no hardware faults.

The Zero 2 W and the OV5647 are the stock hardware pieces that I use with the latest stock raspi os. I was hoping someone can reproduce this with this hardware. If this fault occurs for all Zero 2 W + OV5647, it should be straight forward to test this.

6by9 commented 2 years ago

Tested on a standard Pi OS install. Works fine. Added the -v option to get more debug

pi@raspberrypi:~ $ libcamera-still -o img.jpg -v
Options:
    verbose: 1
    info_text:#%frame (%fps fps) exp %exp ag %ag dg %dg
    timeout: 5000
    width: 0
    height: 0
    output: img.jpg
    post_process_file: 
    rawfull: 0
    preview: default
    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
    encoding: jpg
    quality: 93
    raw: 0
    restart: 0
    timelapse: 0
    framestart: 0
    datetime: 0
    timestamp: 0
    keypress: 0
    signal: 0
    thumbnail width: 320
    thumbnail height: 240
    thumbnail quality: 70
    latest: 
    immediate 0
Preview window unavailable
Running without preview window
Opening camera...
[0:03:59.878997507] [1183]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3384-44d59841
[0:03:59.906707461] [1184] ERROR CameraSensor camera_sensor.cpp:535 'ov5647 10-0036': Camera sensor does not support test pattern modes.
[0:03:59.959928514] [1184]  INFO RPI raspberrypi.cpp:1313 Registered camera /base/soc/i2c0mux/i2c@1/ov5647@36 to Unicam device /dev/media3 and ISP device /dev/media0
Acquired camera /base/soc/i2c0mux/i2c@1/ov5647@36
Configuring viewfinder...
Viewfinder size chosen is 1296x972
[0:03:59.963037005] [1183]  INFO Camera camera.cpp:1028 configuring streams: (0) 1296x972-YUV420
[0:03:59.964218151] [1184]  INFO RPI raspberrypi.cpp:738 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected sensor format: 1296x972-SGBRG10_1X10 - Selected unicam format: 1296x972-pGAA
Camera streams configured
Buffers allocated and mapped
Viewfinder setup complete
Requests created
[0:03:59.992237063] [1189]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Saturation = 1.000000
[0:03:59.992525397] [1189]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Contrast = 1.000000
[0:03:59.992641803] [1189]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Brightness = 0.000000
[0:03:59.992745605] [1189]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AwbMode = 0
[0:03:59.992852115] [1189]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Sharpness = 1.000000
[0:03:59.992971543] [1189]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: ExposureValue = 0.000000
[0:03:59.993093365] [1189]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeExposureMode = 0
[0:03:59.993204199] [1189]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
[0:03:59.993413574] [1189]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeMeteringMode = 0
[0:03:59.993527480] [1189]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: NoiseReductionMode = 3
[0:03:59.995882324] [1184]  INFO RPISTREAM rpi_stream.cpp:133 No buffers available for ISP Output0
[0:03:59.995959095] [1184]  INFO RPISTREAM rpi_stream.cpp:133 No buffers available for ISP Output0
[0:03:59.996009981] [1184]  INFO RPISTREAM rpi_stream.cpp:133 No buffers available for ISP Output0
[0:03:59.996056595] [1184]  INFO RPISTREAM rpi_stream.cpp:133 No buffers available for ISP Output0
[0:03:59.996102272] [1184]  INFO RPISTREAM rpi_stream.cpp:133 No buffers available for ISP Output0
[0:03:59.996150293] [1184]  INFO RPISTREAM rpi_stream.cpp:133 No buffers available for ISP Output0
[0:03:59.996198574] [1184]  INFO RPISTREAM rpi_stream.cpp:133 No buffers available for ISP Output0
Camera started!
Viewfinder frame 0
Viewfinder frame 1
Viewfinder frame 2
Viewfinder frame 3
Viewfinder frame 4
Viewfinder frame 5
Viewfinder frame 6
Viewfinder frame 7
Viewfinder frame 8
Viewfinder frame 9
Viewfinder frame 10
Viewfinder frame 11
Viewfinder frame 12
Viewfinder frame 13
Viewfinder frame 14
Viewfinder frame 15
Viewfinder frame 16
Viewfinder frame 17
Viewfinder frame 18
Viewfinder frame 19
Viewfinder frame 20
Viewfinder frame 21
Viewfinder frame 22
Viewfinder frame 23
Viewfinder frame 24
Viewfinder frame 25
Viewfinder frame 26
Viewfinder frame 27
Viewfinder frame 28
Viewfinder frame 29
Viewfinder frame 30
Viewfinder frame 31
Viewfinder frame 32
Viewfinder frame 33
Viewfinder frame 34
Viewfinder frame 35
Viewfinder frame 36
Viewfinder frame 37
Viewfinder frame 38
Viewfinder frame 39
Viewfinder frame 40
Viewfinder frame 41
Viewfinder frame 42
Viewfinder frame 43
Viewfinder frame 44
Viewfinder frame 45
Viewfinder frame 46
Viewfinder frame 47
Viewfinder frame 48
Viewfinder frame 49
Viewfinder frame 50
Viewfinder frame 51
Viewfinder frame 52
Viewfinder frame 53
Viewfinder frame 54
Viewfinder frame 55
Viewfinder frame 56
Viewfinder frame 57
Viewfinder frame 58
Viewfinder frame 59
Viewfinder frame 60
Viewfinder frame 61
Viewfinder frame 62
Viewfinder frame 63
Viewfinder frame 64
Viewfinder frame 65
Viewfinder frame 66
Viewfinder frame 67
Viewfinder frame 68
Viewfinder frame 69
Viewfinder frame 70
Viewfinder frame 71
Viewfinder frame 72
Viewfinder frame 73
Viewfinder frame 74
Viewfinder frame 75
Viewfinder frame 76
Viewfinder frame 77
Viewfinder frame 78
Viewfinder frame 79
Viewfinder frame 80
Viewfinder frame 81
Viewfinder frame 82
Viewfinder frame 83
Viewfinder frame 84
Viewfinder frame 85
Viewfinder frame 86
Viewfinder frame 87
Viewfinder frame 88
Viewfinder frame 89
Viewfinder frame 90
Viewfinder frame 91
Viewfinder frame 92
Viewfinder frame 93
Viewfinder frame 94
Viewfinder frame 95
Viewfinder frame 96
Viewfinder frame 97
Viewfinder frame 98
Viewfinder frame 99
Viewfinder frame 100
Viewfinder frame 101
Viewfinder frame 102
Viewfinder frame 103
Viewfinder frame 104
Viewfinder frame 105
Viewfinder frame 106
Viewfinder frame 107
Viewfinder frame 108
Viewfinder frame 109
Viewfinder frame 110
Viewfinder frame 111
Viewfinder frame 112
Viewfinder frame 113
Viewfinder frame 114
Viewfinder frame 115
Viewfinder frame 116
Viewfinder frame 117
Viewfinder frame 118
Viewfinder frame 119
Viewfinder frame 120
Viewfinder frame 121
Viewfinder frame 122
Viewfinder frame 123
Viewfinder frame 124
Viewfinder frame 125
Viewfinder frame 126
Viewfinder frame 127
Viewfinder frame 128
Viewfinder frame 129
Viewfinder frame 130
Viewfinder frame 131
Viewfinder frame 132
Viewfinder frame 133
Viewfinder frame 134
Viewfinder frame 135
Viewfinder frame 136
Viewfinder frame 137
Viewfinder frame 138
Viewfinder frame 139
Viewfinder frame 140
Viewfinder frame 141
Viewfinder frame 142
Camera stopped!
Tearing down requests, buffers and configuration
Configuring still capture...
[0:04:05.112949788] [1183]  INFO Camera camera.cpp:1028 configuring streams: (0) 2592x1944-YUV420 (1) 2592x1944-SGBRG10_CSI2P
[0:04:05.114423486] [1184]  INFO RPI raspberrypi.cpp:738 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected sensor format: 2592x1944-SGBRG10_1X10 - Selected unicam format: 2592x1944-pGAA
Camera streams configured
Buffers allocated and mapped
Still capture setup complete
Requests created
[0:04:05.182088813] [1192]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Saturation = 1.000000
[0:04:05.182264803] [1192]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Contrast = 1.000000
[0:04:05.182349282] [1192]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Brightness = 0.000000
[0:04:05.182427147] [1192]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AwbMode = 0
[0:04:05.182501626] [1192]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Sharpness = 1.000000
[0:04:05.182580688] [1192]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: ExposureValue = 0.000000
[0:04:05.182663344] [1192]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeExposureMode = 0
[0:04:05.182733813] [1192]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: FrameDurationLimits = [ 100, 1000000000 ]
[0:04:05.182817667] [1192]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeMeteringMode = 0
[0:04:05.182890949] [1192]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: NoiseReductionMode = 2
[0:04:05.184902043] [1184]  INFO RPISTREAM rpi_stream.cpp:133 No buffers available for ISP Output0
Camera started!
Camera stopped!
Still capture image received
Exposure time: 29967
Ag 2.8125 Dg 1.01317 Total 2.84953
Thumbnail dimensions are 320 x 240
Thumbnail size 10764
JPEG size is 909271
EXIF data len 266
Saved image 2592 x 1944 to file img.jpg
Closing Libcamera application(frames displayed 142, dropped 0)
Camera stopped!
Tearing down requests, buffers and configuration
Camera closed

Memory says that lite installs a slightly different set of binaries due to X being absent, but it shouldn't make any functional difference in this case.

christianrauch commented 2 years ago

Tested on a standard Pi OS install. Works fine.

Is this via ssh without a display and without X forwarding?

For me, this is:

$ libcamera-still -o img.jpg -v
Options:
    verbose: 1
    info_text:#%frame (%fps fps) exp %exp ag %ag dg %dg
    timeout: 5000
    width: 0
    height: 0
    output: img.jpg
    post_process_file: 
    rawfull: 0
    preview: default
    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
    encoding: jpg
    quality: 93
    raw: 0
    restart: 0
    timelapse: 0
    framestart: 0
    datetime: 0
    timestamp: 0
    keypress: 0
    signal: 0
    thumbnail width: 320
    thumbnail height: 240
    thumbnail quality: 70
    latest: 
    immediate 0
No connector ID specified.  Choosing default from list:
Connector 32 (crtc 0): type 11, 0x0
Preview window unavailable
Running without preview window
Opening camera...
[0:01:50.736928943] [725]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3406-e96d0201
[0:01:50.786056790] [726] ERROR CameraSensor camera_sensor.cpp:551 'ov5647 10-0036': Camera sensor does not support test pattern modes.
[0:01:50.869734456] [726]  INFO RPI raspberrypi.cpp:1326 Registered camera /base/soc/i2c0mux/i2c@1/ov5647@36 to Unicam device /dev/media3 and ISP device /dev/media0
Acquired camera /base/soc/i2c0mux/i2c@1/ov5647@36
Configuring viewfinder...
Viewfinder size chosen is 1296x972
[0:01:50.872306130] [725]  INFO Camera camera.cpp:1028 configuring streams: (0) 1296x972-YUV420
[0:01:50.872992941] [726]  INFO RPI raspberrypi.cpp:747 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected sensor format: 1296x972-SGBRG10_1X10 - Selected unicam format: 1296x972-pGAA
Camera streams configured
Buffers allocated and mapped
Viewfinder setup complete
Requests created
[0:01:50.926737635] [731]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Saturation = 1.000000
[0:01:50.932406495] [731]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Contrast = 1.000000
[0:01:50.932501285] [731]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Brightness = 0.000000
[0:01:50.932576544] [731]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AwbMode = 0
[0:01:50.932649512] [731]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Sharpness = 1.000000
[0:01:50.932725552] [731]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: ExposureValue = 0.000000
[0:01:50.932799509] [731]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeExposureMode = 0
[0:01:50.932869821] [731]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
[0:01:50.932950600] [731]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeMeteringMode = 0
[0:01:50.933021224] [731]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: NoiseReductionMode = 3
Camera started!

and form there it is stuck.

According to gdb, it is stuck waiting for some condition to become true:

Thread 1 "libcamera-still" received signal SIGINT, Interrupt.
futex_wait_cancelable (private=0, expected=0, futex_word=0x7efff190) at ../sysdeps/nptl/futex-internal.h:186
186 ../sysdeps/nptl/futex-internal.h: No such file or directory.
(gdb) bt
#0  futex_wait_cancelable (private=0, expected=0, futex_word=0x7efff190) at ../sysdeps/nptl/futex-internal.h:186
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x0, cond=0x7efff168) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0x7efff168, mutex=0x0) at pthread_cond_wait.c:638
#3  0x76dd5430 in std::condition_variable::wait(std::unique_lock<std::mutex>&) () from /lib/arm-linux-gnueabihf/libstdc++.so.6
#4  0x76f5fbc4 in LibcameraApp::Wait() () from /lib/arm-linux-gnueabihf/libcamera_app.so
#5  0x0001bc2c in ?? ()
#6  0x76bcbbe0 in __libc_start_main (main=0x7efff574, argc=1993347072, argv=0x76bcbbe0 <__libc_start_main+276>, init=<optimized out>, fini=0x29bb4, rtld_fini=0x76fdd510 <_dl_fini>, stack_end=0x7efff574)
    at libc-start.c:308
#7  0x0001c630 in ?? ()

I noticed that my verbose log additionally shows:

No connector ID specified.  Choosing default from list:
Connector 32 (crtc 0): type 11, 0x0
6by9 commented 2 years ago

SSH, display connected, no X forwarding.

6by9 commented 2 years ago

SSH, display connected, no X forwarding.

Tested with no display connected, and again it produces 142 preview frames and captures a JPEG.

christianrauch commented 2 years ago

So... I actually have a second OV5647 that I just tried... and it worked.

Looking at the boards, they are not identical. Both say "P5V04A SUNNY" and "Rev 1.3" but the not-working one has a white "connector" and the working one has a brown connector.

Still, the "white connector OV5647" that does not work with the Zero 2 " does work with the other Raspberry Pis.

pelwell commented 2 years ago

does work with the other Raspberry Pis.

Is that with moving cards between the Pis, thereby ruling out configuration differences?

christianrauch commented 2 years ago

Is that with moving cards between the Pis, thereby ruling out configuration differences?

Yes, the same SD card with the armhf-lite installation and exactly the same camera. Only the cable and the Pi itself change.

pelwell commented 2 years ago

And I presume the same cable has been used with Zero W and Zero 2 W? And the Zero 2 W has been tried repeatedly, meaning that we can rule out a bad cable and poor cable seating for the failing OV5647/Zero 2 W combination?

6by9 commented 2 years ago

Raspberry Pi haven't sold the V1.3 camera board since around 2016 when the V2 IMX219 module was released. Omnivision had declared the sensor End Of Life.

There are numerous 3rd parties that have copied the design with varying degrees of accuracy. Some of the original clones required the LED line to be connected, which isn't present on the Pi02. I'm slightly surprised that the sensor responds at all over I2C if that is the case, but it's not something that is worth investigating from our side.

christianrauch commented 2 years ago

And I presume the same cable has been used with Zero W and Zero 2 W? And the Zero 2 W has been tried repeatedly, meaning that we can rule out a bad cable and poor cable seating for the failing OV5647/Zero 2 W combination?

I always used the same cable on the same Pi. I only disconnected the camera. But this also means that the cable is ok, since one of the two OV5647 works.

christianrauch commented 2 years ago

There are numerous 3rd parties that have copied the design with varying degrees of accuracy. Some of the original clones required the LED line to be connected, which isn't present on the Pi02.

Thanks for this information. Is this a hardware limitation or can this be fixed by an software update?

It's impossible for me to tell apart the original and a potential copy. My faulty version that does not work with the Zero 2 W looks very similar this one https://www.arducam.com/product/arducam-ov5647-standard-raspberry-pi-camera-b0033/. The "P5V04A SUNNY" is right beneath the camera sensor and the cable connector is white. My PCB additionally has the "Rev 1.3" printed on it.

My working OV5647 is different to this. It has the "P5V04A SUNNY" and "A1508" written on top of the sensor connector and a brown cable connector.

This image shows both OV5647:

pi_OV5647

How do I know which one is the original and which one is the copy?

pelwell commented 2 years ago

The one which is visibly sloppy ("P5V04A..." not printed on the connector, missing dot on the "i", Courier font, inelegant routing) looks like a copy.

6by9 commented 2 years ago

They may well both be copies. The V1 camera module was made in the early days and the silkscreen for the official modules didn't get the Raspberry Pi logo on them. Therefore there is no copyright or trademark infringement from copying the silkscreen, and it's hard to tell.

christianrauch commented 2 years ago
  1. "Some of the original clones required the LED line to be connected, which isn't present on the Pi02." -> Is this a hardware limitation or can this be fixed by an software update?
  2. Can I detect clones or faulty OV5647 somehow via querying information about the sensor via software? E.g. via serial numbers or other information, or by trying to change the state of the sensor?
6by9 commented 2 years ago

1 Hardware. There is no electrical connection on the Pi02 to pin 18 of the 22pin camera connector, which becomes pin 12 on the 15 way connector. You could short pins 17&18 together on the 22pin connector so that the one signal drove both lines.

2 No. There are no serial numbers or otherwise unique identifiers in the sensor. Anyway it's a function of the board rather than the sensor - swap the sensor itself between the two boards and I suspect that the issue will stay with the board, not the sensor module.

Support is provided for the Raspberry Pi camera modules. As this appears to be a third party module, support is going to be limited. As it works with one of your modules the Pi obviously works. Your main option would be to complain to your camera module supplier.

6by9 commented 2 years ago

Having just found what is most likely a genuine Raspberry Pi v1.3 camera module, I can confirm that it matches your second image. The trace round to the LED runs around the outside (rather than under) of the sensor itself, the font matches, and there are 12 vias at the top, all with a small copper ring around them.