[PATCH v1 0/8] Add support for IPA debugging metadata

Stefan Klug stefan.klug at ideasonboard.com
Wed Oct 2 18:19:18 CEST 2024


To easily debug the algorithms of a running IPA it is necessary to
inspect live data. Three options where discussed on how to make that
process easier:

1. Tracing using lttng: We already have a bit infrastructure for that.
Nevertheless the setup is a bit more involved and there is no code
available (yet) to digest the live data. Adding new tracepoints also
requires modifications at multiple places.

2. Extending the metadata infrastructure: We already have good
infrastructure for metadata handling. Tooling around libcamera (like
camshark) already have good support for metadata. The downside of
metadata might be the limited efficiency on the way from the ipa to the
user involving (possibly) inefficient serializations and copies.

3. Adding a completely new infrastructure for debug metadata and
seperate interfaces on the API.

This series implements the tooling for option 2 (add debug metadata).
Option 1 will also be investigated further, but seems to be better
fitted to performance issues than to algorithmic issue.  Option 3 was
not investigated further due to the involved effort and the unclear
needs on the overall process.

Patches 1-3 add some infrastructure to make the process easier.

Patches 4 and 6 are tiny fixups.

Patch 5 adds debug metadata support to the rkisp1 IPA.

Patch 7 adds actual debug entries to the agc algorithm in the rkisp1.

The whole series works in companion with the new graph display in
camhsark, that is available in the current master of camshark (
https://gitlab.freedesktop.org/camera/camshark )

Best regards,
Stefan



Stefan Klug (8):
  libcamera: Add debug control space
  libcamera: Add a DebugMetadata helper
  utils: Add script to generate control_ids_debug.yaml
  ipa: rkisp1: Add constructor to the ipa context
  ipa: rkisp1: Add debug metadata support to the rkisp1
  ipa: libipa: Add data accessor to Histogram
  [WIP] ipa: Add debug controls to the agc algorithm
  [WIP] ipa: enable debug metadata by default

 include/libcamera/internal/debug_controls.h |  52 +++++++
 include/libcamera/internal/meson.build      |   1 +
 include/libcamera/meson.build               |   3 +-
 src/ipa/libipa/agc_mean_luminance.cpp       |   8 +
 src/ipa/libipa/agc_mean_luminance.h         |   4 +
 src/ipa/libipa/histogram.cpp                |   6 +
 src/ipa/libipa/histogram.h                  |   1 +
 src/ipa/rkisp1/algorithms/agc.cpp           |   8 +
 src/ipa/rkisp1/ipa_context.h                |  10 ++
 src/ipa/rkisp1/rkisp1.cpp                   |  11 +-
 src/libcamera/control_ids_core.yaml         |   6 +
 src/libcamera/control_ids_debug.yaml        |  26 ++++
 src/libcamera/control_ranges.yaml           |   5 +-
 src/libcamera/debug_controls.cpp            | 144 +++++++++++++++++
 src/libcamera/meson.build                   |   1 +
 utils/gen-debug-controls.py                 | 161 ++++++++++++++++++++
 16 files changed, 444 insertions(+), 3 deletions(-)
 create mode 100644 include/libcamera/internal/debug_controls.h
 create mode 100644 src/libcamera/control_ids_debug.yaml
 create mode 100644 src/libcamera/debug_controls.cpp
 create mode 100755 utils/gen-debug-controls.py

-- 
2.43.0



More information about the libcamera-devel mailing list