Open Bug 1463274 Opened 6 years ago Updated 1 year ago

Firefox does not allow configuring a default webcam device

Categories

(Firefox :: Site Permissions, defect, P3)

60 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: philipp+mozilla, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0
Build ID: 20180518073241

Steps to reproduce:

Boot Linux on a laptop with a built-in webcam, plug in USB webcam after boot.


Actual results:

The built-in camera is listed as /dev/video0 and selected as default, the usb cam is listed at /dev/video1.


Expected results:

Firefox should ask me which camera is the preferred device, and remember that choice.

There does not seem to be any way to configure a preferred video device on the Linux / video4linux (V4L) level.

IIUC Firefox is currently simply running through /dev/video{0..63} and selects the first device present as default. Instead it could try to check a certain rendez-vous point first, eg. /dev/video-preferred{0..63} and only go through video{0..63} if nothing is found there. Or it could save the name of the camera, etc.
Hi philipp+mozilla,

I tested this issue on Linux 16.04 with FF 60 release and FF Nightly 62.0a1(2018-06-04) using the https://permission.site/.
If you click on "Camera", you are prompted with a pop-up from where you can choose what camera should be share and if you click on "Remember this decision" checkbox this camera will be used by default every time on this site. 
Please try it and tell me your results. Thanks
Flags: needinfo?(philipp+mozilla)
Hi,
Marking this as Resolved: Incomplete due to the lack of response from philipp+mozilla.
If the issue is still reproducible with the latest Firefox version, feel free to reopen the bug with more information.
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → INCOMPLETE
Hi,

If you go to permission.site, and authorise accessing the camera, with the USB camera selected, "remembering this decision" will only remember that the site is allowed to access *a* camera device but will *not* remember which one. So reloading the site and clicking on "Camera" will not prompt me for a device but instead "wrongly" select the default camera device: the internal camera.

Just tested this with FF 62.0
Flags: needinfo?(philipp+mozilla)
Status: RESOLVED → UNCONFIRMED
Resolution: INCOMPLETE → ---
Hi,
I tested this on Ubuntu 16.04 with FF 62 release and I'm not able to select "remember this decision" because the site is not https I think and this is expected. But I've tried on another site https://meet.jit.si and if I start a call with the USB selected camera and "remember this decision" checked everything works and also if I reload the site the selected camera(from the preview step) starts to capture. 

Please try with https://meet.jit.si and see, this is an https site.
Flags: needinfo?(philipp+mozilla)
Hi,

https://permission.site/ is using https, and I was able to select "Remember this decision".
I doubt this has much to do with the site itself, but I'll test it with https://meet.jit.si tonight.

As for your setup, did you have the USB camera plugged in at boot time? Does it still work
if it is only connected after boot? Is the internal camera listed first in /dev/video* ?
You can check this for instance with this one-liner:
```
for f in  /sys/class/video4linux/*; do udevadm info $f | sed -rn -e '/DEVNAME=|ID_MODEL=/p'; done
```
Or by opening the different device nodes in /dev/video* with mpv.

Even if Ubuntu does some kind of magic to change the enumeration of your video devices, Firefox should not rely on that but just keep a list of preferred video devices.
Flags: needinfo?(philipp+mozilla)
(In reply to philipp+mozilla from comment #5)

> As for your setup, did you have the USB camera plugged in at boot time? Does
> it still work
> if it is only connected after boot? Is the internal camera listed first in
> /dev/video* ?
> You can check this for instance with this one-liner:
> ```
> for f in  /sys/class/video4linux/*; do udevadm info $f | sed -rn -e
> '/DEVNAME=|ID_MODEL=/p'; done
> ```
> Or by opening the different device nodes in /dev/video* with mpv.

I have it plugged both times. The internal camera is listed first.
Component: Untriaged → Device Permissions
Priority: -- → P3

I can confirm this bug. E.g. I have allowed meet.jit.si access to webcam. I have two modules loaded at boot: uvc driver and v4l2loopback. Firefox always tries to access device with bigger /dev/videoX number, in my case v4l2loopback device. In this particular case it fails hard, since no translation organized on v4l2loopback device (at least usually) and all sites do not have webcam working at all.

Just bought a new webcam for my laptop (so there's an built in one) and set it up beautifully with Cheese under Linux Mint 20.

Went to use Facebook messenger with Firefox and seem to have walked straight into this bug.

First use, FF pops up and asks me to authorise use of microphone and camera with a choice and an option to "remember this choice".

I choose the USB webcam proceed and all is fine.

Close call, make a second and - FF doesn't prompt and just goes to use the inbuilt one.

Wiping the permission to use a camera does force FF to prompt, but then FB messenger doesn't seem to use the camera (no corner screen showing).

using v4l2loopback virtual devices on raspbian buster with Firefox 78.4(32-bit). Firefox will only list default video device. It will not show any virtual devices created with v4l2loopback will only show default device option.

As reported by few users. On some websites such as https://meet.jit.si, Firefox list both cameras as expected. On other website, such as https://meet.google.com, Firefox only list the first camera.

Apologies if this is not the right place but I thought I'd share https://hoelz.ro/blog/using-udev-to-disable-my-infrared-camera-on-linux to help some users.
With this you can disable your laptop camera (or the one you don't use), which will make Firefox only list the camera you want to use.

Few additions to the article:

  • Use sudo lshw -numeric to find the vendor and product ids
  • The udev rules should be stored in /etc/udev/rules.d/99-<arbitrary name>.rules

Click the menu button Fx89menuButton and select Settings.

Click Privacy & Security from the left menu.
Scroll down to the Permissions section.
Click the Settings… button for the Camera option.
Firefox displays the websites with saved Allow or Block permission.
Use the Allow/Block selector to change permission for the website. You can remove the site by selecting it from the list and clicking the Remove Website.
Select the Block new requests asking to access your camera checkbox if you do not want to give any other sites access to your camera.
Click the Save Changes button.
Change microphone permissions
Click the menu button Fx89menuButton and select Settings.

Click Privacy & Security from the left menu.
Scroll down to the Permissions section.
Click the Settings… button for the Microphone option.
Firefox displays the websites with saved Allow or Block permission.
Use the Allow/Block selector to change permission for the website. You can remove the site by selecting it from the list and clicking the Remove Website.
Select the Block new requests asking to access your microphone checkbox if you do not want to give any other sites access to your microphone.
Click the Save Changes button.
Use Firefox’s address bar to clear camera or microphone permissions for a site like https://www.dailyinfopk.com/
Click the permissions Fx87PermissionsIcon icon that displays in the address bar on the left.
Any relevant permission statuses for the current site are displayed in the Site Permissions
Click the X next to Allowed, Allowed Temporarily, Blocked, or Blocked Temporarily to clear the status so that Firefox will ask again for permission when you next visit the site.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.