Ardusan
Posts: 14
Joined: Fri Jun 04, 2021 1:30 am

building libcamera on buster-lite

Wed Jun 09, 2021 2:36 am

Hi, can libcamera and libcamera-apps be built on lite version of raspberry OS? I have run into a bunch of issues so I am wondering if not having X11 creates problems. (I need camera only for image processing of captured images, I will not have any display on the device).

User avatar
Gavinmc42
Posts: 5873
Joined: Wed Aug 28, 2013 3:31 am

Re: building libcamera on buster-lite

Wed Jun 09, 2021 4:18 am

You could build the apps on a Desktop Pi and just copy them to the Lite Pi.
I did that last week.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

therealdavidp
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 200
Joined: Tue Jan 07, 2020 9:15 am

Re: building libcamera on buster-lite

Wed Jun 09, 2021 7:32 am

Hi, yes the Lite OS doesn't haven't all the same dependencies installed. I just tried it and it worked fine with the following small alternations.

1. Before using pip3, run

Code: Select all

sudo apt install python3-pip
2. Prior to downloading anything with git, run

Code: Select all

sudo apt install git
3. Before invoking meson for the first time, run

Code: Select all

sudo pip3 install jinja2
After that everything built fine and Iibcamera-hello produced the usual camera image. Please post back if your installation gives you any further problems.

Ardusan
Posts: 14
Joined: Fri Jun 04, 2021 1:30 am

Re: building libcamera on buster-lite

Wed Jun 09, 2021 10:10 am

Thanks, I sorted out the missing dependencies. I also needed to disable werror in meson

Code: Select all

 meson configure -Dpipelines=raspberrypi -Dtest=false -Dwerror=false
but when trying to run qcam I get:

Code: Select all

qt.qpa.screen: QXcbConnection: Could not connect to display
Could not connect to any X display.
tried

Code: Select all

export DISPLAY=:0
export DISPLAY=:0.0
with no success. That is not a big deal as I will not have any display in final device, but would be nice to see the output.
BTW, do you know if zbarcam (QRcode decoding tool) supports libcamera? they(https://giters.com/mchehab/zbar) say:
"The zbarcam program uses the video4linux API (v4l1 or v4l2) to access the video device. This interface is part of the linux kernel, a 3.16 kernel or upper is recommended for full support."

Thanks!

therealdavidp
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 200
Joined: Tue Jan 07, 2020 9:15 am

Re: building libcamera on buster-lite

Wed Jun 09, 2021 11:00 am

Hi again, indeed I don't expect that qcam would work - instead try libcamera-hello from our libcamera-apps which will run without X.

I don't know anything about zbarcam but assume it will only support v4l2 devices and won't interface natively to libcamera. However, libcamera does have a V4L2 compatibility layer for this kind of thing, see here. I've not tried it myself, but I'm sure there will be folks on the libcamera mailing list who have!

Ardusan
Posts: 14
Joined: Fri Jun 04, 2021 1:30 am

Re: building libcamera on buster-lite

Fri Jun 11, 2021 1:05 am

Ok, I managed to build everything. My initial compilation errors were due to having previously installed gcc 10.1 :)

Finally, libcamera apps cannot find (any) camera. I have connected two cameras to the development board following:
https://www.raspberrypi.org/documentati ... -camera.md

libcamera-hello gives this :

Code: Select all

[0:01:36.001122230] [641]  INFO Camera camera_manager.cpp:294 libcamera v0.0.0+2660-529a3c4e
ERROR: *** no cameras available ***

User avatar
Gavinmc42
Posts: 5873
Joined: Wed Aug 28, 2013 3:31 am

Re: building libcamera on buster-lite

Fri Jun 11, 2021 1:50 am

Finally got around to testing it last night.
Got the same error on a Pi4, except for the last digits.
Using 5.10.39-v7l+

I thought it might be V4L2 related but my apps that use V4L2 worked.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

therealdavidp
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 200
Joined: Tue Jan 07, 2020 9:15 am

Re: building libcamera on buster-lite

Fri Jun 11, 2021 6:31 am

Hi again
Ardusan wrote:
Fri Jun 11, 2021 1:05 am
libcamera-hello gives this :

Code: Select all

[0:01:36.001122230] [641]  INFO Camera camera_manager.cpp:294 libcamera v0.0.0+2660-529a3c4e
ERROR: *** no cameras available ***
Does raspistill work? To run it you'll have have to comment the "dtoverlay=imx219" (or whichever camera you are using) out of your /boot/config.txt and reboot. If it doesn't, the output of "vcgencmd get_camera" might be helpful.

Can you confirm what camera modules you have and that they're official Raspberry Pi boards? Also, the output of "uname -a" and "vcgencmd version" is often helpful just to see what software you're running. Are you using a CM3 or CM4?

User avatar
Gavinmc42
Posts: 5873
Joined: Wed Aug 28, 2013 3:31 am

Re: building libcamera on buster-lite

Fri Jun 11, 2021 6:59 am

Raspistill works, using V1 Noir.

Something does happen when libcamera-hello is run.
It looks like a preview windows pops up and then vanishes, but too fast to see what it is.

dtoverlay=imx219?
Bingo, I added dtoverlay=ov5647 to config.txt and now I get a preview window.

I skipped over this section of the github.
Also make sure you have the correct dtoverlay for your sensor in the /boot/config.txt file (for example, dtoverlay=imx477 for the HQ cam) and then reboot your Pi.
Thanks.
just in time for weekend camera fun :D
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Ardusan
Posts: 14
Joined: Fri Jun 04, 2021 1:30 am

Re: building libcamera on buster-lite

Fri Jun 11, 2021 9:32 am

Does raspistill work? To run it you'll have have to comment the "dtoverlay=imx219" (or whichever camera you are using) out of your /boot/config.txt and reboot. If it doesn't, the output of "vcgencmd get_camera" might be helpful.

Can you confirm what camera modules you have and that they're official Raspberry Pi boards? Also, the output of "uname -a" and "vcgencmd version" is often helpful just to see what software you're running. Are you using a CM3 or CM4?
I am using CM3+, Camera V2.1,

Code: Select all

$ uname -a
Linux BBPRO 5.10.42-v7+ #1422 SMP Tue Jun 8 13:00:54 BST 2021 armv7l GNU/Linux
$ vcgencmd version
Jun  8 2021 13:09:11
Copyright (c) 2012 Broadcom
version 03df0e450c356822f03454c27edea347fd8d211b (clean) (release) (start_x)
 $ vcgencmd get_camera
supported=2 detected=2

But:
 $ raspistill -o x.jpg
Camera control callback  cmd=0x4f525245mmal: No data received from sensor. Check all connections, including the Sunny one on the camera board

although picamera works fine... I have to look into this more as raspistill was wotking fine with other raspbian images...

Ardusan
Posts: 14
Joined: Fri Jun 04, 2021 1:30 am

Re: building libcamera on buster-lite

Tue Jun 15, 2021 8:30 am

No luck yet :(
I started from the scratch, got to the point where raspistill works nicely with both cameras, built libcamera and libcamera-apps, added the two overlays to config.txt, but I am still getting the same message:

Code: Select all

Opening camera...
[0:50:45.949308820] [837]  INFO Camera camera_manager.cpp:294 libcamera v0.0.0+2675-2f6b951b
Closing Libcamera application(frames displayed 0, dropped 0)
Camera stopped!
Tearing down requests, buffers and configuration
Camera closed
ERROR: *** no cameras available ***
BTW, how do I specify which of the two cameras should llibcamera-hello (or other apps) use?

naushir
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 106
Joined: Mon Apr 25, 2016 10:21 am

Re: building libcamera on buster-lite

Tue Jun 15, 2021 8:53 am

Ardusan wrote:
Tue Jun 15, 2021 8:30 am
No luck yet :(
I started from the scratch, got to the point where raspistill works nicely with both cameras, built libcamera and libcamera-apps, added the two overlays to config.txt, but I am still getting the same message:

Code: Select all

Opening camera...
[0:50:45.949308820] [837]  INFO Camera camera_manager.cpp:294 libcamera v0.0.0+2675-2f6b951b
Closing Libcamera application(frames displayed 0, dropped 0)
Camera stopped!
Tearing down requests, buffers and configuration
Camera closed
ERROR: *** no cameras available ***
Could we perhaps start with just trying this with one camera attached? On boot, can you provide the output of dmesg to see if it gives any clues as to why the camera is not detected?
BTW, how do I specify which of the two cameras should llibcamera-hello (or other apps) use?
This is currently not possible with libcamera-apps. I'll put it on our to-do list, it should not be a big change.

Ardusan
Posts: 14
Joined: Fri Jun 04, 2021 1:30 am

Re: building libcamera on buster-lite

Tue Jun 15, 2021 10:38 am

OK, done that...there are some suspicious lines...

Code: Select all



[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.10.42-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) #1422 SMP Tue Jun 8 13:00:54 BST 2021
[    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 Compute Module 3 Plus Rev 1.0
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] Reserved memory: created CMA memory pool at 0x1ec00000, 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-0x0000000037ffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000037ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000037ffffff]
[    0.000000] On node 0 totalpages: 229376
[    0.000000]   DMA zone: 2016 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 229376 pages, LIFO batch:63
[    0.000000] percpu: Embedded 20 pages/cpu s50700 r8192 d23028 u81920
[    0.000000] pcpu-alloc: s50700 r8192 d23028 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: 227360
[    0.000000] Kernel command line: coherent_pool=1M snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 video=HDMI-A-1:1920x1080M@60,margin_left=48,margin_right=48,margin_top=48,margin_bottom=48 smsc95xx.macaddr=B8:27:EB:46:35:FC vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  root=PARTUUID=19129801-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
[    0.000000] Kernel parameter elevator= does not have any effect anymore.
               Please use sysfs to set IO scheduler for individual devices.
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes, linear)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 630056K/917504K available (9216K kernel code, 1311K rwdata, 2948K rodata, 1024K init, 859K bss, 25304K reserved, 262144K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 32029 entries in 63 pages
[    0.000000] ftrace: allocated 63 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=0
[    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.000025] Switching to timer-based delay loop, resolution 52ns
[    0.000332] Console: colour dummy device 80x30
[    0.001198] printk: console [tty0] enabled
[    0.001272] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[    0.001333] pid_max: default: 32768 minimum: 301
[    0.001558] LSM: Security Framework initializing
[    0.001830] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.001881] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.003616] Disabling memory control group subsystem
[    0.003763] CPU: Testing write buffer coherency: ok
[    0.004320] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.005596] Setting up static identity map for 0x100000 - 0x10003c
[    0.005807] rcu: Hierarchical SRCU implementation.
[    0.006735] smp: Bringing up secondary CPUs ...
[    0.007925] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.009291] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.010692] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.010854] smp: Brought up 1 node, 4 CPUs
[    0.010910] SMP: Total of 4 processors activated (153.60 BogoMIPS).
[    0.010944] CPU: All CPU(s) started in HYP mode.
[    0.010971] CPU: Virtualization extensions available.
[    0.012045] devtmpfs: initialized
[    0.030303] VFP support v0.3: implementor 41 architecture 3 part 40 variant 3 rev 4
[    0.030601] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.030662] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.042519] pinctrl core: initialized pinctrl subsystem
[    0.043808] NET: Registered protocol family 16
[    0.048274] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[    0.054091] audit: initializing netlink subsys (disabled)
[    0.054460] audit: type=2000 audit(0.050:1): state=initialized audit_enabled=0 res=1
[    0.055082] thermal_sys: Registered thermal governor 'step_wise'
[    0.056033] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.056096] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.056419] Serial: AMBA PL011 UART driver
[    0.082583] bcm2835-mbox 3f00b880.mailbox: mailbox enabled
[    0.100228] raspberrypi-firmware soc:firmware: Attached to firmware from 2021-06-08T13:09:11, variant start_x
[    0.110235] raspberrypi-firmware soc:firmware: Firmware hash is 03df0e450c356822f03454c27edea347fd8d211b
[    0.155082] Kprobes globally optimized
[    0.160383] bcm2835-dma 3f007000.dma: DMA legacy API manager, dmachans=0x1
[    0.162733] SCSI subsystem initialized
[    0.163023] usbcore: registered new interface driver usbfs
[    0.163110] usbcore: registered new interface driver hub
[    0.163200] usbcore: registered new device driver usb
[    0.165212] clocksource: Switched to clocksource arch_sys_counter
[    1.941211] VFS: Disk quotas dquot_6.6.0
[    1.941366] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    1.941604] FS-Cache: Loaded
[    1.941922] CacheFiles: Loaded
[    1.942981] simple-framebuffer 3e503000.framebuffer: framebuffer at 0x3e503000, 0x6e7000 bytes, mapped to 0x(ptrval)
[    1.943033] simple-framebuffer 3e503000.framebuffer: format=a8r8g8b8, mode=1824x984x32, linelength=7296
[    1.974077] Console: switching to colour frame buffer device 228x61
[    2.002565] simple-framebuffer 3e503000.framebuffer: fb0: simplefb registered!
[    2.013422] NET: Registered protocol family 2
[    2.013878] IP idents hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    2.015721] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    2.016113] TCP established hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    2.016452] TCP bind hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    2.016851] TCP: Hash tables configured (established 8192 bind 8192)
[    2.017239] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[    2.017489] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[    2.018059] NET: Registered protocol family 1
[    2.019146] RPC: Registered named UNIX socket transport module.
[    2.019341] RPC: Registered udp transport module.
[    2.019490] RPC: Registered tcp transport module.
[    2.019639] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    2.021672] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 7 counters available
[    2.025874] Initialise system trusted keyrings
[    2.026319] workingset: timestamp_bits=14 max_order=18 bucket_order=4
[    2.036211] zbud: loaded
[    2.038475] FS-Cache: Netfs 'nfs' registered for caching
[    2.039539] NFS: Registering the id_resolver key type
[    2.039728] Key type id_resolver registered
[    2.039861] Key type id_legacy registered
[    2.040137] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    2.040336] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    2.041727] Key type asymmetric registered
[    2.041867] Asymmetric key parser 'x509' registered
[    2.050138] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    2.058301] io scheduler mq-deadline registered
[    2.066433] io scheduler kyber registered
[    2.086256] bcm2835-rng 3f104000.rng: hwrng registered
[    2.094794] vc-mem: phys_addr:0x00000000 mem_base=0x3ec00000 mem_size:0x40000000(1024 MiB)
[    2.103949] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[    2.124261] brd: module loaded
[    2.144908] loop: module loaded
[    2.154977] Loading iSCSI transport class v2.0-870.
[    2.164632] libphy: Fixed MDIO Bus: probed
[    2.172867] usbcore: registered new interface driver lan78xx
[    2.180759] usbcore: registered new interface driver smsc95xx
[    2.188516] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    2.924498] Core Release: 2.80a
[    2.932161] Setting default values for core params
[    2.939790] Finished setting default values for core params
[    3.147763] Using Buffer DMA mode
[    3.155349] Periodic Transfer Interrupt Enhancement - disabled
[    3.163009] Multiprocessor Interrupt Enhancement - disabled
[    3.170819] OTG VER PARAM: 0, OTG VER FLAG: 0
[    3.178558] Dedicated Tx FIFOs mode

[    3.186646] WARN::dwc_otg_hcd_init:1074: FIQ DMA bounce buffers: virt = 9ed04000 dma = 0xded04000 len=9024
[    3.202012] FIQ FSM acceleration enabled for :
               Non-periodic Split Transactions
               Periodic Split Transactions
               High-Speed Isochronous Endpoints
               Interrupt/Control Split Transaction hack enabled
[    3.240206] dwc_otg: Microframe scheduler enabled

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

[    3.255053] WARN::hcd_init_fiq:458: FIQ ASM at 807c7b98 length 36

[    3.269581] WARN::hcd_init_fiq:497: MPHI regs_base at b8810000
[    3.283906] dwc_otg 3f980000.usb: DWC OTG Controller
[    3.291056] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
[    3.298300] dwc_otg 3f980000.usb: irq 89, io mem 0x00000000
[    3.305472] Init: Port Power? op_state=1
[    3.312456] Init: Power Port (0)
[    3.319763] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
[    3.326887] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.334074] usb usb1: Product: DWC OTG Controller
[    3.341251] usb usb1: Manufacturer: Linux 5.10.42-v7+ dwc_otg_hcd
[    3.348557] usb usb1: SerialNumber: 3f980000.usb
[    3.356540] hub 1-0:1.0: USB hub found
[    3.363620] hub 1-0:1.0: 1 port detected
[    3.371943] dwc_otg: FIQ enabled
[    3.371956] dwc_otg: NAK holdoff enabled
[    3.371967] dwc_otg: FIQ split-transaction FSM enabled
[    3.371987] Module dwc_common_port init
[    3.372367] usbcore: registered new interface driver usb-storage
[    3.379631] mousedev: PS/2 mouse device common for all mice
[    3.388299] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer
[    3.398220] sdhci: Secure Digital Host Controller Interface driver
[    3.405405] sdhci: Copyright(c) Pierre Ossman
[    3.413311] sdhost-bcm2835 3f202000.mmc: could not get clk, deferring probe
[    3.420871] sdhci-pltfm: SDHCI platform and OF driver helper
[    3.428827] ledtrig-cpu: registered to indicate activity on CPUs
[    3.436244] hid: raw HID events driver (C) Jiri Kosina
[    3.443494] usbcore: registered new interface driver usbhid
[    3.450623] usbhid: USB HID core driver
[    3.462705] Initializing XFRM netlink socket
[    3.469927] NET: Registered protocol family 17
[    3.477084] Key type dns_resolver registered
[    3.484589] Registering SWP/SWPB emulation handler
[    3.491572] registered taskstats version 1
[    3.498578] Indeed it is in host mode hprt0 = 00021501
[    3.505510] Loading compiled-in X.509 certificates
[    3.566019] Key type ._fscrypt registered
[    3.572903] Key type .fscrypt registered
[    3.579704] Key type fscrypt-provisioning registered
[    3.592517] random: fast init done
[    3.598993] uart-pl011 3f201000.serial: cts_event_workaround enabled
[    3.606461] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 114, base_baud = 0) is a PL011 rev2
[    3.616356] bcm2835-aux-uart 3f215040.serial: error -ENOSPC: unable to register 8250 port
[    3.623539] bcm2835-aux-uart: probe of 3f215040.serial failed with error -28
[    3.631193] bcm2835-power bcm2835-power: Broadcom BCM2835 power domains driver
[    3.641104] sdhost: log_buf @ (ptrval) (ded07000)
[    3.696997] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[    3.707536] of_cfs_init
[    3.714958] of_cfs_init: OK
[    3.715271] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    3.729204] Indeed it is in host mode hprt0 = 00001101
[    3.729534] Waiting for root device PARTUUID=19129801-02...
[    3.808106] mmc0: new high speed MMC card at address 0001
[    3.816305] mmcblk0: mmc0:0001 8GTF4R 7.28 GiB
[    3.823774] mmcblk0boot0: mmc0:0001 8GTF4R partition 1 4.00 MiB
[    3.831486] mmcblk0boot1: mmc0:0001 8GTF4R partition 2 4.00 MiB
[    3.838894] mmcblk0rpmb: mmc0:0001 8GTF4R partition 3 512 KiB, chardev (245:0)
[    3.848601]  mmcblk0: p1 p2
[    3.896710] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    3.904098] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[    3.919165] devtmpfs: mounted
[    3.934075] Freeing unused kernel memory: 1024K
[    3.965784] Run /sbin/init as init process
[    3.973022]   with arguments:
[    3.973034]     /sbin/init
[    3.973056]   with environment:
[    3.973126]     HOME=/
[    3.973137]     TERM=linux
[    3.973262] usb 1-1: New USB device found, idVendor=214b, idProduct=7000, bcdDevice= 1.00
[    3.980651] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    3.988064] usb 1-1: Product: USB2.0 HUB
[    3.996188] hub 1-1:1.0: USB hub found
[    4.003608] hub 1-1:1.0: 4 ports detected
[    4.325293] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    4.455944] usb 1-1.1: New USB device found, idVendor=214b, idProduct=7000, bcdDevice= 1.00
[    4.463279] usb 1-1.1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    4.470600] usb 1-1.1: Product: USB2.0 HUB
[    4.478751] hub 1-1.1:1.0: USB hub found
[    4.486265] hub 1-1.1:1.0: 4 ports detected
[    4.596327] systemd[1]: System time before build time, advancing clock.
[    4.741051] NET: Registered protocol family 10
[    4.749922] Segment Routing with IPv6
[    4.805500] usb 1-1.1.1: new high-speed USB device number 4 using dwc_otg
[    4.837568] systemd[1]: systemd 241 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
[    4.855371] systemd[1]: Detected architecture arm.
[    4.956815] usb 1-1.1.1: New USB device found, idVendor=7392, idProduct=7811, bcdDevice= 2.00
[    4.956832] usb 1-1.1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    4.956844] usb 1-1.1.1: Product: 802.11n WLAN Adapter
[    4.956857] usb 1-1.1.1: Manufacturer: Realtek
[    4.956869] usb 1-1.1.1: SerialNumber: 00e04c000001
[    4.999432] systemd[1]: Set hostname to <BBPRO>.
[    5.055375] usb 1-1.1.2: new low-speed USB device number 5 using dwc_otg
[    5.222102] usb 1-1.1.2: New USB device found, idVendor=0461, idProduct=0010, bcdDevice= 1.10
[    5.231048] usb 1-1.1.2: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[    5.239593] usb 1-1.1.2: Product: USB Keyboard
[    5.274019] input: USB Keyboard as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.2/1-1.1.2:1.0/0003:0461:0010.0001/input/input0
[    5.346443] hid-generic 0003:0461:0010.0001: input,hidraw0: USB HID v1.11 Keyboard [USB Keyboard] on usb-3f980000.usb-1.1.2/input0
[    5.380029] input: USB Keyboard Consumer Control as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.2/1-1.1.2:1.1/0003:0461:0010.0002/input/input1
[    5.455822] input: USB Keyboard System Control as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.2/1-1.1.2:1.1/0003:0461:0010.0002/input/input2
[    5.465361] hid-generic 0003:0461:0010.0002: input,hidraw1: USB HID v1.11 Device [USB Keyboard] on usb-3f980000.usb-1.1.2/input1
[    5.832383] systemd[1]: /lib/systemd/system/smbd.service:9: PIDFile= references path below legacy directory /var/run/, updating /var/run/samba/smbd.pid → /run/samba/smbd.pid; please update the unit file accordingly.
[    5.870342] systemd[1]: /lib/systemd/system/nmbd.service:9: PIDFile= references path below legacy directory /var/run/, updating /var/run/samba/nmbd.pid → /run/samba/nmbd.pid; please update the unit file accordingly.
[    5.987390] random: systemd: uninitialized urandom read (16 bytes read)
[    6.015929] random: systemd: uninitialized urandom read (16 bytes read)
[    6.028048] systemd[1]: Created slice User and Session Slice.
[    6.049199] random: systemd: uninitialized urandom read (16 bytes read)
[    6.058769] systemd[1]: Reached target Slices.
[    6.079508] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    6.101494] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[    6.123793] systemd[1]: Listening on Journal Socket (/dev/log).
[    7.141649] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    7.285810] systemd-journald[107]: Received request to flush runtime journal from PID 1
[    7.539777] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    8.040137] vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned.
[    8.054945] bcm2835_vc_sm_cma_probe: Videocore shared memory driver
[    8.054992] [vc_sm_connected_init]: start
[    8.060476] mc: Linux media interface: v0.10
[    8.072059] [vc_sm_connected_init]: installed successfully
[    8.116709] videodev: Linux video capture interface: v2.00
[    8.164119] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[    8.164128] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[    8.167860] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[    8.172048] bcm2835_isp: module is from the staging directory, the quality is unknown, you have been warned.
[    8.181867] bcm2835_codec: module is from the staging directory, the quality is unknown, you have been warned.
[    8.188141] bcm2835-isp bcm2835-isp: Device node output[0] registered as /dev/video13
[    8.188937] bcm2835-isp bcm2835-isp: Device node capture[0] registered as /dev/video14
[    8.189629] bcm2835-isp bcm2835-isp: Device node capture[1] registered as /dev/video15
[    8.191435] bcm2835-isp bcm2835-isp: Device node stats[2] registered as /dev/video16
[    8.191486] bcm2835-isp bcm2835-isp: Register output node 0 with media controller
[    8.191516] bcm2835-isp bcm2835-isp: Register capture node 1 with media controller
[    8.191545] bcm2835-isp bcm2835-isp: Register capture node 2 with media controller
[    8.191567] bcm2835-isp bcm2835-isp: Register capture node 3 with media controller
[    8.192085] bcm2835-isp bcm2835-isp: Loaded V4L2 bcm2835-isp
[    8.193245] bcm2835-codec bcm2835-codec: Device registered as /dev/video10
[    8.193307] bcm2835-codec bcm2835-codec: Loaded V4L2 decode
[    8.201748] bcm2835-codec bcm2835-codec: Device registered as /dev/video11
[    8.201816] bcm2835-codec bcm2835-codec: Loaded V4L2 encode
[    8.210913] bcm2835-codec bcm2835-codec: Device registered as /dev/video12
[    8.210973] bcm2835-codec bcm2835-codec: Loaded V4L2 isp
[    8.215625] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.
[    8.412102] i2c i2c-11: Added multiplexed i2c bus 0
[    8.413144] i2c i2c-11: Added multiplexed i2c bus 10
[    8.485732] input: soc:shutdown_button@6 as /devices/platform/soc/soc:shutdown_button@6/input/input3
[    8.909023] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    9.068381] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    9.143736] vc4-drm soc:gpu: bound 3f600000.firmwarekms (ops vc4_fkms_ops [vc4])
[    9.144023] vc4-drm soc:gpu: bound 3fc00000.v3d (ops vc4_v3d_ops [vc4])
[    9.144047] checking generic (3e503000 6e7000) vs hw (0 ffffffff)
[    9.144062] fb0: switching to vc4drmfb from simple
[    9.144907] Console: switching to colour dummy device 80x30
[    9.146932] [drm] Initialized vc4 0.0.0 20140616 for soc:gpu on minor 0
[    9.369724] Console: switching to colour frame buffer device 240x67
[    9.396469] vc4-drm soc:gpu: [drm] fb0: vc4drmfb frame buffer device
[    9.623767] rtl8192cu: Chip version 0x10
[    9.747665] rtl8192cu: Board Type 0
[    9.747921] rtl_usb: rx_max_size 15360, rx_urb_num 8, in_ep 1
[    9.748049] rtl8192cu: Loading firmware rtlwifi/rtl8192cufw_TMSC.bin
[    9.748652] ieee80211 phy0: Selected rate control algorithm 'rtl_rc'
[    9.751550] usbcore: registered new interface driver rtl8192cu
[   10.486756] imx219 10-0010: failed to read chip id 219
[   10.487899] imx219: probe of 10-0010 failed with error -5
[   11.094844] random: crng init done
[   11.094892] random: 7 urandom warning(s) missed due to ratelimiting
[   11.350218] 8021q: 802.1Q VLAN Support v1.8
[   11.568204] Adding 102396k swap on /var/swap.  Priority:-2 extents:1 across:102396k SSFS
[   11.815521] rtl8192cu: MAC auto ON okay!
[   11.857727] rtl8192cu: Tx queue select: 0x05
[   14.497569] wlan0: authenticate with 68:ff:7b:1f:5d:c3
[   14.524691] wlan0: send auth to 68:ff:7b:1f:5d:c3 (try 1/3)
[   14.577421] wlan0: authenticated
[   14.585289] wlan0: associate with 68:ff:7b:1f:5d:c3 (try 1/3)
[   14.590989] wlan0: RX AssocResp from 68:ff:7b:1f:5d:c3 (capab=0x431 status=0 aid=1)
[   14.697436] wlan0: associated
[   14.769109] cryptd: max_cpu_qlen set to 1000
[   14.801388] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   33.755284] imx219_vddl: disabling
[   33.755304] imx219_vdig: disabling
[   33.755319] imx219_vana: disabling


User avatar
Gavinmc42
Posts: 5873
Joined: Wed Aug 28, 2013 3:31 am

Re: building libcamera on buster-lite

Tue Jun 15, 2021 11:57 am

I am getting no cameras found too.

Code: Select all

./libcamera-still 
[0:02:35.953509694] [1314]  INFO Camera camera_manager.cpp:294 libcamera v0.0.0+2650-62578ecc
ERROR: *** no cameras available ***
Tried various combos of overlays.
Raspiraw cannot find a camera either.

The Camera works for Raspistill when overlays swapped.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11487
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: building libcamera on buster-lite

Tue Jun 15, 2021 1:05 pm

Ardusan wrote:
Tue Jun 15, 2021 10:38 am
OK, done that...there are some suspicious lines...

Code: Select all

[   10.486756] imx219 10-0010: failed to read chip id 219
[   10.487899] imx219: probe of 10-0010 failed with error -5
CM1/3 doesn't follow the normal wiring of other Pis for cameras and displays.
The default overlays are for the camera to be on GPIOs 28&29 or 44&45 (depending on platform variant) which is i2c-10. GPIOs 0&1 are assigned i2c-0.

The original firmware stack CM1/3 wiring as described in the docs wires cam1 connector to GPIOs 0&1. (CM4 is hardwired with CAM1 on 44&45, so works).

There's no easy way to keep all the aliases mapped in a consistent manner. Swapping them would mean that any breakout board that expects i2c-0 on 0&1 would fail.

The cam1_reg regulator is assigned to GPIO 2, and cam0_reg is assigned to GPIO 30, so that bit does match.

For dual cameras, I had started on the relevant overlays (although they're also going to have issues on CM1/3), but I had issues getting it all working and that stalled due to other priorities. https://github.com/raspberrypi/linux/pull/4140
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Ardusan
Posts: 14
Joined: Fri Jun 04, 2021 1:30 am

Re: building libcamera on buster-lite

Thu Jun 17, 2021 12:58 am

I am still not getting how to make my two cameras (or one) work with libcamera and CM3....

User avatar
Gavinmc42
Posts: 5873
Joined: Wed Aug 28, 2013 3:31 am

Re: building libcamera on buster-lite

Fri Jun 18, 2021 11:06 am

Getting a bit further in getting libcamera to work.
Raspistill use the VC to control the i2c.
Libcamera is ARM based, so "dtparam=i2c_arm=on" config.txt?

Code: Select all

 sudo i2cdetect -y 10
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: 10 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- 64 -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                  

Code: Select all

./raspiraw -m
Using I2C device /dev/i2c-10
RaspiRaw: Probing sensor ov5647 on addr 36
RaspiRaw: Probing sensor imx219 on addr 10
RaspiRaw: Found sensor imx219 at address 10
RaspiRaw: Encoding 41414270
Now that is interesting I thought I had the NOIR V1
Raspiraw is finding V2?

Edit - I have too many cameras and Pi's.
Qcam and libcamera now working. proceed to next level, two cameras on CM4 ;)

A note in the Wiki?
Check config.txt, the i2c is arm and the right overlay is used :oops:
Missed the obvious.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Return to “Camera board”