occ-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
359 stars 28 forks source link

Crash upon adding audio filter with 7.1 channel #73

Closed A0nameless0man closed 4 months ago

A0nameless0man commented 4 months ago

Hi! Plugin looks like a great concept, however,as soon as I add it as an audio filter to my capture device obs freezes and after a few seconds of waiting it crashes with no errors or anything.

I can only add it as an audio filter when I mute the audio first.

I tried to build the latest code. But keep got LNK 2019 error complaing about missing __ms_vsnprintf when building obs. I managed to bypass this by bumping obs to 30.0.2, which is my current version. It can be built with or without cuda. But it just keeps crashing.

Let me know if need to gather more info.

Here is all the crash logs i have now.

Crash 2024-03-10 03-29-32.txt Crash 2024-03-10 03-54-32.txt Crash 2024-03-10 04-03-29.txt

Most time it just crash without crash log. So I add obs running log as a supplement.

2024-03-10 06-25-51.txt

As far as I'm aware, the last log before crash is always like this and end with starting whisper thread

07:19:04.368: warning: Could not update timestamps for skipped samples.
07:19:54.985: [obs-localvocal] transcription_filter_defaults
07:19:54.985: [obs-localvocal] transcription filter create
07:19:54.985: [obs-localvocal] Checking if model models/ggml-tiny.en.bin exists in data...
07:19:54.986: [obs-localvocal] Model found in data: ../../data/obs-plugins/obs-localvocal/models/ggml-tiny.en.bin
07:19:54.986: [obs-localvocal] Loading whisper model from ../../data/obs-plugins/obs-localvocal/models/ggml-tiny.en.bin
07:19:55.324: [obs-localvocal] Whisper model loaded: AVX = 1 | AVX2 = 1 | AVX512 = 0 | FMA = 1 | NEON = 0 | ARM_FMA = 0 | METAL = 0 | F16C = 1 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 1 | SSE3 = 1 | SSSE3 = 0 | VSX = 0 | CUDA = 1 | COREML = 0 | OPENVINO = 0 | 
07:19:55.328: User added filter 'LocalVocal Transcription' (transcription_filter_audio_filter) to source '媒体源'
07:19:55.328: [obs-localvocal] transcription_filter_defaults
07:19:55.329: [obs-localvocal] starting whisper thread
royshil commented 4 months ago

Are you by chance loading an external whisper model? On windows there are path resolution problem if your file path on disk has special characters beyond ascii Even if it's your username Try putting the model in e.g. c:\ and then try

A0nameless0man commented 4 months ago

No. I was using built in model with all default settings.

ModelPath is C:\Users\hugua\AppData\Roaming\obs-studio\plugin_config\obs-localvocal\models

I tried to load external model(by mute the audio first), it was fine until i turned on the audio and obs crash right away.

royshil commented 4 months ago

@A0nameless0man are you using primarily the CUDA version or the one prebuilt on this repo?

A0nameless0man commented 4 months ago

@A0nameless0man are you using primarily the CUDA version or the one prebuilt on this repo?

I tried both. But there isn't a primarily version because none of them can work at all.

royshil commented 4 months ago

@A0nameless0man are you able to build the plugin on your own computer?

A0nameless0man commented 4 months ago

I could build by bumping obs to 30.0.2, which is my current version. It can be built with or without cuda. But it just keeps crashing.

royshil commented 4 months ago

@A0nameless0man you have an AMD machine

06:25:53.719: CPU Name: AMD Ryzen 5 3600 6-Core Processor              

so it might not support AVX/AVX2, SSE etc. although it theoretically should...

but just to check, you can disable those in the cmake/BuildWhispercpp.cmake build script look in line 16,17

  set(WHISPER_ADDITIONAL_CMAKE_ARGS -DWHISPER_BLAS=OFF -DWHISPER_CUBLAS=OFF -DWHISPER_OPENBLAS=OFF -DWHISPER_NO_AVX=ON
                                    -DWHISPER_NO_AVX2=ON)

try setting these flags to on for the standard build

A0nameless0man commented 4 months ago

@royshil I found out why.

royshil commented 4 months ago

resolved