Bug 245250 - www/chromium: webcam doesn't work in chrome
Summary: www/chromium: webcam doesn't work in chrome
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Conrad Meyer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-01 19:25 UTC by Yuri Victorovich
Modified: 2023-05-04 23:04 UTC (History)
8 users (show)

See Also:
bugzilla: maintainer-feedback? (chromium)


Attachments
fix build after 17b8c1ab3fdb1951f6bb63df8ea9c79db1cdd655 (1003 bytes, patch)
2023-05-02 19:57 UTC, Stefan Ehmann
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2020-04-01 19:25:36 UTC
https://www.onlinemictest.com/webcam-test/ says "We can't find your camera"

The V4L device otherwise works in Firefox, qTox, mplayer.

Version 80.0.3987.132 (Official Build) (64-bit)
Comment 1 Tamas Szakaly 2020-04-06 13:13:21 UTC
Although I've only tried this with www/qutebrowser (which uses www/qt5-webengine), not www/chromium, this might still be relevant (almost the same code, after all):

The following two patches essentially #ifdef out video capture code:
 - patch-src_3rdparty_chromium_media_capture_video_linux_video__capture__device__factory__linux.cc
 - patch-src_3rdparty_chromium_media_capture_video_linux_video__capture__device__linux.cc

With those patches, VideoCaptureDeviceFactoryLinux::HasUsableFormats always returns false, so capable devices are not even detected. I've removed those #ifdefs in www/qt5-webengine, and I've been using Facebook Messenger and Jitsi from qutebrowser for a few days now on a HardenedBSD 13.0-CURRENT laptop.

That said, I don't know if those patches fix some problem that just luckily don't occur on my box, or they were just left there accidentally. I've tried git --follow and internet searches, but wasn't able to find the reason they exist.
Comment 2 Conrad Meyer freebsd_committer freebsd_triage 2020-04-07 19:44:02 UTC
As far as I can tell, they were introduced for no documented reason in r416521.
Comment 3 Conrad Meyer freebsd_committer freebsd_triage 2020-04-07 19:54:50 UTC
I'm preparing a patch: https://reviews.freebsd.org/D24330
Comment 4 commit-hook freebsd_committer freebsd_triage 2020-04-08 00:23:20 UTC
A commit references this bug:

Author: cem
Date: Wed Apr  8 00:22:47 UTC 2020
New revision: 531050
URL: https://svnweb.freebsd.org/changeset/ports/531050

Log:
  www/chromium: Un-remove v4l video capture support

  This support was removed in r416521. The revision message did not document the
  removal nor justify patching out a major port feature.

  This restores that support.

  The earlier revision should probably be audited for other patches which (a) add
  update burden to this already huge port and (b) remove expected functionality.

  PR:		245250
  Submitted by:	Tamas Szakaly <sghctoma AT gmail.com>
  Reported by:	yuri@
  Approved by:	jrm
  Differential Revision:	https://reviews.freebsd.org/D24330

Changes:
  head/www/chromium/Makefile
  head/www/chromium/files/patch-media_capture_video_linux_video__capture__device__factory__linux.cc
  head/www/chromium/files/patch-media_capture_video_linux_video__capture__device__linux.cc
Comment 5 Marcin Cieślak 2020-04-10 15:01:19 UTC
There is progress (it gets detected), but I am getting green flicker, for which I have opened https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245505
Comment 6 DaisyWalters 2021-11-03 07:46:45 UTC
MARKED AS SPAM
Comment 7 branson 2022-10-29 07:47:32 UTC
MARKED AS SPAM
Comment 8 commit-hook freebsd_committer freebsd_triage 2023-05-02 13:21:15 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=17b8c1ab3fdb1951f6bb63df8ea9c79db1cdd655

commit 17b8c1ab3fdb1951f6bb63df8ea9c79db1cdd655
Author:     Robert Nagy <rnagy@FreeBSD.org>
AuthorDate: 2023-05-02 13:18:02 +0000
Commit:     Robert Nagy <rnagy@FreeBSD.org>
CommitDate: 2023-05-02 13:20:29 +0000

    www/{*chromium,iridium}: unbreak webcam support

    do not observ for video capture device configuration
    as it seems to hang the video capture process

    PR:             245250
    Approved by:    rene (mentor, implicit)

 www/chromium/Makefile                              |   2 +-
 ..._capture_video_linux_v4l2__capture__delegate.cc | 323 ++++++++++++++++++++-
 www/iridium/Makefile                               |   1 +
 ..._capture_video_linux_v4l2__capture__delegate.cc | 323 ++++++++++++++++++++-
 www/ungoogled-chromium/Makefile                    |   2 +-
 ..._capture_video_linux_v4l2__capture__delegate.cc | 323 ++++++++++++++++++++-
 6 files changed, 930 insertions(+), 44 deletions(-)
Comment 9 commit-hook freebsd_committer freebsd_triage 2023-05-02 13:22:17 UTC
A commit in branch 2023Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=aca39076bc80e378f1f9d95d61fa1d4631118eaa

commit aca39076bc80e378f1f9d95d61fa1d4631118eaa
Author:     Robert Nagy <rnagy@FreeBSD.org>
AuthorDate: 2023-05-02 13:18:02 +0000
Commit:     Robert Nagy <rnagy@FreeBSD.org>
CommitDate: 2023-05-02 13:21:29 +0000

    www/{*chromium,iridium}: unbreak webcam support

    do not observ for video capture device configuration
    as it seems to hang the video capture process

    PR:             245250
    Approved by:    rene (mentor, implicit)

    (cherry picked from commit 17b8c1ab3fdb1951f6bb63df8ea9c79db1cdd655)

 www/chromium/Makefile                              |   1 +
 ..._capture_video_linux_v4l2__capture__delegate.cc | 323 ++++++++++++++++++++-
 www/iridium/Makefile                               |   1 +
 ..._capture_video_linux_v4l2__capture__delegate.cc | 323 ++++++++++++++++++++-
 www/ungoogled-chromium/Makefile                    |   1 +
 ..._capture_video_linux_v4l2__capture__delegate.cc | 323 ++++++++++++++++++++-
 6 files changed, 930 insertions(+), 42 deletions(-)
Comment 10 Stefan Ehmann 2023-05-02 19:17:15 UTC
I get this error with today's ports in poudriere (13.2/amd64)

../../media/capture/video/linux/v4l2_capture_delegate.cc:220:27: error: out-of-line definition of 'IsSpecialControl' does not match any declaration in 'media::V4L2CaptureDelegate'
bool V4L2CaptureDelegate::IsSpecialControl(int control_id) {
                          ^~~~~~~~~~~~~~~~
../../media/capture/video/linux/v4l2_capture_delegate.cc:242:27: error: out-of-line definition of 'IsBlockedControl' does not match any declaration in 'media::V4L2CaptureDelegate'
bool V4L2CaptureDelegate::IsBlockedControl(int control_id) {
                          ^~~~~~~~~~~~~~~~
2 errors generated.
Comment 11 Stefan Ehmann 2023-05-02 19:57:55 UTC
Created attachment 241938 [details]
fix build after 17b8c1ab3fdb1951f6bb63df8ea9c79db1cdd655

The attached patch fixes the build for me.
I haven't tested if it fixes the original problem.
Comment 12 Cy Schubert freebsd_committer freebsd_triage 2023-05-04 15:28:28 UTC
(In reply to Stefan Ehmann from comment #11)

slippy$ git apply --check /tmp/bug-245250-fixbuild.diff 
error: patch failed: www/chromium/files/patch-media_capture_video_linux_v4l2__capture__delegate.cc:86
error: www/chromium/files/patch-media_capture_video_linux_v4l2__capture__delegate.cc: patch does not apply
slippy$
Comment 13 Stefan Ehmann 2023-05-04 23:04:17 UTC
(In reply to Cy Schubert from comment #12)

There has been an update since I posted the patch. Now builds for me.

commit 3a9105aba46ced9c83c639b68492cbc60a04f255
Author: Robert Nagy <rnagy@FreeBSD.org>
Date:   Tue May 2 09:31:57 2023 +0200

    www/chromium: update to 113.0.5672.63
    
    Approved by:    rene (mentor, implicit)
    Security:       https://vuxml.freebsd.org/freebsd/246174d3-e979-11ed-8290-a8a1599412c6.html