Re: [PATCH v2 0/6] media: uvcvideo: Implement the Privacy GPIO as a subdevice

Hans de Goede
2024-11-11T12:03:37Z

Hi Ricardo,

On 9-Nov-24 5:29 PM, Ricardo Ribalda wrote:
> Hi Hans
>
> On Sat, 9 Nov 2024 at 16:37, Hans de Goede <hdegoede@redhat.com> wrote:

<snip>

Note only replying to the button remark here, to try and disentangle
that from the general power-management discussions.

>> One downside is that this stops UVC button presses from working when
>> not streaming. But userspace will typically only open the /dev/video#
>> node if it plans to stream anyways so there should not be much of
>> a difference wrt button press behavior.
>
> I do not personally use the button, but it is currently implemented as
> a standard HID device. Making it only work during streamon() might be
> a bit weird.
> I am afraid that if there is a button we should keep the current behaviour.

There are 2 sort of "snapshot" buttons on UVC cameras

1. Snapshot buttons handled through the UVC protocol / USB interface.
These require the UVC interface to be powered on and the status interrupt
URB to be submitted (uvc_status_start() called).

These will only work if the /dev/video# node is open, otherwise the UVC
interface is powered down and the status interrupt URB is not submitted.

IOW most of the time these already do not work, since most of the time
userspace will not have /dev/video# open (otherwise we would have
the power-consumption issues this patch-series tries to fix everywhere).

IMHO not having these working only when /dev/video# is open and instead
only having them working when streaming is a not a big deal since usually
userspace will only open /dev/video# to stream anyways (except for udev
probing, but that is very short lived and does not help with the button).

2. Snapshot buttons which use a separate standard USB HID interface

Since these use a separate USB interface, using the usb-hid driver.
These do always work and these are handled completely independent
of the UVC driver so it does not matter what we do in the UVC driver.

I hope this helps clarify the button situation.

Regards,

Hans