[libcamera-devel] [PATCH] meson: detect kernel version
Kieran Bingham
kieran.bingham at ideasonboard.com
Thu Jun 11 11:53:25 CEST 2020
Hi Stéphane
On 11/06/2020 10:32, scerveau wrote:
> Hi Kieran,
>
> Thank you for your feedback.
> I updated the message to be shorter and more explicit (I hope).
>
> Concerning V4L2 message, yes that's the original issue I was facing :)
> Not understand what I neeed to do fix this error:
>
> V4L2 API v4.15.18 too old, v5.0.0 or later
>
> Maybe we should fix this message too :)
Aha - so the V4L2VideoDevice already does the check. I see. And that
will indeed prevent pipelines from being created.
Below I think I was really just being pedantic about the message
printed, as it is the kernel version not a 'v4l2 api' version (though
those are the same thing ultimately).
>
> Stéphane.
>
> On 11/6/20 11:09, Kieran Bingham wrote:
>> Hi Stéphane,
>>
>> On 11/06/2020 09:43, Stéphane Cerveau wrote:
>>> Add kernel version detection to warn user
>>> that only >= 5.0.0 V4L API are supported in
>>> libcamera.
>>>
>>> Signed-off-by: Stéphane Cerveau <scerveau at collabora.com>
>>> ---
>>> meson.build | 8 ++++++++
>>> 1 file changed, 8 insertions(+)
>>>
>>> diff --git a/meson.build b/meson.build
>>> index e898782..a72fef6 100644
>>> --- a/meson.build
>>> +++ b/meson.build
>>> @@ -105,6 +105,14 @@ if get_option('test')
>>> subdir('test')
>>> endif
>>> +if not meson.is_cross_build()
>>> + kernel_version_req = '>= 5.0.0'
>>> + kernel_version = run_command('uname', '-r').stdout()
>>
>>> meson.build:112: WARNING: V4L2 API version 5.4.0-33-generic
>>> is too old, >= 5.8.0 is required, consider to upgrade your kernel
>>> version to use libcamera
>>
>> This needs a .strip() at the end to remove the new lines:
>>
>>> + if not kernel_version.version_compare(kernel_version_req)
>>> + warning('V4L2 API version @0@ is too old, @1@ is required,
>>> consider to upgrade your kernel version to use
>> libcamera'.format(kernel_version, kernel_version_req))
>>
>> That line is really long, can it be reduced? At the very least, the
>> .format() can move to a new line I believe.
>>
>>
>> Grammatically I think this should be :
>> "consider upgrading your"
>> rather than
>> "consider to upgrade"
>>
>> but that's longer ;-(
>>
>>
>> "WARNING: V4L2 API version 5.4.0-33-generic"
>>
>> That's not really the V4L2 API version (I mean I guess it is) but it's
>> the Linux-kernel version...
>>
>> So I wouldn't reference the V4L2 API there ...
>>
>>
>>> + endif
>>> +endif
>>> +
>>> # Create a symlink from the build root to the source root. This is
>>> used when
>>> # running libcamera from the build directory to locate resources in
>>> the source
>>> # directory (such as IPA configuration files).
>>>
>>
> _______________________________________________
> 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