[libcamera-devel] [PATCH v2 1/2] libcamera: control: initialise control info to ControlTypeNone by default

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue Oct 4 21:50:06 CEST 2022


Hi Kieran,

(CC'ing Hans Verkuil, in case he would happen to know of someone
interested in working on the vimc driver)

On Tue, Sep 27, 2022 at 01:03:32PM +0100, Kieran Bingham via libcamera-devel wrote:
> Quoting Christian Rauch via libcamera-devel (2022-09-04 17:10:08)
> > Am 31.08.22 um 23:07 schrieb Kieran Bingham:
> > > Quoting Christian Rauch via libcamera-devel (2022-08-31 21:45:31)
> > >> Hi Kieran,
> > >>
> > >> This test (and others) are skipped with "exit status 77". When I try to
> > >> run "test/serialization/ipa_data_serializer_test" manually, it fails
> > >> with "Can not find 'platform/vimc.0 Sensor B' camera". This seems to be
> > >> a virtual device. Is it somewhere documented how this is created? Could
> > >> this be created automatically for convenience?
> > >
> > > To load the modules for testing:
> > >
> > > sudo modprobe vimc
> > > sudo modprobe vim2m
> > > sudo modrpobe vivid
> > >
> > > We should really find somewhere suitable to document that.
> > 
> > I managed to create that virtual device. This only exposes BGR888 and
> > RGB888 formats. Is it possible to simulate other formats, such as YUYV
> > or NV21?
> 
> Not with VIMC. I'd like to see more formats supported by VIMC - but that
> requires kernel work.

I second that, it would be *really* useful.

> However, another option is the Vivid pipeline handler. This is a
> pipeline handler for the vivid kernel test device. We keep this 'out of
> tree' from libcamera, because it's not supposed to be a supported
> device.
> 
> It is however really useful because the vivid device can generate all,
> if not certainly most of the formats supported by V4L2.
> 
> To use it, merge the vivid pipeline handler into libcamera from:
> 
>   https://git.libcamera.org/libcamera/vivid.git/log/
> 
> This will then provide you with a new 'vivid' camera which can generate
> many more formats.
> 
> It's constantly rebased with my local build scripts to maintain it on
> top of tree, and also serves as some 'patch' documentation as to how to
> add and introduce a new pipeline handler.
> 
> > >> Am 31.08.22 um 13:51 schrieb Kieran Bingham:
> > >>> Quoting Christian Rauch via libcamera-devel (2022-08-30 21:21:23)
> > >>>> The default ControlInfo constructor allows to partially initialised the
> > >>>> min/max/def values. Uninitialised values are assigned to 0 by default. This
> > >>>> implicit initialisation makes it impossible to distinguish between and
> > >>>> uninitialised and an explicitly 0-initialised ControlValue.
> > >>>>
> > >>>> Default construct the ControlValue in the ControlInfo default contructor to
> > >>>> explicitly represent uninitialised values by the ControlTypeNone type.
> > >>>
> > >>> This sounds ... a lot better !
> > >>>
> > >>> Testing with this series applied (including the patch 2/2, which should
> > >>> probably be squashed to one patch to maintain bisection) has the
> > >>> following failures for me:
> > >>>
> > >>> 27/70 libcamera:serialization / ipa_data_serializer_test                 FAIL            0.02s   (exit status 255 or signal 127 SIGinvalid)
> > >>>>>> MALLOC_PERTURB_=174 /home/kbingham/iob/libcamera/libcamera/build/gcc/test/serialization/ipa_data_serializer_test
> > >>> ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ✀  ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
> > >>> stderr:
> > >>> [148:04:16.561414604] [830675]  INFO IPAManager ipa_manager.cpp:141 libcamera is not installed. Adding '/home/kbingham/iob/libcamera/libcamera/build/gcc/src/ipa' to the IPA search path
> > >>> [148:04:16.562718193] [830675]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3856-6478a395
> > >>> [148:04:16.567590564] [830679]  WARN CameraSensorProperties camera_sensor_properties.cpp:174 No static properties available for 'Sensor B'
> > >>> [148:04:16.567599841] [830679]  WARN CameraSensorProperties camera_sensor_properties.cpp:176 Please consider updating the camera sensor properties database
> > >>> [148:04:16.567605382] [830679]  WARN CameraSensor camera_sensor.cpp:411 'Sensor B': Failed to retrieve the camera location
> > >>> [148:04:16.568583439] [830679]  INFO IPAProxy ipa_proxy.cpp:130 libcamera is not installed. Loading IPA configuration from '/home/kbingham/iob/libcamera/libcamera/src/ipa/vimc/data'
> > >>> [148:04:16.569025699] [830675] ERROR Serializer control_serializer.cpp:509 Bad data, entry offset mismatch (entry 1)
> > >>> lhs:
> > >>> - 1: [false..true]
> > >>> - 7: [0..999999]
> > >>> - 8: [1.000000..32.000000]
> > >>> - 9: [-1.000000..1.000000]
> > >>> - 15: [0.000000..32.000000]
> > >>> rhs:
> > >>> Deserialized std::vector<libcamera::ControlInfoMap> doesn't match original
> > >>>
> > >>> So I think we have to identify what impact this has on control
> > >>> serialisation. I expect we haven't tried to serialize ControlTypeNone
> > >>> before.
> > >>>
> > >>> But I think this is a good path to take currently.
> > >>>
> > >>>> Signed-off-by: Christian Rauch <Rauch.Christian at gmx.de>
> > >>>> ---
> > >>>>  include/libcamera/controls.h | 6 +++---
> > >>>>  1 file changed, 3 insertions(+), 3 deletions(-)
> > >>>>
> > >>>> diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h
> > >>>> index ebc168fc..38d0a3e8 100644
> > >>>> --- a/include/libcamera/controls.h
> > >>>> +++ b/include/libcamera/controls.h
> > >>>> @@ -268,9 +268,9 @@ private:
> > >>>>  class ControlInfo
> > >>>>  {
> > >>>>  public:
> > >>>> -       explicit ControlInfo(const ControlValue &min = 0,
> > >>>> -                            const ControlValue &max = 0,
> > >>>> -                            const ControlValue &def = 0);
> > >>>> +       explicit ControlInfo(const ControlValue &min = {},
> > >>>> +                            const ControlValue &max = {},
> > >>>> +                            const ControlValue &def = {});
> > >>>>         explicit ControlInfo(Span<const ControlValue> values,
> > >>>>                              const ControlValue &def = {});
> > >>>>         explicit ControlInfo(std::set<bool> values, bool def);

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list