brave-browser: [Desktop] Webcam not working on Snap

interestingly the webcam works with firefox and chromium

Description: Ubuntu 18.04.4 LTS Version 1.5.123 Chromium: 80.0.3987.163 (Official Build) (64-bit)

The device is a Lenovo Thinkpad P1

For me it would be nice to have it for jitsi - but to decouple the issue from jitsi I tried webcamtest.com

Selection_427

here the output of v4l-info

### v4l2 device info [/dev/video0] ###
general info
    VIDIOC_QUERYCAP
	driver                  : "uvcvideo"
	card                    : "Integrated Camera: Integrated C"
	bus_info                : "usb-0000:00:14.0-8"
	version                 : 4.15.18
	capabilities            : 0x84200001 [VIDEO_CAPTURE,?,STREAMING,(null)]

standards

inputs
    VIDIOC_ENUMINPUT(0)
	index                   : 0
	name                    : "Camera 1"
	type                    : CAMERA
	audioset                : 0
	tuner                   : 0
	std                     : 0x0 []
	status                  : 0x0 []

video capture
    VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)
	index                   : 0
	type                    : VIDEO_CAPTURE
	flags                   : 1
	description             : "Motion-JPEG"
	pixelformat             : 0x47504a4d [MJPG]
    VIDIOC_ENUM_FMT(1,VIDEO_CAPTURE)
	index                   : 1
	type                    : VIDEO_CAPTURE
	flags                   : 0
	description             : "YUYV 4:2:2"
	pixelformat             : 0x56595559 [YUYV]
    VIDIOC_G_FMT(VIDEO_CAPTURE)
	type                    : VIDEO_CAPTURE
	fmt.pix.width           : 1280
	fmt.pix.height          : 720
	fmt.pix.pixelformat     : 0x47504a4d [MJPG]
	fmt.pix.field           : NONE
	fmt.pix.bytesperline    : 0
	fmt.pix.sizeimage       : 1843200
	fmt.pix.colorspace      : SRGB
	fmt.pix.priv            : 4276996862

controls
    VIDIOC_QUERYCTRL(BASE+0)
	id                      : 9963776
	type                    : INTEGER
	name                    : "Brightness"
	minimum                 : 0
	maximum                 : 255
	step                    : 1
	default_value           : 128
	flags                   : unknown
    VIDIOC_QUERYCTRL(BASE+1)
	id                      : 9963777
	type                    : INTEGER
	name                    : "Contrast"
	minimum                 : 0
	maximum                 : 255
	step                    : 1
	default_value           : 32
	flags                   : unknown
    VIDIOC_QUERYCTRL(BASE+2)
	id                      : 9963778
	type                    : INTEGER
	name                    : "Saturation"
	minimum                 : 0
	maximum                 : 100
	step                    : 1
	default_value           : 64
	flags                   : unknown
    VIDIOC_QUERYCTRL(BASE+3)
	id                      : 9963779
	type                    : INTEGER
	name                    : "Hue"
	minimum                 : -180
	maximum                 : 180
	step                    : 1
	default_value           : 0
	flags                   : unknown
    VIDIOC_QUERYCTRL(BASE+12)
	id                      : 9963788
	type                    : BOOLEAN
	name                    : "White Balance Temperature, Auto"
	minimum                 : 0
	maximum                 : 1
	step                    : 1
	default_value           : 1
	flags                   : unknown
    VIDIOC_QUERYCTRL(BASE+16)
	id                      : 9963792
	type                    : INTEGER
	name                    : "Gamma"
	minimum                 : 90
	maximum                 : 150
	step                    : 1
	default_value           : 120
	flags                   : unknown
    VIDIOC_QUERYCTRL(BASE+24)
	id                      : 9963800
	type                    : MENU
	name                    : "Power Line Frequency"
	minimum                 : 0
	maximum                 : 2
	step                    : 1
	default_value           : 1
	flags                   : unknown
    VIDIOC_QUERYCTRL(BASE+26)
	id                      : 9963802
	type                    : INTEGER
	name                    : "White Balance Temperature"
	minimum                 : 2800
	maximum                 : 6500
	step                    : 10
	default_value           : 4600
	flags                   : INACTIVE
    VIDIOC_QUERYCTRL(BASE+27)
	id                      : 9963803
	type                    : INTEGER
	name                    : "Sharpness"
	minimum                 : 0
	maximum                 : 7
	step                    : 1
	default_value           : 0
	flags                   : unknown
    VIDIOC_QUERYCTRL(BASE+28)
	id                      : 9963804
	type                    : INTEGER
	name                    : "Backlight Compensation"
	minimum                 : 0
	maximum                 : 2
	step                    : 1
	default_value           : 1
	flags                   : unknown

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 18 (9 by maintainers)

Most upvoted comments

I have installed chromium and brave via snap-package. In Chromium the camera works fine. Brave does not find my camera.

I’ve tried it with Google Meet.

#  brave --version                                                   
Brave Browser 81.1.7.98 

About screen tells me another version: Version 1.7.98 Chromium: 81.0.4044.113 (Official Build) (64-bit)

#  snap --version                                                                                                 ~ 
snap    2.44.3
snapd   2.44.3
series  16
ubuntu  19.10
kernel  5.3.0-51-generic

dmesg yells the same message to me:

[442642.190845] audit: type=1400 audit(1588669455.279:328218): apparmor="DENIED" operation="open" profile="snap.brave.brave" name="/dev/video1" pid=1013 comm="brave" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

On further investigation: Chromium makes use of the Slot&Plug system from snap to utilize camera https://snapcraft.io/docs/interface-management

# sudo snap connections chromium            
Interface                 Plug                               Slot                            Notes                                 
 camera                    chromium:camera                    :camera                         -

Brave is missing this line.

Solving this issue manually You may enter this into your command line: # sudo snap connect brave:camera core:camera

@Frozen-byte Works like a charm on Ubuntu 20.04! Thanks a lot!

#  brave --version       
Brave Browser 81.1.9.72

#  snap --version       
snap    2.45
snapd   2.45
series  16
ubuntu  20.04
kernel  5.4.0-33-generic

Our request for camera autoconnection has been granted. This will take effect for users with the next snap release.

Deinstalling and reinstalling the Brave snap package did not change anything for me. I still have to connect the camera according to @Frozen-byte 's solution.

I think that we should go for the auto-connection. In my experience looking at the support forums, the average snap user is generally less comfortable doing things on the command-line.

In general, we should match the desktop packages as much as possible. We already have all of the safeguards we need in the browser (if we didn’t, that would be a bug).

Same issue with ubuntu 20.04.1 & Version 1.20.103 Chromium: 88.0.4324.152 (Official Build) (64-bit) Solved with sudo snap connect brave:camera core:camera. Brave installed by snap store. With google chrome all works fine. thanks.

I needed to enable webcam access:

sudo snap connect brave:camera core:camera

Thanks @Frozen-byte

@Frozen-byte cool - also works for me now. But I think we should leave this issue open so it gets this by default?!