No webcam in chrome (works in firefox)
Jan Beich
jbeich at FreeBSD.org
Thu Aug 8 18:36:14 UTC 2019
(redirecting to a better list)
Frederic Chardon <chardon.frederic at gmail.com> writes:
> Hi
>
> I can't make chrome to recognize my webcam. webcamd is running, pwcview,
> firefox or mpv all works
> Ports are at revision 507476 and base at 350255 (amd64).
>
> There is no camera listed in chrome://media-internals and typing
> "navigator.mediaDevices.getUserMedia({video:true});" in the javascript
> console throw a NotFoundError.
>
> ktrace shows that open() succeed
> 83513 chrome CALL openat(AT_FDCWD,0x81812d101,0<O_RDONLY>)
> 83513 chrome NAMI "/dev/video0"
> 83513 chrome RET openat 159/0x9f
> 83513 chrome CALL ioctl(0x9f,0x40685600,0x7fffde9f2aa8)
0x40685600 is probably VIDIOC_QUERYCAP, used by Chromium in a number of places.
https://cs.chromium.org/search/?q=VIDIOC_QUERYCAP
Firefox also uses VIDIOC_QUERYCAP but doesn't seem to check capabilities.
https://searchfox.org/mozilla-central/search?q=VIDIOC_QUERYCAP
> 83513 chrome RET ioctl 0
> 83513 chrome CALL close(0x9f)
> 83513 chrome RET close 0
>
> So this is rather not a permission issue (and anyway, the other programs
> all work)
Can you show output from the following? I don't have a camera, so no
clue which capabilities Chromium wants.
$ cat a.c
#include <linux/videodev2.h>
#include <err.h>
#include <fcntl.h>
int main(void)
{
int fd;
if ((fd = open("/dev/video0", O_RDWR)) == -1)
err(1, "failed to open /dev/video0");
struct v4l2_capability cap = {};
if (ioctl(fd, VIDIOC_QUERYCAP, &cap) == -1)
err(1, "VIDIOC_QUERYCAP failed");
warnx("/dev/video0 capabilities: %#x", cap.capabilities);
if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE))
warnx("V4L2_CAP_VIDEO_CAPTURE is missing");
if (cap.capabilities & V4L2_CAP_VIDEO_OUTPUT)
warnx("V4L2_CAP_VIDEO_OUTPUT is present, not allowed for delegation");
if (!(cap.capabilities & V4L2_CAP_STREAMING))
warnx("V4L2_CAP_STREAMING is missing");
if (!(cap.capabilities & V4L2_CAP_VIDEO_M2M_MPLANE))
warnx("V4L2_CAP_VIDEO_M2M_MPLANE is missing, required for streaming");
return 0;
}
$ pkg install v4l_compat
$ cc a.c -isystem/usr/local/include
$ ./a.out
>
> Is it a known issue? Or am I missing something?
> Thanks
Did previous www/chromium major versions work fine?
More information about the freebsd-chromium
mailing list