Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp3918642rwl; Tue, 27 Dec 2022 18:10:04 -0800 (PST) X-Google-Smtp-Source: AMrXdXs1QiSX/q0GaNv0cbpnNMfSOylQLTlwoudb1DjQ+CsZIbYFm1P9bIfOD/OTnfpIZ5Wb4+0w X-Received: by 2002:a05:6a20:6d17:b0:af:88f7:26ae with SMTP id fv23-20020a056a206d1700b000af88f726aemr24857664pzb.23.1672193404366; Tue, 27 Dec 2022 18:10:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672193404; cv=none; d=google.com; s=arc-20160816; b=oz+XpPfRrI0/v0SktrHxS+ndfa1XDUYvyv0YwGuclmW/yz+RoYpcAsL2cYeFLtLxs3 Qdbt7ULKY3tcMMxsUZLRna0zZEvpe4H/01JxaUbkT9aWXdrbPrL9PTrERod7gPvTxY2+ iRs4YLW9xFxDqT4dvWUux7c1BS1zuYpxfv7R9K+XKkOsUVwTuSlxNQu2KF3f4pBB/odF S136zY0XnHO6lYX8W+LIJGj648uL3F+K/f2WsS2E8dxwJa2VUtzZzq13cOSE7Sxcd6LP 8S7rDxRuEOXorkyDMsPxFaYM59VnywfnErKMWGtZs5ZdI8/TtkF74AQtdn62lfj9XwRf 578Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :feedback-id:references:in-reply-to:message-id:subject:cc:from:to :dkim-signature:date; bh=oLeUZ2Tm7OdAxYY/+wU18/U6sCAVhgxK8vg5WvQ6Bvw=; b=DKB/NVmcDz0Ab1O02/AhXyk7A5whpDh+pTLeyyVJYdGJLl1E3KjyqzOHbY6CjZwc+H xIUpYf1buJblZ4tNAr+HiH88avvn44yhXpw+00naZ5C4SgUEu0wNorq65ttHxVHgc5oe sgNlV2WHWwObAqXuJ2YDaTm9fBNPX8gj9/p2J+CwG6c9ACkkNBqdNg+p/DhlZdWF16ha AXlmbNFZm8LPAQO2RZj51qs7uAki6JLN5E4Ytk13CHyv91Ys2UsI7eHwbV0ZqXaWyxVi BitMwjPmtHnLTNNTHyesKPwy7QmYfml2u428VzFmBmpQ+zXpt7PXZXO8hWZ7oK6BplJl 5O+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=N6fxuBqZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r24-20020a63ce58000000b00477c498cca3si15198102pgi.55.2022.12.27.18.09.52; Tue, 27 Dec 2022 18:10:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=N6fxuBqZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230451AbiL1Boz (ORCPT + 65 others); Tue, 27 Dec 2022 20:44:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230077AbiL1Bow (ORCPT ); Tue, 27 Dec 2022 20:44:52 -0500 Received: from mail-0201.mail-europe.com (mail-0201.mail-europe.com [51.77.79.158]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3714D2FC; Tue, 27 Dec 2022 17:44:51 -0800 (PST) Date: Wed, 28 Dec 2022 01:44:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1672191887; x=1672451087; bh=oLeUZ2Tm7OdAxYY/+wU18/U6sCAVhgxK8vg5WvQ6Bvw=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=N6fxuBqZFchnD+fBbpaE3Tdwz6PA9J9yJgJbHA1tql7NPPTNY4A4xCY0C9QHfkRGm n8G6TaZXxqJyAZHPOwMkmsR8kAOiZsEM9+/pharEJ26vIzCrVw0mEqU9MRoxC4fPR6 nEOvAhxlVhqnu8NwBU0xdnbkO3f2VdBzv7R/Y/O2nCVmkNcUv0aHiKVc1QoxQs48cz 0u7VngxapAtY9BMf5U9UnDVEm5puVX34DjT8gXhT3zN9gWl2/CW+JZW55vjttRXDTn Gb9Pl28c7TzxYbvLeKPHbJ0x+QAzfaI1wxYxHFyXiSm7uOVIvco3sdwOHdMnhG6lfo DaJGdK2zPuvdQ== To: Laurent Pinchart From: =?utf-8?Q?Barnab=C3=A1s_P=C5=91cze?= Cc: Kieran Bingham , linux-media@vger.kernel.org, Mauro Carvalho Chehab , Sakari Ailus , Tomi Valkeinen , Hans Verkuil , Christophe JAILLET , open list Subject: Re: [RFC PATCH] media: v4l2-dev: sysfs: Support streaming attribute Message-ID: In-Reply-To: References: <20221223231736.2111774-1-kieran.bingham@ideasonboard.com> Feedback-ID: 20568564:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi On 2022. december 26., h=C3=A9tf=C5=91 10:52, Laurent Pinchart wrote: > Hi Kieran, >=20 > Thank you for the patch. >=20 > On Fri, Dec 23, 2022 at 11:17:35PM +0000, Kieran Bingham wrote: >=20 > > Provide a streaming attribute to allow userspace to interogate if a dev= ice > > is actively streaming or not. > >=20 > > 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. > >=20 > > Bug: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2669 > > Signed-off-by: Kieran Bingham kieran.bingham@ideasonboard.com > > --- > >=20 > > 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 abl= e > > to determine if a device is actively streaming on a system. >=20 >=20 > 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 lapto= p camera is used. The script that the user previously had only checked if /dev/video= 0 was open in any process, if it was, the indicator was shown. However, libca= mera - at least at the moment - keeps the file descriptor open as long as the Ca= mera object exists, which pipewire keeps alive for the entire lifetime of the de= vice, therefore the "camera-in-use" indicator is always shown. > [...] Regards, Barnab=C3=A1s P=C5=91cze