Brave-browser: [Desktop] Webcam not working on ubuntu

Created on 24 Apr 2020  路  7Comments  路  Source: brave/brave-browser

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

ODesktop OLinusnap featurvideo

Most helpful comment

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

All 7 comments

Digged a bit deeper - might be a problem with the snap and not brave directly. I see these in my dmesg:

[206432.560664] audit: type=1400 audit(1587789524.957:9505): apparmor="DENIED" operation="open" profile="snap.brave.brave" name="/dev/video0" pid=18403 comm="brave" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

@ligi definitely good debugging; there are already some known issues with the snap. You can always try uninstalling the snap and re-install using the standard instructions:
https://brave-browser.readthedocs.io/en/latest/installing-brave.html

This may move the profile directory used by Brave (if snaps capture the profile in a place different than ~/.config/BraveSoftware/brave-browser/; I can't remember)

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

cc: @mbacchi can you take a look?

@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

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

Can confirm. @Frozen-byte solution worked for me too.

Brave Browser 86.1.15.72  
$ snap --version
snap    2.47
snapd   2.47
series  16
ubuntu  20.04
kernel  5.4.0-48-generic
Was this page helpful?
0 / 5 - 0 ratings