void-packages icon indicating copy to clipboard operation
void-packages copied to clipboard

OBS only shows black output

Open Luciogi opened this issue 1 year ago • 7 comments

Is this a new report?

Yes

System Info

Void 6.1.101_1 x86_64 GenuineIntel uptodate rrmFFFFFFFFFFFFFFFFFFFFFFFFFFFF

Package(s) Affected

obs-30.2.1_2

Does a report exist for this bug with the project's home (upstream) and/or another distro?

No response

Expected behaviour

Render preview

Actual behaviour

image

Steps to reproduce

  1. Open OBS
  2. add source
  3. see output (black)

System info

Nvidia gtx 1650 with nouveu drivers intel uhd 630 X11

Luciogi avatar Aug 04 '24 11:08 Luciogi

Logs

debug: Found portal inhibitor
debug: Attempted path: /usr/bin/..//usr/share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: /usr/bin/..//usr/share/obs/obs-studio/locale.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale.ini
debug: Attempted path: /usr/bin/..//usr/share/obs/obs-studio/themes
debug: Attempted path: /usr/share/obs/obs-studio/themes
debug: Attempted path: /usr/bin/..//usr/share/obs/obs-studio/themes/
debug: Attempted path: /usr/share/obs/obs-studio/themes/
warning: ReadOne on org.freedesktop.portal.Settings returned an invalid reply
warning: ================================
warning: Warning: OBS is already running!
warning: ================================
warning: User is now running multiple instances of OBS!
info: Using EGL/X11
info: CPU Name: Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz
info: CPU Speed: 899.961MHz
info: Physical Cores: 4, Logical Cores: 8
info: Physical Memory: 7746MB Total, 999MB Free
info: Kernel Version: Linux 6.1.101_1
info: Distribution: "Void" Unknown
info: Desktop Environment: KDE
info: Session Type: x11
info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.21.1
info: Qt Version: 6.7.2 (runtime), 6.7.2 (compiled)
info: Portable mode: false
info: OBS 30.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: Loading up OpenGL on adapter Intel Mesa Intel(R) UHD Graphics (CML GT2)
info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 24.1.4, 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 enabled
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'
warning: Failed to load 'en-US' text for module: 'decklink.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'
warning: Failed to load 'en-US' text for module: 'frontend-tools.so'
warning: Failed to load 'en-US' text for module: 'image-source.so'
warning: Failed to load 'en-US' text for module: 'linux-alsa.so'
warning: Failed to load 'en-US' text for module: 'linux-capture.so'
warning: Failed to load 'en-US' text for module: 'linux-jack.so'
warning: Failed to load 'en-US' text for module: 'linux-pipewire.so'
info: [pipewire] Available capture sources:
info: [pipewire]     - Monitor source
info: [pipewire]     - Window source
warning: Failed to load 'en-US' text for module: 'linux-pulseaudio.so'
warning: Failed to load 'en-US' text for module: 'linux-v4l2.so'
warning: v4l2loopback not installed, virtual camera not registered
warning: Failed to load 'en-US' text for module: 'obs-ffmpeg.so'
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: VAAPI: API version 1.22
info: FFmpeg VAAPI H264 encoding supported
info: FFmpeg VAAPI AV1 encoding not supported
info: FFmpeg VAAPI HEVC encoding not supported
warning: Failed to load 'en-US' text for module: 'obs-filters.so'
warning: Failed to load 'en-US' text for module: 'obs-outputs.so'
warning: Failed to load 'en-US' text for module: 'obs-transitions.so'
warning: Failed to load 'en-US' text for module: 'obs-webrtc.so'
warning: Failed to load 'en-US' text for module: 'obs-x264.so'
warning: Failed to load 'en-US' text for module: 'rtmp-services.so'
warning: Failed to load 'en-US' text for module: 'text-freetype2.so'
warning: Failed to load 'en-US' text for module: 'vlc-video.so'
info: [vlc-video]: VLC 3.0.21 Vetinari found, VLC video source enabled
info: ---------------------------------
info:   Loaded Modules:
info:     vlc-video.so
info:     text-freetype2.so
info:     rtmp-services.so
info:     obs-x264.so
info:     obs-webrtc.so
info:     obs-transitions.so
info:     obs-outputs.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: ---------------------------------
info: ---------------------------------
info: Available Encoders:
info:   Video Encoders:
info:   - ffmpeg_svt_av1 (SVT-AV1)
info:   - ffmpeg_aom_av1 (AOM AV1)
info:   - ffmpeg_vaapi_tex (FFmpeg VAAPI H.264)
info:   - obs_x264 (x264)
info:   Audio Encoders:
info:   - ffmpeg_aac (FFmpegAAC)
info:   - ffmpeg_opus (FFmpegOpus)
info:   - ffmpeg_pcm_s16le (FFmpegPCM16Bit)
info:   - ffmpeg_pcm_s24le (FFmpegPCM24Bit)
info:   - ffmpeg_pcm_f32le (FFmpegPCM32BitFloat)
info:   - ffmpeg_alac (FFmpegALAC)
info:   - ffmpeg_flac (FFmpegFLAC)
info: ==== Startup complete ===============================================
info: All scene data cleared
info: ------------------------------------------------
error: Could not find fade_transition.effect
error: Failed to create source 'FadeTransition'!
info: pulse-input: Server name: 'PulseAudio (on PipeWire 1.2.2) 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-platform-skl_hda_dsp_generic.HiFi__Speaker__sink.monitor' (default)
info: [Loaded global audio device]: 'Desktop Audio'
info: pulse-input: Server name: 'PulseAudio (on PipeWire 1.2.2) 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-platform-skl_hda_dsp_generic.HiFi__Mic1__source' (default)
info: [Loaded global audio device]: 'Mic/Aux'
info: PipeWire initialized
info: xshm-input: Geometry 1920x1080 @ 0,0
info: [window-capture: 'XCCapture'] update settings:
        title: OBS only shows black output · Issue #51629 · void-linux/void-packages — Mozilla Firefox
        class: Navigator

info: Switched to scene 'Scene'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Screen Capture (PipeWire)' (pipewire-desktop-capture-source)
info:     - source: 'X11SharedMemoryDisplayInput' (xshm_input)
info:     - source: 'XCCapture' (xcomposite_input)
info: ------------------------------------------------
warning: [pipewire] Failed to create session, denied or cancelled by user
info: adding 42 milliseconds of audio buffering, total audio buffering is now 42 milliseconds (source: Desktop Audio)

info: xshm-input: Geometry 1920x1080 @ 0,0
info: xshm-input: Geometry 1920x1080 @ 0,0
info: xshm-input: Geometry 1920x1080 @ 0,0
info: ---------------------------------
info: [x264 encoder: 'simple_video_recording'] preset: ultrafast
info: [x264 encoder: 'simple_video_recording'] profile: high
info: [x264 encoder: 'simple_video_recording'] settings:
        rate_control: CRF
        bitrate:      0
        buffer size:  0
        crf:          19
        fps_num:      60
        fps_den:      1
        width:        1280
        height:       720
        keyint:       250

info: ---------------------------------
info: [FFmpeg aac encoder: 'simple_aac_recording0'] bitrate: 192, channels: 2, channel_layout: stereo

info: ==== Recording Start ===============================================
info: [ffmpeg muxer: 'simple_file_output'] Writing file '/home/oggy/2024-08-04 16-19-00.mkv'...
info: [ffmpeg muxer: 'simple_file_output'] Output of file '/home/oggy/2024-08-04 16-19-00.mkv' stopped
info: Output 'simple_file_output': stopping
info: Output 'simple_file_output': Total frames output: 169
info: Output 'simple_file_output': Total drawn frames: 128 (182 attempted)
info: Output 'simple_file_output': Number of lagged frames due to rendering lag/stalls: 54 (29.7%)
[aac @ 0x559da52b2bc0] Qavg: 65536.000
[aac @ 0x559da52b2bc0] 2 frames left in the queue on closing
info: ==== Recording Stop ================================================

Luciogi avatar Aug 04 '24 11:08 Luciogi

change "FadeTransition" to "CutTransition" in the "Scene Transitions" section

classabbyamp avatar Aug 04 '24 11:08 classabbyamp

error: Could not find fade_transition.effect
error: Failed to create source 'FadeTransition'!

classabbyamp avatar Aug 04 '24 11:08 classabbyamp

https://obsproject.com/forum/threads/obs-no-longer-capturing-display-after-system-update.177102/

https://github.com/obsproject/obs-studio/issues/10852#issuecomment-2254511971

classabbyamp avatar Aug 04 '24 11:08 classabbyamp

Updated the comment on that issue. OBS_PLUGINS_PATH=/lib/obs-plugins OBS_PLUGINS_DATA_PATH=/usr/share/obs/obs-plugins/ obs gets fade and cut to work - but segfaults on exit...

zlice avatar Aug 06 '24 12:08 zlice

-.- well it looks like they dont care

can fix up with a patch for the dumb logic (plus add hardcoded system directories i guess, see 'second' below)

https://github.com/obsproject/obs-studio/blob/master/libobs/obs-nix.c#L92

  struct stat stat_info;

  for (int i = 0; i < module_patterns_size; i++) {
    if ((stat(module_bin[i], &stat_info) == 0 && !!S_ISDIR(stat_info.st_mode) )
        && (stat(module_data[i], &stat_info) == 0 && !!S_ISDIR(stat_info.st_mode) ) )
      obs_add_module_path(module_bin[i], module_data[i]);
  }

first problem is bad plugins/dirs wipe old plugins. check if they exist

second problem they wont fix or say is a void issue for cmake vars

third is, shouldn't user supplied env vars override current plugins? basically the above fixed loop should go first, then the user provided stuff

add:

fwiw - this doesn't fix the double loaded plugins segfaulting on exit. it actually makes it more common because your plugins actually fukin load :)

WIP patch
--- a/libobs/obs-nix.c
+++ b/libobs/obs-nix.c
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
+#include <sys/stat.h>
 #if defined(__FreeBSD__) || defined(__OpenBSD__)
 #include <sys/sysctl.h>
 #endif
@@ -68,28 +69,18 @@
 
 void add_default_module_paths(void)
 {
-	char *module_bin_path =
-		os_get_executable_path_ptr("../" OBS_PLUGIN_PATH);
-	char *module_data_path = os_get_executable_path_ptr(
-		"../" OBS_DATA_PATH "/obs-plugins/%module%");
-
-	if (module_bin_path && module_data_path) {
-		char *abs_module_bin_path =
-			os_get_abs_path_ptr(module_bin_path);
-
-		if (abs_module_bin_path &&
-		    strcmp(abs_module_bin_path, OBS_INSTALL_PREFIX
-			   "/" OBS_PLUGIN_DESTINATION) != 0) {
+	char *module_bin_path = "/usr/lib/obs-plugins";
+	char *module_data_path = OBS_DATA_PATH "/obs-plugins/%module%";
+			printf("TRYING DIRS\nBIN=%s\nDATA=%s\n",
+              module_bin_path, module_data_path);
 			obs_add_module_path(module_bin_path, module_data_path);
-		}
-		bfree(abs_module_bin_path);
-	}
 
-	bfree(module_bin_path);
-	bfree(module_data_path);
+	struct stat stat_info;
 
 	for (int i = 0; i < module_patterns_size; i++) {
-		obs_add_module_path(module_bin[i], module_data[i]);
+		if ((stat(module_bin[i], &stat_info) == 0 && !!S_ISDIR(stat_info.st_mode) )
+				&& (stat(module_data[i], &stat_info) == 0 && !!S_ISDIR(stat_info.st_mode) ) )
+			obs_add_module_path(module_bin[i], module_data[i]);
 	}
 }

zlice avatar Aug 06 '24 17:08 zlice

@sgn thoughts?

Hardcodes plugin dir that's set at build instead of fixing cmake vars. Fixes loading duplicate plugin paths instead of on the deletion side.

This message is a bit misleading here: I do not have a .config/obs-studio/plugins. Also it's clobbered to extra / and %module%/data which can't really exist.

OBS_PLUGINS_PATH=/lib/obs-plugins OBS_PLUGINS_DATA_PATH=/usr/share/obs/obs-plugins/ obs --verbose
(^this is a symlink dupe of /bin/lib/ and literal dupe of /usr/share)

warning: Skipping duplicate module path: bin: '/lib/obs-plugins', data: '/usr/share/obs/obs-plugins//%module%'
warning: Skipping duplicate module path: bin: '/home/zlice/.config/obs-studio/plugins/%module%/bin/64bit', data: '/home/zlice/.config/obs-studio/plugins/%module%/data'
--- a/libobs/obs-module.c
+++ b/libobs/obs-module.c
@@ -22,6 +22,8 @@
 #include "obs-internal.h"
 #include "obs-module.h"

+#include <sys/stat.h>
+
 extern const char *get_module_extension(void);

 static inline int req_func_not_found(const char *name, const char *path)
@@ -269,6 +271,34 @@
 	if (!obs || !bin || !data)
 		return;

+	char tmp_data[255] = {0}; // shouldn't hit paths 255 big?
+	for (size_t i = 0; i < obs->module_paths.num; i++) {
+		struct obs_module_path *old_omp = obs->module_paths.array + i;
+		char *mod_loc = 0;
+		struct stat old_bin, new_bin, old_data, new_data;
+		size_t maxlen = strlen(old_omp->data);
+		if (maxlen > 254) {
+			maxlen = 254;
+			blog(LOG_WARNING, "Max length of module path is over void-hackery 254 character length");
+		}
+		memcpy(tmp_data, old_omp->data, maxlen);
+		mod_loc = strstr(tmp_data, "%module%");
+		if (mod_loc) *mod_loc = 0;
+		stat(old_omp->bin, &old_bin);
+		stat(bin, &new_bin);
+		stat(tmp_data, &old_data);
+		stat(data, &new_data);
+		if ((old_bin.st_dev == new_bin.st_dev
+			&& old_bin.st_ino == new_bin.st_ino)
+			|| (old_data.st_dev == new_data.st_dev
+				&& old_data.st_ino == new_data.st_ino) )
+			{
+			blog(LOG_WARNING, "Skipping duplicate module path: bin: '%s', data: '%s'"
+				,bin, data);
+			return;
+			}
+	}
+
 	omp.bin = bstrdup(bin);
 	omp.data = bstrdup(data);
 	da_push_back(obs->module_paths, &omp);
--- a/libobs/obs-nix.c
+++ b/libobs/obs-nix.c
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
+#include <sys/stat.h>
 #if defined(__FreeBSD__) || defined(__OpenBSD__)
 #include <sys/sysctl.h>
 #endif
@@ -68,28 +69,16 @@

 void add_default_module_paths(void)
 {
-	char *module_bin_path =
-		os_get_executable_path_ptr("../" OBS_PLUGIN_PATH);
-	char *module_data_path = os_get_executable_path_ptr(
-		"../" OBS_DATA_PATH "/obs-plugins/%module%");
-
-	if (module_bin_path && module_data_path) {
-		char *abs_module_bin_path =
-			os_get_abs_path_ptr(module_bin_path);
-
-		if (abs_module_bin_path &&
-		    strcmp(abs_module_bin_path, OBS_INSTALL_PREFIX
-			   "/" OBS_PLUGIN_DESTINATION) != 0) {
-			obs_add_module_path(module_bin_path, module_data_path);
-		}
-		bfree(abs_module_bin_path);
-	}
+	char *module_bin_path = "/usr/lib/obs-plugins";
+	char *module_data_path = OBS_DATA_PATH "/obs-plugins/%module%";
+	obs_add_module_path(module_bin_path, module_data_path);

-	bfree(module_bin_path);
-	bfree(module_data_path);
+	struct stat stat_info;

 	for (int i = 0; i < module_patterns_size; i++) {
-		obs_add_module_path(module_bin[i], module_data[i]);
+		if ((stat(module_bin[i], &stat_info) == 0 && !!S_ISDIR(stat_info.st_mode) )
+				&& (stat(module_data[i], &stat_info) == 0 && !!S_ISDIR(stat_info.st_mode) ) )
+			obs_add_module_path(module_bin[i], module_data[i]);
 	}
 }

(updated patch aug 29 2024 - size check and warn)

zlice avatar Aug 06 '24 23:08 zlice

Hi, I am having the same behavior, fyi. Any patches? Thanks

zenny avatar Sep 08 '24 18:09 zenny

Same problem here, works with changing the plugins path as zlice says

russnes avatar Sep 09 '24 14:09 russnes

did the last update fix this for people?

zlice avatar Nov 05 '24 20:11 zlice

Yup, OBS launches and records fine for me without the OBS_PLUGINS_PATH override (the segfault on exit stills happens when running with the override but it's a non-issue since OBS runs just fine without it) - perhaps this issue can be closed

TheEgghead27 avatar Nov 05 '24 21:11 TheEgghead27

ok so my patch still applies. thx

zlice avatar Nov 05 '24 21:11 zlice