{"id":19182,"url":"https://patchwork.libcamera.org/api/1.1/patches/19182/?format=json","web_url":"https://patchwork.libcamera.org/patch/19182/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20231024132746.31689-1-naush@raspberrypi.com>","date":"2023-10-24T13:27:46","name":"[libcamera-devel] pipeline: rpi: Add some useful logging messages","commit_ref":"091591b52e5535065eef141339c3d69406185136","pull_url":null,"state":"accepted","archived":false,"hash":"76807021961b7427ba5ce6d8eac900017e803089","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/19182/mbox/","series":[{"id":4060,"url":"https://patchwork.libcamera.org/api/1.1/series/4060/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4060","date":"2023-10-24T13:27:46","name":"[libcamera-devel] pipeline: rpi: Add some useful logging messages","version":1,"mbox":"https://patchwork.libcamera.org/series/4060/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/19182/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/19182/checks/","tags":{},"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 0C94DBDCBD\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 24 Oct 2023 13:27:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7A78C61DE6;\n\tTue, 24 Oct 2023 15:27:54 +0200 (CEST)","from mail-lf1-x134.google.com (mail-lf1-x134.google.com\n\t[IPv6:2a00:1450:4864:20::134])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F23E361DCF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 24 Oct 2023 15:27:52 +0200 (CEST)","by mail-lf1-x134.google.com with SMTP id\n\t2adb3069b0e04-507c5249d55so6412578e87.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 24 Oct 2023 06:27:52 -0700 (PDT)","from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\to7-20020a056000010700b0032da6f17ffdsm9925987wrx.38.2023.10.24.06.27.51\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 24 Oct 2023 06:27:51 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1698154074;\n\tbh=i7rapnZXn/F9XgZF8422vRfU9YWl0vheGPqPU6cqQfs=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=wtUx75COK77mDw2FeGslWzq34m/oVz4WV/0fIARKuFXha0cm/YIMSX7Hwa7OiRm9e\n\tiKFeMshBPnA3B7KxVPNeQ7Y4mq/5L1IIjD3aLzezBgPmesk8vhkLfQB3/Rop199zZC\n\tLOB5Q0D646PPBwSGUJowlpkyNWCSaTK4GNgGM1J2zt7Mxj0wltlxG8X5iW+Nk9v6G9\n\t/MDiIHsJAn+bMsOyKcqP6MsvYKtOh0HxWauWEUcFBlsiFHPDiPdbV0xc0nciVeW1Zi\n\tuoTQS0aVqgpblU9kvl4F3W/W3lW3nS0Qd6MF4g90V1ug14CXsqxC7UWlwv4eG0rfmQ\n\tdNorD5MkrDDjw==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1698154072; x=1698758872;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:from:to:cc:subject:date:message-id:reply-to;\n\tbh=M/Y3LdFn388e8Rg85AqnadwaQmDaJa0rFxYo8xLYyXQ=;\n\tb=WHWqL2rP53erdpjE3fwC8HvZMOpfNNHOx7+UDv3jLBieQ7UjId7RTI+zYKlaV/+3A9\n\th/fsakZcM0DgKYJZIYcQOX8XhTaaFO0V7F0C9KEY4SRdztiRzDubt6VXmrINPqFl8+Q5\n\tpk8T8VHmjCIaVRPJspFSG8Gx/29YLvIhDLeRLnMexIu+Da1J45FM3cXQd9/WQ1rF04rF\n\trMpitsdKJYy93Q4Eo97+t3RQDz55IXRqgiN0p6DjMdzC/v9TKyGlJRDR7Gqh74WrG/7B\n\tMXQtU+YPtvguabXVE7P6GDA4e6vxb1j+AYGlBtWgZ4CIkIh/VLACTxb+5xenn7gCbfie\n\tvN7Q=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"WHWqL2rP\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1698154072; x=1698758872;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=M/Y3LdFn388e8Rg85AqnadwaQmDaJa0rFxYo8xLYyXQ=;\n\tb=l6Aj/BWZV+M6M8xHrWUl2tW/tiqM8bS9rIeTe7YVZPoglBqp0qmZa+u+r7NE7weag9\n\tF3P/yNiAccfEcaX9D+JX71TRTFLEjjE4dnCFwxQz/3OthlDTNb4PDZb6koJ1t9WoJZ/v\n\tGdHlKg235SL4NZswJf79iK4a4pxRfWP6BN3d3L/9++A+j9qbz54JA9NOSLAW10V6w7N/\n\tr0ARZrZvMSmiPU3INlw/S/TX5qiBYpGkKqh4+9Sizd2D8aEEejmiEN2rSMbH7XhCTqYv\n\tzO08wPzE+x54PMRqwp6n0niR2zEZypREmXEJo3kRmdK/IC7Bq7+ek0QVkYWER6QsdfKE\n\tSsSg==","X-Gm-Message-State":"AOJu0YySrfEGCpWOZE/dkh+CZaxk/UUwWu6clcYrs7DpkLvHmM32537a\n\t7VoIpG7aMoc+RtsxyLStyYlI3ptlWMqMjxVo8wJrBg==","X-Google-Smtp-Source":"AGHT+IFmqTQ8RRhLPDReFVPEyNjlidhtjZT2QsnWQrKFHUrGcR5dANFBH28m1nbO/+qelfqJUgbHXA==","X-Received":"by 2002:a05:6512:70b:b0:507:a1b3:2d47 with SMTP id\n\tb11-20020a056512070b00b00507a1b32d47mr8245656lfs.17.1698154071711; \n\tTue, 24 Oct 2023 06:27:51 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 24 Oct 2023 14:27:46 +0100","Message-Id":"<20231024132746.31689-1-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.34.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH] pipeline: rpi: Add some useful logging\n\tmessages","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":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Add a bunch of logging messages that have come in handy debugging\nvarious issues with the pipeline handler code.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 11 ++++++++++-\n src/libcamera/pipeline/rpi/vc4/vc4.cpp              |  3 +++\n 2 files changed, 13 insertions(+), 1 deletion(-)","diff":"diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\nindex 9f788c9d1bc2..8e1cbbe67a52 100644\n--- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n@@ -731,7 +731,8 @@ int PipelineHandlerBase::queueRequestDevice(Camera *camera, Request *request)\n \tif (!data->isRunning())\n \t\treturn -EINVAL;\n \n-\tLOG(RPI, Debug) << \"queueRequestDevice: New request.\";\n+\tLOG(RPI, Debug) << \"queueRequestDevice: New request sequence: \"\n+\t\t\t<< request->sequence();\n \n \t/* Push all buffers supplied in the Request to the respective streams. */\n \tfor (auto stream : data->streams_) {\n@@ -1436,6 +1437,8 @@ void CameraData::handleStreamBuffer(FrameBuffer *buffer, RPi::Stream *stream)\n \t\t * Tag the buffer as completed, returning it to the\n \t\t * application.\n \t\t */\n+\t\tLOG(RPI, Debug) << \"Completing request buffer for stream \"\n+\t\t\t\t<< stream->name();\n \t\tpipe()->completeBuffer(request, buffer);\n \t} else {\n \t\t/*\n@@ -1444,6 +1447,8 @@ void CameraData::handleStreamBuffer(FrameBuffer *buffer, RPi::Stream *stream)\n \t\t * unconditionally for internal streams), or there is no pending\n \t\t * request, so we can recycle it.\n \t\t */\n+\t\tLOG(RPI, Debug) << \"Returning buffer to stream \"\n+\t\t\t\t<< stream->name();\n \t\tstream->returnBuffer(buffer);\n \t}\n }\n@@ -1487,6 +1492,9 @@ void CameraData::checkRequestCompleted()\n \t\tif (state_ != State::IpaComplete)\n \t\t\treturn;\n \n+\t\tLOG(RPI, Debug) << \"Completing request sequence: \"\n+\t\t\t\t<< request->sequence();\n+\n \t\tpipe()->completeRequest(request);\n \t\trequestQueue_.pop();\n \t\trequestCompleted = true;\n@@ -1499,6 +1507,7 @@ void CameraData::checkRequestCompleted()\n \tif (state_ == State::IpaComplete &&\n \t    ((ispOutputCount_ == ispOutputTotal_ && dropFrameCount_) ||\n \t     requestCompleted)) {\n+\t\tLOG(RPI, Debug) << \"Going into Idle state\";\n \t\tstate_ = State::Idle;\n \t\tif (dropFrameCount_) {\n \t\t\tdropFrameCount_--;\ndiff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\nindex 616e0bc95021..816de14e5b22 100644\n--- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n+++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n@@ -283,6 +283,9 @@ int PipelineHandlerVc4::prepareBuffers(Camera *camera)\n \t\t\tnumBuffers = 1;\n \t\t}\n \n+\t\tLOG(RPI, Debug) << \"Preparing \" << numBuffers\n+\t\t\t\t<< \" buffers for stream \" << stream->name();\n+\n \t\tret = stream->prepareBuffers(numBuffers);\n \t\tif (ret < 0)\n \t\t\treturn ret;\n","prefixes":["libcamera-devel"]}