Skip to main content
Topic: [SOLVED] Gnome Wayland unable to get Obs Screen or Window Capture (Read 1368 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

[SOLVED] Gnome Wayland unable to get Obs Screen or Window Capture

Hey all,
I apologize for my frequent posting here. I have run into a small problem. I installed the KDE image of Artix s6, but have decided to install and use Gnome Wayland with gdm. Everything works pretty seamlessly except for screen capture with obs or firefox. I can't get either to work. I have xdg-desktop-portal-gnome and pipewire installed and I have set this variable:

export QT_QPA_PLATFORM=wayland

It doesn't seem to have made a difference. When I open obs from a terminal and then try to screen capture, the output from the terminal is:

Code: [Select]
==== Startup complete ===============================================
info: All scene data cleared
info: ------------------------------------------------
info: pulse-input: Server name: 'pulseaudio 16.1'
info: pulse-input: Audio format: s16le, 44100 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo.monitor' (default)
info: [Loaded global audio device]: 'Desktop Audio'
info: pulse-input: Server name: 'pulseaudio 16.1'
info: pulse-input: Audio format: s16le, 44100 Hz, 1 channels
info: pulse-input: Started recording from 'alsa_input.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.mono-fallback' (default)
info: [Loaded global audio device]: 'Mic/Aux'
info: PipeWire initialized
info: PipeWire initialized
info: Switched to scene 'Scene'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Screen Capture (PipeWire)' (pipewire-desktop-capture-source)
info:     - source: 'Window Capture (PipeWire)' (pipewire-window-capture-source)
info: ------------------------------------------------
info: [pipewire] Screencast session created
info: [pipewire] Screencast session created
info: [pipewire] Asking for desktop
info: [pipewire] Asking for window
info: adding 42 milliseconds of audio buffering, total audio buffering is now 42 milliseconds (source: Mic/Aux)

warning: [pipewire] Failed to start screencast, denied or cancelled by user

OBS has a screen share dialog pop up and asks what screen I want to capture. I select it and it then prints out the last line in the obs output above. It reminds me of when I haven't added my user to the proper groups, but I don't think there is a group for this kind of thing.

When I do a "grep portal /var/log/*", I get these messages from ten days ago:

Code: [Select]
messages.log.2:Jul 17 21:06:24 brandon-artixdesktop dbus-daemon[8868]: [session uid=0 pid=8866] Activating service name='org.freedesktop.impl.portal.desktop.gnome' requested by ':1.1' (uid=0 pid=8870 comm="/usr/lib/xdg-desktop-portal")
messages.log.2:Jul 17 21:06:24 brandon-artixdesktop dbus-daemon[8868]: [session uid=0 pid=8866] Activated service 'org.freedesktop.impl.portal.desktop.gnome' failed: Process org.freedesktop.impl.portal.desktop.gnome exited with status 1
messages.log.2:Jul 17 21:06:24 brandon-artixdesktop dbus-daemon[8868]: [session uid=0 pid=8866] Activating service name='org.freedesktop.impl.portal.desktop.gnome' requested by ':1.1' (uid=0 pid=8870 comm="/usr/lib/xdg-desktop-portal")
messages.log.2:Jul 17 21:06:24 brandon-artixdesktop dbus-daemon[8868]: [session uid=0 pid=8866] Activated service 'org.freedesktop.impl.portal.desktop.gnome' failed: Process org.freedesktop.impl.portal.desktop.gnome exited with status 1
messages.log.2:Jul 17 21:06:24 brandon-artixdesktop dbus-daemon[8868]: [session uid=0 pid=8866] Successfully activated service 'org.freedesktop.portal.Desktop'

I doubt this is related, as you would expect error messages like these to be spit out whenever you try to screen capture, but I thought I would post about it.

Let me know if you have any suggestions/ideas, I always appreciate the help I get here. :)

Re: Gnome Wayland unable to get Obs Screen or Window Capture

Reply #1
There is an OBS forum which has several threads regarding this kind of issue, e.g.:
https://obsproject.com/forum/threads/obs-and-hyprland-works.167558/

From what I read there can also be some variation in Wayland behavior depending on what graphics you have. It sounds like OBS should work though.

Re: Gnome Wayland unable to get Obs Screen or Window Capture

Reply #2
I figured it out. You can't just have pipewire installed, you need to start it before obs (or any screen capturing application, like firefox) can start capturing. I also start wireplumber with it (I'm sure if that's needed, but I do it anyways and it doesn't cause any issues, I think). If I used pipewire for my audio handling, it would have just worked, but since I use pulseaudio+jack, it didn't just work.

Here is what I run at the startup of my gnome session:

Code: [Select]
#!/bin/sh

/usr/bin/pipewire & /usr/bin/wireplumber &

I hope this helps anyone else who may still be using pulseaudio! :)