From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com [209.85.128.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF23520B80B for ; Sat, 1 Aug 2026 05:00:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785560453; cv=none; b=NH7Tf4l1PyPyHJ+eORB8W3uot1D6WoqC+87eObA8fcDLOc9eY4hpezLJQImFCwN7fZADgcW2jDhWw/6CjfjdXX+SILqGDxzHL3tcFDD6HTI2TLZ1fy5yVuHgI0+mCedzRFVacqV5d+1cRyXnVWgcPaukmM7aqlNAkwMWotXEAgk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785560453; c=relaxed/simple; bh=4wyrLp/SrEeQ+/4YAQyVLPaL85K+AMmql5OMwhyIIRQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jGu8s+geJD5Mjtj55UAi+VqCG9IPIBa0CyxauuZ9cPYHlb6KWEfG07uxVNJCUm3mdt/ri1RNQS9+kWDoNjAXFs967pPiBi/sdzUNlArTZ/Myvc7Qlfv0tmty+5HeVudC1pQRpwBG93P2qqSfV1neCLlLnRV1cQ6sMiYVZ9Ifw/o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=plqe/DDr; arc=none smtp.client-ip=209.85.128.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="plqe/DDr" Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-80dc4a68e4aso18901587b3.0 for ; Fri, 31 Jul 2026 22:00:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785560451; x=1786165251; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=TY54OJ8xDORFwsmnTbHRbxsXiQngAEL2gchs9oCincE=; b=plqe/DDrNS7dAg0vrsbnMVQZjqPrR+PTKNCNLBEA6wf7lyOpPRiJIkbirS/XE8npn8 43j4d/9p+s2bSEp1EA0ycSqORZQIPzoIA71bur/rvGzlniuUt1cbjl7BJoM5lm/xPyTu FWuMJbwV6SD4QdVDwNHDwls8dzvTg/3g4kYiIo6bJg+4TLTh5AbaiJkH4WnmmdcuQVwz pAGcPqyWA33JBXaQYUhCTkoOPdyr6nRvUoHC2areI7fWiRs25HuvoNA6xIGqdeUzsuC6 YoQZY1tsf2tO2cThNP6NOdYQaPApGcVDfvHIJp7YCgrB7Mk+s7L5VGC7v7WpOPqeVtfO Ce6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785560451; x=1786165251; h=content-transfer-encoding:mime-version:references:in-reply-to :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=TY54OJ8xDORFwsmnTbHRbxsXiQngAEL2gchs9oCincE=; b=DimPEPRqMnJ0QWjksYZwNhytKcjUfnwlntO5aF5F8NnGlXicVTXoiz62NcBHLTrAbt zwr+XcfxNGHMAxdJb8/Rc0UoAYYIf6cFmb9PNAZw72xbdbEyURwCgf6nU0tMksa5m8sj vocVT24jwqov1AT8u2Iy1hwsj/wG4yxqRCjp7qpsE/7WdAdN/waSyzwLaif9qkZJos8x 2JKFwx5SZzH2jtwZN7W/n+4/XzqeXaG6d5hjlQke4oat29OV8RMr4S2WXNXOgXaPN/BE sBUO5dPA9grzoFHCkVMPuU07ShIbIEOePUu0WJPFXKJxLpiIQnWEp8FdhB9+98D7fAy6 6Bmg== X-Forwarded-Encrypted: i=1; AHgh+RpZsAyV5JFa/gZFbIo3J/TOq77QnkMI9QQF4IUPf+h/7SMN3GPqjOt71F1mly9sdAOXBRFjjY47RT5FtlY=@vger.kernel.org X-Gm-Message-State: AOJu0Yxp/kUpMj/7Z2zKaJKrTU/1pmy6AphrOfaOsDCiru3Gxl4OPV8c f4ljRw0zWUq0HBFdvDaOQnSLhJ3OZcM3CJkiKWmMTTvNoFpBsq25ZgcI X-Gm-Gg: AR+sD11XFS16JzNIi9XKn3GiI6UAhMUShavUnyEPdqhw6dUMgIcJBkOYdDcDbqXvI5G 6LpWQfTE4cQKyAdSbyYidvqnHNn75Kb4t5aNZfsr90Qf3TUGR09zESMaOdaoeEJFDcDKcKA3ceg KfCamIjskXq4zioI5XdDWKviqqSgoK7WMhVpl2EEVhASpFJTskvLNjYNL5wrhkfkeERdDsaDjtl ZKC2Efk2m6KlTsA/54G5PYLtFlhcbcBXYdKD7d37VBMAO/r7rj491unCf0l/nAJEljinL9wjuNg MBAT6g3bROcrymQHRQGNHJOOm8z0HsWvuyDsBMSJPhHmKgNLAnOd/LH4UK7n3bWYkd61yhtX7r8 +mSwAEx5y0c0Pb1veG90v2giib2tdl19SisLyv2PycKCZ4QV48Nsq+YaY91lqPbDVz3Lxqm2NHh x0TUkyw4pcQDms5t1YfI/hQk700RWJfZc5QwlLQWb9lDrKZekBUsofKFJXDQ== X-Received: by 2002:a05:690c:9b0a:b0:81e:eebb:8e4a with SMTP id 00721157ae682-81fd4ad1c05mr36507957b3.12.1785560450801; Fri, 31 Jul 2026 22:00:50 -0700 (PDT) Received: from llmbox.. ([38.81.85.65]) by smtp.gmail.com with ESMTPSA id 00721157ae682-81fcd0d6301sm19005487b3.26.2026.07.31.22.00.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2026 22:00:49 -0700 (PDT) From: Michael Jordan To: Ricardo Ribalda , Hans Verkuil Cc: laurent.pinchart@ideasonboard.com, hansg@kernel.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] media: uvcvideo: query pan/tilt position from the device on every read Date: Sat, 1 Aug 2026 01:00:48 -0400 Message-ID: <20260801050049.984234-1-jordan.mymail@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20260725212332.64927-1-jordan.mymail@gmail.com> <20260731151509.577383-1-jordan.mymail@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi Ricardo, On Fri, 31 Jul 2026 19:14:51 +0200, Ricardo Ribalda wrote: > How accurate does the mapping frame/position need to be? > > You do not know how big the camera pipeline is. Maybe you are > processing frame NOW-4 when you read position NOW Not accurate at all, and I should have been clearer earlier: I picked "the former" for the continuous part of your question, not for the frame-tagging example. Nothing in my use case correlates a position with a particular frame. The position is an input to a control loop ("where am I, so I can ask for ten degrees left of here") and a number on a UI, and the gimbal's own time constants are hundreds of milliseconds per move, so a few frames of pipeline skew is far below anything that matters. If someone did want frame-accurate pose, I agree a G_CTRL read would be the wrong instrument entirely -- that is a per-frame metadata problem, and this patch would not be the right vehicle for it. > unrelated note: if you need to set the two axis at the set time, you > can use V4L.VIDIOC_S_EXT_CTRLS > [...] > In fact you could use that today to avoid part of the kernel issue. > Always send pan and tilt when you are tracking the movement. Thanks -- and you are right that this sidesteps the merge problem completely, which I had not appreciated. Both mappings land in UVC_CTRL_DATA_CURRENT before the single commit, so whatever __uvc_ctrl_load_cur() put there is fully overwritten and it no longer matters which source the RMW pulled from. I will switch my userspace to always send both axes. It does not touch the read side, but it makes the write side a non-issue for me in the meantime. > If AUTO_UPDATE is present you would get fresh data when you poll the > control. One clarification for the record, since it bears on what you are asking HansV to weigh: that holds via the interrupt rather than via the poll. uvc_ctrl_status_event() clears ctrl->loaded, so a poll after a notification does re-read the device -- but polls between notifications still return the cache, because __uvc_ctrl_load_cur() returns early on ctrl->loaded and nothing else clears it outside a commit. So on a compliant autoupdate device the update rate is the device's signalling rate, and for pan/tilt 4.2.2.1.15 only promises that signal at the end of the movement. Good enough for "it stopped, here is where"; not for sampling a trajectory. I mention it only so the comparison is accurate, not to relitigate -- your framing of the two problems matches how I see them. > You definitely have to ping the vendor to make sure they fix their > firmware. Agreed, and I will. I am not counting on a timeline. > Let's wait a bit for Laurent or HansG (or even Hans Verkuil) to > comment. Sounds good -- no rush at all from my side, and I am happy to respin against whatever shape you all land on. Enjoy the time off. Best regards, Michael Jordan