You are not logged in.

#1 2023-12-18 18:11:49

charper_flow
Member
Registered: 2022-07-15
Posts: 34

Issue with wayland and OBS screen capture

I know this is a well documented issue but I have tried all of the solutions I have seen posted thusfar. I am trying to create a screen capture using OBS, however,  I do not see screen capture as a potential source. I believe this is an issue with my pipewire. This is the debug file produced on launching obs:

debug: Found portal inhibitor
debug: Attempted path: share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: share/obs/obs-studio/locale.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale.ini
debug: Attempted path: share/obs/obs-studio/themes/Yami.qss
debug: Attempted path: /usr/share/obs/obs-studio/themes/Yami.qss
info: Platform: Wayland
info: CPU Name: 12th Gen Intel(R) Core(TM) i5-1235U
info: CPU Speed: 2374.553MHz
info: Physical Cores: 10, Logical Cores: 12
info: Physical Memory: 23881MB Total, 20389MB Free
info: Kernel Version: Linux 6.6.7-arch1-1
info: Distribution: "Arch Linux" Unknown
info: Desktop Environment: sway
info: Session Type: wayland
info: Qt Version: 6.6.1 (runtime), 6.6.1 (compiled)
info: Portable mode: false
info: OBS 30.0.2-1 (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
	samples per sec: 48000
	speakers:        2
	max buffering:   960 milliseconds
	buffering type:  dynamically increasing
info: ---------------------------------
info: Initializing OpenGL...
info: Using EGL/Wayland
info: Initialized EGL 1.5
info: Loading up OpenGL on adapter Intel Mesa Intel(R) Graphics (ADL GT2)
info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 23.3.1-arch1.1, shading language 4.60
info: ---------------------------------
info: video settings reset:
	base resolution:   1920x1080
	output resolution: 1280x720
	downscale filter:  Bicubic
	fps:               60/1
	format:            NV12
	YUV mode:          Rec. 709/Partial
info: NV12 texture support not available
info: P010 texture support not available
info: Audio monitoring device:
	name: Default
	id: default
info: ---------------------------------
warning: Failed to load 'en-US' text for module: 'decklink-captions.so'
warning: Failed to load 'en-US' text for module: 'decklink-output-ui.so'
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
warning: Failed to initialize module 'decklink.so'
info: [pipewire] No captures available
error: VAAPI: Failed to initialize display in vaapi_device_h264_supported
info: FFmpeg VAAPI H264 encoding not supported
error: VAAPI: Failed to initialize display in vaapi_device_hevc_supported
info: FFmpeg VAAPI HEVC encoding not supported
info: ---------------------------------
info:   Loaded Modules:
info:     text-freetype2.so
info:     rtmp-services.so
info:     obs-x264.so
info:     obs-vst.so
info:     obs-transitions.so
info:     obs-qsv11.so
info:     obs-outputs.so
info:     obs-libfdk.so
info:     obs-filters.so
info:     obs-ffmpeg.so
info:     linux-v4l2.so
info:     linux-pulseaudio.so
info:     linux-pipewire.so
info:     linux-jack.so
info:     linux-capture.so
info:     linux-alsa.so
info:     image-source.so
info:     frontend-tools.so
info:     decklink-output-ui.so
info:     decklink-captions.so
info: ---------------------------------
warning: QWidget::setTabOrder: 'first' and 'second' must be in the same window
info: ==== Startup complete ===============================================
info: All scene data cleared
info: ------------------------------------------------
info: pulse-input: Server name: 'PulseAudio (on PipeWire 1.0.0) 15.0.0'
info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.pci-0000_00_1f.3.analog-stereo.monitor' (default)
info: [Loaded global audio device]: 'Desktop Audio'
error: Source ID 'pipewire-desktop-capture-source' not found
error: Failed to create source 'Screen Capture (PipeWire)'!
info: alsa-input: PCM 'front:CARD=PCH,DEV=0' rate set to 44100
info: alsa-input: PCM 'front:CARD=PCH,DEV=0' channels set to 2
info: pulse-input: Server name: 'PulseAudio (on PipeWire 1.0.0) 15.0.0'
info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_input.pci-0000_00_1f.3.analog-stereo' (default)
info: Switched to scene 'Scene'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Audio Capture Device (ALSA)' (alsa_input_capture)
info:     - source: 'Audio Input Capture (PulseAudio)' (pulse_input_capture)
info:     - source: 'Screen Capture (PipeWire)' (pipewire-desktop-capture-source)
info: ------------------------------------------------
info: adding 21 milliseconds of audio buffering, total audio buffering is now 21 milliseconds (source: Desktop Audio)

info: adding 725 milliseconds of audio buffering, total audio buffering is now 746 milliseconds (source: Audio Capture Device (ALSA))

info: [Media Source 'Media Source']: settings:
	input:                   
	input_format:            (null)
	speed:                   100
	is_looping:              no
	is_linear_alpha:         no
	is_hw_decoding:          no
	is_clear_on_media_end:   yes
	restart_on_activate:     yes
	close_when_inactive:     no
	full_decode:             no
	ffmpeg_options:          
info: User added source 'Media Source' (ffmpeg_source) to scene 'Scene'
info: User Removed source 'Media Source' (ffmpeg_source) from scene 'Scene'

I think my issues is highlighted in these two lines:

error: Source ID 'pipewire-desktop-capture-source' not found
error: Failed to create source 'Screen Capture (PipeWire)'!

I have the whole pipewire suite installed, and I have wireplumber and xdg-desktop-portal installed. I believe I am exporting my desktop variables correctly. This is what my .bash_profile file currently looks like:

# ~/.bash_profile
#

[[ -f ~/.bashrc ]] && . ~/.bashrc

if [ "$(tty)" = "/dev/tty1" ] ; then
        #Your environment variables
        export QT_QPA_PLATFORM=wayland
        export MOZ_ENABLE_WAYLAND=1
        export MOZ_WEBRENDER=1
        export XDG_BACKEND=wayland
        export XDG_SESSION_TYPE=wayland
        export SDL_VIDEODRIVER=wayland
        export XDG_CURRENT_DESKTOP=sway
        export GDK_BACKEND=wayland
        exec sway
fi

So I am quite at a loss of what to do next...Any and all help would be appreciated. I am happy to provide any more information smile

Offline

#2 2023-12-18 21:30:46

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,232

Re: Issue with wayland and OBS screen capture

Is pipewire/wireplumber/xdg-desktop-portal-wlr installed and started?

systemctl --user status pipewire{,-media-session} wireplumber xdg-desktop-portal-wlr

Offline

#3 2023-12-19 00:46:33

charper_flow
Member
Registered: 2022-07-15
Posts: 34

Re: Issue with wayland and OBS screen capture

I believe those are all installed. I don't have pipe-wire-media-session installed because it conflicts with wireplumber. When I run your request, I get the following results:

[charper@vinho ~]$ systemctl --user status pipewire{,-media-session} wireplumber xdg-desktop-portal-wlr
Unit pipewire-media-session.service could not be found.
● pipewire.service - PipeWire Multimedia Service
     Loaded: loaded (/usr/lib/systemd/user/pipewire.service; enabled; preset: enable>
     Active: active (running) since Mon 2023-12-18 09:42:15 PST; 6h ago
TriggeredBy: ● pipewire.socket
   Main PID: 987 (pipewire)
      Tasks: 4 (limit: 28624)
     Memory: 12.4M (peak: 13.7M)
        CPU: 16.081s
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire.se>
             └─987 /usr/bin/pipewire

Dec 18 16:38:11 vinho pipewire[987]: spa.audioadapter: params Spa:Enum:ParamId:EnumF>
Dec 18 16:38:11 vinho pipewire[987]: pw.node: (alsa_input.pci-0000_00_1f.3.analog-st>
Dec 18 16:38:16 vinho pipewire[987]: spa.alsa: 'front:0': capture open failed: Devic>
Dec 18 16:38:16 vinho pipewire[987]: spa.alsa: 'front:0': capture open failed: Devic>
Dec 18 16:38:16 vinho pipewire[987]: spa.audioadapter: params Spa:Enum:ParamId:EnumF>
Dec 18 16:38:16 vinho pipewire[987]: pw.node: (alsa_input.pci-0000_00_1f.3.analog-st>
Dec 18 16:38:21 vinho pipewire[987]: spa.alsa: 'front:0': capture open failed: Devic>
Dec 18 16:38:21 vinho pipewire[987]: spa.alsa: 'front:0': capture open failed: Devic>
Dec 18 16:38:21 vinho pipewire[987]: spa.audioadapter: params Spa:Enum:ParamId:EnumF>
Dec 18 16:38:21 vinho pipewire[987]: pw.node: (alsa_input.pci-0000_00_1f.3.analog-st>

● wireplumber.service - Multimedia Service Session Manager
     Loaded: loaded (/usr/lib/systemd/user/wireplumber.service; enabled; preset: ena>
     Active: active (running) since Mon 2023-12-18 09:42:15 PST; 6h ago
   Main PID: 988 (wireplumber)
      Tasks: 7 (limit: 28624)
     Memory: 16.8M (peak: 19.2M)
        CPU: 1.330s
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/wireplumber>
             └─988 /usr/bin/wireplumber

Dec 18 09:42:15 vinho systemd[979]: Started Multimedia Service Session Manager.
Dec 18 09:42:15 vinho wireplumber[988]: Failed to get percentage from UPower: org.fr>
Dec 18 09:42:15 vinho wireplumber[988]: [0:00:18.023717518] [988] ERROR IPAModule ip>
Dec 18 09:42:15 vinho wireplumber[988]: [0:00:18.023735801] [988] ERROR IPAModule ip>
Dec 18 09:42:15 vinho wireplumber[988]: [0:00:18.023761014] [988]  INFO Camera camer>
Dec 18 09:42:16 vinho wireplumber[988]: <WpPortalPermissionStorePlugin:0x56119c89fc7>
Dec 18 09:42:16 vinho wireplumber[988]: <WpPortalPermissionStorePlugin:0x56119c89fc7>

○ xdg-desktop-portal-wlr.service - Portal service (wlroots implementation)
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal-wlr.service; static)
     Active: inactive (dead)

My guess is that I should do something like

systemctl --user enable xdg-desktop-portla-wlr.service

Would that be a reasonable next thing to try? It looks like pipwire is successfully started, but I'm not sure about those errors...


UPDATE

So I found a solution but I need a little bit of help to make it permanent:

dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway

systemctl --user stop pipewire wireplumber xdg-desktop-portal xdg-desktop-portal-wlr
systemctl --user start wireplumber

and then when I reload sway it all works! So, I need to execute these from from sway .config, which I know I can do with the

exec $file_name

command. But Im not exactly sure what file this should be...dose the extension matter? Is could I just call it activate_desktop_environ.sh?

Last edited by charper_flow (2023-12-19 01:24:09)

Offline

#4 2023-12-19 10:26:02

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,232

Re: Issue with wayland and OBS screen capture

Did you see the note in https://wiki.archlinux.org/title/Sway#Configuration? All of this should already happen granted you source the baseline properly.

Last edited by V1del (2023-12-19 10:26:31)

Offline

Board footer

Powered by FluxBB