snapcrafters / obs-studio

This is a community-supported modified build of OBS Studio.
https://snapcraft.io/obs-studio
111 stars 37 forks source link

OBS can't share screen/application in Wayland #141

Closed Hans03430 closed 2 years ago

Hans03430 commented 2 years ago

I would like to report a bug that didn't happen when using the first versions of Ubuntu 21.04. In this case, in the current version of Ubuntu 21.10, OBS-Studio (The current snap version) can't share applications or the entire screen when using the Wayland compositor, something that did indeed work in the previous version of Ubuntu.

I am using the default drivers for my RX 5700 XT, so I think that won't be a problem. However, i've seen some errors that pop up in the terminal.

info: [pipewire] window selected, setting up screencast
[W][00539.777415][  module-rtkit.c:  200 translate_error()] RTKit error: org.freedesktop.DBus.Error.AccessDenied
[W][00539.777427][  module-rtkit.c:  460 set_nice()] could not set nice-level to -11: Permission denied
[W][00539.777489][  module-rtkit.c:  200 translate_error()] RTKit error: org.freedesktop.DBus.Error.AccessDenied
[W][00539.780674][  module-rtkit.c:  200 translate_error()] RTKit error: org.freedesktop.DBus.Error.AccessDenied
[W][00539.780763][  module-rtkit.c:  200 translate_error()] RTKit error: org.freedesktop.DBus.Error.AccessDenied
[W][00539.780773][  module-rtkit.c:  633 impl_acquire_rt()] could not make thread realtime: Permission denied
info: [pipewire] created stream 0x555e41961e20
info: [pipewire] playing stream…
[E][00539.781377][        stream.c:  365 stream_set_state()] stream 0x555e41961e20: error wrong resource type/version
error: [pipewire] Error id:2 seq:2 res:-71 (Unknown error -71): wrong resource type/version
[W][00539.781464][     impl-node.c:  386 suspend_node()] node 0x555e41962eb0: error unset format input: Input/output error
error: [pipewire] Error id:0 seq:3 res:-2 (Unknown error -2): unknown resource 2 op:2
error: [pipewire] Error id:0 seq:4 res:-2 (Unknown error -2): unknown resource 2 op:3
flexiondotorg commented 2 years ago

Please try connecting the screencast-legacy interface and report back:

snap connect obs-studio:screencast-legacy

Hans03430 commented 2 years ago

Nothing happened. It still shows nothing as before when doing screen/application sharing. This is the console output:

snap connect obs-studio:screencast-legacy
obs-studio
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
QSocketNotifier: Can only be used with threads started with QThread

(process:16846): Gtk-WARNING **: 20:31:47.842: Locale not supported by C library.
    Using the fallback 'C' locale.

(obs:16846): dbind-WARNING **: 20:31:47.853: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-kqwwguqUFD: No such file or directory
Attempted path: share/obs/obs-studio/locale/en-US.ini
Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini
Attempted path: share/obs/obs-studio/themes/Dark.qss
Attempted path: /usr/share/obs/obs-studio/themes/Dark.qss
info: User enabled --multi flag and is now running multiple instances of OBS.
info: Command Line Arguments: --multi
info: Platform: Wayland
info: CPU Name: AMD Ryzen 7 3700X 8-Core Processor
info: CPU Speed: 2200.000MHz
info: Physical Cores: 8, Logical Cores: 16
info: Physical Memory: 31984MB Total, 19565MB Free
info: Kernel Version: Linux 5.13.0-20-generic
info: Distribution: "Ubuntu Core" "20"
info: Session Type: wayland
info: Portable mode: false
Attempted path: share/obs/obs-studio/themes/Dark/no_sources.svg
Attempted path: /usr/share/obs/obs-studio/themes/Dark/no_sources.svg
QMetaObject::connectSlotsByName: No matching signal for on_tbar_position_valueChanged(int)
QMetaObject::connectSlotsByName: No matching signal for on_actionShowTransitionProperties_triggered()
QMetaObject::connectSlotsByName: No matching signal for on_actionHideTransitionProperties_triggered()
info: OBS 27.1.3-modified (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
    samples per sec: 48000
    speakers:        2
info: ---------------------------------
info: Initializing OpenGL...
info: Using EGL/Wayland
info: Initialized EGL 1.5
info: Loading up OpenGL on adapter AMD AMD Radeon RX 5700 XT (NAVI10, DRM 3.41.0, 5.13.0-20-generic, LLVM 12.0.0)
info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 21.0.3, shading language 4.60
info: ---------------------------------
info: video settings reset:
    base resolution:   1920x1080
    output resolution: 1920x1080
    downscale filter:  Bicubic
    fps:               60/1
    format:            NV12
    YUV mode:          709/Partial
info: NV12 texture support not available
info: Audio monitoring device:
    name: Default
    id: default
info: ---------------------------------
info: [StreamFX] Loading Version 0.10.1.0-gc8484f65
info: [StreamFX] Loaded Version 0.10.1.0-gc8484f65
info: [adv-ss] version: 3b465e1fdc7feb87599c6a914c2dca815117e2e7
info: [adv-ss] curl loaded successfully
info: [adv-ss] found curl library
warning: Failed to load 'en-US' text for module: 'decklink-captions.so'
warning: Failed to load 'en-US' text for module: 'decklink-ouput-ui.so'
info: [Downstream Keyer] loaded version 0.2.1
info: [Freeze Filter] loaded version 0.3.2
info: [Gradient Source] loaded version 0.2.0
info: [pango]: Loaded system fontconfig
info: [pipewire] Available captures:
info: [pipewire]     - Desktop capture
info: [pipewire]     - Window capture
libDeckLinkAPI.so: cannot open shared object file: No such file or directory
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
info: No blackmagic support
warning: v4l2loopback not installed, virtual camera disabled
info: [linux-vkcapture] plugin loaded successfully (version 1.0.1)
info: [Move Transition] loaded version 2.5.1
error: os_dlopen(libnvidia-fbc.so.1->libnvidia-fbc.so.1): libnvidia-fbc.so.1: cannot open shared object file: No such file or directory

error: Unable to load NvFBC library
warning: Failed to initialize module 'nvfbc.so'
warning: Failed to load 'en-US' text for module: 'obs-audio-pan-filter.so'
info: [obs-audio-pan-filter] plugin loaded successfully (version 0.1.2)
info: [obs-browser]: Version 2.16.3
info: [obs-browser]: CEF Version 87.1.14+ga29e9a3+chromium-87.0.4280.141
error: os_dlopen(libnvidia-encode.so.1->libnvidia-encode.so.1): libnvidia-encode.so.1: cannot open shared object file: No such file or directory

info: FFMPEG VAAPI supported
warning: Failed to load 'en-US' text for module: 'obs-gphoto.so'
info: obs-gstreamer build: 9ed970d
info: [obs-ndi] hello ! (version 4.9.1)
info: [obs-ndi] Trying ''
info: [obs-ndi] Trying '/usr/lib'
info: [obs-ndi] Trying '/usr/local/lib'
info: [obs-ndi] Found NDI library at '/usr/local/lib/libndi.so.4'
info: [obs-ndi] NDI runtime loaded successfully
info: [obs-ndi] NDI library initialized successfully (NDI SDK LINUX 18:32:11 Jun 30 2020 4.5.3)
warning: Failed to load 'en-US' text for module: 'obs-vnc.so'
info: [obs-vnc] plugin loaded successfully (version 0.4.0)
info: [obs-websocket] you can haz websockets (version 4.9.1)
info: [obs-websocket] qt version (compile-time): 5.15.2 ; qt version (run-time): 5.15.2
info: [obs-websocket] module loaded!
info: [Replay Source] loaded version 1.6.9
info: [Source Copy] loaded version 0.1.3
info: [Source Record] loaded version 0.2.6
info: [Source Switcher] loaded version 0.3.0
info: [spectralizer] Loading v1.3.2 build time 2021.10.20 22:37
info: [TimeWarpScan] loaded version 0.1.6
info: [Transition Table] loaded version 0.2.2
info: VLC found, VLC video source enabled
info: ---------------------------------
info:   Loaded Modules:
info:     vlc-video.so
info:     transition-table.so
info:     time-warp-scan.so
info:     text-freetype2.so
info:     spectralizer.so
info:     source-switcher.so
info:     source-record.so
info:     source-copy.so
info:     sndio.so
info:     rtmp-services.so
info:     replay-source.so
info:     recursion-effect.so
info:     obs-x264.so
info:     obs-websocket.so
info:     obs-vst.so
info:     obs-vnc.so
info:     obs-transitions.so
info:     obs-rtspserver.so
info:     obs-rgb-levels-filter.so
info:     obs-outputs.so
info:     obs-ndi.so
info:     obs-libfdk.so
info:     obs-gstreamer.so
info:     obs-gphoto.so
info:     obs-filters.so
info:     obs-ffmpeg.so
info:     obs-browser.so
info:     obs-audio-pan-filter.so
info:     nvfbc.so
info:     move-transition.so
info:     linux-vkcapture.so
info:     linux-v4l2.so
info:     linux-pulseaudio.so
info:     linux-jack.so
info:     linux-decklink.so
info:     linux-capture.so
info:     linux-alsa.so
info:     libtext-pango.so
info:     image-source.so
info:     gradient-source.so
info:     frontend-tools.so
info:     freeze-filter.so
info:     dynamic-delay.so
info:     dvd-screensaver.so
info:     downstream-keyer.so
info:     dir-watch-media.so
info:     decklink-ouput-ui.so
info:     decklink-captions.so
info:     advanced-scene-switcher.so
info:     StreamFX.so
info: ---------------------------------
info: ==== Startup complete ===============================================
info: All scene data cleared
info: ------------------------------------------------
info: pulse-input: Server name: 'pulseaudio 15.0'
info: pulse-input: Audio format: s16le, 44100 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.pci-0000_0f_00.4.analog-stereo.monitor'
info: [Loaded global audio device]: 'Desktop Audio'
info: pulse-input: Server name: 'pulseaudio 15.0'
info: pulse-input: Audio format: s16le, 44100 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_input.pci-0000_0f_00.4.analog-stereo'
info: [Loaded global audio device]: 'Mic/Aux'
info: [pipewire] available cursor modes:
info: [pipewire]     - Metadata
info: [pipewire]     - Always visible
info: [pipewire]     - Hidden
info: PipeWire initialized (sender name: 1_403)
info: Switched to scene 'Scene'
info: [adv-ss] trying to reconnect to  in 10 seconds.
info: [adv-ss] started
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Screen Capture (PipeWire)' (pipewire-desktop-capture-source)
info: ------------------------------------------------
info: [obs-websocket] WSServer::start: Not locked to IPv4 bindings
info: [obs-websocket] server started successfully on port 4444
info: [obs-websocket] IO thread started.
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Attempted path: share/obs/obs-studio/images/overflow.png
Attempted path: /usr/share/obs/obs-studio/images/overflow.png
info: [pipewire] screencast session created
info: [pipewire] asking for desktop…
info: adding 42 milliseconds of audio buffering, total audio buffering is now 42 milliseconds (source: Mic/Aux)

info: [pipewire] desktop selected, setting up screencast
[W][05264.404270][  module-rtkit.c:  200 translate_error()] RTKit error: org.freedesktop.DBus.Error.AccessDenied
[W][05264.404293][  module-rtkit.c:  460 set_nice()] could not set nice-level to -11: Permission denied
[W][05264.404434][  module-rtkit.c:  200 translate_error()] RTKit error: org.freedesktop.DBus.Error.AccessDenied
[W][05264.408901][  module-rtkit.c:  200 translate_error()] RTKit error: org.freedesktop.DBus.Error.AccessDenied
[W][05264.409068][  module-rtkit.c:  200 translate_error()] RTKit error: org.freedesktop.DBus.Error.AccessDenied
[W][05264.409086][  module-rtkit.c:  633 impl_acquire_rt()] could not make thread realtime: Permission denied
info: [pipewire] created stream 0x55bc48445120
info: [pipewire] playing stream…
[E][05264.409730][        stream.c:  365 stream_set_state()] stream 0x55bc48445120: error wrong resource type/version
error: [pipewire] Error id:2 seq:2 res:-71 (Unknown error -71): wrong resource type/version
[W][05264.409822][     impl-node.c:  386 suspend_node()] node 0x55bc48446b80: error unset format input: Input/output error
error: [pipewire] Error id:0 seq:3 res:-2 (Unknown error -2): unknown resource 2 op:2
error: [pipewire] Error id:0 seq:4 res:-2 (Unknown error -2): unknown resource 2 op:3
oSoMoN commented 2 years ago

This error (error wrong resource type/version) is caused by a version mismatch between the pipewire server on the host (0.3.32 in Ubuntu 21.10), and the client lib in the snap (currently 0.3.34, since https://github.com/snapcrafters/obs-studio/commit/63a760944f811fe275315bf19a43c1ccae7d1c1c). Downgrading to 0.3.32 in the snap should fix the problem (it did for me when I was experimenting with enabling pipewire in the firefox snap). I haven't tested on an Ubuntu 21.04 host, but I suspect the client lib would have to be downgraded even further to 0.3.24.

oSoMoN commented 2 years ago

Just tested in a 21.04 VM, and screensharing works in my firefox snap with libpipewire version 0.3.32, meaning the version mismatch isn't a problem there, somehow.

Hans03430 commented 2 years ago

Just tested in a 21.04 VM, and screensharing works in my firefox snap with libpipewire version 0.3.32, meaning the version mismatch isn't a problem there, somehow.

Well, like i said in the first post, I remember OBS working perfectly on wayland during the first weeks after Ubuntu 21.04 came out. When i tried it before upgrading to 21.10 it didn't work anymore, same as in 21.10 itself :( I suspect it might be related to RTKit error: org.freedesktop.DBus.Error.AccessDenied

Hans03430 commented 2 years ago

Any updates on this bug?