Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS Screen Capture stops working after waking from sleep #8928

Closed
JacksonChen666 opened this issue May 19, 2023 · 9 comments
Closed

macOS Screen Capture stops working after waking from sleep #8928

JacksonChen666 opened this issue May 19, 2023 · 9 comments

Comments

@JacksonChen666
Copy link

JacksonChen666 commented May 19, 2023

Operating System Info

macOS 13

Other OS

No response

OBS Studio Version

29.1.1

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/6rGLVnQlA1EhExs7

OBS Studio Crash Log URL

No response

Expected Behavior

macOS Screen Capture continues to work (capture) after waking from sleep.

Current Behavior

macOS Screen Capture freezes after waking from sleep.

Steps to Reproduce

  1. Open OBS
  2. Have a macOS Screen Capture source (Add if necessary)
  3. (Optional) Start recording
  4. Close lid (or go to sleep)
  5. Open lid (wake from sleep)
  6. Experience the issue

Anything else we should know?

  • 100% reproduction chance
  • Only macOS Screen Capture seems to stop working (freeze).
  • This issue can be fixed by the end-user by restarting OBS Studio, or by switching to another scene collection and back (likely restarting the macOS Screen Capture source).
@gxalpha
Copy link
Member

gxalpha commented Aug 30, 2023

We added a "Restart Capture" button to the properties of the source in OBS 30.0 that should be enabled when certain stoppages of capture (computer goes to sleep, user stops capture via menu bar in macOS 14) are detected. Could you try if that button is enabled when the computer wakes up again, and if pressing it fixes the problem?

@JacksonChen666
Copy link
Author

Could you try if that button is enabled when the computer wakes up again, and if pressing it fixes the problem?

The first time I started OBS 30 beta 2, for some reason, the restart button didn't do much other make it output nothing and the display setting had no items anymore. Logs

After restarting OBS, the restart button does work. The capture continues working. Logs

Although, the button is quite far away (multiple clicks away), and that doesn't really seem that practical.

@mattymatty
Copy link

same issues happens to me

@RytoEX
Copy link
Member

RytoEX commented Feb 29, 2024

The Apple sample app does the same thing as OBS here, so this seems like intended behavior for ScreenCaptureKit. Closing as such.

@RytoEX RytoEX closed this as not planned Won't fix, can't repro, duplicate, stale Feb 29, 2024
@baardbi
Copy link

baardbi commented May 1, 2024

This has happened to me several times now. If I do some recording of webcam and macOS screen capture for a little while, it works fine. Then I stop the recording and go to lunch (leaving the OBS application open). Then I come back and start recording again, and when I'm done I see that (in the recorded video) only the webcam recording is shown in front of my desktop wallpaper. None of the applications (or mouse pointer, app windows etc.) I use during the recording is shown in the finished video. Just me in front of the desktop wallpaper. If I close the OBS recording before going to lunch and open it when I come back and start recording, it work just fine. The problem is that I sometimes forget to do that, and it's super frustrating when I have recorded an hour of a tutorial video for something.

@thefrostypixel
Copy link

I don't understand why this has been closed. It's really annoying to have to manually go to OBS, right click the screen recording, select properties and press Restart Capture every time my mac wakes back up, and I don't see any reason for it being that way. Just because an Apple app does it this way that doesn't mean it's convenient or logical in any way.

@rafalsk
Copy link

rafalsk commented May 24, 2024

also I do not understand, we are using OBS like a lot (gridnet.org) and this behaviour of OBS is real pain the ass on mac OS.

Basically all our scripts get broken after single session. Mac OS goes to sleep - everything broken all over again.

@lauhub
Copy link

lauhub commented May 31, 2024

I have the same problem and it is really a pain...

If it is possible to put a button to "Restart capture", why OBS couldn't be able to restart it automatically, without human action ?

At least an option should be available to allow this. And capture should be restarted automatically when resuming recording or streaming, or starting a new one.

Should we create a new issue for this ?

@RytoEX
Copy link
Member

RytoEX commented May 31, 2024

Should we create a new issue for this ?

No. GitHub Issues are not feature requests, they are for bug reports. A request to add an option or to change OBS behavior from in the manner described above is a feature request.

If it is possible to put a button to "Restart capture", why OBS couldn't be able to restart it automatically, without human action ?

See this comment on the PR that introduced the button:

Is there anything that prevents us from just restarting the capture without the user having to manually do it?
Yes, the fact that the user explicitly chose to stop the capture.
I guess for the other failures (sleep etc) that could be an option.

The challenge then becomes how to make sure we never accidentally re-enable capture when the user has explicitly chosen to stop the capture. I do not know if there is even a way to tell the difference programmatically. We had, and still have, little to no interest in trying to be "smart" when consent/permissions were involved in this case.

The fact that the Apple sample app does the same thing as OBS here indicates to us that ScreenCaptureKit does not by itself support resuming an active capture session that is interrupted by system sleep, so our implementation is "working as designed". Generally speaking, we consider the system changing power states while OBS is running to be disruptive and not something we're super interested in working around. Quitting OBS before putting your system to sleep is the best way to avoid unexpected behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants