[PATCH] pipeline: simple: Use proper device for frame start events

Stanislaw Gruszka stanislaw.gruszka at linux.intel.com
Wed Dec 18 15:11:16 CET 2024


Hi

On Tue, Dec 17, 2024 at 02:43:49PM +0100, Hans de Goede wrote:
> On 17-Dec-24 11:52 AM, Stanislaw Gruszka wrote:
> > Currently we use frame start event from video capture device to
> > apply controls. But the capture device might not generate the events.
> > Usually CSI-2 receiver is proper device to subscribe for start
> > frame events.
> > 
> > Without DelayedConntrols:applyControls() is possible that we can get
> > call to DelayedControls::get() with frame number that exceed number
> > of saved entries and get below assertion failure:
> > 
> > ../src/libcamera/delayed_controls.cpp:227:
> > libcamera::ControlList libcamera::DelayedControls::get(uint32_t):
> > Assertion `info.type() != ControlTypeNone' failed
> > 
> > Assertion failure can happen at the beginning of streaming when
> > ControlRingBuffer is not yet filled and there are errors on CSI-2.
> > 
> > To fix, loop over devices in the pipeline (starting from the last one),
> > find one that emits start frame events and connect applyControls()
> > to it.
> > 
> > Bug: https://bugs.libcamera.org/show_bug.cgi?id=241
> > Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka at linux.intel.com>
> 
> p.s.
> 
> With this patch in place we can also introduce a custom frameStart handler,
> rather then directly using delayedCtrls_->apply() as handler and also
> get a timestamp from the framestart handler fixing the todo comment
> around line 832 of simple.cpp.
> 
> This could/should be done in a follow-up patch to this one.

I'm going to do this. Will post the change after this one
get applied.

Regards
Stanislaw


More information about the libcamera-devel mailing list