From patchwork Fri Jul 24 17:47:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Magdum X-Patchwork-Id: 27504 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 5B7D4BDE17 for ; Fri, 24 Jul 2026 17:47:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5F73E67F3B; Fri, 24 Jul 2026 19:47:12 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="K0qHcgYn"; dkim-atps=neutral Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D0F8167F22 for ; Fri, 24 Jul 2026 19:47:10 +0200 (CEST) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4953de5be0aso5135525e9.0 for ; Fri, 24 Jul 2026 10:47:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784915230; x=1785520030; darn=lists.libcamera.org; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=2NSRGwIK5TYaXCX0S1KwdIRLoygO3yhNTvIHaiTWplo=; b=K0qHcgYnWF+qI3apoxulf5RkD3q2q0M58HFVciNqDfIc1e3NWR2aLEfLd67BauoydG Dgw0aq5L/f8jZ5a+BXRzz9M26vg+2QIoU+G9FMyXD0bGbi79DKYcuZsHgtChHZRoPD80 Wy2/YEFp+NVnR/U4gUQsZQ3rf8z1brKroSewxW0frunFUHLasomcLrPxyukUsQoztYxq NyfOpqFyYeHmNL0T0Vm7wqlTK4v03ff4/51EaYjErwXg3CIQkxMmmXM/kOi86HCNIXNo P1Gz5vZ69Zz5QrKqBzDac9ha2pJeQzcOYMMUe2affM9HS1GYsxnTjHyOkY939PieM+9n /c6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784915230; x=1785520030; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=2NSRGwIK5TYaXCX0S1KwdIRLoygO3yhNTvIHaiTWplo=; b=DiIecjylJOv6ar04yyKIBY3A/Uuny0CgB1I8HPbKxFHX/QBiOVMVUG5s4NToX87HQS MyKnIFremsdV8JGzPQ/tTromivmVBBxr+LRTsqk6mBDfFMLa8mxzAUg3Y/vqrqxtk3an /aTBZAQh3kd4QirVUEFWVU/6lFIq+6F1h49MhJVyMEsYFALoolO1wuLY0u9QUekjXBja WEqgnSAM5nYPPBYBYWSf85MDH0Lx+k0BRgwCqKu8nkx4tM0fYOG4Ecah73ABDAhwJkty G3H9PbzDbAqWU209mk83aqapehwMkhF0BvICJgU3aq1wzeCAhytetZ1IwXBYXVIcE3uz dwSA== X-Gm-Message-State: AOJu0YyMnM3u3X60Fat2PQjB435dENi6PlPrXWga3LYFRSLDzjQ6TlS1 B2DcWI1sAD560TG9gsxYHTfcSmZHy4TreDqgjyj5hhxcjBqJ5jnEj5f+cidG2SmIc0c= X-Gm-Gg: AR+sD10D5gflYFig74b8FRuf5t8on/icIm+wA5l6VyCfr30VBju88Z4LZoA2Lmz76Br icgmAPMr1qQu1dkJHK4F/8G9UKXbBsmko/wMBvUJ7ZjpUbhhnC4fi7l1f4RKltJ6YRytqmx2cFU pgCykvACqdHFhL0wlmO5VyfGRJwf7JbBpjrt0HqdbBiXkfWH034rWA722fHSFtlR+u6Bw9elyOQ 1w0jyGt5y2D0VUbM3cU+DsXXzhhGIhgp2cjccckaLiI4ROGxcZThlM7Z5NZB7HX/BOUOm34LUg0 4CTzSQOreObe86qZHfenWbkjvOtb450lqJdaso9eSUiJ045gECqSa1pjFHxPOmjDt7GPyXU2Jv3 ZmWyoojXbgcZbdxpV/lT61hkIkKIsP/v632e9XFz4SvNpb1bQbBjhAk2UUaW6gHcprrunDxwrnb cWDD72EKfCxBh5BV7ycGY7O92kARrpwH1CS2A5JGAqTqc6tK2Pxhpr X-Received: by 2002:a05:600c:46c8:b0:495:6713:9aa3 with SMTP id 5b1f17b1804b1-4957a6e9f55mr61531175e9.30.1784915229921; Fri, 24 Jul 2026 10:47:09 -0700 (PDT) Received: from magdum-System-Product-Name.vodafone.ultrahub ([2a02:810d:4b14:4600:38a1:bd9f:46a9:a191]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-496b4eecb4fsm814055e9.7.2026.07.24.10.47.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2026 10:47:09 -0700 (PDT) From: Magdum To: libcamera-devel@lists.libcamera.org Cc: Magdum Subject: [RFC PATCH 0/1] Add NVIDIA Tegra VI pipeline handler Date: Fri, 24 Jul 2026 19:47:00 +0200 Message-ID: <20260724174705.9411-1-magdum.foss@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" *** I have written a new libcamera pipeline handler for NVIDIA Tegra-based Jetson boards (Nano, TX2, Xavier NX, AGX Xavier, AGX Orin). Before submitting it upstream I need real-hardware test reports. If you have a Jetson board with a CSI camera attached and a mainline kernel, **your help would be greatly appreciated**. --- ## What this patch does Adds support for the Tegra VI (Video Input) camera pipeline to libcamera, covering: - Jetson Nano / TX2 / Xavier (tegra-vi driver) - Jetson AGX Orin / Orin NX / Orin Nano (tegra234-vi driver) The pipeline routes raw Bayer frames from the sensor through the CSI bridge into VI capture buffers, then uses libcamera's SoftwareISP to debayer and apply AGC/AWB/CCM so the application receives a usable RGB or YUV frame. --- ## Prerequisites ### Hardware - Any Jetson board (Nano / TX2 / Xavier NX / AGX Xavier / AGX Orin) - A CSI camera module with an upstream kernel sensor driver ### Kernel - **Mainline kernel 6.x** (not NVIDIA's downstream BSP kernel). The tegra-video driver must be present and the sensor driver loaded. Verify with: ```bash # Should list a tegra-vi or tegra234-vi media device media-ctl -p # Should show your sensor as a V4L2 subdevice v4l2-ctl --list-devices ``` ### Software dependencies ```bash # Ubuntu / Debian sudo apt install \ meson ninja-build pkg-config \ libglib2.0-dev libudev-dev libyaml-dev \ python3-yaml python3-ply python3-jinja2 \ libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ qtbase5-dev # optional, needed only for qcam GUI ``` --- ## Build instructions ```bash git clone https://git.libcamera.org/libcamera/libcamera.git cd libcamera # Apply the provided tegra patch git am 0001-pipeline-Add-NVIDIA-Tegra-VI-pipeline-handler.patch meson setup build \ -Dpipelines=tegra \ -Dipas=simple \ -Ddocumentation=disabled ninja -C build ``` --- ## Test procedure ### 1. Verify the camera is detected ```bash ./build/src/apps/cam/cam --list ``` Expected output (sensor name will vary): ``` Available cameras: 1: /base/soc/cam0_regulator/... (imx219) ``` If no cameras are listed, check `dmesg` for errors from `tegra-csi`, `tegra-vi`, or the sensor driver. --- ### 2. Basic capture smoke test ```bash # Capture 30 frames, no output file — just check for errors ./build/src/apps/cam/cam \ -c 1 \ -s width=1280,height=720,pixelformat=RGB888 \ --capture=30 ``` Expected: no error messages, final line reports 30 frames completed. --- ### 3. Save frames to disk and inspect ```bash ./build/src/apps/cam/cam \ -c 1 \ -s width=1920,height=1080,pixelformat=RGB888 \ --capture=10 \ --file=/tmp/frame-#.ppm # Open a frame (any image viewer works) eog /tmp/frame-0.ppm ``` Expected: a recognisable, correctly-coloured image of the scene. It may be slightly dark or slightly over-exposed in the first few frames while AGC converges — that is normal. --- ### 4. Live preview (optional, requires Qt) ```bash ./build/src/apps/qcam/qcam ``` Expected: a live preview window showing the camera feed. --- ### 5. Stress / reliability test ```bash # 20 start/stop cycles — tests cleanup and resource release for i in $(seq 1 20); do ./build/src/apps/cam/cam \ -c 1 \ -s width=1280,height=720,pixelformat=RGB888 \ --capture=5 done # Check dmesg for warnings or errors after the run dmesg | grep -i "tegra\|csi\|isp\|cam" | tail -20 ``` --- ## What to report back Please reply with the following information: ``` Board: e.g. Jetson Nano 4GB / AGX Orin 32GB Kernel: e.g. 6.8.0 mainline Camera: e.g. IMX219 (Raspberry Pi Camera v2) Driver: tegra-vi / tegra234-vi Test 1 – cam --list: PASS / FAIL Test 2 – 30-frame capture: PASS / FAIL Test 3 – PPM image quality: PASS / FAIL / (describe issues) Test 4 – Live preview: PASS / FAIL / SKIP Test 5 – Stress test: PASS / FAIL dmesg errors (if any): Additional notes: ``` --- ## Known limitations - Only a single output stream is supported per camera. - Hardware rotation/flip is not supported (Rotate0 only). - Hardware ISP (ISP7 on Tegra234/Orin) is not yet supported — frames are processed by the CPU-based SoftwareISP. This means image quality and CPU load will be lower and higher respectively than a hardware ISP path. ISP7 support will be added in a follow-up once the upstream kernel driver is available. --- ## Contact Please send test results to the libcamera mailing list: **libcamera-devel@lists.libcamera.org** Or open a discussion on the libcamera GitLab: **https://gitlab.freedesktop.org/camera/libcamera** Thank you for your time! *** Magdum (1): pipeline: Add NVIDIA Tegra VI pipeline handler include/libcamera/ipa/meson.build | 1 + meson_options.txt | 1 + src/libcamera/pipeline/tegra/meson.build | 5 + src/libcamera/pipeline/tegra/tegra.cpp | 1102 ++++++++++++++++++++++ src/libcamera/software_isp/meson.build | 2 +- 5 files changed, 1110 insertions(+), 1 deletion(-) create mode 100644 src/libcamera/pipeline/tegra/meson.build create mode 100644 src/libcamera/pipeline/tegra/tegra.cpp