Skip to content
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

OBS crashes when trying to share screen #8925

Closed
notmentaloutlaw opened this issue May 18, 2023 · 11 comments
Closed

OBS crashes when trying to share screen #8925

notmentaloutlaw opened this issue May 18, 2023 · 11 comments
Labels
Confirmed This bug report has been confirmed by project members Linux Affects Linux

Comments

@notmentaloutlaw
Copy link

Operating System Info

Other

Other OS

Gentoo Linux (MUSL SELINUX Hardened profile)

OBS Studio Version

29.1.1

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/1tRkGrqAuSP8AQql

OBS Studio Crash Log URL

https://obsproject.com/logs/1tRkGrqAuSP8AQql

Expected Behavior

I should be able to click on a selected monitor to share and it should share the screen without crashing.

Current Behavior

When I click on the monitor to share it immediately crashes and gives me a segmentation fault.

Steps to Reproduce

  1. Be on Wayland (Hyprland or Sway)
  2. Open obs
  3. Select monitor to share

Anything else we should know?

I am on Hyprland (Wayland Compositor) I have xdg-desktop-portal-wlr running and I know it works since I can share screen using flatpak version of firefox. This could be something related to MUSL but I am not sure.

@kkartaltepe
Copy link
Collaborator

Please provide a backtrace from gdb.

@kkartaltepe kkartaltepe added the Linux Affects Linux label May 19, 2023
@notmentaloutlaw
Copy link
Author

Please let me know if there is anything else

 gdb obs
GNU gdb (Gentoo 13.1.90_p20230325 vanilla) 13.1.90.20230325-git
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-gentoo-linux-musl".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from obs...
Reading symbols from /usr/lib/debug//usr/bin/obs.debug...
(gdb) run
Starting program: /usr/bin/obs
[New LWP 16670]
[New LWP 16671]
[New LWP 16672]
[New LWP 16673]
[New LWP 16674]
[New LWP 16675]
debug: Found portal inhibitor
[New LWP 16676]
[New LWP 16677]
[New LWP 16678]
[New LWP 16679]
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: Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz
info: CPU Speed: 4699.926MHz
info: Physical Cores: 8, Logical Cores: 8
info: Physical Memory: 32010MB Total, 28576MB Free
info: Kernel Version: Linux 6.3.3-gentoo-dist-hardened
info: Distribution: Gentoo "2.13"
info: Desktop Environment: Hyprland
info: Session Type: wayland
[New LWP 16680]
[New LWP 16681]
info: Qt Version: 5.15.9 (runtime), 5.15.9 (compiled)
info: Portable mode: false
QMetaObject::connectSlotsByName: Connecting slot on_transitionDuration_valueChanged() with the first of the following compatible signals: ("valueChanged(int)", "valueChanged(QString)")
info: OBS 29.1.1 (linux)
info: ---------------------------------
[New LWP 16682]
[New LWP 16683]
[New LWP 16684]
[New LWP 16685]
info: ---------------------------------
info: audio settings reset:
	samples per sec: 48000
	speakers:        2
	max buffering:   960 milliseconds
	buffering type:  dynamically increasing
[New LWP 16686]
info: ---------------------------------
info: Initializing OpenGL...
info: Using EGL/Wayland
info: Initialized EGL 1.5
[New LWP 16687]
[New LWP 16688]
info: Loading up OpenGL on adapter AMD AMD Radeon RX 6800 (navi21, LLVM 15.0.7, DRM 3.52, 6.3.3-gentoo-dist-hardened)
info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 23.1.0, shading language 4.60
info: ---------------------------------
info: video settings reset:
	base resolution:   2560x1440
	output resolution: 2560x1440
	downscale filter:  Bicubic
	fps:               60/1
	format:            NV12
	YUV mode:          Rec. 709/Partial
[New LWP 16689]
info: NV12 texture support not available
info: P010 texture support not available
[New LWP 16690]
info: Audio monitoring device:
	name: Default
	id: default
info: ---------------------------------
info: [pipewire] Available captures:
info: [pipewire]     - Desktop capture
[New LWP 16691]
[New LWP 16692]
[New LWP 16693]
[New LWP 16694]
info: VAAPI: API version 1.18
[LWP 16694 exited]
[LWP 16693 exited]
[LWP 16692 exited]
[LWP 16691 exited]
info: FFmpeg VAAPI H264 encoding supported
[New LWP 16695]
[New LWP 16696]
[New LWP 16697]
[New LWP 16698]
[LWP 16698 exited]
[LWP 16697 exited]
[LWP 16696 exited]
info: FFmpeg VAAPI HEVC encoding supported
[LWP 16695 exited]
[New LWP 16699]
info: ---------------------------------
info:   Loaded Modules:
info:     rtmp-services.so
info:     obs-x264.so
info:     obs-vst.so
info:     obs-transitions.so
info:     obs-outputs.so
info:     obs-filters.so
info:     obs-ffmpeg.so
info:     linux-pulseaudio.so
info:     linux-pipewire.so
info:     linux-capture.so
info:     linux-alsa.so
info:     image-source.so
info:     frontend-tools.so
info: ---------------------------------
info: ==== Startup complete ===============================================
[New LWP 16700]
[New LWP 16701]
[New LWP 16702]
[LWP 16702 exited]
[LWP 16701 exited]
[LWP 16700 exited]
[New LWP 16703]
[New LWP 16704]
[New LWP 16705]
[New LWP 16706]
[LWP 16706 exited]
[LWP 16704 exited]
[LWP 16705 exited]
[LWP 16703 exited]
info: All scene data cleared
info: ------------------------------------------------
[New LWP 16707]
info: pulse-input: Server name: 'PulseAudio (on PipeWire 0.3.70) 15.0.0'
info: pulse-input: Audio format: s24le, 48000 Hz, 2 channels
info: pulse-input: Sample format s24le not supported by OBS,using float32le instead for recording
info: pulse-input: Started recording from 'alsa_output.usb-SYC_SA9123_USB_Audio-01.analog-stereo.monitor' (default)
info: [Loaded global audio device]: 'Desktop Audio'
info: pulse-input: Server name: 'PulseAudio (on PipeWire 0.3.70) 15.0.0'
error: pulse-input: An error occurred while getting the source info!
info: PipeWire initialized
info: Switched to scene 'Scene'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Audio Input Capture (PulseAudio)' (pulse_input_capture)
info:     - source: 'Screen Capture (PipeWire)' (pipewire-desktop-capture-source)
info: ------------------------------------------------
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
info: [pipewire] Screencast session created
[LWP 16699 exited]
info: adding 21 milliseconds of audio buffering, total audio buffering is now 21 milliseconds (source: Desktop Audio)

info: [pipewire] Asking for desktop
info: [pipewire] desktop selected, setting up screencast
[New LWP 16729]
[New LWP 16730]
info: [pipewire] Server version: 0.3.70
info: [pipewire] Library version: 0.3.70
info: [pipewire] Header version: 0.3.70
info: [pipewire] Created stream 0x7fffdb74f630
info: [pipewire] Stream 0x7fffdb74f630 state: "connecting" (error: none)
info: [pipewire] Playing stream 0x7fffdb74f630
info: [pipewire] Stream 0x7fffdb74f630 state: "paused" (error: none)
info: [pipewire] Negotiated format:
info: [pipewire]     Format: 7 (Spa:Enum:VideoFormat:RGBx)
info: [pipewire]     Size: 2560x1440
info: [pipewire]     Framerate: 0/1
info: [pipewire] Stream 0x7fffdb74f630 state: "streaming" (error: none)

Thread 41 "PipeWire thread" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 16730]
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in  ()
#1  0x00007fffe270aceb in swap_texture_red_blue (texture=<optimized out>)
    at /var/tmp/portage/media-video/obs-studio-29.1.1/work/obs-studio-29.1.1/plugins/linux-pipewire/pipewire.c:322
#2  0x00007fffe270c197 in on_process_cb (user_data=0x7fffeefd23a0) at /var/tmp/portage/media-video/obs-studio-29.1.1/work/obs-studio-29.1.1/plugins/linux-pipewire/pipewire.c:688
#3  0x00007fffe2669870 in  () at /usr/lib/libpipewire-0.3.so.0
#4  0x00007fffe4ab17f7 in  () at /usr/lib/spa-0.2/support/libspa-support.so
#5  0x00007fffe4ab163d in  () at /usr/lib/spa-0.2/support/libspa-support.so
#6  0x00007fffe4ab3c86 in  () at /usr/lib/spa-0.2/support/libspa-support.so
#7  0x00007fffe267afc2 in  () at /usr/lib/libpipewire-0.3.so.0
#8  0x00007ffff7fb5cfe in  () at /lib/ld-musl-x86_64.so.1
#9  0x0000000000000000 in  ()
(gdb)

@kkartaltepe kkartaltepe added the Confirmed This bug report has been confirmed by project members label May 19, 2023
@kkartaltepe
Copy link
Collaborator

Looks like if we get an unusable format and try to renegotiate in https://github.com/obsproject/obs-studio/blob/master/plugins/linux-pipewire/pipewire.c#L664 we still try to swizzle the possibly null texture at the end https://github.com/obsproject/obs-studio/blob/master/plugins/linux-pipewire/pipewire.c#L705

@GeorgesStavracas @columbarius if you are interested.

@columbarius
Copy link
Contributor

Please test if #8993 fixes this.

@notmentaloutlaw
Copy link
Author

I still have the same issue unfortunately even with the patch.

gdb obs
GNU gdb (Gentoo 13.1.90_p20230325 vanilla) 13.1.90.20230325-git
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-gentoo-linux-musl".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from obs...
Reading symbols from /usr/lib/debug//usr/bin/obs.debug...
(gdb) run
Starting program: /usr/bin/obs
[New LWP 16458]
QStandardPaths: wrong permissions on runtime directory /run/user/1000, 0750 instead of 0700
[New LWP 16459]
[New LWP 16460]
[New LWP 16461]
[New LWP 16462]
[New LWP 16463]
debug: Found portal inhibitor
[New LWP 16464]
[New LWP 16465]
[New LWP 16466]
[New LWP 16467]
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: Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz
info: CPU Speed: 4706.475MHz
info: Physical Cores: 8, Logical Cores: 8
info: Physical Memory: 32010MB Total, 16666MB Free
info: Kernel Version: Linux 6.3.4-gentoo-dist-hardened
info: Distribution: Gentoo "2.13"
info: Desktop Environment: Hyprland
info: Session Type: wayland
[New LWP 16468]
[New LWP 16469]
info: Qt Version: 5.15.9 (runtime), 5.15.9 (compiled)
info: Portable mode: false
QMetaObject::connectSlotsByName: Connecting slot on_transitionDuration_valueChanged() with the first of the following compatible signals: ("valueChanged(int)", "valueChanged(QString)")
info: OBS 29.1.2 (linux)
info: ---------------------------------
[New LWP 16470]
[New LWP 16471]
[New LWP 16472]
[New LWP 16473]
info: ---------------------------------
info: audio settings reset:
	samples per sec: 48000
	speakers:        2
	max buffering:   960 milliseconds
	buffering type:  dynamically increasing
[New LWP 16474]
info: ---------------------------------
info: Initializing OpenGL...
info: Using EGL/Wayland
info: Initialized EGL 1.5
[New LWP 16475]
[New LWP 16476]
info: Loading up OpenGL on adapter AMD AMD Radeon RX 6800 (navi21, LLVM 15.0.7, DRM 3.52, 6.3.4-gentoo-dist-hardened)
info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 23.1.1, shading language 4.60
info: ---------------------------------
info: video settings reset:
	base resolution:   2560x1440
	output resolution: 2560x1440
	downscale filter:  Bicubic
	fps:               60/1
	format:            NV12
	YUV mode:          Rec. 709/Partial
[New LWP 16477]
info: NV12 texture support not available
info: P010 texture support not available
[New LWP 16478]
info: Audio monitoring device:
	name: Default
	id: default
info: ---------------------------------
info: [pipewire] Available captures:
info: [pipewire]     - Desktop capture
[New LWP 16479]
[New LWP 16480]
[New LWP 16481]
[New LWP 16482]
info: VAAPI: API version 1.18
[LWP 16482 exited]
[LWP 16481 exited]
[LWP 16480 exited]
[LWP 16479 exited]
info: FFmpeg VAAPI H264 encoding supported
[New LWP 16483]
[New LWP 16484]
[New LWP 16485]
[New LWP 16486]
[New LWP 16487]
[LWP 16487 exited]
[LWP 16486 exited]
[LWP 16485 exited]
[LWP 16484 exited]
[LWP 16483 exited]
info: FFmpeg VAAPI HEVC encoding supported
[New LWP 16488]
info: ---------------------------------
info:   Loaded Modules:
info:     rtmp-services.so
info:     obs-x264.so
info:     obs-vst.so
info:     obs-transitions.so
info:     obs-outputs.so
info:     obs-filters.so
info:     obs-ffmpeg.so
info:     linux-pulseaudio.so
info:     linux-pipewire.so
info:     linux-capture.so
info:     linux-alsa.so
info:     image-source.so
info:     frontend-tools.so
info: ---------------------------------
info: ==== Startup complete ===============================================
[New LWP 16489]
[New LWP 16490]
[New LWP 16491]
[New LWP 16492]
[LWP 16492 exited]
[LWP 16491 exited]
[LWP 16490 exited]
[LWP 16489 exited]
[New LWP 16493]
[New LWP 16494]
[New LWP 16495]
[New LWP 16496]
[LWP 16496 exited]
[LWP 16495 exited]
[LWP 16494 exited]
[LWP 16493 exited]
info: All scene data cleared
info: ------------------------------------------------
[New LWP 16497]
info: pulse-input: Server name: 'PulseAudio (on PipeWire 0.3.70) 15.0.0'
info: pulse-input: Audio format: s24le, 48000 Hz, 2 channels
info: pulse-input: Sample format s24le not supported by OBS,using float32le instead for recording
info: pulse-input: Started recording from 'alsa_output.usb-SYC_SA9123_USB_Audio-01.analog-stereo.monitor' (default)
info: [Loaded global audio device]: 'Desktop Audio'
info: pulse-input: Server name: 'PulseAudio (on PipeWire 0.3.70) 15.0.0'
error: pulse-input: An error occurred while getting the source info!
info: PipeWire initialized
info: Switched to scene 'Scene'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Audio Input Capture (PulseAudio)' (pulse_input_capture)
info:     - source: 'Screen Capture (PipeWire)' (pipewire-desktop-capture-source)
info: ------------------------------------------------
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
info: [pipewire] Screencast session created
[LWP 16488 exited]
info: adding 21 milliseconds of audio buffering, total audio buffering is now 21 milliseconds (source: Desktop Audio)

info: [pipewire] Asking for desktop
info: [pipewire] desktop selected, setting up screencast
[New LWP 16523]
[New LWP 16524]
info: [pipewire] Server version: 0.3.70
info: [pipewire] Library version: 0.3.70
info: [pipewire] Header version: 0.3.70
info: [pipewire] Created stream 0x7fffdb79f670
info: [pipewire] Stream 0x7fffdb79f670 state: "connecting" (error: none)
info: [pipewire] Playing stream 0x7fffdb79f670
info: [pipewire] Stream 0x7fffdb79f670 state: "paused" (error: none)
info: [pipewire] Negotiated format:
info: [pipewire]     Format: 7 (Spa:Enum:VideoFormat:RGBx)
info: [pipewire]     Size: 2560x1440
info: [pipewire]     Framerate: 0/1
info: [pipewire] Stream 0x7fffdb79f670 state: "streaming" (error: none)

Thread 43 "PipeWire thread" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 16524]
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in  ()
#1  0x00007fffe274bceb in swap_texture_red_blue (texture=<optimized out>)
    at /var/tmp/portage/media-video/obs-studio-29.1.2/work/obs-studio-29.1.2/plugins/linux-pipewire/pipewire.c:322
#2  0x00007fffe274d18f in on_process_cb (user_data=0x7fffdbf00a60) at /var/tmp/portage/media-video/obs-studio-29.1.2/work/obs-studio-29.1.2/plugins/linux-pipewire/pipewire.c:689
#3  0x00007fffe26aa870 in  () at /usr/lib/libpipewire-0.3.so.0
#4  0x00007fffe4ac27f7 in  () at /usr/lib/spa-0.2/support/libspa-support.so
#5  0x00007fffe4ac263d in  () at /usr/lib/spa-0.2/support/libspa-support.so
#6  0x00007fffe4ac4c86 in  () at /usr/lib/spa-0.2/support/libspa-support.so
#7  0x00007fffe26bbfc2 in  () at /usr/lib/libpipewire-0.3.so.0
#8  0x00007ffff7fb5cfe in  () at /lib/ld-musl-x86_64.so.1
#9  0x0000000000000000 in  ()

@columbarius
Copy link
Contributor

columbarius commented Jun 1, 2023 via email

@notmentaloutlaw
Copy link
Author

Sorry for the late response, I am not sure what you mean by that. All I did was copy the patch into /etc/portage/patches/media-video/obs-studio/fix_pipewire.patch

diff --git a/plugins/linux-pipewire/pipewire.c b/plugins/linux-pipewire/pipewire.c
--- a/plugins/linux-pipewire/pipewire.c
+++ b/plugins/linux-pipewire/pipewire.c
@@ -668,6 +668,7 @@ static void on_process_cb(void *user_data)
			pw_loop_signal_event(
				pw_thread_loop_get_loop(obs_pw->thread_loop),
				obs_pw->reneg);
+                       goto read_metadata;
		}
	} else {
		blog(LOG_DEBUG, "[pipewire] Buffer has memory texture");

And then simply compiled it again with this and then did the gdb commands. If I was suppose to do something else please could you explain what you wish me to do further thanks.

@notmentaloutlaw
Copy link
Author

Although I would prefer to use the system compiled package I was testing the flatpak version of obs and I have experienced this same exact issue. https://obsproject.com/logs/cPBQuBMJykNFBslS

This doesn't make any sense as even a flatpak browser can share the screen.

@kkartaltepe
Copy link
Collaborator

Flatpak does not incorporate the patch mentioned, so it should be expected that it behaves the same as your system package.

@Roger-Roger-debug
Copy link

I came across the same issue today and it now works after upgrading xdg-desktop-portal-wlr from version 0.5 to version 0.7.

@notmentaloutlaw
Copy link
Author

Thank you Roger-Roger-debug this actually solved all my issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Confirmed This bug report has been confirmed by project members Linux Affects Linux
Projects
None yet
Development

No branches or pull requests

4 participants