obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
60.38k stars 7.99k forks source link

OBS crashing on Mac M2 Air when switching scenes #11116

Closed GammaScorpii closed 2 months ago

GammaScorpii commented 3 months ago

Operating System Info

macOS 14

Other OS

No response

OBS Studio Version

30.2.2

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/Ro85YoO1FwcEnwcd

OBS Studio Crash Log URL

https://drive.google.com/file/d/1fYH5g8GrLBeXpl5BMZ2-EYLIO8Jpvi8e/view?usp=sharing

Expected Behavior

Switch scenes indefinitely

Current Behavior

After switching scenes for a while, OBS will crash with no message. It crashes as soon as I do a cut to another scene. Doesnt seem to consistantly be the same scene. Mac reports OBS quit unexpectedly. Last line of the log always states:

QObject::startTimer: Timers cannot be started from another thread

Doesn't seem to have anything to do with any scripts/plugins, as it happens even in safe mode. I've tried changing output formats and codecs but this doesn't seem to be related.

Steps to Reproduce

  1. Install any OBS version after 30.1.2 (30.2.0 onwards) for Mac OS (might be specific to Apple Silicon or M2)
  2. Create a bunch of scenes (might need content like simple colour layers, might not need anything)
  3. Start streaming to YouTube while also recording the stream encoder. Output can be anything (mov, mp4, ts). I did not test without recording as I always need to (sorry).
  4. Switch scenes a bunch of times in Studio Mode. Sometimes it will crash immediately, sometimes after switching a dozen times. I can't seem to get it to crash without being in Studio Mode. ...

Anything else we should know?

I have NDI plugin updated and NDI SDK updated. But this crash occurs even in safe mode on any version after 30.1.2. Log provided was from a safe mode crash.

30.1.2 doesn't seem to have this issue.

PatTheMav commented 3 months ago

Your report provides no crash log, we need an actual macOS crash log (not the OBS Studio Log) to check which part of the program actually crashed.

You can find recent crash logs in Console.app on macOS: https://support.apple.com/guide/console/reports-cnsl664be99a/mac

GammaScorpii commented 3 months ago

I see thanks. I believe this is from the same crash:

https://drive.google.com/file/d/1fYH5g8GrLBeXpl5BMZ2-EYLIO8Jpvi8e/view?usp=sharing

txt format:

https://drive.google.com/file/d/1HOlDZn86c_BUjjHj7KbZQeahSFrfwt_p/view?usp=sharing

PatTheMav commented 3 months ago

Thanks - so symbolicating that crash tells us that it happens deep inside the bowels of Qt triggered in our code by OBSBasic::UpdateEditMenu() (in OBS) (window-basic-main.cpp:8626).

That's this line right here in version 30.2.2 (the source file has changed since then): https://github.com/obsproject/obs-studio/blob/5854f3b9e5861246ea57dd4a26d3d847a8552c4b/UI/window-basic-main.cpp#L8626

It also jumps at me that we trigger a UI change on the audio thread and not on the UI thread, which is not allowed and might be the reason for this message:

QObject::startTimer: Timers cannot be started from another thread

I haven't been able to reproduce this with stock OBS however (tried switching scenes with one having multiple audio filters added to a source) because the audio thread only ever triggered the destruction of the "scene" source.

So we'd need you to try to reproduce this issue on your machine with simpler scene setups, particularly using only stock sources (i.e. no sources provided by 3rd party plugins).

GammaScorpii commented 3 months ago

I've been messing around with 30.2.3 for a while (still occurs on this version) and it's clear that streaming/recording is not relevant. It's very random though which makes it difficult to test.

I have not been able to reproduce on a fresh Scene Collection yet, only my old one which is fairly complex.

I will continue to figure out what it is.

GammaScorpii commented 3 months ago

I've reduced it down and I'm interested to know if this one crashes for anyone else. Can this Scene Collection be imported, and if you switch to studio mode and use spacebar to cut between all the scenes, will it crash? It may take a while but it always crashes for me after about 2 minutes max of just randomly cutting to different scenes. https://drive.google.com/file/d/1hriQLDlMKO7p95M8TATt1ROLxNSeRfSV/view

PatTheMav commented 3 months ago

I've reduced it down and I'm interested to know if this one crashes for anyone else. Can this Scene Collection be imported, and if you switch to studio mode and use spacebar to cut between all the scenes, will it crash? It may take a while but it always crashes for me after about 2 minutes max of just randomly cutting to different scenes. https://drive.google.com/file/d/1hriQLDlMKO7p95M8TATt1ROLxNSeRfSV/view

Remove the source_record_filter from your scene collection and try again - I've been eyeing this one since I saw it in your original OBS log.

GammaScorpii commented 3 months ago

Ah that's probably it. I have had nothing but trouble with that plugin. I'll only get to remove and test this again in a few days, but I should have checked the filters. I hadn't used that plugin in a long time and I since deleted the plugin file because it caused many issues.

PatTheMav commented 3 months ago

Got it - I wouldn't blame the plugin just yet, because it could be that it just exposes an underlying issue within libobs, but for that we need to isolate the trigger of the issue first.

GammaScorpii commented 2 months ago

Can confirm that removing the Source Record filter from all my scenes has resolved this. Strange it affected things even with the plugin file missing. And only after 30.1.2. And in safe mode too.