Age | Commit message (Collapse) | Author |
|
When libcamera is compiled with the address sanitizer enabled, the
v4l2_compat test generates failures in the link order runtime check, as
the host v4l2-ctl and v4l2-compliance tools are not (generally) linked
to ASan. For this reason, the test is disabled, which sadly shrinks test
coverage.
Fix this by loading the ASan runtime using LD_PRELOAD. This needs to be
done from within the v4l2_compat_test.py Python script, as the Python
interpreter itself leaks memory and would cause test failures if run
with ASan.
To LD_PRELOAD the ASan runtime, the path to the binary needs to be
known. gcc gives us a generic way to get the path, but that doesn't work
with clang as the ASan runtime file name depends on the clang version
and target architecture. We thus have to keep the v4l2_compat test
disabled when ASan is enabled and libcamera is compiled with clang.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
|
|
Return early with subdir_done() to reduce indentation in case the
v4l2_compat layer is not enabled. This matches our usual code patterns
in meson.build files, and prepares for enabling the v4l2_compat test
with ASan.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
|
|
Add a -v/--verbose argument to the v4l2_compat test to print the output
of v4l2-compliance, even when the test passes. This can be useful when
debugging.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
As the vimc scaler prevents us from passing v4l2-compliance, skip it
until the fix has been merged. Instead of removing it from the
supported_pipelines list, add an extra check, since we will have the
same construct later when we check for the kernel version.
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The V4L2 compatibility layer test includes a list of supported devices,
as V4L2 compatibility isn't officially supported with all devices yet.
If no supported device is present, the test reports success, while it
actually hasn't run. Report it being skipped in that case.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
|
|
v4l2-compliance changed their version string:
v4l2-compliance 1.21.0-4618
v4l2-compliance SHA: cc211b76476aca2c072ffa83a9b003957d5f3909, 64 bits, 64-bit time_t
v4l2-compliance 1.21.0-4838, 64 bits, 64-bit time_t
The current parsing takes the last result of split, which works for the
former, but not the latter. Take the second result of split instead, and
strip away any commas.
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
The V4L2 compat test runs v4l2-ctl and v4l2-compliance with
v4l2-compat.so preloaded. If libcamera is compiled with the address
sanitizer enabled, the ASan library will be loaded due to preloading
v4l2-compat.so. This however doesn't occur early enough in the dynamic
linking process due to the v4l2 executables not being themselves linked
to the ASan runtime, which causes ASan to abort with
==2198==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
Using LD_PRELOAD to load the ASan runtime would fix this issue, but it
requires knowing the absolute path to the ASan shared object. This is
compiler-dependent and for clang, architecture-dependent as well.
Until we figure out how to safely retrieve that information, disable the
test when ASan is enabled as a quick fix.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
|
|
v4l2-compliance originally printed the SHA before the version, leading
to the indexing that was used previously. Now that the version is
printed before the SHA, the indexing is incorrect. Fix this.
Although v4l2-ctl doesn't suffer the same issue, it is more correct to
use the zeroth index like the v4l2-compliance version check now does, so
fix that as well.
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
v4l2-compliance and v4l2-ctl with version 1.20 and before will fail with
v4l2-compat. Check the versions of v4l2-compliance and v4l2-ctl before
continuing.
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
When a test is being run on a video device, there is output like so:
Testing /dev/video0 with uvcvideo driver...
and when it succeeds, "success" is appended:
Testing /dev/video0 with uvcvideo driver... success
On failure, however, the output of v4l2-compliance is printed before
"failure" is printed, resulting in the first line of the v4l2-compliance
output to be printed on the same line as the message:
Testing /dev/video2 with uvcvideo driver... v4l2-compliance SHA: not available, 64 bits
<v4l2-compliance output>
failure
Refactor the code to make "failure" print before the output of the test,
to prettify the output upon failure.
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Test the V4L2 compatibility layer by running v4l2-compliance -s on every
/dev/video* device.
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|