Slack 与 WebRTCPipeWireCapture Wyaland 黑屏共享,但在 Chrome 上可用

Slack 与 WebRTCPipeWireCapture Wyaland 黑屏共享,但在 Chrome 上可用

我在用

  • Ubuntu 23.10
  • 松弛 4.35.121
  • Pipewire 0.3.79-2
  • 图形处理器
➜  ~ echo $XDG_SESSION_TYPE                        
wayland

➜  ~ sudo lspci -k | grep -EA3 'VGA|3D|Display'
pcilib: Error reading /sys/bus/pci/devices/0000:00:08.3/label: Operation not permitted
03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 23 [Radeon RX 6650 XT / 6700S / 6800S] (rev c0)
        Subsystem: ASUSTeK Computer Inc. Navi 23 [Radeon RX 6650 XT]
        Kernel driver in use: amdgpu
        Kernel modules: amdgpu
--
07:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt [Radeon 680M] (rev c7)
        Subsystem: ASUSTeK Computer Inc. Rembrandt [Radeon 680M]
        Kernel driver in use: amdgpu
        Kernel modules: amdgpu

管线

➜  ~ dpkg -l | grep -i pipewire                                 
ii  gnome-remote-desktop                             45.0-1                                    amd64        Remote desktop daemon for GNOME using PipeWire
ii  gstreamer1.0-pipewire:amd64                      0.3.79-2                                  amd64        GStreamer 1.0 plugin for the PipeWire multimedia server
ii  libpipewire-0.3-0:amd64                          0.3.79-2                                  amd64        libraries for the PipeWire multimedia server
ii  libpipewire-0.3-common                           0.3.79-2                                  all          libraries for the PipeWire multimedia server - common files
ii  libpipewire-0.3-modules:amd64                    0.3.79-2                                  amd64        libraries for the PipeWire multimedia server - modules
ii  libspa-0.2-bluetooth:amd64                       0.3.79-2                                  amd64        libraries for the PipeWire multimedia server - bluetooth plugins
ii  libspa-0.2-modules:amd64                         0.3.79-2                                  amd64        libraries for the PipeWire multimedia server Simple Plugin API - modules
ii  pipewire:amd64                                   0.3.79-2                                  amd64        audio and video processing engine multimedia server
ii  pipewire-alsa:amd64                              0.3.79-2                                  amd64        PipeWire ALSA plugin
ii  pipewire-audio                                   0.3.79-2                                  all          recommended set of PipeWire packages for a standard audio desktop use
ii  pipewire-bin                                     0.3.79-2                                  amd64        PipeWire multimedia server - programs
ii  pipewire-pulse                                   0.3.79-2                                  amd64        PipeWire PulseAudio daemon
ii  wireplumber  
  1. Snap 版 Slackslack --enable-features=WebRTCPipeWireCapturer在共享时会显示黑屏(或不显示黑屏)
  2. 屏幕共享在 Xorg 上有效
  3. 屏幕共享适用于基于 Chromium 的浏览器 (Brave)
  4. Deb 版本的 slack slack-desktop-4.34.121-amd64 - 共享时黑屏
  5. 之前我使用的是 Fedora 37,内核是 6.12,gnome 43,slack 可以共享屏幕,所以这绝对是可行的

我在日志中看到,有一些子进程带有禁用 WebRTCPipeWireCapturer 的标志

user+   26075  7.3  0.5 1178928616 180012 ?   SLl  11:27   0:02 /snap/slack/110/usr/lib/slack/slack --no-sandbox --enable-features=WebRTCPipeWireCapturer --executed-from=/home/user --pid=25496
user+   26082  0.0  0.1 33988524 49408 ?      S    11:27   0:00 /snap/slack/110/usr/lib/slack/slack --type=zygote --no-zygote-sandbox --no-sandbox
user+   26083  0.0  0.1 33988520 49280 ?      S    11:27   0:00 /snap/slack/110/usr/lib/slack/slack --type=zygote --no-sandbox
user+   26099  0.0  0.0 33588712 3200 ?       Sl   11:27   0:00 /snap/slack/110/usr/lib/slack/chrome_crashpad_handler --monitor-self-annotation=ptype=crashpad-handler --no-upload-gzip --database=/home/user/snap/slack/110/.config/Slack/Crashpad --url=https://slack.com/apps/sentryproxy/api/5277886/minidump/?sentry_key=fd30fe469dbf4aec9db40548e5acf91e --annotation=_productName=Slack --annotation=_version=4.35.121 --annotation=lsb-release=Ubuntu Core 18 --annotation=plat=Linux --annotation=prod=Electron --annotation=sentry___initialScope={"release":"[email protected]","environment":"production","user":{"id":"e1f78694-1d56-4017-a027-beab0ea663ae"},"tags":{"uuid":"e1f78694-1d56-4017-a027-beab0ea663ae"}} --annotation=ver=27.0.0 --initial-client-fd=43 --shared-client-connection
user+   26126  2.2  0.2 34046980 72972 ?      Sl   11:27   0:00 /snap/slack/110/usr/lib/slack/slack --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --enable-logging --crashpad-handler-pid=26099 --enable-crash-reporter=f0b3e071-ce2a-4a61-89db-a168791729e9,no_channel --user-data-dir=/home/user/snap/slack/110/.config/Slack --standard-schemes=app,slack-webapp-dev --secure-schemes=app,slack-webapp-dev --bypasscsp-schemes=slack-webapp-dev --cors-schemes=slack-webapp-dev --fetch-schemes=slack-webapp-dev --service-worker-schemes=slack-webapp-dev --streaming-schemes --enable-logging --log-file=/home/user/snap/slack/110/.config/Slack/logs/default/electron_debug.log --shared-files=v8_context_snapshot_data:100 --field-trial-handle=0,i,8702521800839048508,11262088157928811340,262144 --disable-features=AllowAggressiveThrottlingWithWebSocket,CalculateNativeWinOcclusion,HardwareMediaKeyHandling,IntensiveWakeUpThrottling,LogJsConsoleMessages,RequestInitiatorSiteLockEnfocement,SpareRendererForSitePerProcess,WebRTCPipeWireCapturer,WebRtcHideLocalIpsWithMdns,WinRetrieveSuggestionsOnlyOnDemand
user+   26179 37.9  1.3 1191407300 418572 ?   Sl   11:27   0:11 /snap/slack/110/usr/lib/slack/slack --type=renderer --crashpad-handler-pid=26099 --enable-crash-reporter=f0b3e071-ce2a-4a61-89db-a168791729e9,no_channel --user-data-dir=/home/user/snap/slack/110/.config/Slack --standard-schemes=app,slack-webapp-dev --secure-schemes=app,slack-webapp-dev --bypasscsp-schemes=slack-webapp-dev --cors-schemes=slack-webapp-dev --fetch-schemes=slack-webapp-dev --service-worker-schemes=slack-webapp-dev --streaming-schemes --app-path=/snap/slack/110/usr/lib/slack/resources/app.asar --enable-sandbox --enable-blink-features=ExperimentalJSProfiler --disable-blink-features --first-renderer-process --no-sandbox --autoplay-policy=no-user-gesture-required --enable-logging --force-color-profile=srgb --log-file=/home/user/snap/slack/110/.config/Slack/logs/default/electron_debug.log --lang=en-US --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=4 --time-ticks-at-unix-epoch=-1698307092377958 --launch-time-ticks=5365682318 --shared-files=v8_context_snapshot_data:100 --field-trial-handle=0,i,8702521800839048508,11262088157928811340,262144 --disable-features=AllowAggressiveThrottlingWithWebSocket,CalculateNativeWinOcclusion,HardwareMediaKeyHandling,IntensiveWakeUpThrottling,LogJsConsoleMessages,RequestInitiatorSiteLockEnfocement,SpareRendererForSitePerProcess,WebRTCPipeWireCapturer,WebRtcHideLocalIpsWithMdns,WinRetrieveSuggestionsOnlyOnDemand --window-type=main
user+   26229  7.5  0.3 34636732 127500 ?     Sl   11:27   0:02 /snap/slack/110/usr/lib/slack/slack --type=gpu-process --no-sandbox --enable-logging --crashpad-handler-pid=26099 --enable-crash-reporter=f0b3e071-ce2a-4a61-89db-a168791729e9,no_channel --user-data-dir=/home/user/snap/slack/110/.config/Slack --gpu-preferences=WAAAAAAAAAAgAAAEAAAAAAAAAAAAAAAAAABgAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAGAAAAAAAAAAYAAAAAAAAAAgAAAAAAAAACAAAAAAAAAAIAAAAAAAAAA== --use-gl=angle --use-angle=swiftshader-webgl --enable-logging --log-file=/home/user/snap/slack/110/.config/Slack/logs/default/electron_debug.log --shared-files --field-trial-handle=0,i,8702521800839048508,11262088157928811340,262144 --disable-features=AllowAggressiveThrottlingWithWebSocket,CalculateNativeWinOcclusion,HardwareMediaKeyHandling,IntensiveWakeUpThrottling,LogJsConsoleMessages,RequestInitiatorSiteLockEnfocement,SpareRendererForSitePerProcess,WebRTCPipeWireCapturer,WebRtcHideLocalIpsWithMdns,WinRetrieveSuggestionsOnlyOnDemand
user+   26318  5.7  0.2 34227536 64128 ?      Sl   11:27   0:01 /snap/slack/110/usr/lib/slack/slack --type=utility --utility-sub-type=audio.mojom.AudioService --lang=en-US --service-sandbox-type=none --no-sandbox --enable-logging --crashpad-handler-pid=26099 --enable-crash-reporter=f0b3e071-ce2a-4a61-89db-a168791729e9,no_channel --user-data-dir=/home/user/snap/slack/110/.config/Slack --standard-schemes=app,slack-webapp-dev --secure-schemes=app,slack-webapp-dev --bypasscsp-schemes=slack-webapp-dev --cors-schemes=slack-webapp-dev --fetch-schemes=slack-webapp-dev --service-worker-schemes=slack-webapp-dev --streaming-schemes --enable-logging --log-file=/home/user/snap/slack/110/.config/Slack/logs/default/electron_debug.log --shared-files=v8_context_snapshot_data:100 --field-trial-handle=0,i,8702521800839048508,11262088157928811340,262144 --disable-features=AllowAggressiveThrottlingWithWebSocket,CalculateNativeWinOcclusion,HardwareMediaKeyHandling,IntensiveWakeUpThrottling,LogJsConsoleMessages,RequestInitiatorSiteLockEnfocement,SpareRendererForSitePerProcess,WebRTCPipeWireCapturer,WebRtcHideLocalIpsWithMdns,WinRetrieveSuggestionsOnlyOnDemand
user+   26366  0.0  0.0  17784  2304 pts/0    S+   11:28   0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox slack

答案1

较新的 slacks 明确禁用了 WebRTCPipeWireCapturer,但您可以通过直接编辑 JS 资源文件来解决这个问题。有一些完整性检查,并且需要相同的长度,否则 Slack 根本无法启动,但以下命令对我有效4.35.121。当然需要像以前一样传入命令行选项--enable-features=WebRTCPipeWireCapturer和/或将其放在桌面文件中。

sudo sed -i'.backup' -e 's/,"WebRTCPipeWireCapturer"/,"LebRTCPipeWireCapturer"/' /usr/lib/slack/resources/app.asar

桌面文件可以存在~/.local/share/applications/slack.desktop并且不会被更新破坏,但是每次更新后都需要重复 app.asar 修补。

答案2

根据这个线最新的 Wyaland 工作版本是 slack-desktop-4.29.149

可以使用以下命令下载、安装并运行工作屏幕共享

#Download
wget https://downloads.slack-edge.com/releases/linux/4.29.149/prod/x64/slack-desktop-4.29.149-amd64.deb
#install
sudo dpkg -i slack-desktop-4.29.149-amd64.deb 
#run and check whether screen sharing works
slack --enable-features=WebRTCPipeWireCapturer

如果 .desktop 文件可以工作的话,请编辑它

nano /usr/share/applications/slack.desktop 

相关内容