[libcamera-devel] libcamera as non-root

Sebastian Fricke sebastian.fricke.linux at gmail.com
Wed Dec 30 06:45:31 CET 2020


On 30.12.2020 00:32, Laurent Pinchart wrote:
>On Tue, Dec 29, 2020 at 08:31:27PM +0000, Kieran Bingham wrote:
>> On 29/12/2020 18:31, Erik Sohns wrote:
>> > Hello,
>> >
>> > I have a question for the list.
>> >
>> > I am trying to integrate libcamera into my Linux application.
>> > I am making some progress and am enumerating the existing devices on my
>> > system. It turns out, however, that no devices are found when I am not
>> > root. Is there a way around this ? Also, the qcam and cam programs only
>> > seem to work when the user is root.
>> >
>> > Any ideas ? Please answer directly, I am not a subscriber of the list.
>>
>> You'll likely need to add your user account to the 'video' group
>>
>>   $ sudo usermod -aG video $USER
>>   $ newgrp video
>
>Most distributions use the video group for V4L2 video device nodes, but
>some may not put media controller devices in that group. You may want to
>check ownership of all related devices with
>
>ls -l /dev/video* /dev/v4l-* /dev/media*
>
>If some of those devices are not in the video group, this should be
>reported to the distribution.
>
>> The newgrp command adds the group to your current session, but you'll
>> probably just want to log out and back in again completely to make sure
>> it takes effect.
>>
>> Hope this helps, do let us know what you're integrating libcamera into -
>> it's interesting to know where the library gets used.

Can we add this description to the frequently asked questions?
This seems to be a problem, that can be encountered by multiple new
users.
I thought about something like this:

+   Why do I have to be root for devices to be enumerated?
+
+   Most distributions use the **video** group for V4L2 video device
+   nodes. To add yourself to that group use the following:
+   .. code-block:: bash
+       :linenos:
+       sudo usermod -aG video $USER
+       newgrp video

>
>-- 
>Regards,
>
>Laurent Pinchart

Greetings,
Sebastian

>_______________________________________________
>libcamera-devel mailing list
>libcamera-devel at lists.libcamera.org
>https://lists.libcamera.org/listinfo/libcamera-devel


More information about the libcamera-devel mailing list