[{"id":25111,"web_url":"https://patchwork.libcamera.org/comment/25111/","msgid":"<CAHW6GYJnUb7DxEWxME+a3uVW=US3jbmNSu2RhpthUbshSGGL0Q@mail.gmail.com>","date":"2022-09-23T09:08:05","subject":"Re: [libcamera-devel] [PATCH v2 2/2] pipeline: raspberrypi: Improve\n\tUnicam timeout handling","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Naush\n\nOn Wed, 21 Sept 2022 at 09:03, Naushir Patuck via libcamera-devel\n<libcamera-devel@lists.libcamera.org> wrote:\n>\n> Currently, if a Unicam timeout is signalled, the pipeline handler only raises\n> an error message. Update the error handling to put the pipeline handler in an\n> internal error state, disable all device streams, and return all outstanding\n> requests as cancelled. Any subsequent requests that come into the pipeline\n> handler will also be returned as cancelled.\n>\n> Any further error handling (e.g. a reset with camera stop()/start()) is up to\n> the application to perform as it requires.\n>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n\nThanks!\nDavid\n\n> ---\n>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 11 +++++++++++\n>  1 file changed, 11 insertions(+)\n>\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 5c8c89585200..dcd81650c32d 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -1823,6 +1823,17 @@ void RPiCameraData::unicamTimeout()\n>         LOG(RPI, Error) << \"Unicam has timed out!\";\n>         LOG(RPI, Error) << \"Please check that your camera sensor connector is attached securely.\";\n>         LOG(RPI, Error) << \"Alternatively, try another cable and/or sensor.\";\n> +\n> +       state_ = RPiCameraData::State::Error;\n> +       /*\n> +        * To allow the application to attempt a recovery from this timeout,\n> +        * stop all devices streaming, and return any outstanding requests as\n> +        * incomplete and cancelled.\n> +        */\n> +       for (auto const stream : streams_)\n> +               stream->dev()->streamOff();\n> +\n> +       clearIncompleteRequests();\n>  }\n>\n>  void RPiCameraData::unicamBufferDequeue(FrameBuffer *buffer)\n> --\n> 2.25.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id F0974BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 23 Sep 2022 09:08:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B9FDE6222F;\n\tFri, 23 Sep 2022 11:08:17 +0200 (CEST)","from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com\n\t[IPv6:2a00:1450:4864:20::12a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D6B1B621BC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 23 Sep 2022 11:08:16 +0200 (CEST)","by mail-lf1-x12a.google.com with SMTP id a3so18758038lfk.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 23 Sep 2022 02:08:16 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1663924097;\n\tbh=JnREzayj5OFT/YuqNf0r3vLhok1EG5Gru1QLwWXcT4o=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=jZvBDMNjz+0o+FYRA8hO2QPwSwDW5FFE7L7jIUpYD/plW89DD3CIqPkumH8KVK5ex\n\t8rGvox1TmPHIJYIQIouNTsnb/3TVsOqJqt5Lc4o+VmvtExGcCntpMkh+g1SddFh79Q\n\tdAaClnLZOKRjq+49AgQ4jH9pire/vPDa4L5s2pXZHhlqzZ6FcKTe5fivEKf+fIAvHy\n\tjnF+jl1SV8Fw8N0TGwm6MZijkbv8wUXVyRmuQaYfZbGBKTkfc3F68UlJ/aMgUTYzR3\n\tOG0K5Ziakk99gQFOvL4nHjfQwYzTBTKOWtKD4jpf9kvJcc9r7dpCEEs3SP8RGT4Gga\n\tSeg9lioUYUSJQ==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date;\n\tbh=nfZ4EQpQdFcZ9oeSWnZnEd6Mu0puvaPSYeAyyeRhWlc=;\n\tb=Z5FIlDT1bdArcOuBJpDr5vIht02K1wzLH96+zKtVKZh26YYsHbQf46+a8L41lm0AL7\n\tu77L6cY8QAJPzF1YaECA21Ifj1FLScnH7PEgoyr4+JjDG5+w+8P2ldt66i7Y4dDCazV0\n\tSIJMX6hbTccSRi6tqzFI1M9Un6FQwts2UheGAoDQJ5wacpXCXSZGs30q0YJIMC9gKoKl\n\tcpE8KZQboShmNJ1LVwcB5vbeYZjR+UXW8lF0JdzYVE1L4DShNgU/N2WEtfA1qTrcUryN\n\tOnUcSGoC2eD1UARAcNSkbYJejN2ucRQBIUJImGhi6q0NiGSFzFFCTbbVs1LMSDS2CUUw\n\txu8w=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"Z5FIlDT1\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date;\n\tbh=nfZ4EQpQdFcZ9oeSWnZnEd6Mu0puvaPSYeAyyeRhWlc=;\n\tb=u3n0wYUyTZsLS6fO2GM8YqJvpg6KURXbGIaUWHGqgzVdQeTh/x61TY33JMR1UKpr9H\n\tI6AlPovmvCTMIxvODrCPTe/D2HOXuxGVgEBQzxiQ8KR/jm5rzUZYsCOXor/I5JTK6YUW\n\tDSyT4gIX5eU65V9cpkMWB1qIHaEGqRWMOhauDkHaQUfZMOFfGl7kGuBtLnGuKI53CqiT\n\tJ2Os6sTMyG9Vz5RgB5E75GScj2xswwGugSCM95uwKh2DvV3Ky2xSLTiju0DcqFkusJMU\n\tjuMCNP+W+nEYIhIDyCaYgabqtkknWuNWfySet+3vB8x0YGDm3WD4rD5HsqAV0QGHI8+8\n\t82jg==","X-Gm-Message-State":"ACrzQf2evyB0vowLfQs6GclxQDK+4LSVAL9l6o4Z5H6UqRX/bNCRuwHk\n\tpa5rRscZ4sIAQ+rfeD1DsvRM/gp+Y65DDeUZfooiow==","X-Google-Smtp-Source":"AMsMyM5IEaMswn60r8oBY/Cbm9/7u65WvQnYlVmRkSlzp7B0IGrOKrAMAGQZO1k7sHsxMMyNPtmQCzbJjNgC06gKycY=","X-Received":"by 2002:a19:6446:0:b0:49a:9b06:f4be with SMTP id\n\tb6-20020a196446000000b0049a9b06f4bemr2935572lfj.157.1663924096276;\n\tFri, 23 Sep 2022 02:08:16 -0700 (PDT)","MIME-Version":"1.0","References":"<20220921080258.5268-1-naush@raspberrypi.com>\n\t<20220921080258.5268-3-naush@raspberrypi.com>","In-Reply-To":"<20220921080258.5268-3-naush@raspberrypi.com>","Date":"Fri, 23 Sep 2022 10:08:05 +0100","Message-ID":"<CAHW6GYJnUb7DxEWxME+a3uVW=US3jbmNSu2RhpthUbshSGGL0Q@mail.gmail.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] pipeline: raspberrypi: Improve\n\tUnicam timeout handling","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"David Plowman via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"David Plowman <david.plowman@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]