-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chromium: enable WebRTC screen sharing via PipeWire #26144
Conversation
eb43afb
to
d494642
Compare
e91d2f9
to
6cadef1
Compare
6cadef1
to
85c2752
Compare
2d8d648
to
762ac69
Compare
762ac69
to
40852c1
Compare
I hope this PR will ever be merged... I've spent so much time on it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libpipewire0.2 needs to appear in common/shlibs
. Also, I'm getting the following error building chromium:
[16699/43513] CXX obj/third_party/webrtc/modules/audio_processing/vad/vad/voice_activity_detector.o
[16700/43513] STAMP obj/third_party/webrtc/modules/desktop_capture/desktop_capture_generic.inputdeps.stamp
[16701/43513] CXX obj/third_party/webrtc/modules/congestion_controller/goog_cc/estimators/bitrate_estimator.o
[16702/43513] CXX obj/third_party/webrtc/modules/desktop_capture/primitives/shared_desktop_frame.o
[16703/43513] CXX obj/third_party/webrtc/modules/desktop_capture/pipewire_stubs/pipewire_stubs.o
FAILED: obj/third_party/webrtc/modules/desktop_capture/pipewire_stubs/pipewire_stubs.o
clang++ -MMD -MF obj/third_party/webrtc/modules/desktop_capture/pipewire_stubs/pipewire_stubs.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DUSE_X11=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DCR_CLANG_REVISION=\"llvmorg-12-init-5035-gd0abc757-3\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DWEBRTC_ENABLE_PROTOBUF=1 -DRTC_ENABLE_VP9 -DHAVE_SCTP -DENABLE_EXTERNAL_AUTH -DWEBRTC_USE_H264 -DHAVE_WEBRTC_VIDEO -DLOGGING_INSIDE_WEBRTC -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -DWEBRTC_ENABLE_AVX2 -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DWEBRTC_CHROMIUM_BUILD -DWEBRTC_POSIX -DWEBRTC_LINUX -DABSL_ALLOCATOR_NOTHROW=1 -DNO_MAIN_THREAD_WRAPPING -Igen/third_party/webrtc/modules/desktop_capture -I../.. -Igen -I../../third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -Igen/shim_headers/libevent_shim -I../../third_party/webrtc_overrides -I../../third_party/webrtc -Igen/third_party/webrtc -I../../third_party/abseil-cpp -I../../third_party/boringssl/src/include -I../../third_party/protobuf/src -Igen/protoc_out -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -mllvm -enable-dse-memoryssa=false -m64 -march=x86-64 -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -Xclang -fdebug-compilation-dir -Xclang . -no-canonical-prefixes -Wall -Wextra -Wimplicit-fallthrough -Wunreachable-code -Wthread-safety -Wextra-semi -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-psabi -Wno-ignored-pragma-optimize -Wno-implicit-int-float-conversion -Wno-final-dtor-non-final-class -Wno-builtin-assume-aligned-alignment -Wno-deprecated-copy -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g0 -ftrivial-auto-var-init=pattern -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -std=c++14 -fno-trigraphs -Wno-trigraphs -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -c gen/third_party/webrtc/modules/desktop_capture/linux/pipewire_stubs.cc -o obj/third_party/webrtc/modules/desktop_capture/pipewire_stubs/pipewire_stubs.o
gen/third_party/webrtc/modules/desktop_capture/linux/pipewire_stubs.cc:18:10: fatal error: 'pipewire/pipewire.h' file not found
#include <pipewire/pipewire.h>
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
[16704/43513] CXX obj/third_party/webrtc/modules/congestion_controller/congestion_controller/receive_side_congestion_controller.o
[16705/43513] CXX obj/third_party/webrtc/modules/congestion_controller/goog_cc/alr_detector/alr_detector.o
[16706/43513] CXX obj/third_party/webrtc/modules/congestion_controller/goog_cc/estimators/acknowledged_bitrate_estimator_interface.o
[16707/43513] CXX obj/third_party/webrtc/modules/desktop_capture/desktop_capture_generic/desktop_capture_options.o
[16708/43513] CXX obj/third_party/webrtc/modules/desktop_capture/desktop_capture_generic/desktop_capturer.o
[16709/43513] CXX obj/third_party/webrtc/modules/desktop_capture/desktop_capture_generic/desktop_and_cursor_composer.o
[16710/43513] CXX obj/third_party/webrtc/modules/congestion_controller/goog_cc/goog_cc/goog_cc_network_control.o
[16711/43513] CXX obj/third_party/webrtc/modules/congestion_controller/rtp/control_handler/control_handler.o
[16712/43513] CXX obj/third_party/webrtc/modules/congestion_controller/rtp/transport_feedback/transport_feedback_adapter.o
ninja: build stopped: subcommand failed.
=> ERROR: chromium-87.0.4280.66_1: do_build: 'ninja -C out/Release ${makejobs} chrome chromedriver mksnapshot' exited with 1
=> ERROR: in do_build() at srcpkgs/chromium/template:269
Didn't have time to look into what's causing it yet. I'm on x86_64 glibc for what it's worth.
40852c1
to
32484e9
Compare
@ifreund that's because for some strange reason |
You may need to do this if you want the package to detect the |
72f4e7f
to
ef30986
Compare
@ifreund OK, I've fixed |
That's all working as intended. Applications use |
OK, if I'll explicitly include |
ef30986
to
e153d1f
Compare
I still get the same error with the latest commit. I also don't see the include dir for pipewire in the clang++ command line flags, so it seems like pipewire's pkgconfig is not getting used for whatever reason. |
@ifreund can I ask you to check if |
Looks like it's there, still get the same error building chromium though.
|
I guess you have to rerun |
Looks like you were right, after a |
Confirmed that this works with #23296 to screenshare on sway x86_64 glibc using the webrtc test page here: https://mozilla.github.io/webrtc-landing/gum_test.html |
e153d1f
to
4646f1e
Compare
Finally, my changes have been merged (#27060)! Thanks to everyone who were involved. |
[ci skip]
There are minor issues though:
xdg-desktop-portal*
processes sometimes, probably caused by some sort of race condition;✔️ https://www.webrtc-experiment.com/Pluginfree-Screen-Sharing
✔️ https://zoom.us (in-browser version)
✔️ https://discord.com (in-browser version)
Currently I'm investigating these stability issues with
pipewire
. It seems thatpipewire
is trying to usertkit
to make audio/video processing run in real time. Unfortunately, it fails to do so:After a bit of searching, I've found these bugs:
https://bugzilla.redhat.com/show_bug.cgi?id=1229700
https://bugs.gentoo.org/show_bug.cgi?id=569546
I've built
linux5.9
forx86_64
withCONFIG_RT_GROUP_SCHED
disabled.For some strange reason, nothing changed, the error persists. Luckily, screen sharing works without
rtkit
.I guess that those rare issues with screen sharing, which were described above, may be caused by
rtkit
not working.