Libcamera no cameras available for IMX519 after reboot

Hi, I can’t get my camera working at all. I followed the guide for this camera step by step but I keep getting “no cameras available” in the terminal. Weird part is I was actually able to take a picture once with libcamera-still -t 1000 -o test.jpg -n and it worked fine, but after I rebooted I’m back to the same error. Anyone know what’s going on?

Hey, sorry you’re running into this. Let’s dig in. Can you tell me which camera sensor you’re using, and paste the exact error you’re seeing along with your libcamera version? Also run dmesg | grep imx519 (adjust for your sensor) and share what comes back. That’ll help me figure out whether it’s a driver thing or something else.

Sure. Sensor is an imx519 (shows up as imx519 10-001a). libcamera version is v0.0.0+3897-c3c878a9. I’ve got media devices /dev/media0 through /dev/media4.

Here’s what happens when I run libcamera-still -t 1000 -o test.jpg -n:

[0:00:57.336191760] [1808]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3897-c3c878a9
[0:00:57.336547353] [1810] ERROR MediaDevice media_device.cpp:479 /dev/media0[]: Failed to open media device at /dev/media0: Permission denied
[0:00:57.336603149] [1810]  INFO DeviceEnumerator device_enumerator.cpp:218 Unable to populate media device /dev/media0 (Permission denied), skipping
[0:00:57.336654927] [1810] ERROR MediaDevice media_device.cpp:479 /dev/media3[]: Failed to open media device at /dev/media3: Permission denied
[0:00:57.336683446] [1810]  INFO DeviceEnumerator device_enumerator.cpp:218 Unable to populate media device /dev/media3 (Permission denied), skipping
[0:00:57.336724205] [1810] ERROR MediaDevice media_device.cpp:479 /dev/media1[]: Failed to open media device at /dev/media1: Permission denied
[0:00:57.336750779] [1810]  INFO DeviceEnumerator device_enumerator.cpp:218 Unable to populate media device /dev/media1 (Permission denied), skipping
[0:00:57.336790186] [1810] ERROR MediaDevice media_device.cpp:479 /dev/media4[]: Failed to open media device at /dev/media4: Permission denied
[0:00:57.336816205] [1810]  INFO DeviceEnumerator device_enumerator.cpp:218 Unable to populate media device /dev/media4 (Permission denied), skipping
[0:00:57.336855316] [1810] ERROR MediaDevice media_device.cpp:479 /dev/media2[]: Failed to open media device at /dev/media2: Permission denied
[0:00:57.336881260] [1810]  INFO DeviceEnumerator device_enumerator.cpp:218 Unable to populate media device /dev/media2 (Permission denied), skipping
ERROR: *** no cameras available ***

And dmesg | grep imx519 gives me:

[    8.475566] imx519 10-001a: Device found is imx519
[    8.476169] imx519 10-001a: Consider updating driver imx519 to match on endpoints

I forgot to mention - I went through the whole setup guide for this camera already, ran the dmesg check, even got a picture out of it once before the reboot. I’ve also searched a bunch of forum threads here but nothing seems to match this exact error. Not sure what else to try.

Thanks, that log is really helpful. The key thing I’m seeing is the repeated Failed to open media device at /dev/mediaX: Permission denied for all five media devices, followed by no cameras available. The sensor itself is detected fine at the kernel level (your dmesg shows Device found is imx519), so it’s not a hardware or driver detection problem - it’s a permissions issue on the media devices.

Out of curiosity, did you recently update/upgrade to a newer kernel version? That would explain why it worked once and then broke after the reboot - the new kernel tightened up access to the media devices.

Yeah actually I did upgrade recently. So is that what’s causing it? What do I need to do to fix it?

That lines up. With the newer kernel, the libcamera command needs elevated privileges to open the media devices, otherwise you get exactly those Permission denied errors. The fix is simple - just add sudo at the beginning of your command:

sudo libcamera-still -t 1000 -o test.jpg -n

Give that a try and let us know how it goes.

That did it! sudo libcamera-still -t 1000 -o test.jpg -n works and I’m getting images again. Thank you, I never would’ve guessed it was just a permissions thing.

Great to hear it’s working now. To summarize for anyone else finding this thread: after upgrading to the newer kernel version, the libcamera command must be run with sudo. The telltale sign is the Failed to open media device at /dev/mediaX: Permission denied errors in the log for all the media devices, which then results in ERROR: *** no cameras available *** even though the sensor is detected correctly by the kernel. Running sudo libcamera-still -t 1000 -o test.jpg -n resolves it. If you’re scripting this, make sure the elevated privileges are applied there too.