featherbear / ndi-streamer

Cross-platform display capture over NDI. Barebones version of Scan Converter made as an alternative to obs-ndi on Linux
MIT License
18 stars 6 forks source link

Segmentation fault (core dumped) #2

Open santosardr opened 1 year ago

santosardr commented 1 year ago

Your project could be a solution to soften my old machine load. I use Ubuntu 20.04 LTS on a four-core machine. I use obs in another machine broadcasting a webcam capture. I use OBS to create a virtual camera and capture the NDI Source on my computer. As you know, OBS helps to stress my machine when LibreOffice, TEAMS (showing several webcam images in a meeting), and Firefox are already loaded.

First: your readme does not inform the user of the need to unpack the 'NDI SDK for Linux' exactly with this name on the lib folder.

Second, your readme also does not tell the user to git clone screen_capture_lite inside the lib folder.

Third, I would like to inform you that despite being installed with sudo privileges, I had to create a symbolic link to compile the project: sudo ln -fs /usr/local/lib/libscreen_capture_lite_shared.so /usr/local/lib/libscreen_capture_lite.so

Fourth, after all, I got it compiled. However, to run it also was necessary to create a second link: sudo ln -fs /usr/local/lib/libscreen_capture_lite_shared.so /usr/lib

And last, after a few seconds running, I got the message: build$ ./ndi-streamer Running display capture Library is requesting the list of monitors to capture! Display 0 Display 1 Segmentation fault (core dumped)

Please, can you help me?

jgilles63 commented 1 month ago

Hi, I have the exact same issue, did you find a solution to this segmentation fault error. It seems it comes from GetMonitors() function and XineramaQueryScreens().

I try to use xrandr instead of Xinerama but got the same issue. Now I maybe think that it could be due to the thread.

Let me know if you find out the solution. Thank you

jgilles63 commented 1 month ago

Hi,

Yes it looks like changing app.cpp of ndi-streamer project: Adding just after main():

and changing GetMonitors.cpp in screen_capture_lite project:

namespace Screen_Capture {

std::mutex displayMutex;

std::vector<Monitor> GetMonitors()
{
    std::vector<Monitor> ret;

    // Bloquear el mutex al inicio del bloque
    std::lock_guard<std::mutex> lock(displayMutex);

    Display* display = XOpenDisplay(NULL);

. . .

it fix my issue. hope it can help.