locaal-ai / obs-localvocal

OBS plugin for local speech recognition and captioning using AI
https://obsproject.com/forum/resources/localvocal-live-stream-ai-assistant.1769/
GNU General Public License v2.0
507 stars 37 forks source link

OBS crashes after installing the plugin on Ubuntu22.04 based Pop Os system #84

Closed vpgits closed 4 months ago

vpgits commented 6 months ago
sogaiu commented 6 months ago

I experienced a similar result, i.e. getting undefined symbol: GetX86Info during launch of obs.

I tried compiling using the instructions in the README and I also tried the .deb files for 0.2.3 and 0.2.4 from the releases page. In all three cases I got the same sort of result mentioned above about undefined symbol.

Grepping through the locally cloned repository after building, I noticed use of what looked like CTranslate2.

That seems to use GetX86Info in at least one place, here:

namespace ctranslate2 {
  namespace cpu {

    static const cpu_features::X86Info info = cpu_features::GetX86Info();

Perhaps GetX86Info is from cpu_features.

May be this is related to the issue?

royshil commented 6 months ago

@sogaiu @vpgits i believe i resolved the issue in #94 by bundling cpu_features can you test?

vpgits commented 6 months ago

But i still get the same error.

sogaiu commented 6 months ago

@royshil I had success via the branch mentioned in https://github.com/occ-ai/obs-localvocal/pull/94. By "success" I mean that OBS does not crash for me now and I am able to see evidence of LocalVocal in OBS' UI.

My environment was Xubuntu 22.04.4 in a VM.

The following are a few things I did that were slightly different from the instructions:

  1. The CI script seems to have a different name now, so adapted the name (left off the trailing .sh).
  2. Manually did sudo apt install libssl-dev without which the script would not complete.
  3. Set the environment variables OBS_PLUGINS_PATH and OBS_PLUGINS_DATA_PATH to $(repo)/release/RelWithDebInfo/lib/x86_64-linux-gnu/obs-plugins and $(repo)/release/RelWithDebInfo/share/obs/obs-plugins respectively (where $(repo) is the full path to the locally cloned repository).

On a side note, I had difficulty in figuring out how to put the resulting files and directories under ~/.config/obs-studio/plugins -- I'm still not quite sure (^^; Perhaps this is not the place to mention it, as it is not specific to this plugin, but FWIW.

In any case, thanks for this plugin and the fix.

royshil commented 6 months ago

@sogaiu ok i'm going to merge in #94 as a fix and ive also updated the build instructions for linux. thank you!

vpgits commented 6 months ago

@sogaiu I followed your instructions. I used the updated readme instructions as well. After completing the build process I copied the plugin files to the given directories and launched obs. The issue was still there. OBS crashed. However., I deleted the obs-localvocal.so from usr/lib/x86_64-linux-gnu/obs-plugins and OBS launched without crashing. I proceeded to test the plugin and it works as expected. So the reason why OBS launched and recognized the plugin is because I launched OBS from the same terminal where I exported export OBS_PLUGINS_DATA_PATH=$(pwd)/release/RelWithDebInfo/share/obs/obs-plugins and export OBS_PLUGINS_PATH=$(pwd)/release/RelWithDebInfo/lib/x86_64-linux-gnu/obs-plugins

sogaiu commented 6 months ago

This part of the updated instructions:

$ export OBS_PLUGINS_PATH=$(pwd)/release/RelWithDebInfo/lib/x86_64-linux-gnu/obs-plugins
$ export OBS_PLUGINS_DATA_PATH=$(pwd)/release/RelWithDebInfo/share/obs/obs-plugins

seems slightly out of place.

As I understand it, those environment variables are what OBS uses to find plugin bits when it starts up / is running. I don't think they are used during the build (though I may be wrong about that).

What I have yet to figure out is how to arrange the resulting built files and directories to live under ~/.config/obs-studio/plugins. Once that is determined, IIUC, the environment variables shouldn't need to be set.

Unfortunately, I haven't had much luck finding good info about how yet. I suppose one could repeatedly try different arrangements in combination with examining the output of strace...may be there's some other plugin that documents this that I haven't found yet (^^;

vpgits commented 6 months ago

This part of the updated instructions:

$ export OBS_PLUGINS_PATH=$(pwd)/release/RelWithDebInfo/lib/x86_64-linux-gnu/obs-plugins
$ export OBS_PLUGINS_DATA_PATH=$(pwd)/release/RelWithDebInfo/share/obs/obs-plugins

seems slightly out of place.

As I understand it, those environment variables are what OBS uses to find plugin bits when it starts up / is running. I don't think they are used during the build (though I may be wrong about that).

What I have yet to figure out is how to arrange the resulting built files and directories to live under ~/.config/obs-studio/plugins. Once that is determined, IIUC, the environment variables shouldn't need to be set.

Unfortunately, I haven't had much luck finding good info about how yet. I suppose one could repeatedly try different arrangements in combination with examining the output of strace...may be there's some other plugin that documents this that I haven't found yet (^^;

Simply, told those export statements tell obs to look in those folders for the plugins and that's why it worked for me. I think what might be the issue is, /usr//lib/x86_64-linux-gnu/obs-plugins/obs-localvocal.so these double forward slashes near usr/lib.

sogaiu commented 6 months ago

I found a hint here.

May be adapting the following will work:

~/.config/obs-studio/plugins/plugin_name/bin/64-bit/plugin_name.so
~/.config/obs-studio/plugins/plugin_name/data/locale/en-US.ini
vpgits commented 6 months ago

I found a hint here.

May be adapting the following will work:

~/.config/obs-studio/plugins/plugin_name/bin/64-bit/plugin_name.so
~/.config/obs-studio/plugins/plugin_name/data/locale/en-US.ini

Tried this but didn't work out.

vpgits commented 6 months ago

@royshil @sogaiu Found the error. I shouldn't have bothered in the first place. It has to do with how the plugin files are copied using the bash command. It should be sudo cp -R release/RelWithDebInfo/lib/* /usr/lib/ instead of sudo cp -R release/RelWithDebInfo/lib/* /usr/lib/x86_64-linux-gnu/ .The * wildcard matches the directories and previous command created a x86_64-linux-gnu folder inside x86_64-linux-gnu. So just update the documentation for that command , the other copy command for the settings data seems to be fine. Again sorry for bothering, and this plugin is so cool I don't have to run ffmpeg with whisper anymore, on jupyter notebooks.

sogaiu commented 6 months ago

It seems like the instructions from the Arch Wiki may have been slightly off.

Changing 64-bit to 64bit in one of the paths yielded success here.

The file / directory layout that worked here was:

~/.config/obs-studio/plugins$ tree
.
└── obs-localvocal
    ├── bin
    │   └── 64bit
    │       ├── obs-localvocal
    │       │   ├── libonnxruntime_providers_shared.so
    │       │   └── libonnxruntime.so.1.17.1
    │       └── obs-localvocal.so
    └── data
        ├── locale
        │   ├── ar-SA.ini
        │   ├── de-DE.ini
        │   ├── en-US.ini
        │   ├── es-ES.ini
        │   ├── fr-FR.ini
        │   ├── hi-IN.ini
        │   ├── ja-JP.ini
        │   ├── ko-KR.ini
        │   ├── pl-PL.ini
        │   ├── pt-BR.ini
        │   ├── ru-RU.ini
        │   └── zh-CN.ini
        └── models
            ├── ggml-model-whisper-tiny-en
            │   └── ggml-model-whisper-tiny.en.bin
            └── silero-vad
                └── silero_vad.onnx

On a slight tangent, this was determined via following the instructions for another plugin (along with examining the content of one of its release files) and examining closely the path mentioned here.

royshil commented 6 months ago

@sogaiu so as an instruction to folks does this make sense?

$ mkdir -p ~/.config/obs-studio/plugins/obs-localvocal
$ sudo cp -R release/RelWithDebInfo/lib/* ~/.config/obs-studio/plugins/obs-localvocal
$ sudo cp -R release/RelWithDebInfo/share/* ~/.config/obs-studio/plugins/obs-localvocal
sogaiu commented 6 months ago

@royshil I think I tried something like that before that but did not find it to work.

Adjusting the source and destination paths a bit, I found the following to work here:

$ mkdir -p ~/.config/obs-studio/plugins/obs-localvocal/bin/64bit
$ cp -R release/RelWithDebInfo/lib/x86_64-linux-gnu/obs-plugins/* ~/.config/obs-studio/plugins/obs-localvocal/bin/64bit/
$ mkdir -p ~/.config/obs-studio/plugins/obs-localvocal/data
$ cp -R release/RelWithDebInfo/share/obs/obs-plugins/obs-localvocal/* ~/.config/obs-studio/plugins/obs-localvocal/data/

On a side note, I did not use sudo because the destination is within a user's home directory and is likely to be writable.

ogmkp commented 5 months ago

Updated to 0.2.4 and same error: undefined symbol: GetX86Info

vpgits commented 5 months ago

Updated to 0.2.4 and same error: undefined symbol: GetX86Info

Could you try following instructions from this reply? https://github.com/occ-ai/obs-localvocal/issues/84#issuecomment-2085391875 So basically when copying the plugin files, it doesn't get copied into _x86 path.

sogaiu commented 5 months ago

Updated to 0.2.4 and same error: undefined symbol: GetX86Info

IIUC, 0.2.4 predates the changes that royshil made to address the reported error about "undefined symbol", so I think it won't be enough to modify the paths involved in copying.

ATM, I think it's necessary to build from source (and follow the updated instructions) as described here.

royshil commented 5 months ago

the latest version shuold take care of this @ogmkp @sogaiu @vpgits can you all test plz?

sogaiu commented 5 months ago

I tried via the .deb for 0.2.6 as well as compiling from source (and copying things under ~/.config/obs-studio/plugins in the latter case).

Installation went ok and looking at the output in the console, the plugin appeared to be detected.

I tried adding an audio capture device (alsa) source and then a corresponding filter for LocalVocal. The addition appeared successful in the GUI, but shortly after obs crashed.

Below is the console output from one of the sessions.

$ obs
debug: Found portal inhibitor
debug: Attempted path: share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: share/obs/obs-studio/locale.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale.ini
debug: Attempted path: share/obs/obs-studio/themes
debug: Attempted path: /usr/share/obs/obs-studio/themes
debug: Attempted path: share/obs/obs-studio/themes/Yami.qss
debug: Attempted path: /usr/share/obs/obs-studio/themes/Yami.qss
info: Using EGL/X11
info: CPU Name: 11th Gen Intel(R) Core(TM) i5-1145G7 @ 2.60GHz
info: CPU Speed: 1497.600MHz
info: CPU Name: 11th Gen Intel(R) Core(TM) i5-1145G7 @ 2.60GHz
info: CPU Speed: 1497.600MHz
info: Physical Cores: 2, Logical Cores: 2
info: Physical Memory: 3911MB Total, 1740MB Free
info: Kernel Version: Linux 5.15.0-107-generic
info: Distribution: "Ubuntu" "22.04"
info: Desktop Environment: XFCE (xubuntu)
info: Session Type: x11
info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.21.1
info: Qt Version: 6.2.4 (runtime), 6.2.4 (compiled)
info: Portable mode: false
info: OBS 30.1.2 (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...
libEGL warning: DRI2: failed to authenticate
info: Loading up OpenGL on adapter Mesa llvmpipe (LLVM 15.0.7, 256 bits)
info: OpenGL loaded successfully, version 4.5 (Core Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2, shading language 4.50
info: ---------------------------------
info: video settings reset:
    base resolution:   1024x768
    output resolution: 640x480
    downscale filter:  Bicubic
    fps:               30/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: No AJA devices found, skipping loading AJA UI plugin
warning: Failed to initialize module 'aja-output-ui.so'
warning: No AJA devices found, skipping loading AJA plugin
warning: Failed to initialize module 'aja.so'
warning: Failed to load 'en-US' text for module: 'decklink-captions.so'
warning: Failed to load 'en-US' text for module: 'decklink-output-ui.so'
libDeckLinkAPI.so: cannot open shared object file: No such file or directory
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
warning: Failed to initialize module 'decklink.so'
info: [pipewire] No captures available
info: [obs-browser]: Version 2.23.4
info: [obs-browser]: CEF Version 103.0.5060.134 (runtime), 103.0.0-5060-shared-textures.2594+g17f8588+chromium-103.0.5060.134 (compiled)
info: FFmpeg VAAPI H264 encoding not supported
info: FFmpeg VAAPI AV1 encoding not supported
info: FFmpeg VAAPI HEVC encoding not supported
info: [obs-localvocal] plugin loaded successfully (version 0.2.6)
info: [obs-websocket] [obs_module_load] you can haz websockets (Version: 5.4.2 | RPC Version: 1)
info: [obs-websocket] [obs_module_load] Qt version (compile-time): 6.2.4 | Qt version (run-time): 6.2.4
info: [obs-websocket] [obs_module_load] Linked ASIO Version: 101801
info: [obs-websocket] [obs_module_load] Module loaded.
info: [vlc-video]: VLC 3.0.16 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-websocket.so
info:     obs-vst.so
info:     obs-transitions.so
info:     obs-qsv11.so
info:     obs-outputs.so
info:     obs-localvocal.so
info:     obs-libfdk.so
info:     obs-filters.so
info:     obs-ffmpeg.so
info:     obs-browser.so
info:     linux-v4l2.so
info:     linux-pulseaudio.so
info:     linux-pipewire.so
info:     linux-jack.so
info:     linux-capture.so
info:     linux-alsa.so
info:     image-source.so
info:     frontend-tools.so
info:     decklink-output-ui.so
info:     decklink-captions.so
info: ---------------------------------
warning: QWidget::setTabOrder: 'first' and 'second' must be in the same window
info: ==== Startup complete ===============================================
info: All scene data cleared
info: ------------------------------------------------
info: pulse-input: Server name: 'pulseaudio 15.99.1'
info: pulse-input: Audio format: s16le, 44100 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.pci-0000_00_1b.0.analog-stereo.monitor' (default)
info: [Loaded global audio device]: 'Desktop Audio'
info: pulse-input: Server name: 'pulseaudio 15.99.1'
info: pulse-input: Audio format: s16le, 44100 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_input.pci-0000_00_1b.0.analog-stereo' (default)
info: [Loaded global audio device]: 'Mic/Aux'
info: Switched to scene 'Scene'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info: ------------------------------------------------
info: adding 21 milliseconds of audio buffering, total audio buffering is now 21 milliseconds (source: Desktop Audio)

info: alsa-input: PCM 'default' rate set to 44100
info: alsa-input: PCM 'default' channels set to 2
info: User added source 'Audio Capture Device (ALSA)' (alsa_input_capture) to scene 'Scene'
info: [obs-localvocal] filter defaults
info: [obs-localvocal] LocalVocal filter create
info: [obs-localvocal] create text source
info: User added source 'LocalVocal Subtitles' (text_ft2_source_v2) to scene 'Scene'
info: [obs-localvocal] Checking if model 'Whisper Tiny En' exists in data...
info: [obs-localvocal] TokenBufferThread::monitor
info: [obs-localvocal] Model folder found in data: /usr/share/obs/obs-plugins/obs-localvocal/models/ggml-model-whisper-tiny-en
info: [obs-localvocal] TokenBufferThread::monitor: done
info: [obs-localvocal] Model bin file found in folder: /usr/share/obs/obs-plugins/obs-localvocal/models/ggml-model-whisper-tiny-en/ggml-model-whisper-tiny.en.bin
2024-05-14 12:01:09.173363571 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '131'. It is not used by any node and should be removed from the model.
2024-05-14 12:01:09.173422569 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '136'. It is not used by any node and should be removed from the model.
2024-05-14 12:01:09.173430144 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '139'. It is not used by any node and should be removed from the model.
2024-05-14 12:01:09.173436950 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '140'. It is not used by any node and should be removed from the model.
2024-05-14 12:01:09.173444158 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '134'. It is not used by any node and should be removed from the model.
2024-05-14 12:01:09.173499911 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '628'. It is not used by any node and should be removed from the model.
2024-05-14 12:01:09.173505228 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '623'. It is not used by any node and should be removed from the model.
2024-05-14 12:01:09.173509805 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '629'. It is not used by any node and should be removed from the model.
2024-05-14 12:01:09.173514871 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '620'. It is not used by any node and should be removed from the model.
2024-05-14 12:01:09.173523974 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '625'. It is not used by any node and should be removed from the model.
info: [obs-localvocal] Loading whisper model from /usr/share/obs/obs-plugins/obs-localvocal/models/ggml-model-whisper-tiny-en/ggml-model-whisper-tiny.en.bin
info: [obs-localvocal] Using CPU for inference
info: [obs-localvocal] DTW token timestamps disabled
info: [obs-localvocal] Whisper model loaded: AVX = 1 | AVX2 = 0 | AVX512 = 0 | FMA = 1 | NEON = 0 | ARM_FMA = 0 | METAL = 0 | F16C = 1 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 0 | SSE3 = 1 | SSSE3 = 1 | VSX = 0 | CUDA = 0 | COREML = 0 | OPENVINO = 0
info: User added filter 'LocalVocal Transcription' (transcription_filter_audio_filter) to source 'Audio Capture Device (ALSA)'
info: [obs-localvocal] starting whisper thread
info: [obs-localvocal] filter defaults
info: [obs-localvocal] whisper_model_path_external modified
Segmentation fault (core dumped)
vpgits commented 5 months ago

the latest version shuold take care of this @ogmkp @sogaiu @vpgits can you all test plz?

info: [vlc-video]: Couldn't find VLC installation, VLC video source disabled info: --------------------------------- info: Loaded Modules: info: vlc-video.so info: text-freetype2.so info: rtmp-services.so info: obs-x264.so info: obs-websocket.so info: obs-vst.so info: obs-transitions.so info: obs-qsv11.so info: obs-outputs.so info: obs-localvocal.so info: obs-libfdk.so info: obs-filters.so info: obs-ffmpeg.so info: obs-browser.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: ==== Startup complete =============================================== info: All scene data cleared info: ------------------------------------------------ info: pulse-input: Server name: 'PulseAudio (on PipeWire 1.0.3) 15.0.0' info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels info: pulse-input: Started recording from 'alsa_output.pci-0000_00_1f.3.analog-stereo.monitor' (default) info: [obs-localvocal] filter defaults info: [obs-localvocal] LocalVocal filter create info: [obs-localvocal] Checking if model 'Whisper Tiny En' exists in data... info: [obs-localvocal] TokenBufferThread::monitor info: [obs-localvocal] Model folder found in data: /usr/share/obs/obs-plugins/obs-localvocal/models/ggml-model-whisper-tiny-en info: [obs-localvocal] TokenBufferThread::monitor: done info: [obs-localvocal] Model bin file found in folder: /usr/share/obs/obs-plugins/obs-localvocal/models/ggml-model-whisper-tiny-en/ggml-model-whisper-tiny.en.bin 2024-05-16 06:44:02.281747401 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '131'. It is not used by any node and should be removed from the model. 2024-05-16 06:44:02.281771316 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '136'. It is not used by any node and should be removed from the model. 2024-05-16 06:44:02.281773902 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '139'. It is not used by any node and should be removed from the model. 2024-05-16 06:44:02.281776302 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '140'. It is not used by any node and should be removed from the model. 2024-05-16 06:44:02.281778882 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '134'. It is not used by any node and should be removed from the model. 2024-05-16 06:44:02.281814188 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '628'. It is not used by any node and should be removed from the model. 2024-05-16 06:44:02.281816857 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '623'. It is not used by any node and should be removed from the model. 2024-05-16 06:44:02.281819081 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '629'. It is not used by any node and should be removed from the model. 2024-05-16 06:44:02.281821447 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '620'. It is not used by any node and should be removed from the model. 2024-05-16 06:44:02.281823860 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '625'. It is not used by any node and should be removed from the model. info: [obs-localvocal] Loading whisper model from /usr/share/obs/obs-plugins/obs-localvocal/models/ggml-model-whisper-tiny-en/ggml-model-whisper-tiny.en.bin info: [obs-localvocal] Using CPU for inference info: [obs-localvocal] DTW token timestamps disabled info: [obs-localvocal] Whisper model loaded: AVX = 1 | AVX2 = 0 | AVX512 = 0 | FMA = 1 | NEON = 0 | ARM_FMA = 0 | METAL = 0 | F16C = 1 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 0 | SSE3 = 1 | SSSE3 = 1 | VSX = 0 | CUDA = 0 | COREML = 0 | OPENVINO = 0 info: [obs-localvocal] filter defaults info: [obs-localvocal] starting whisper thread info: [Loaded global audio device]: 'Desktop Audio' info: - filter: 'LocalVocal Transcription' (transcription_filter_audio_filter) info: pulse-input: Server name: 'PulseAudio (on PipeWire 1.0.3) 15.0.0' info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels info: pulse-input: Started recording from 'alsa_input.pci-0000_00_1f.3.analog-stereo' (default) info: [Loaded global audio device]: 'Mic/Aux' info: [Media Source 'abc.mkv']: settings: input: /home/user/Videos/abc.mkv input_format: (null) speed: 100 is_looping: no is_linear_alpha: no is_hw_decoding: no is_clear_on_media_end: yes restart_on_activate: yes close_when_inactive: no full_decode: no ffmpeg_options: info: [obs-localvocal] filter defaults info: [obs-localvocal] LocalVocal filter create info: [obs-localvocal] Checking if model 'Whisper Tiny En' exists in data... info: [obs-localvocal] Model folder found in data: /usr/share/obs/obs-plugins/obs-localvocal/models/ggml-model-whisper-tiny-en info: [obs-localvocal] Model bin file found in folder: /usr/share/obs/obs-plugins/obs-localvocal/models/ggml-model-whisper-tiny-en/ggml-model-whisper-tiny.en.bin info: [obs-localvocal] TokenBufferThread::monitor [aac @ 0x729328012240] Assuming an incorrectly encoded 7.1 channel layout instead of a spec-compliant 7.1(wide) layout, use -strict 1 to decode according to the specification instead. [aac @ 0x72932810c5c0] Assuming an incorrectly encoded 7.1 channel layout instead of a spec-compliant 7.1(wide) layout, use -strict 1 to decode according to the specification instead. 2024-05-16 06:44:02.379402134 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '131'. It is not used by any node and should be removed from the model. 2024-05-16 06:44:02.379422274 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '136'. It is not used by any node and should be removed from the model. 2024-05-16 06:44:02.379425393 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '139'. It is not used by any node and should be removed from the model. 2024-05-16 06:44:02.379431052 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '140'. It is not used by any node and should be removed from the model. 2024-05-16 06:44:02.379433396 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '134'. It is not used by any node and should be removed from the model. 2024-05-16 06:44:02.379472764 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '628'. It is not used by any node and should be removed from the model. 2024-05-16 06:44:02.379477695 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '623'. It is not used by any node and should be removed from the model. 2024-05-16 06:44:02.379485968 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '629'. It is not used by any node and should be removed from the model. 2024-05-16 06:44:02.379488356 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '620'. It is not used by any node and should be removed from the model. 2024-05-16 06:44:02.379490904 [W:onnxruntime:, graph.cc:3593 CleanUnusedInitializersAndNodeArgs] Removing initializer '625'. It is not used by any node and should be removed from the model. info: [obs-localvocal] Loading whisper model from /usr/share/obs/obs-plugins/obs-localvocal/models/ggml-model-whisper-tiny-en/ggml-model-whisper-tiny.en.bin info: [obs-localvocal] Using CPU for inference info: [obs-localvocal] DTW token timestamps disabled info: [obs-localvocal] Whisper model loaded: AVX = 1 | AVX2 = 0 | AVX512 = 0 | FMA = 1 | NEON = 0 | ARM_FMA = 0 | METAL = 0 | F16C = 1 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 0 | SSE3 = 1 | SSSE3 = 1 | VSX = 0 | CUDA = 0 | COREML = 0 | OPENVINO = 0 info: [obs-localvocal] filter defaults info: [obs-localvocal] starting whisper thread info: Switched to scene 'Scene' info: ------------------------------------------------ info: Loaded scenes: info: - scene 'Scene': info: - source: 'LocalVocal Subtitles' (text_ft2_source_v2) info: - source: 'abc.mkv' (ffmpeg_source) info: - filter: 'LocalVocal Transcription' (transcription_filter_audio_filter) info: ------------------------------------------------ info: adding 21 milliseconds of audio buffering, total audio buffering is now 21 milliseconds (source: Desktop Audio)

Segmentation fault (core dumped)


- OBS crashes with larger files > 2GB , here but can be lower sizes as well depending on the hardware. 
- My hypothesis is this has something to do with the memory leak.
ogmkp commented 5 months ago

Sorry, still random crash on OBS 30.1.2 on Debian 12 here with localvocal 0.2.6. Crash randomly when I add the filter on a source, crash randomly when I tick an option in localvocal's advanced properties etc ...

Full trace:

[Thread 0x7ffece3cc6c0 (LWP 21532) exited]
[Thread 0x7ffecdbcb6c0 (LWP 21533) exited]
[Thread 0x7ffecd3ca6c0 (LWP 21534) exited]
terminate called after throwing an instance of 'std::out_of_range'
  what():  map::at

Thread 1385 "obs" received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffefcc1b6c0 (LWP 18151)]
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44  ./nptl/pthread_kill.c: Aucun fichier ou dossier de ce type.
(gdb) 
(gdb) bt full
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
        tid = <optimized out>
        ret = 0
        pd = <optimized out>
        old_mask = {__val = {4702111234474983745}}
        ret = <optimized out>
#1  0x00007ffff42a9e8f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
No locals.
#2  0x00007ffff425afb2 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
        ret = <optimized out>
#3  0x00007ffff4245472 in __GI_abort () at ./stdlib/abort.c:79
        save_stage = 1
        act = {__sigaction_handler = {sa_handler = 0x20, sa_sigaction = 0x20}, sa_mask = {__val = {1880844493789993498, 0, 0, 0, 0, 4575657222473777152, 4575657222473777152, 4575657222473777152, 
              4575657222473777152, 4575657222473777152, 4575657222473777152, 4575657222473777152, 4575657222473777152, 140737291167360, 10, 140733138974400}}, sa_flags = -198588054, 
          sa_restorer = 0x7ffff43f2840 <stderr>}
#4  0x00007ffff409d919 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#5  0x00007ffff40a8e1a in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#6  0x00007ffff40a8e85 in std::terminate() () from /lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#7  0x00007ffff40a90d8 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#8  0x00007ffff40a0240 in std::__throw_out_of_range(char const*) () from /lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#9  0x00007fff9ba12cfc in whisper_token_to_str () from /home/og/.config/obs-studio/plugins/obs-localvocal/bin/64bit/obs-localvocal.so
No symbol table info available.
#10 0x00007fff9b9a1385 in ?? () from /home/og/.config/obs-studio/plugins/obs-localvocal/bin/64bit/obs-localvocal.so
No symbol table info available.
#11 0x00007fff9b9a25c5 in ?? () from /home/og/.config/obs-studio/plugins/obs-localvocal/bin/64bit/obs-localvocal.so
No symbol table info available.
#12 0x00007fff9b9a2d72 in ?? () from /home/og/.config/obs-studio/plugins/obs-localvocal/bin/64bit/obs-localvocal.so
No symbol table info available.
#13 0x00007ffff40d44a3 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#14 0x00007ffff42a8134 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
        ret = <optimized out>
        pd = <optimized out>
        out = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140733138974400, 8992474932148312199, -400, 2, 140737488338592, 140733130584064, -8991918460165547897, -8992465685109270393}, mask_was_saved = 0}}, priv = {
            pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
#15 0x00007ffff43287dc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
No locals.
(gdb) 
royshil commented 4 months ago

@ogmkp can you try v0.3.0 with the fix?

sogaiu commented 4 months ago

FWIW, with 052de4f4 I no longer experience the crash :)

royshil commented 4 months ago

i think we can close this for now and open a new ticket when more evidence arrives