mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: "Barnabás Pőcze" <pobrn@protonmail.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Kieran Bingham <kieran.bingham@ideasonboard.com>,
	linux-media@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] media: v4l2-dev: sysfs: Support streaming attribute
Date: Mon, 2 Jan 2023 13:14:15 +0000	[thread overview]
Message-ID: <Y7LYp01J5co9KSfJ@paasikivi.fi.intel.com> (raw)
In-Reply-To: <yvFnaY1MM7I5C7H18aJdvQ6XEQn979YkGYpCjRLsnJvCRr2vYWVKorYqFXGxP3tWKeJ5B0oEA4Fn4W2-IqPd_N_wivEM4uKJD4WX53RiSmY=@protonmail.com>

Hi Barnabás, others,

On Wed, Dec 28, 2022 at 01:44:38AM +0000, Barnabás Pőcze wrote:
> Hi
> 
> 
> On 2022. december 26., hétfő 10:52, Laurent Pinchart wrote:
> 
> > Hi Kieran,
> > 
> > Thank you for the patch.
> > 
> > On Fri, Dec 23, 2022 at 11:17:35PM +0000, Kieran Bingham wrote:
> > 
> > > Provide a streaming attribute to allow userspace to interogate if a device
> > > is actively streaming or not.
> > > 
> > > This will allow desktop notifications to report if a camera or device
> > > is active on the system, rather than just 'open' which can occur when
> > > configuring the device.
> > > 
> > > Bug: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2669
> > > Signed-off-by: Kieran Bingham kieran.bingham@ideasonboard.com
> > > ---
> > > 
> > > This is a quick POC to see if such a facility makes sense.
> > > I'm weary that not all video devices may have the queues registered on
> > > the struct video_device, but this seems like an effective way to be able
> > > to determine if a device is actively streaming on a system.
> > 
> > 
> > I can imagine multiple problems, from race conditions to permissions and
> > privacy. In order to comment on the fitness of this solution to address
> > the problem you're trying to solve, could you describe the actual
> > problem ?
> 
> 
> The issue is explained in the following thread:
> https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2669#note_1697388
> 
> In short, the user wants to show a "camera-in-use" indicator when the laptop camera
> is used. The script that the user previously had only checked if /dev/video0
> was open in any process, if it was, the indicator was shown. However, libcamera
> - at least at the moment - keeps the file descriptor open as long as the Camera
> object exists, which pipewire keeps alive for the entire lifetime of the device,
> therefore the "camera-in-use" indicator is always shown.

A sysfs attribute is not a great way to address this.

libcamera certainly has information on whether streaming is ongoing. The
information should come from there. Or Pipewire. Dbus perhaps?

Alternatively libcamera could close the video devices while not streaming
but that would involve e.g. releasing possible video buffer allocations as
well, increasing streaming start latency.

-- 
Kind regards,

Sakari Ailus

  reply	other threads:[~2023-01-02 13:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-23 23:17 Kieran Bingham
2022-12-26  9:52 ` Laurent Pinchart
2022-12-28  1:44   ` Barnabás Pőcze
2023-01-02 13:14     ` Sakari Ailus [this message]
2023-01-02 13:35       ` Laurent Pinchart
2023-01-03  9:33         ` Kieran Bingham
2023-01-03 13:31           ` Laurent Pinchart
2023-01-03 15:23             ` Kieran Bingham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y7LYp01J5co9KSfJ@paasikivi.fi.intel.com \
    --to=sakari.ailus@linux.intel.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=pobrn@protonmail.com \
    --cc=tomi.valkeinen@ideasonboard.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®