[libcamera-devel] How to use this library

Kieran Bingham kieran.bingham at ideasonboard.com
Sat Mar 27 15:26:36 CET 2021


Hi Jason,

On 27/03/2021 00:13, Jason H wrote:
> Many thanks for your reply. I'll get the details Monday, but the cliff notes are, it is a Pi4 2Gb,  stock Pi Desktop (most recent version), and rapsistill works fine. That's why I am confused.

If raspistill works, then I think you have not configured the board for
use with libcamera.

libcamera on Raspberry Pi uses a different means of controlling the
hardware.

With raspistill, the hardware is operated through the GPU (VideoCore),
whereas to operate with libcamera, the hardware uses drivers in the
kernel on the ARM side.

This requires a boot time configuration change, and they can't both be
used at the same time.

Please check through the raspberry pi documentation for this.

I believe this is worth reading through for this topic:

https://www.raspberrypi.org/documentation/linux/software/libcamera/README.md

In particular, step 4 in David's mail below is probably the missing step.

--
Kieran




> I will report the rest in frail Monday. Have a great weekend!
> 
>> Sent: Friday, March 26, 2021 at 11:18 PM
>> From: "David Plowman" <david.plowman at raspberrypi.com>
>> To: "Jason H" <jhihn at gmx.com>
>> Cc: "libcamera devel" <libcamera-devel at lists.libcamera.org>
>> Subject: Re: [libcamera-devel] How to use this library
>>
>> Hi Jason
>>
>> Thanks for your question. Perhaps you can provide some details about
>> your setup and what you've tried?
>>
>> 1. What kind of Raspberry Pi do you have? Are you using it with a
>> local keyboard and display, or (for example) via ssh?
>>
>> 2. It might be helpful to report the responses you get from "uname -a"
>> and "sudo vcdbg version", just to check what software versions you are
>> running.
>>
>> 3. What kind of camera module do you have? If it's an imx219 or an
>> imx477 then it has to be an official Raspberry Pi model; for other
>> supported sensors there are no restrictions.
>>
>> 4. Did you follow all the build instructions libcamera-apps page
>> successfully? Have you also added the correct dtoverlay to your
>> /boot/config.txt for your sensor? Did qcam work when it suggested
>> trying it?
>>
>> 5. If you comment out the dtoverlay line for your sensor and reboot,
>> does "raspistill -t 0" display a camera image?
>>
>> Best regards
>> David
>>
>> On Fri, 26 Mar 2021 at 20:55, Jason H <jhihn at gmx.com> wrote:
>>>
>>> So I can't find any good getting started guide on how to use this, and there isn't a
>>> liubcamera-users email list that I can find. But my own attempts have resulted in frequent crashing.
>>>
>>> I am trying to use the libcamera-apps fom RaspberryPi:
>>> https://github.com/raspberrypi/libcamera-apps
>>>
>>> However my efforts have been not successful in adapting their code.
>>> I don't want any preview - I just want to get images (memory access ok, if it
>>> is RGB888, BGR888, or I'll also accept file output as well) I don't want a preview,
>>> window, and I only want/need one frame per second (a sequence of stills). The code
>>> is already written against another library with a timer to acquire frames.
>>>
>>> My instant problem is on my pi (with a camera) it does not find any cameras: (cameras().size() == 0)
>>>
>>> camera_manager_ = std::make_unique<CameraManager>();
>>> int ret = camera_manager_->start();
>>> if (ret)
>>>     throw std::runtime_error("camera manager failed to start, code " + std::to_string(-ret));
>>>
>>> if (camera_manager_->cameras().size() == 0)
>>>     throw std::runtime_error("no cameras available");
>>>
>>> There is stuff in the v4l tree:
>>> /dev/v4l/by-path/platform-bcm2835-codec-video-index0
>>> /dev/v4l/by-path/platform-bcm2835-isp-video-index1
>>> /dev/v4l/by-path/platform-bcm2835-isp-video-index3
>>> /dev/v4l/by-path/platform-bcm2835-isp-video-index0
>>> /dev/v4l/by-path/platform-bcm2835-isp-video-index2
>>>
>>> I don't know what to do next.
>>> Help?
>>>
>>> _______________________________________________
>>> libcamera-devel mailing list
>>> libcamera-devel at lists.libcamera.org
>>> https://lists.libcamera.org/listinfo/libcamera-devel
>>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
> 

-- 
Regards
--
Kieran


More information about the libcamera-devel mailing list