[libcamera-devel,0/2] libcamera: pipeline_handler: Prepare requests
mbox series

Message ID 20220107125506.1477795-1-kieran.bingham@ideasonboard.com
Headers show
Series
  • libcamera: pipeline_handler: Prepare requests
Related show

Message

Kieran Bingham Jan. 7, 2022, 12:55 p.m. UTC
Provide a new call on pipeline handlers allowing the Camera to prepare a
request and associate the request with the pipeline handler after it is
constructed.

This allows us to perform one-time operations such as connecting
relevant signals on the request to the pipeline handler.

Use this new call to move the prepared signal connection away from
queueRequest where it was repeatedly connecting the signal, leading to
bugs which exhibited excessively long shutdown times when any
substantial number of frames had been processed. This is reported to
have taken more than 10 minutes to close down the pipeline after a 2
hour capture run.

Finally add an assertion to the signal connection to ensure that we
catch and prevent this from happening again. We only have a limited
expectation of the size of slot lists, so if this is exceeded it likely
exposes a bug. If we come across a use case that requires substantial
conections here, it can be revisted then.

This underlying bug was identified from :
 https://github.com/raspberrypi/libcamera-apps/issues/217

And should resolve the issue there.


Note that the assertion preventing excessive slot usage already breaks
the CTS tests on CrOS and may indicate either we really need more slots,
or that other slot leaks are occuring.

Kieran Bingham (2):
  libcamera: pipeline_handler: Prepare requests
  libcamera: base: signal: Prevent excessive slot usage

 include/libcamera/internal/pipeline_handler.h |  1 +
 src/libcamera/base/signal.cpp                 |  8 ++++++++
 src/libcamera/camera.cpp                      | 14 ++++++++++---
 src/libcamera/pipeline_handler.cpp            | 20 ++++++++++++++++---
 4 files changed, 37 insertions(+), 6 deletions(-)