We use some essential cookies to make our website work.

We use optional cookies, as detailed in our cookie policy, to remember your settings and understand how you use our website.

Bluemethyst
Posts: 3
Joined: Mon Sep 16, 2024 10:09 pm

libcamera-hello: ERROR: *** no cameras available ***

Mon Sep 16, 2024 11:24 pm

Hey! i am trying to view my Pi Zero W 2's connected camera via a web browser with python and i got it working yesterday but when i booted up the Pi this morning the camera is no longer detected by libcamera-hello or any other means. I tried putting an SD card into it that has MotionEyeOS on it and that worked perfectly, first try. Its weird to me that it was working perfectly fine yesterday but this morning, nothing! ive done about an hour of googling and cant find any solutions that work for me, i tried this command

Code: Select all

vcgencmd get_camera
and it gave this output which is worrying:

Code: Select all

supported=0 detected=0, libcamera interfaces=0
. Any help would be amazing thanks!

Edit: when running libcamera-hello with sudo like so:

Code: Select all

sudo libcamera-hello
it works perfectly fine... any reason why? and i still cant get it to work with python...

redvli
Posts: 2949
Joined: Thu Sep 03, 2020 8:09 am

Re: libcamera-hello: ERROR: *** no cameras available ***

Tue Sep 17, 2024 6:34 am

Can be something wrong with the flatcable.

MotionEyeOS maybe using the old/legacy camera stack, that is something different, has different timing etc. I have had several cases where the old stack works and new libcamera base does not work. Especially flat-cable length was/can be an issue.

But update your OS to latest Bookworm state, so run

Code: Select all

sudo apt update && apt full-upgrade
You should then run it via new name:

Code: Select all

sudo rpicam-hello
Version should be v0.3.1+50-69a894c4

I just ran it via a serial console CLI on a Pi3 64-bit OS with long 2 meter cable, it works, but it is slow in starting up, very slow on Pi1 and Pi0, count 10 seconds or more.

redvli
Posts: 2949
Joined: Thu Sep 03, 2020 8:09 am

Re: libcamera-hello: ERROR: *** no cameras available ***

Tue Sep 17, 2024 8:56 am

When old / legacy stack is enabled via config.txt (start_x=1), you should get:

Code: Select all

# vcgencmd get_camera
supported=1 detected=1, libcamera interfaces=0

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

Re: libcamera-hello: ERROR: *** no cameras available ***

Tue Sep 17, 2024 10:54 am

Bluemethyst wrote:
Mon Sep 16, 2024 11:24 pm
Edit: when running libcamera-hello with sudo like so:

Code: Select all

sudo libcamera-hello
it works perfectly fine... any reason why? and i still cant get it to work with python...
That implies that something has got messed up with permissions.
Did you upgrade via apt or similar? (Doing so shouldn't break anything, but is a change).
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

redvli
Posts: 2949
Joined: Thu Sep 03, 2020 8:09 am

Re: libcamera-hello: ERROR: *** no cameras available ***

Tue Sep 17, 2024 12:19 pm

6by9 wrote:
Tue Sep 17, 2024 10:54 am
That implies that something has got messed up with permissions.
Did you upgrade via apt or similar? (Doing so shouldn't break anything, but is a change).
Indeed, I did not catch the root v.s. non-root issue, as I usually run as root doing this kind of setups/administration/testing. So just for the topic, I insert 'sudo' as most people use unmodified RPIOS I guess.

But as normal user rpicam-hello also works fine on my old from-buster-upgraded-Pi3B

Bluemethyst
Posts: 3
Joined: Mon Sep 16, 2024 10:09 pm

Re: libcamera-hello: ERROR: *** no cameras available ***

Mon Sep 23, 2024 11:07 pm

Thanks guys, ive tried pretty much everything here except the config.txt change? can you tell me more about that? nothing has worked unfortunately, if nothing else fixes it ig ill just reinstall the os?
a full log of the command output is below:

Code: Select all

admin@picam:~ $ rpicam-hello
Could not open any dmaHeap device
[0:05:13.870697069] [1591]  INFO Camera camera_manager.cpp:316 libcamera v0.3.1+50-69a894c4
[0:05:13.905379190] [1595] ERROR DmaBufAllocator dma_buf_allocator.cpp:116 Could not open any dma-buf provider
[0:05:13.938966830] [1595]  WARN RPiSdn sdn.cpp:40 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise
[0:05:13.943645741] [1595] ERROR RPI vc4.cpp:216 Failed to register camera imx477 10-001a: -12
Preview window unavailable
ERROR: *** no cameras available ***
when run with sudo:

Code: Select all

admin@picam:~ $ sudo rpicam-hello
[0:05:07.583339606] [1578]  INFO Camera camera_manager.cpp:316 libcamera v0.3.1+      50-69a894c4
[0:05:07.693058787] [1583]  WARN RPiSdn sdn.cpp:40 Using legacy SDN tuning - ple      ase consider moving SDN inside rpi.denoise
[0:05:07.699284835] [1583]  INFO RPI vc4.cpp:447 Registered camera /base/soc/i2c      0mux/i2c@1/imx477@1a to Unicam device /dev/media0 and ISP device /dev/media1
[0:05:07.699442856] [1583]  INFO RPI pipeline_base.cpp:1125 Using configuration       file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
Preview window unavailable
Mode selection for 2028:1520:12:P
    SRGGB10_CSI2P,1332x990/0 - Score: 3456.22
    SRGGB12_CSI2P,2028x1080/0 - Score: 1083.84
    SRGGB12_CSI2P,2028x1520/0 - Score: 0
    SRGGB12_CSI2P,4056x3040/0 - Score: 887
[0:05:07.704570779] [1578]  INFO Camera camera.cpp:1191 configuring streams: (0)       2028x1520-YUV420 (1) 2028x1520-SBGGR12_CSI2P
[0:05:07.705300206] [1583]  INFO RPI vc4.cpp:622 Sensor: /base/soc/i2c0mux/i2c@1      /imx477@1a - Selected sensor format: 2028x1520-SBGGR12_1X12 - Selected unicam fo      rmat: 2028x1520-pBCC
#0 (0.00 fps) exp 15303.00 ag 2.00 dg 1.00
#1 (30.01 fps) exp 15303.00 ag 2.00 dg 1.02
#2 (30.01 fps) exp 15303.00 ag 2.00 dg 1.02
#3 (30.01 fps) exp 15303.00 ag 2.00 dg 1.02
etc, etc....

redvli
Posts: 2949
Joined: Thu Sep 03, 2020 8:09 am

Re: libcamera-hello: ERROR: *** no cameras available ***

Tue Sep 24, 2024 7:02 am

Things with permissions can keep you busy for a long time is my experience, so up to you what you do. I usually go back to older snapshot backup, and/or do compare with parallel new installation. Maybe you are fine with running as root if it is just a remote headless Pi without microphone.
This is brand new software on stable Debian Bookworm so maybe use more logging/debugging options by default, that is what I usually do for new software (versions younger than 1 years or so).

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

Re: libcamera-hello: ERROR: *** no cameras available ***

Tue Sep 24, 2024 9:28 am

Code: Select all

Could not open any dmaHeap device
So it's the permissions on /dev/dma_heap/* that has gone wrong.
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Bluemethyst
Posts: 3
Joined: Mon Sep 16, 2024 10:09 pm

Re: libcamera-hello: ERROR: *** no cameras available ***

Fri Sep 27, 2024 10:49 pm

Im not sure what the issue was in the end, i reinstalled the RaspberryPiOS Lite 64bit on the SD card and it works again.

Return to “Camera board”