Github messages for voidlinux
 help / color / mirror / Atom feed
* [ISSUE] OBS only shows black output
@ 2024-08-04 11:18 Luciogi
  2024-08-04 11:19 ` Luciogi
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: Luciogi @ 2024-08-04 11:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 626 bytes --]

New issue by Luciogi on void-packages repository

https://github.com/void-linux/void-packages/issues/51629

Description:
### 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](https://github.com/user-attachments/assets/d7e6f59c-284e-4eb1-a3f9-733a91f0fcea)


### Steps to reproduce

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
@ 2024-08-04 11:19 ` Luciogi
  2024-08-04 11:25 ` [ISSUE] [CLOSED] " classabbyamp
                   ` (21 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: Luciogi @ 2024-08-04 11:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 9078 bytes --]

New comment by Luciogi on void-packages repository

https://github.com/void-linux/void-packages/issues/51629#issuecomment-2267505711

Comment:
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 ================================================

```


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [ISSUE] [CLOSED] OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
  2024-08-04 11:19 ` Luciogi
@ 2024-08-04 11:25 ` classabbyamp
  2024-08-04 11:25 ` classabbyamp
                   ` (20 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: classabbyamp @ 2024-08-04 11:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 731 bytes --]

Closed issue by Luciogi on void-packages repository

https://github.com/void-linux/void-packages/issues/51629

Description:
### 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](https://github.com/user-attachments/assets/d7e6f59c-284e-4eb1-a3f9-733a91f0fcea)


### 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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
  2024-08-04 11:19 ` Luciogi
  2024-08-04 11:25 ` [ISSUE] [CLOSED] " classabbyamp
@ 2024-08-04 11:25 ` classabbyamp
  2024-08-04 11:27 ` classabbyamp
                   ` (19 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: classabbyamp @ 2024-08-04 11:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 226 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/issues/51629#issuecomment-2267507329

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
                   ` (2 preceding siblings ...)
  2024-08-04 11:25 ` classabbyamp
@ 2024-08-04 11:27 ` classabbyamp
  2024-08-04 11:32 ` classabbyamp
                   ` (18 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: classabbyamp @ 2024-08-04 11:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 253 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/issues/51629#issuecomment-2267507812

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
                   ` (3 preceding siblings ...)
  2024-08-04 11:27 ` classabbyamp
@ 2024-08-04 11:32 ` classabbyamp
  2024-08-06 12:12 ` zlice
                   ` (17 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: classabbyamp @ 2024-08-04 11:32 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 326 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/issues/51629#issuecomment-2267509207

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

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
                   ` (4 preceding siblings ...)
  2024-08-04 11:32 ` classabbyamp
@ 2024-08-06 12:12 ` zlice
  2024-08-06 17:41 ` zlice
                   ` (16 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: zlice @ 2024-08-06 12:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 319 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/issues/51629#issuecomment-2271142576

Comment:
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...

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
                   ` (5 preceding siblings ...)
  2024-08-06 12:12 ` zlice
@ 2024-08-06 17:41 ` zlice
  2024-08-06 17:42 ` zlice
                   ` (15 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: zlice @ 2024-08-06 17:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 920 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/issues/51629#issuecomment-2271813654

Comment:
-.- well it looks like they dont care

can fix up with a patch for the dumb logic

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
                   ` (6 preceding siblings ...)
  2024-08-06 17:41 ` zlice
@ 2024-08-06 17:42 ` zlice
  2024-08-06 17:45 ` zlice
                   ` (14 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: zlice @ 2024-08-06 17:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 988 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/issues/51629#issuecomment-2271813654

Comment:
-.- 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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
                   ` (7 preceding siblings ...)
  2024-08-06 17:42 ` zlice
@ 2024-08-06 17:45 ` zlice
  2024-08-06 19:23 ` zlice
                   ` (13 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: zlice @ 2024-08-06 17:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 5785 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/issues/51629#issuecomment-2271813654

Comment:
-.- 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 :)


<details>

<summary>WIP patch</summary>

```diff
--- a/libobs/obs-module.c
+++ b/libobs/obs-module.c
@@ -135,6 +135,7 @@
 	mod.mod_name = get_module_name(mod.file);
 	mod.data_path = bstrdup(data_path);
 	mod.next = obs->first_module;
+  blog(LOG_WARNING, "OPENED MOD : with dir - '%s'", data_path);

 	if (mod.file) {
 		blog(LOG_DEBUG, "Loading module: %s", mod.file);
@@ -241,6 +242,7 @@
 	dstr_copy(&output, module->data_path);
 	if (!dstr_is_empty(&output) && dstr_end(&output) != '/' && *file)
 		dstr_cat_ch(&output, '/');
+  blog(LOG_WARNING, "TRYING TO FIND : Module '%s' - AT - %s", file, output.array);
 	dstr_cat(&output, file);

 	if (!os_file_exists(output.array))
@@ -442,11 +444,15 @@
 	bool found = false;

 	make_data_dir(&parsed_data_dir, data_dir, module_name);
+  blog(LOG_WARNING, "JFC1 - '%s'", parsed_data_dir.array);

 	found = os_file_exists(parsed_data_dir.array);

-	if (!found && astrcmpi_n(module_name, "lib", 3) == 0)
+	if (!found && astrcmpi_n(module_name, "lib", 3) == 0) {
+    blog(LOG_WARNING, "JFC2 - '%s'", parsed_data_dir.array);
 		make_data_dir(&parsed_data_dir, data_dir, module_name + 3);
+  }
+  blog(LOG_WARNING, "JFC3 RETURNING - '%s'", parsed_data_dir.array);

 	return parsed_data_dir.array;
 }
@@ -511,9 +517,11 @@
 		return;

 	dstr_copy(&name, file);
+  blog(LOG_WARNING, "PROCCESS : original name from file - '%s'", name.array);
 	char *ext = strrchr(name.array, '.');
 	if (ext)
 		dstr_resize(&name, ext - name.array);
+  blog(LOG_WARNING, "PROCCESS : update ? - '%s'", name.array);

 	if (!directory) {
 		dstr_copy(&parsed_bin_path, path);
@@ -521,8 +529,10 @@
 		bin_found = parse_binary_from_directory(&parsed_bin_path,
 							omp->bin, name.array);
 	}
+  blog(LOG_WARNING, "PROCCESS : bin update ? - '%s'", name.array);

 	parsed_data_dir = make_data_directory(name.array, omp->data);
+  blog(LOG_WARNING, "PROCESS FOUND MOD : with dir - '%s'", parsed_data_dir);

 	if (parsed_data_dir && bin_found) {
 		info.bin_path = parsed_bin_path.array;
@@ -530,6 +540,7 @@
 		info.name = name.array;
 		callback(param, &info);
 	}
+  blog(LOG_WARNING, "PROCCESS : last chk - '%s'", name.array);

 	bfree(parsed_data_dir);
 	dstr_free(&name);
--- 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,40 @@

 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 =
+//		os_get_executable_path_ptr("../" OBS_PLUGIN_PATH);
+//	char *module_data_path = os_get_executable_path_ptr(
+//		"../" OBS_DATA_PATH "/obs-plugins/%module%");
+//	char *module_data_path = os_get_executable_path_ptr(
+//		"../../" OBS_DATA_PATH "/obs-plugins/%module%");
+	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);
+//	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) {
+//			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]);
 	}
 }
```

</details>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
                   ` (8 preceding siblings ...)
  2024-08-06 17:45 ` zlice
@ 2024-08-06 19:23 ` zlice
  2024-08-06 20:37 ` zlice
                   ` (12 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: zlice @ 2024-08-06 19:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2730 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/issues/51629#issuecomment-2271813654

Comment:
-.- 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 :)


<details>

<summary>WIP patch</summary>

```diff
--- a/libobs/obs-module.c
+++ b/libobs/obs-module.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]);
 	}
 }
```

</details>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
                   ` (9 preceding siblings ...)
  2024-08-06 19:23 ` zlice
@ 2024-08-06 20:37 ` zlice
  2024-08-06 23:43 ` zlice
                   ` (11 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: zlice @ 2024-08-06 20:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2724 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/issues/51629#issuecomment-2271813654

Comment:
-.- 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 :)


<details>

<summary>WIP patch</summary>

```diff
--- 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]);
 	}
 }
```

</details>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
                   ` (10 preceding siblings ...)
  2024-08-06 20:37 ` zlice
@ 2024-08-06 23:43 ` zlice
  2024-08-06 23:44 ` zlice
                   ` (10 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: zlice @ 2024-08-06 23:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 3505 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/issues/51629#issuecomment-2272348138

Comment:
@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.

```
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'
```

```diff
--- 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,29 @@
 	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;
+		memcpy(tmp_data, old_omp->data, strlen(old_omp->data) );
+		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]);
 	}
 }
```

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
                   ` (11 preceding siblings ...)
  2024-08-06 23:43 ` zlice
@ 2024-08-06 23:44 ` zlice
  2024-08-06 23:45 ` zlice
                   ` (9 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: zlice @ 2024-08-06 23:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 3676 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/issues/51629#issuecomment-2272348138

Comment:
@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 symlnk 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'
```

```diff
--- 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,29 @@
 	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;
+		memcpy(tmp_data, old_omp->data, strlen(old_omp->data) );
+		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]);
 	}
 }
```

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
                   ` (12 preceding siblings ...)
  2024-08-06 23:44 ` zlice
@ 2024-08-06 23:45 ` zlice
  2024-08-29 13:52 ` zlice
                   ` (8 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: zlice @ 2024-08-06 23:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 3677 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/issues/51629#issuecomment-2272348138

Comment:
@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'
```

```diff
--- 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,29 @@
 	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;
+		memcpy(tmp_data, old_omp->data, strlen(old_omp->data) );
+		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]);
 	}
 }
```

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
                   ` (13 preceding siblings ...)
  2024-08-06 23:45 ` zlice
@ 2024-08-29 13:52 ` zlice
  2024-08-29 13:55 ` zlice
                   ` (7 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: zlice @ 2024-08-29 13:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 3910 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/issues/51629#issuecomment-2272348138

Comment:
@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'
```

```diff
--- 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)

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
                   ` (14 preceding siblings ...)
  2024-08-29 13:52 ` zlice
@ 2024-08-29 13:55 ` zlice
  2024-09-08 18:25 ` zenny
                   ` (6 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: zlice @ 2024-08-29 13:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 3898 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/issues/51629#issuecomment-2272348138

Comment:
@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'
```

```diff
--- 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)

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
                   ` (15 preceding siblings ...)
  2024-08-29 13:55 ` zlice
@ 2024-09-08 18:25 ` zenny
  2024-09-08 19:39 ` zenny
                   ` (5 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: zenny @ 2024-09-08 18:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 214 bytes --]

New comment by zenny on void-packages repository

https://github.com/void-linux/void-packages/issues/51629#issuecomment-2336779519

Comment:
Hi, I am having the same behavior in voidlinux, fyi. Any patches? Thanks

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
                   ` (16 preceding siblings ...)
  2024-09-08 18:25 ` zenny
@ 2024-09-08 19:39 ` zenny
  2024-09-09 14:01 ` russnes
                   ` (4 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: zenny @ 2024-09-08 19:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 201 bytes --]

New comment by zenny on void-packages repository

https://github.com/void-linux/void-packages/issues/51629#issuecomment-2336779519

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
                   ` (17 preceding siblings ...)
  2024-09-08 19:39 ` zenny
@ 2024-09-09 14:01 ` russnes
  2024-11-05 20:38 ` zlice
                   ` (3 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: russnes @ 2024-09-09 14:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 213 bytes --]

New comment by russnes on void-packages repository

https://github.com/void-linux/void-packages/issues/51629#issuecomment-2338212605

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
                   ` (18 preceding siblings ...)
  2024-09-09 14:01 ` russnes
@ 2024-11-05 20:38 ` zlice
  2024-11-05 21:01 ` TheEgghead27
                   ` (2 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: zlice @ 2024-11-05 20:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 182 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/issues/51629#issuecomment-2458109817

Comment:
did the last update fix this for people?

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
                   ` (19 preceding siblings ...)
  2024-11-05 20:38 ` zlice
@ 2024-11-05 21:01 ` TheEgghead27
  2024-11-05 21:05 ` zlice
  2025-03-15  6:34 ` [ISSUE] [CLOSED] " Luciogi
  22 siblings, 0 replies; 24+ messages in thread
From: TheEgghead27 @ 2024-11-05 21:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 389 bytes --]

New comment by TheEgghead27 on void-packages repository

https://github.com/void-linux/void-packages/issues/51629#issuecomment-2458143305

Comment:
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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
                   ` (20 preceding siblings ...)
  2024-11-05 21:01 ` TheEgghead27
@ 2024-11-05 21:05 ` zlice
  2025-03-15  6:34 ` [ISSUE] [CLOSED] " Luciogi
  22 siblings, 0 replies; 24+ messages in thread
From: zlice @ 2024-11-05 21:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 175 bytes --]

New comment by zlice on void-packages repository

https://github.com/void-linux/void-packages/issues/51629#issuecomment-2458148974

Comment:
ok so my patch still applies. thx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [ISSUE] [CLOSED] OBS only shows black output
  2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
                   ` (21 preceding siblings ...)
  2024-11-05 21:05 ` zlice
@ 2025-03-15  6:34 ` Luciogi
  22 siblings, 0 replies; 24+ messages in thread
From: Luciogi @ 2025-03-15  6:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 731 bytes --]

Closed issue by Luciogi on void-packages repository

https://github.com/void-linux/void-packages/issues/51629

Description:
### 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](https://github.com/user-attachments/assets/d7e6f59c-284e-4eb1-a3f9-733a91f0fcea)


### 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

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2025-03-15  6:34 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-04 11:18 [ISSUE] OBS only shows black output Luciogi
2024-08-04 11:19 ` Luciogi
2024-08-04 11:25 ` [ISSUE] [CLOSED] " classabbyamp
2024-08-04 11:25 ` classabbyamp
2024-08-04 11:27 ` classabbyamp
2024-08-04 11:32 ` classabbyamp
2024-08-06 12:12 ` zlice
2024-08-06 17:41 ` zlice
2024-08-06 17:42 ` zlice
2024-08-06 17:45 ` zlice
2024-08-06 19:23 ` zlice
2024-08-06 20:37 ` zlice
2024-08-06 23:43 ` zlice
2024-08-06 23:44 ` zlice
2024-08-06 23:45 ` zlice
2024-08-29 13:52 ` zlice
2024-08-29 13:55 ` zlice
2024-09-08 18:25 ` zenny
2024-09-08 19:39 ` zenny
2024-09-09 14:01 ` russnes
2024-11-05 20:38 ` zlice
2024-11-05 21:01 ` TheEgghead27
2024-11-05 21:05 ` zlice
2025-03-15  6:34 ` [ISSUE] [CLOSED] " Luciogi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).