Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libcamera-apps not working on RPi 3 Model B+ #125

Closed
babinos87 opened this issue Oct 12, 2021 · 20 comments
Closed

libcamera-apps not working on RPi 3 Model B+ #125

babinos87 opened this issue Oct 12, 2021 · 20 comments

Comments

@babinos87
Copy link

Hi,

I am trying to run libcamera-apps in my Raspberry Pi 3 Model B+. I get the below error:

$ libcamera-jpeg -o ~/Desktop/test6.jpg
[0:26:34.032643212] [2313]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3097-fa7a95bf
ERROR: *** no cameras available ***

but my camera is detected:

$ sudo vcgencmd get_camera
supported=1 detected=1

same for

$ sudo libcamera-hello 
[0:49:18.747128742] [3096]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3097-fa7a95bf
ERROR: *** no cameras available ***

and, if I use raspistill, the camera seems to work fine:

$ raspistill -o ~/Desktop/test.jpg

works great. I can see a pop up window with video, image is saved.

I am following the guide from Raspberry Pi site: https://www.raspberrypi.com/documentation/accessories/camera.html#building-libcamera-and-libcamera-apps

I have built by specifying -Dv4l2=true to the meson configure command and without. The result is the same. I also tried to run with -n, still same error.

I am clueless to what is happening. The camera seems to be installed correctly and works fine, so the problem in my case seems to be with the libcamera-apps. Any ideas what could be missing here, or at least some guidance to debug this?

Some info of my setup:

$ sudo vcgencmd version
Sep 28 2021 11:33:44 
Copyright (c) 2012 Broadcom
version 778b6a4f3c7d8d48bb63c02c47bcfbac79417bea (clean) (release) (start_x)
$ cat /etc/os-release 
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
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"

/boot/config.txt file:

$ cat /boot/config.txt 
disable_overscan=1

# I have tried both setting the below to on and commenting out, same result
dtparam=i2c_arm=on
dtparam=audio=on

[pi4]
max_framebuffers=2

[all]
# imx219 did not work at all - not even raspistil.
# raspistill works with vc4-fkms-v3d
dtoverlay=vc4-fkms-v3d
#dtoverlay=imx219
start_x=1
gpu_mem=128

Let me know if I can provide further info.

Many Thanks,
Babis

@davidplowman
Copy link
Collaborator

Hi, looking at your config.txt, perhaps you just need to uncomment the #dtoverlay=imx219 line (and reboot)? Note that when raspistill is working then libcamera cannot work, and vice versa. (There's more documentation here, noting that you have a pre-Bullseye image as Bullseye is not officially released yet!)

@babinos87
Copy link
Author

babinos87 commented Oct 13, 2021

Hi @davidplowman , thanks for your reply. I have already tried this and it didn't help. In fact, when I set dtoverlay=imx219, then the camera is not detected at all:

$ sudo vcgencmd get_camera
supported=1 detected=0

but I get a different error when I set dtoverlay=imx219:

$ libcamera-hello 
libEGL warning: DRI2: failed to authenticate
[0:02:08.593706385] [1002]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3100-0ce723fc
[0:02:08.667891694] [1002]  INFO Camera camera.cpp:937 configuring streams: (0) 1640x1232-YUV420
[0:02:08.668193136] [1012]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt RG10 Score: 2218 (best 2218)
[0:02:08.668353648] [1012]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt RG10 Score: 2041.48 (best 2041.48)
[0:02:08.668456299] [1012]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt RG10 Score: 1500 (best 1500)
[0:02:08.668555461] [1012]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt RG10 Score: 5004.81 (best 1500)
[0:02:08.668653581] [1012]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt pRAA Score: 1718 (best 1500)
[0:02:08.668748523] [1012]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt pRAA Score: 1541.48 (best 1500)
[0:02:08.668847841] [1012]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt pRAA Score: 1000 (best 1000)
[0:02:08.668941326] [1012]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt pRAA Score: 4504.81 (best 1000)
[0:02:08.669044654] [1012]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt RGGB Score: 3218 (best 1000)
[0:02:08.669139388] [1012]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt RGGB Score: 3041.48 (best 1000)
[0:02:08.669235269] [1012]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt RGGB Score: 2500 (best 1000)
[0:02:08.669328753] [1012]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt RGGB Score: 6004.81 (best 1000)
[0:02:08.669593791] [1012]  INFO RPI raspberrypi.cpp:620 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected mode: 1640x1232-pRAA
[0:02:08.720508972] [1016]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Sharpness = 1.000000
[0:02:08.720713701] [1016]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Saturation = 1.000000
[0:02:08.720777969] [1016]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Contrast = 1.000000
[0:02:08.720834580] [1016]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Brightness = 0.000000
[0:02:08.720886661] [1016]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
[0:02:08.720966969] [1016]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: NoiseReductionMode = 3
[0:02:08.721027799] [1016]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeMeteringMode = 0
[0:02:08.721085088] [1016]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeExposureMode = 0
[0:02:08.721137012] [1016]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: ExposureValue = 0.000000
[0:02:08.721197374] [1016]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AwbMode = 0
[0:02:08.722332991] [1012]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:02:08.722433611] [1012]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:02:08.722509440] [1012]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:02:08.806025976] [1012]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (6 left)
[0:02:08.839569156] [1012]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (5 left)
[0:02:08.873270765] [1012]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (4 left)
[0:02:08.905389228] [1012]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (3 left)
[0:02:08.938677265] [1012]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (2 left)
[0:02:08.972198936] [1012]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (1 left)
[0:02:09.005348179] [1012]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (0 left)
terminate called after throwing an instance of 'std::runtime_error'
  what():  failed to import fd 18
Aborted

Then, I try with -n:

$ libcamera-jpeg -o ~/Desktop/test201.jpg -n

and it works!!! 😮

@davidplowman
Copy link
Collaborator

Ah, are you running headless? The zero-copy optimised display pipeline doesn't work over the network. Try libcamera-hello --qt-preview. That's an unoptimised software renderer which works through X forwarding, but will eat your entire CPU and network bandwidth (so it's quite small by default). As you've discovered, the alternative is simply to suppress the preview altogether.

Note that the old legacy stack will not detect your camera when you switch to libcamera - that's expected.

@babinos87
Copy link
Author

babinos87 commented Oct 13, 2021

Nope, I am not running headless.

I tried to set some symbolic links as per some other suggestions I found: https://pi3d.github.io/html/FAQ.html#glx-dri2-not-supported-or-failed-to-authenticate

but this has messed up my libraries and I've broken it completely.

I ended up uninstalling and reinstalling libgles2 and libgl1

sudo apt remove libgl1
sudo apt remove libgles2
sudo apt install libgl1
sudo apt install libgles2

then I had to reinstall qt dependencies:

sudo apt install qtbase5-dev libqt5core5a libqt5gui5 libqt5widgets5

If I try libcamera-hello I get another error that makes me think that something is still messed up:

$ libcamera-hello 
Couldn't open libEGL.so.1: libEGL.so.1: cannot open shared object file: No such file or directory
Aborted

BUT what you've asked me to run WORKS:

$ libcamera-hello --qt-preview
[0:48:37.175042932] [3280]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3100-0ce723fc
[0:48:37.249340689] [3280]  INFO Camera camera.cpp:937 configuring streams: (0) 1640x1232-YUV420
[0:48:37.249726521] [3288]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt RG10 Score: 2218 (best 2218)
[0:48:37.249900062] [3288]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt RG10 Score: 2041.48 (best 2041.48)
[0:48:37.249983082] [3288]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt RG10 Score: 1500 (best 1500)
[0:48:37.250117821] [3288]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt RG10 Score: 5004.81 (best 1500)
[0:48:37.250198863] [3288]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt pRAA Score: 1718 (best 1500)
[0:48:37.250269852] [3288]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt pRAA Score: 1541.48 (best 1500)
[0:48:37.250339383] [3288]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt pRAA Score: 1000 (best 1000)
[0:48:37.250407560] [3288]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt pRAA Score: 4504.81 (best 1000)
[0:48:37.250486883] [3288]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt RGGB Score: 3218 (best 1000)
[0:48:37.250552351] [3288]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt RGGB Score: 3041.48 (best 1000)
[0:48:37.250620372] [3288]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt RGGB Score: 2500 (best 1000)
[0:48:37.250680840] [3288]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt RGGB Score: 6004.81 (best 1000)
[0:48:37.250972766] [3288]  INFO RPI raspberrypi.cpp:620 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected mode: 1640x1232-pRAA
[0:48:37.386204941] [3292]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Sharpness = 1.000000
[0:48:37.386409732] [3292]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Saturation = 1.000000
[0:48:37.386470721] [3292]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Contrast = 1.000000
[0:48:37.386526763] [3292]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Brightness = 0.000000
[0:48:37.386612231] [3292]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
[0:48:37.386689731] [3292]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: NoiseReductionMode = 3
[0:48:37.386764262] [3292]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeMeteringMode = 0
[0:48:37.386820772] [3292]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeExposureMode = 0
[0:48:37.386945615] [3292]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: ExposureValue = 0.000000
[0:48:37.387177594] [3292]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AwbMode = 0
[0:48:37.388623318] [3288]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:48:37.388717276] [3288]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:48:37.388760921] [3288]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:48:37.474789417] [3288]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (6 left)
[0:48:37.505962067] [3288]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (5 left)
[0:48:37.543044487] [3288]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (4 left)
[0:48:37.578237330] [3288]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (3 left)
[0:48:37.609768155] [3288]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (2 left)
[0:48:37.660191622] [3288]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (1 left)
[0:48:37.680641445] [3288]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (0 left)

This fails:

$ libcamera-jpeg -o ~/Desktop/test202.jpg
Couldn't open libEGL.so.1: libEGL.so.1: cannot open shared object file: No such file or directory
Aborted

but this works:

$ libcamera-jpeg -o ~/Desktop/test202.jpg -n
[0:49:44.006415849] [3313]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3100-0ce723fc
[0:49:44.067618443] [3313]  INFO Camera camera.cpp:937 configuring streams: (0) 1640x1232-YUV420
[0:49:44.068276774] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt RG10 Score: 2218 (best 2218)
[0:49:44.068441565] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt RG10 Score: 2041.48 (best 2041.48)
[0:49:44.068756200] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt RG10 Score: 1500 (best 1500)
[0:49:44.068937032] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt RG10 Score: 5004.81 (best 1500)
[0:49:44.069098698] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt pRAA Score: 1718 (best 1500)
[0:49:44.069166771] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt pRAA Score: 1541.48 (best 1500)
[0:49:44.069409583] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt pRAA Score: 1000 (best 1000)
[0:49:44.069562759] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt pRAA Score: 4504.81 (best 1000)
[0:49:44.069747602] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt RGGB Score: 3218 (best 1000)
[0:49:44.069817237] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt RGGB Score: 3041.48 (best 1000)
[0:49:44.069882498] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt RGGB Score: 2500 (best 1000)
[0:49:44.069943487] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt RGGB Score: 6004.81 (best 1000)
[0:49:44.070341246] [3315]  INFO RPI raspberrypi.cpp:620 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected mode: 1640x1232-pRAA
[0:49:44.133399303] [3319]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Sharpness = 1.000000
[0:49:44.133680604] [3319]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Saturation = 1.000000
[0:49:44.133743156] [3319]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Contrast = 1.000000
[0:49:44.133804562] [3319]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Brightness = 0.000000
[0:49:44.133863780] [3319]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
[0:49:44.133958832] [3319]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: NoiseReductionMode = 3
[0:49:44.134024092] [3319]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeMeteringMode = 0
[0:49:44.134085134] [3319]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeExposureMode = 0
[0:49:44.134140238] [3319]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: ExposureValue = 0.000000
[0:49:44.134285810] [3319]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AwbMode = 0
[0:49:44.135871950] [3315]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:49:44.135963512] [3315]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:49:44.136027106] [3315]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:49:44.220669044] [3315]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (6 left)
[0:49:44.253236533] [3315]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (5 left)
[0:49:44.290066974] [3315]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (4 left)
[0:49:44.323369877] [3315]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (3 left)
[0:49:44.355834917] [3315]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (2 left)
[0:49:44.389682349] [3315]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (1 left)
[0:49:44.423783478] [3315]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (0 left)
[0:49:49.257236744] [3313]  INFO Camera camera.cpp:937 configuring streams: (0) 3280x2464-YUV420
[0:49:49.258123356] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt BG10 Score: 1500 (best 1500)
[0:49:49.258321532] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt BG10 Score: 7155.48 (best 1500)
[0:49:49.258433355] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt BG10 Score: 7244 (best 1500)
[0:49:49.258538719] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt BG10 Score: 10748.8 (best 1500)
[0:49:49.258652468] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt BA81 Score: 2500 (best 1500)
[0:49:49.258842780] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt BA81 Score: 8155.48 (best 1500)
[0:49:49.259120123] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt BA81 Score: 8244 (best 1500)
[0:49:49.259271841] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt BA81 Score: 11748.8 (best 1500)
[0:49:49.259378768] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt pBAA Score: 1000 (best 1000)
[0:49:49.259482466] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt pBAA Score: 6655.48 (best 1000)
[0:49:49.259588246] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt pBAA Score: 6744 (best 1000)
[0:49:49.259691111] [3315]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt pBAA Score: 10248.8 (best 1000)
[0:49:49.260090901] [3315]  INFO RPI raspberrypi.cpp:620 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected mode: 3280x2464-pBAA
[0:49:49.355074729] [3321]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Sharpness = 1.000000
[0:49:49.355446134] [3321]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Saturation = 1.000000
[0:49:49.355557905] [3321]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Contrast = 1.000000
[0:49:49.355649259] [3321]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Brightness = 0.000000
[0:49:49.355735196] [3321]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: FrameDurationLimits = [ 100, 1000000000 ]
[0:49:49.355835196] [3321]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: NoiseReductionMode = 2
[0:49:49.355929101] [3321]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeMeteringMode = 0
[0:49:49.356050664] [3321]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeExposureMode = 0
[0:49:49.356135819] [3321]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: ExposureValue = 0.000000
[0:49:49.356225715] [3321]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AwbMode = 0
Still capture image received

@davidplowman
Copy link
Collaborator

Can you check what kind of display driver you've got in your /boot/config.txt? Check out the "NOTE" in this Getting Started section of the documentation. (I'm not sure removing those libraries will have helped you...)

@babinos87
Copy link
Author

Yes, just to clarify, all the the above last steps are with dtoverlay=imx219 (after your first suggestion I thought to try despite that the camera seems as not detected).

$ cat /boot/config.txt
...
[all]
#dtoverlay=vc4-fkms-v3d
dtoverlay=imx219
start_x=1
gpu_mem=128
$ sudo vcgencmd get_camera
supported=1 detected=0

So to recap:

  • I am using imx219 dtoverlay
  • The camera is reported as not detected, which is misleading, as it seems not true
  • I am having some other issues, as shown above, for the libcamera-apps (when not running with -n)

I will setup a new OS (same version) and repeat what I've done, before messing up the libraries, and see how things look like.

@babinos87
Copy link
Author

OK, I got a fresh Raspbian Buster, ran all the steps listed in official RPI site regarding the build of libcamera-apps.

Something works, but something is wrong.

My config

$ cat /boot/config.txt 
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=1

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

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
#dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d
dtoverlay=imx219
start_x=1
gpu_mem=128

Camera seems not detected:

$ sudo vcgencmd get_camera
supported=1 detected=0

libcamera-hello - NOT working

$ libcamera-hello
libEGL warning: DRI2: failed to authenticate
[0:19:58.125501550] [2636]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3100-0ce723fc
[0:19:58.184663587] [2636]  INFO Camera camera.cpp:937 configuring streams: (0) 1640x1232-YUV420
[0:19:58.185014046] [2647]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt RG10 Score: 2218 (best 2218)
[0:19:58.185154250] [2647]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt RG10 Score: 2041.48 (best 2041.48)
[0:19:58.185228050] [2647]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt RG10 Score: 1500 (best 1500)
[0:19:58.185290601] [2647]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt RG10 Score: 5004.81 (best 1500)
[0:19:58.185356016] [2647]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt pRAA Score: 1718 (best 1500)
[0:19:58.185416326] [2647]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt pRAA Score: 1541.48 (best 1500)
[0:19:58.185478095] [2647]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt pRAA Score: 1000 (best 1000)
[0:19:58.185538302] [2647]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt pRAA Score: 4504.81 (best 1000)
[0:19:58.185604759] [2647]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt RGGB Score: 3218 (best 1000)
[0:19:58.185664028] [2647]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt RGGB Score: 3041.48 (best 1000)
[0:19:58.185724964] [2647]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt RGGB Score: 2500 (best 1000)
[0:19:58.185785326] [2647]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt RGGB Score: 6004.81 (best 1000)
[0:19:58.186086203] [2647]  INFO RPI raspberrypi.cpp:620 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected mode: 1640x1232-pRAA
[0:19:58.325198965] [2651]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Sharpness = 1.000000
[0:19:58.325416199] [2651]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Saturation = 1.000000
[0:19:58.325475781] [2651]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Contrast = 1.000000
[0:19:58.325537341] [2651]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Brightness = 0.000000
[0:19:58.325588955] [2651]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
[0:19:58.325667129] [2651]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: NoiseReductionMode = 3
[0:19:58.325730148] [2651]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeMeteringMode = 0
[0:19:58.325785668] [2651]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeExposureMode = 0
[0:19:58.325836187] [2651]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: ExposureValue = 0.000000
[0:19:58.325924362] [2651]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AwbMode = 0
[0:19:58.327021831] [2647]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:19:58.327078704] [2647]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:19:58.327122193] [2647]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:19:58.412352092] [2647]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (6 left)
[0:19:58.443061647] [2647]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (5 left)
[0:19:58.479978059] [2647]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (4 left)
[0:19:58.513771068] [2647]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (3 left)
[0:19:58.546534472] [2647]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (2 left)
[0:19:58.591505293] [2647]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (1 left)
[0:19:58.615680135] [2647]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (0 left)
terminate called after throwing an instance of 'std::runtime_error'
  what():  failed to import fd 18
Aborted

libcamera-hello -n - WORKING

$ libcamera-hello -n
[0:20:47.145893622] [2660]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3100-0ce723fc
[0:20:47.208170500] [2660]  INFO Camera camera.cpp:937 configuring streams: (0) 1640x1232-YUV420
[0:20:47.209504322] [2662]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt RG10 Score: 2218 (best 2218)
[0:20:47.209903375] [2662]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt RG10 Score: 2041.48 (best 2041.48)
[0:20:47.210090610] [2662]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt RG10 Score: 1500 (best 1500)
[0:20:47.210187483] [2662]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt RG10 Score: 5004.81 (best 1500)
[0:20:47.210289876] [2662]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt pRAA Score: 1718 (best 1500)
[0:20:47.210384249] [2662]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt pRAA Score: 1541.48 (best 1500)
[0:20:47.210480861] [2662]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt pRAA Score: 1000 (best 1000)
[0:20:47.210575546] [2662]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt pRAA Score: 4504.81 (best 1000)
[0:20:47.210681898] [2662]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt RGGB Score: 3218 (best 1000)
[0:20:47.210775177] [2662]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt RGGB Score: 3041.48 (best 1000)
[0:20:47.210870695] [2662]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt RGGB Score: 2500 (best 1000)
[0:20:47.210965068] [2662]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt RGGB Score: 6004.81 (best 1000)
[0:20:47.211295216] [2662]  INFO RPI raspberrypi.cpp:620 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected mode: 1640x1232-pRAA
[0:20:47.320802410] [2666]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Sharpness = 1.000000
[0:20:47.321187453] [2666]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Saturation = 1.000000
[0:20:47.321273700] [2666]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Contrast = 1.000000
[0:20:47.321339063] [2666]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Brightness = 0.000000
[0:20:47.321399479] [2666]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
[0:20:47.321509945] [2666]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: NoiseReductionMode = 3
[0:20:47.321578276] [2666]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeMeteringMode = 0
[0:20:47.321639890] [2666]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeExposureMode = 0
[0:20:47.321693326] [2666]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: ExposureValue = 0.000000
[0:20:47.321824260] [2666]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AwbMode = 0
[0:20:47.323786036] [2662]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:20:47.324051862] [2662]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:20:47.324156495] [2662]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:20:47.411211524] [2662]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (6 left)
[0:20:47.444005418] [2662]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (5 left)
[0:20:47.479293887] [2662]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (4 left)
[0:20:47.513055882] [2662]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (3 left)
[0:20:47.545052087] [2662]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (2 left)
[0:20:47.579266780] [2662]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (1 left)
[0:20:47.621232743] [2662]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (0 left)

libcamera-jpeg -o ~/Desktop/test1.jpg - NOT working

$ libcamera-jpeg -o ~/Desktop/test1.jpg
libEGL warning: DRI2: failed to authenticate
[0:21:17.269505608] [2703]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3100-0ce723fc
[0:21:17.344956852] [2703]  INFO Camera camera.cpp:937 configuring streams: (0) 1640x1232-YUV420
[0:21:17.345462309] [2714]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt RG10 Score: 2218 (best 2218)
[0:21:17.345688294] [2714]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt RG10 Score: 2041.48 (best 2041.48)
[0:21:17.345769698] [2714]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt RG10 Score: 1500 (best 1500)
[0:21:17.345833707] [2714]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt RG10 Score: 5004.81 (best 1500)
[0:21:17.345904747] [2714]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt pRAA Score: 1718 (best 1500)
[0:21:17.345968235] [2714]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt pRAA Score: 1541.48 (best 1500)
[0:21:17.346032140] [2714]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt pRAA Score: 1000 (best 1000)
[0:21:17.346092816] [2714]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt pRAA Score: 4504.81 (best 1000)
[0:21:17.346163023] [2714]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt RGGB Score: 3218 (best 1000)
[0:21:17.346223855] [2714]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt RGGB Score: 3041.48 (best 1000)
[0:21:17.346286145] [2714]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt RGGB Score: 2500 (best 1000)
[0:21:17.346347185] [2714]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt RGGB Score: 6004.81 (best 1000)
[0:21:17.346630825] [2714]  INFO RPI raspberrypi.cpp:620 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected mode: 1640x1232-pRAA
[0:21:17.562253179] [2718]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Sharpness = 1.000000
[0:21:17.562575047] [2718]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Saturation = 1.000000
[0:21:17.562640202] [2718]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Contrast = 1.000000
[0:21:17.562698638] [2718]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Brightness = 0.000000
[0:21:17.562750408] [2718]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
[0:21:17.562831239] [2718]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: NoiseReductionMode = 3
[0:21:17.562897331] [2718]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeMeteringMode = 0
[0:21:17.562950976] [2718]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeExposureMode = 0
[0:21:17.562999517] [2718]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: ExposureValue = 0.000000
[0:21:17.563061911] [2718]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AwbMode = 0
[0:21:17.564554118] [2714]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:21:17.564671459] [2714]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:21:17.564720885] [2714]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:21:17.662318773] [2714]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (6 left)
[0:21:17.696418642] [2714]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (5 left)
[0:21:17.732878927] [2714]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (4 left)
[0:21:17.761801619] [2714]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (3 left)
[0:21:17.795248585] [2714]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (2 left)
[0:21:17.842290719] [2714]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (1 left)
[0:21:17.866258573] [2714]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (0 left)
terminate called after throwing an instance of 'std::runtime_error'
  what():  failed to import fd 18
Aborted

libcamera-jpeg -o ~/Desktop/test1.jpg -n - WORKING

$ libcamera-jpeg -o ~/Desktop/test2.jpg -n
[0:22:11.123696169] [2722]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3100-0ce723fc
[0:22:11.186753977] [2722]  INFO Camera camera.cpp:937 configuring streams: (0) 1640x1232-YUV420
[0:22:11.187361726] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt RG10 Score: 2218 (best 2218)
[0:22:11.187608908] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt RG10 Score: 2041.48 (best 2041.48)
[0:22:11.187698855] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt RG10 Score: 1500 (best 1500)
[0:22:11.187766145] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt RG10 Score: 5004.81 (best 1500)
[0:22:11.187845675] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt pRAA Score: 1718 (best 1500)
[0:22:11.187910465] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt pRAA Score: 1541.48 (best 1500)
[0:22:11.187978901] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt pRAA Score: 1000 (best 1000)
[0:22:11.188043223] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt pRAA Score: 4504.81 (best 1000)
[0:22:11.188126607] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt RGGB Score: 3218 (best 1000)
[0:22:11.188192751] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt RGGB Score: 3041.48 (best 1000)
[0:22:11.188256865] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt RGGB Score: 2500 (best 1000)
[0:22:11.188321551] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt RGGB Score: 6004.81 (best 1000)
[0:22:11.188701440] [2724]  INFO RPI raspberrypi.cpp:620 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected mode: 1640x1232-pRAA
[0:22:11.268570541] [2728]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Sharpness = 1.000000
[0:22:11.269070948] [2728]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Saturation = 1.000000
[0:22:11.269179540] [2728]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Contrast = 1.000000
[0:22:11.269246570] [2728]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Brightness = 0.000000
[0:22:11.269300058] [2728]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
[0:22:11.269419223] [2728]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: NoiseReductionMode = 3
[0:22:11.269493232] [2728]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeMeteringMode = 0
[0:22:11.269554116] [2728]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeExposureMode = 0
[0:22:11.269608334] [2728]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: ExposureValue = 0.000000
[0:22:11.269741873] [2728]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AwbMode = 0
[0:22:11.271628816] [2724]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:22:11.271732564] [2724]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:22:11.271779021] [2724]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:22:11.365582336] [2724]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (6 left)
[0:22:11.397256263] [2724]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (5 left)
[0:22:11.433158964] [2724]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (4 left)
[0:22:11.467370603] [2724]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (3 left)
[0:22:11.499101508] [2724]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (2 left)
[0:22:11.532535297] [2724]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (1 left)
[0:22:11.566469911] [2724]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (0 left)
[0:22:16.388565314] [2722]  INFO Camera camera.cpp:937 configuring streams: (0) 3280x2464-YUV420
[0:22:16.389230822] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt BG10 Score: 1500 (best 1500)
[0:22:16.389394569] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt BG10 Score: 7155.48 (best 1500)
[0:22:16.389461860] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt BG10 Score: 7244 (best 1500)
[0:22:16.389523890] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt BG10 Score: 10748.8 (best 1500)
[0:22:16.389592430] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt BA81 Score: 2500 (best 1500)
[0:22:16.389653783] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt BA81 Score: 8155.48 (best 1500)
[0:22:16.389715553] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt BA81 Score: 8244 (best 1500)
[0:22:16.389776385] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt BA81 Score: 11748.8 (best 1500)
[0:22:16.389838311] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt pBAA Score: 1000 (best 1000)
[0:22:16.389898310] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt pBAA Score: 6655.48 (best 1000)
[0:22:16.389959298] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt pBAA Score: 6744 (best 1000)
[0:22:16.390112004] [2724]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt pBAA Score: 10248.8 (best 1000)
[0:22:16.390358041] [2724]  INFO RPI raspberrypi.cpp:620 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected mode: 3280x2464-pBAA
[0:22:16.507574949] [2730]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Sharpness = 1.000000
[0:22:16.507768956] [2730]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Saturation = 1.000000
[0:22:16.507834944] [2730]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Contrast = 1.000000
[0:22:16.507894110] [2730]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Brightness = 0.000000
[0:22:16.507946400] [2730]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: FrameDurationLimits = [ 100, 1000000000 ]
[0:22:16.508020201] [2730]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: NoiseReductionMode = 2
[0:22:16.508073117] [2730]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeMeteringMode = 0
[0:22:16.508132282] [2730]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeExposureMode = 0
[0:22:16.508183636] [2730]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: ExposureValue = 0.000000
[0:22:16.508240353] [2730]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AwbMode = 0
Still capture image received

libcamera-hello --qt-preview - WORKING

$ libcamera-hello --qt-preview
libEGL warning: DRI2: failed to authenticate
qt5ct: using qt5ct plugin
[0:22:53.429417854] [2743]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3100-0ce723fc
[0:22:53.490765347] [2743]  INFO Camera camera.cpp:937 configuring streams: (0) 1640x1232-YUV420
[0:22:53.491189038] [2756]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt RG10 Score: 2218 (best 2218)
[0:22:53.491378462] [2756]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt RG10 Score: 2041.48 (best 2041.48)
[0:22:53.491461377] [2756]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt RG10 Score: 1500 (best 1500)
[0:22:53.491527939] [2756]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt RG10 Score: 5004.81 (best 1500)
[0:22:53.491594656] [2756]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt pRAA Score: 1718 (best 1500)
[0:22:53.491656061] [2756]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt pRAA Score: 1541.48 (best 1500)
[0:22:53.491718092] [2756]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt pRAA Score: 1000 (best 1000)
[0:22:53.491778299] [2756]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt pRAA Score: 4504.81 (best 1000)
[0:22:53.491851943] [2756]  INFO RPI raspberrypi.cpp:122 Mode: 3280x2464 fmt RGGB Score: 3218 (best 1000)
[0:22:53.491916057] [2756]  INFO RPI raspberrypi.cpp:122 Mode: 1920x1080 fmt RGGB Score: 3041.48 (best 1000)
[0:22:53.491978035] [2756]  INFO RPI raspberrypi.cpp:122 Mode: 1640x1232 fmt RGGB Score: 2500 (best 1000)
[0:22:53.492038086] [2756]  INFO RPI raspberrypi.cpp:122 Mode: 640x480 fmt RGGB Score: 6004.81 (best 1000)
[0:22:53.492324748] [2756]  INFO RPI raspberrypi.cpp:620 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected mode: 1640x1232-pRAA
[0:22:53.653029868] [2760]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Sharpness = 1.000000
[0:22:53.653868551] [2760]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Saturation = 1.000000
[0:22:53.654310887] [2760]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Contrast = 1.000000
[0:22:53.654478645] [2760]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: Brightness = 0.000000
[0:22:53.655653312] [2760]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
[0:22:53.656126377] [2760]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: NoiseReductionMode = 3
[0:22:53.656503037] [2760]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeMeteringMode = 0
[0:22:53.656767356] [2760]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeExposureMode = 0
[0:22:53.656880531] [2760]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: ExposureValue = 0.000000
[0:22:53.657064538] [2760]  INFO IPARPI raspberrypi.cpp:626 Request ctrl: AwbMode = 0
[0:22:53.660304118] [2756]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:22:53.660495105] [2756]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:22:53.660547968] [2756]  INFO RPISTREAM rpi_stream.cpp:122 No buffers available for ISP Output0
[0:22:53.747904653] [2756]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (6 left)
[0:22:53.777607532] [2756]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (5 left)
[0:22:53.812659016] [2756]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (4 left)
[0:22:53.845874334] [2756]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (3 left)
[0:22:53.881427060] [2756]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (2 left)
[0:22:53.912288200] [2756]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (1 left)
[0:22:53.945657890] [2756]  INFO RPI raspberrypi.cpp:1636 Dropping frame at the request of the IPA (0 left)

So it seems that using -n works ok, so does the qt-preview as @davidplowman suggested. But without -n, none of those apps seem to work. Seems that this relates to qt somehow?

@babinos87
Copy link
Author

And this is the build script that I used:

#!/bin/bash

set -e

# Raspberry Pi OS Lite users will first need to install the following 
# additional packages if they have not done so previously
sudo apt install -y python3-pip git
sudo pip3 install jinja2

#  All users should then install the following
sudo apt install -y libboost-dev
sudo apt install -y libgnutls28-dev openssl libtiff5-dev
sudo apt install -y qtbase5-dev libqt5core5a libqt5gui5 libqt5widgets5
sudo apt install -y meson
sudo pip3 install pyyaml ply
sudo pip3 install --upgrade meson

# libcamera
cd ~/Desktop
git clone git://linuxtv.org/libcamera.git
cd libcamera
meson build --buildtype=release
cd build
meson configure -Dpipelines=raspberrypi -Dtest=false
cd ..
ninja -C build
sudo ninja -C build install   # use -j 2 on Pi 3 or earlier devices

# libepoxy
cd ~/Desktop
sudo apt install -y libegl1-mesa-dev
git clone https://github.com/anholt/libepoxy.git
cd libepoxy
mkdir build
cd build
meson
ninja
sudo ninja install

# Building libcamera-apps
sudo apt install -y cmake \
	libboost-program-options-dev \
	libdrm-dev \
	libexif-dev

cd ~/Desktop
git clone https://github.com/raspberrypi/libcamera-apps.git
cd libcamera-apps
mkdir build
cd build
cmake .. -DENABLE_COMPILE_FLAGS_FOR_TARGET=armv8-neon  # add your extra cmake flags here
make -j2  # use -j2 on Pi 3 or earlier devices
sudo make install
sudo ldconfig  # this is only necessary on the first build

@davidplowman
Copy link
Collaborator

According to the "NOTE" in this Getting Started section of the documentation, you need to uncomment the dtoverlay=vc4-fkms-v3d line in the /boot/config.txt.

@babinos87
Copy link
Author

babinos87 commented Oct 14, 2021

I have tried both dtoverlay=vc4-fkms-v3d and dtoverlay=imx219.

  • With imx219: raspistill does not work, libcamera-apps work ONLY when using with -n. libcamera-hello --qt-preview also works with this setting.
  • With vc4-fkms-v3d: raspistill works, libcamera-apps don't work (getting ERROR: *** no cameras available ***)

All comments above and logs are with imx219 setting.

@davidplowman
Copy link
Collaborator

Well, I'm at a bit of a loss really. I feel there must be something awry with your setup but it's hard to know what. I've just been through the following exact steps, doing absolutely nothing other than what I've written below. Are you in a position to repeat the experiment?

  1. I've downloaded the latest Raspberry Pi 32-bit OS onto an SD card using the Raspberry Pi Imager.
  2. I inserted it and started my Pi 3B, letting it do all its updates (takes a little while).
  3. Before rebooting I edited /boot/config.txt to uncomment the vc4-fkms-v3d line and added dtoverlay=imx477 (I have an HQ cam attached). Now grep '^[^#]' /boot/config.txt shows the following:
disable_overscan=1
dtparam=audio=on
[pi4]
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
[all]
dtoverlay=vc4-fkms-v3d
dtoverlay=imx477
  1. I rebooted the Pi. The version information of my image reports:
pi@raspberrypi:~ $ uname -a
Linux raspberrypi 5.10.63-v7+ #1459 SMP Wed Oct 6 16:41:10 BST 2021 armv7l GNU/Linux
pi@raspberrypi:~ $ vcgencmd version
Sep 30 2021 19:22:24 
Copyright (c) 2012 Broadcom
version 51215b4f6e3966401ecd99652a35cf1c25069113 (clean) (release) (start)
  1. I downloaded and ran your installation script from above. The only change I made was to replace the line ninja -C build by ninja -C build -j 2. It went through to completion with no problems (again, it takes a while).
  2. Finally I opened a new terminal window, typed libcamera-hello and the preview window appeared as expected.

Are you in a position to have another go at this? I'm sorry that it's a bit time-consuming.

@babinos87
Copy link
Author

babinos87 commented Oct 16, 2021

OK, hold on a second because I've just realized something crucial; when you wrote uncomment the dtoverlay=vc4-fkms-v3d line in the /boot/config.txt, you literally meant to just uncomment (AND keep the other dtoverlay setting - imx219 in my case)?

What I was trying was to keep one but not another, so I was trying with EITHER dtoverlay=imx219 OR dtoverlay=vc4-fkms-v3d - and I was getting the above mentioned errors in both cases.

Stupid me, not very clear from the other hand when I re-read the official instructions (for someone doing this for their very first time).

So, when I keep both in my /boot/config.txt, ie:

...
dtoverlay=vc4-fkms-v3d
dtoverlay=imx219
...

all commands work great (both with -n and without)!!

Thanks @davidplowman :)

@davidplowman
Copy link
Collaborator

Glad you've figured it out. Sorry if the instructions aren't always totally clear, the new documentation website is still WIP to some extent. And life will get much better once the new Bullseye OS is released soon, stuff will just work "out of the box".

@harshalak77
Copy link

harshalak77 commented Apr 3, 2022

Hi @babinos87 and @davidplowman,
Here is my config file for RPI4

[pi4]
dtoverlay=vc4-fkms-v3d
dtoverlay=imx219
arm_boost=1

and

Here is libcamera-hello command output

libcamera-hello
libEGL warning: DRI2: failed to authenticate
Made X/EGL preview window
[0:32:00.312563346] [2941] INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3424-e68e0f1e
ERROR: *** no cameras available ***

I have both
dtoverlay=vc4-fkms-v3d
dtoverlay=imx219
enabled(uncommented) but still camera doesn't work please help......

@kevleyski
Copy link

Also having problems with dtoverlay=vc4-fkms-v3d (Firmware/Fake)KMS vs Full KMS dtoverlay=vc4-kms-v3d (which is ok but then the touchscreen doesn't work)

@dhaval-khatri1996
Copy link

@harshalak77 were you able to solve your issue?

@MightyMirko
Copy link

Hello,

please make sure your driver config is in all section, not in pi4

@Petros626
Copy link

Petros626 commented Feb 24, 2023

Hi @babinos87 and @davidplowman, Here is my config file for RPI4

[pi4] dtoverlay=vc4-fkms-v3d dtoverlay=imx219 arm_boost=1

and

Here is libcamera-hello command output

libcamera-hello libEGL warning: DRI2: failed to authenticate Made X/EGL preview window [0:32:00.312563346] [2941] INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3424-e68e0f1e ERROR: *** no cameras available ***

I have both dtoverlay=vc4-fkms-v3d dtoverlay=imx219 enabled(uncommented) but still camera doesn't work please help......

I have the same issue since days. I Installed a new image (Bullseye) and tried again, but the preview always fails. I need this preview for my work so the --qt-preview works, but isn't the solution for it. Did you solve it @harshalak77 ?

And @davidplowman is this a x64 bug, seems that the new bullseye version still isn't stable

@davidplowman
Copy link
Collaborator

Generally my advice is to start by connecting a keyboard and HDMI display directly to your Pi, downloading the latest image, touching absolutely nothing else in the image, and seeing if libcamera-hello works.

If that works as it should then proceed to change just one thing at a time until you reach a point where it doesn't. If it doesn't "just work" at the outset, then something is either not plugged in properly or actually broken.

If you haven't been able to get things working by the above steps, then please file a new issue. Thanks!

@Petros626
Copy link

Generally my advice is to start by connecting a keyboard and HDMI display directly to your Pi, downloading the latest image, touching absolutely nothing else in the image, and seeing if libcamera-hello works.

If that works as it should then proceed to change just one thing at a time until you reach a point where it doesn't. If it doesn't "just work" at the outset, then something is either not plugged in properly or actually broken.

If you haven't been able to get things working by the above steps, then please file a new issue. Thanks!

Thanks I'll try it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants