[libcamera-devel] [PATCH v2 0/4] android: Rework metadata tags

Jacopo Mondi jacopo at jmondi.org
Wed Sep 4 14:08:43 CEST 2019


Hello,

Quoting here the v2 cover letter for some background:
------------------------------------------------------------------------------
  following a first simple patch
"[PATCH] android: camera_device: Add pipeline max depth static metadata"

a discussion with Ren-Pei and Ricky made clear the current metadata support was
buggy, and since the ANDROID_REQUEST_AVAILABLE_CAPABILITIES tag was not
reported, cros_camera_test failed to identify which static tags we were missing.

Adding that tag opened a small pandora box, as the test reported -a lot- of tag
where missing, and some of there were wrongly reported as part of the capture
request template.

This series tries to address this, by reporting all tags marked as "BC" and so
required by LIMITED hardware level devices, cleaning up and improving the
generated request template, and using more opportune sized for each metadata
tag.

cros_camera_test seems now more happy, both in regard to static metadata and the
generated request template:

# cros_camera_test  --gtest_filter=Camera3ModuleFixture.*
[==========] 9 tests from 1 test case ran. (2 ms total)
[  PASSED  ] 9 tests.

# cros_camera_test  --gtest_filter=Camera3DeviceTest*
[==========] 22 tests from 4 test cases ran. (1044 ms total)
[  PASSED  ] 18 tests.
[  FAILED  ] 4 tests, listed below:
[  FAILED  ] Camera3DeviceTest/Camera3AlgoSandboxIPCErrorTest.IPCErrorBeforeOpen/0, where GetParam() = 0
[  FAILED  ] Camera3DeviceTest/Camera3AlgoSandboxIPCErrorTest.IPCErrorBeforeOpen/1, where GetParam() = 1
[  FAILED  ] Camera3DeviceTest/Camera3AlgoSandboxIPCErrorTest.IPCErrorAfterOpen/0, where GetParam() = 0
[  FAILED  ] Camera3DeviceTest/Camera3AlgoSandboxIPCErrorTest.IPCErrorAfterOpen/1, where GetParam() = 1
(I guess it's fine if we fail the IPC related tests)

As all of this has been triggered by a system crash with R78 I would ask Laurent
to test the series with his environment. I tested with R77 and things seems
fine.
------------------------------------------------------------------------------

In this v3 there are just a few small reworks to the series:
- use 2 as pipeline depth
- remove two static tags from the template request
- verify the metadata pack sizes is big enough*

* Laurent suggested to use valgrind, but the android metadata library actually
  keeps track of the available and used space. Adding a new tag when space is
  exhausted fails, no need to manually check for out-of-bounds write.

Re-sorted patches 3 and 4 compared to v2.

Now tested with R78 by Laurent and confirmed the crash is fixed

Thanks
   j

Jacopo Mondi (4):
  android: camera_device: Add missing static metadata
  android: camera_device: Use correct sizes for static metadata
  android: camera_device: Rework template generation
  android: camera_device: Report available keys

 src/android/camera_device.cpp | 510 +++++++++++++++++++++++++---------
 1 file changed, 377 insertions(+), 133 deletions(-)

--
2.23.0



More information about the libcamera-devel mailing list