{"id":1518,"url":"https://patchwork.libcamera.org/api/patches/1518/?format=json","web_url":"https://patchwork.libcamera.org/patch/1518/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20190625162353.30434-1-helen.koike@collabora.com>","date":"2019-06-25T16:23:53","name":"[libcamera-devel] cam: capture: Stop stream when queueRequest fails","commit_ref":"059ed93bebbac5710fffd4714ee20cc02d3212aa","pull_url":null,"state":"accepted","archived":false,"hash":"b3b0c9e3653b16b1ea45d24eb5144d78e37cde58","submitter":{"id":20,"url":"https://patchwork.libcamera.org/api/people/20/?format=json","name":"Helen Koike","email":"helen.koike@collabora.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/1518/mbox/","series":[{"id":374,"url":"https://patchwork.libcamera.org/api/series/374/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=374","date":"2019-06-25T16:23:53","name":"[libcamera-devel] cam: capture: Stop stream when queueRequest fails","version":1,"mbox":"https://patchwork.libcamera.org/series/374/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/1518/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/1518/checks/","tags":{},"headers":{"Return-Path":"<helen.koike@collabora.com>","Received":["from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C265660103\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 25 Jun 2019 18:24:09 +0200 (CEST)","from [127.0.0.1] (localhost [127.0.0.1])\n\t(Authenticated sender: koike) with ESMTPSA id 3EF9C263AFA"],"From":"Helen Koike <helen.koike@collabora.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"laurent.pinchart@ideasonboard.com, kernel@collabora.com,\n\tHelen Koike <helen.koike@collabora.com>","Date":"Tue, 25 Jun 2019 13:23:53 -0300","Message-Id":"<20190625162353.30434-1-helen.koike@collabora.com>","X-Mailer":"git-send-email 2.20.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH] cam: capture: Stop stream when\n\tqueueRequest fails","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Tue, 25 Jun 2019 16:24:09 -0000"},"content":"queueRequest is called after starting the stream.\nIf it fails, the stream should be stopped, otherwise it can get a\n\"Device or resource busy\" error, due to VIDIOC_REQBUFS ioctls being\ncalled after VIDIOC_STREAMON without VIDIOC_STREAMOFF in-between.\n\nSigned-off-by: Helen Koike <helen.koike@collabora.com>\n---\n src/cam/capture.cpp | 1 +\n 1 file changed, 1 insertion(+)","diff":"diff --git a/src/cam/capture.cpp b/src/cam/capture.cpp\nindex e455612..6b842d7 100644\n--- a/src/cam/capture.cpp\n+++ b/src/cam/capture.cpp\n@@ -117,6 +117,7 @@ int Capture::capture(EventLoop *loop)\n \t\tret = camera_->queueRequest(request);\n \t\tif (ret < 0) {\n \t\t\tstd::cerr << \"Can't queue request\" << std::endl;\n+\t\t\tcamera_->stop();\n \t\t\treturn ret;\n \t\t}\n \t}\n","prefixes":["libcamera-devel"]}