<div dir="ltr"><div dir="ltr">Hi Kieran,<div><br></div><div>Thanks for the feedback.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 16 Sept 2022 at 14:34, Kieran Bingham <<a href="mailto:kieran.bingham@ideasonboard.com">kieran.bingham@ideasonboard.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Quoting Naushir Patuck via libcamera-devel (2022-09-16 11:05:17)<br>
> Currently, if a Unicam timeout is signalled, the pipeline handler only raises<br>
> an error message. Update the error handling to put the pipeline handler in an<br>
> internal error state, disable all device streams, and return all outstanding<br>
> requests as cancelled. Any subsequent requests that come into the pipeline<br>
> handler will also be returned as cancelled.<br>
<br>
Does this mean that currently the application will stop and exit?<br>
<br>
> <br>
> Any further error handling (e.g. a reset with camera stop()/start()) is up to<br>
> the application to perform as it requires.<br>
> <br>
> Signed-off-by: Naushir Patuck <<a href="mailto:naush@raspberrypi.com" target="_blank">naush@raspberrypi.com</a>><br>
> ---<br>
>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 11 +++++++++++<br>
>  1 file changed, 11 insertions(+)<br>
> <br>
> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
> index d429cb444d58..4464d4d07f15 100644<br>
> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp<br>
> @@ -1819,6 +1819,17 @@ void RPiCameraData::unicamTimeout()<br>
>         LOG(RPI, Error) << "Unicam has timed out!";<br>
>         LOG(RPI, Error) << "Please check that your camera sensor connector is attached securely.";<br>
>         LOG(RPI, Error) << "Alternatively, try another cable and/or sensor.";<br>
> +<br>
> +       state_ = RPiCameraData::State::Error;<br>
> +       /*<br>
> +        * To allow the application to attempt a recovery from this timeout,<br>
> +        * stop all device streaming, and return any outstanding requests as<br>
<br>
s/device/devices/<br>
<br>
> +        * incomplete and cancelled.<br>
> +        */<br>
> +       for (auto const stream : streams_)<br>
> +               stream->dev()->streamOff();<br>
> +<br>
> +       clearIncompleteRequests();<br>
<br>
Again, I think this is fine for RPi, but I wonder if this is something<br>
we should also (instead of?/as well as) handle this in the Camera object<br>
directly ?<br></blockquote><div><br></div><div>It might be possible to put this in a layer above - perhaps the base pipeline handler</div><div>class?  But then we might not be able to make it entirely generic for all pipeline</div><div>handlers, unless we have a defined abort() member function that each pipeline handler</div><div>needs to implement? Perhaps this is something for the future :)</div><div><br></div><div>Regards,</div><div>Naush</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
Reviewed-by: Kieran Bingham <<a href="mailto:kieran.bingham@ideasonboard.com" target="_blank">kieran.bingham@ideasonboard.com</a>><br>
<br>
>  }<br>
>  <br>
>  void RPiCameraData::unicamBufferDequeue(FrameBuffer *buffer)<br>
> -- <br>
> 2.25.1<br>
><br>
</blockquote></div></div>