Question / Help OBS Prevents screen sleep, any work around?

I use OBS for the Replay Buffer function, so OBS was always running and preventing sleep.

If you have the 64 bit version the solution I found was to open the Command Prompt as administrator and use this command:
powercfg -requestsoverride process obs64.exe display system awaymode

You'll know if you did it right if you use powercfg -requestsoverride and see
"obs64.exe DISPLAY SYSTEM AWAYMODE" under [PROCESS]

Hope this helps.
Hello,

Thank you. Solved my issue. Happy New year!
 
I had a similar problem, but on MacOS (12.7.1), and have been annoyed by this for the past 2 years. Today I had ChatGPT write me the following simple program, which I call "mac-idler":
Swift:
import Foundation
import CoreGraphics

// Function to execute 'pmset displaysleepnow'
func putDisplayToSleep() {
    let task = Process()
    task.launchPath = "/usr/bin/pmset"
    task.arguments = ["displaysleepnow"]
    task.launch()
}

// Main
if CommandLine.argc < 2 {
    print("Usage: DisplaySleepMonitor <idle time in seconds>")
    exit(1)
}

guard let thresholdSeconds = Double(CommandLine.arguments[1]) else {
    print("Invalid number format for idle time.")
    exit(1)
}

// Timer to check the idle time every second
Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { _ in
    let idleTime = CGEventSource.secondsSinceLastEventType(.combinedSessionState, eventType: CGEventType(rawValue: UInt32.max)!)
    if idleTime >= thresholdSeconds {
        putDisplayToSleep()
    }
}

// Run the main loop
RunLoop.current.run()
 
I use OBS for the Replay Buffer function, so OBS was always running and preventing sleep.

If you have the 64 bit version the solution I found was to open the Command Prompt as administrator and use this command:
powercfg -requestsoverride process obs64.exe display system awaymode

You'll know if you did it right if you use powercfg -requestsoverride and see
"obs64.exe DISPLAY SYSTEM AWAYMODE" under [PROCESS]

Hope this helps.
This solution caused the video replay buffer to not save the video, how can I get it back?
 
I use OBS for the Replay Buffer function, so OBS was always running and preventing sleep.

If you have the 64 bit version the solution I found was to open the Command Prompt as administrator and use this command:
powercfg -requestsoverride process obs64.exe display system awaymode

You'll know if you did it right if you use powercfg -requestsoverride and see
"obs64.exe DISPLAY SYSTEM AWAYMODE" under [PROCESS]

Hope this helps.

Dude, i was looking for a solution for this for AGES, i previously tried something similar in CMD to override it but it must have been a different command and didn't work, but with yours it works pretty well.

I can now have the PC sleep automatically if i'm AFK for specific duration of time, and when i resume the replay buffer still works albeit somewhat slower, to fix this one can simply restart replay buffer manually. Windows own sleep function does not seem to work, so i use a AutoHotkey script instead.
 
I use OBS for the Replay Buffer function, so OBS was always running and preventing sleep.

If you have the 64 bit version the solution I found was to open the Command Prompt as administrator and use this command:
powercfg -requestsoverride process obs64.exe display system awaymode

You'll know if you did it right if you use powercfg -requestsoverride and see
"obs64.exe DISPLAY SYSTEM AWAYMODE" under [PROCESS]

Hope this helps.
You are fr my hero
I made this account just so I could thank you.
 
Not sure if this is still an issue but I have just implemented an option using advanced scene switcher, I created a scene to start and stop the replay buffer based on system idle

1772884418501.png


1772884437798.png

I did this about 5min ago and tested and initial tests seemed to work perfectly, if anybody sees any issues with this please feel free to let me know, I am very new to making changes to OBS.
 
i use rustdesk, it has "lock screen after session"-option. very nice.
1794508709258.png

so far i had to use this:
1794512403663.jpeg

without OBS recording it could lock the screen after a couple of seconds or minutes.
while OBS was recording, "Interactive logon: Machine inactivity limit" couldn't lock the screen.

and since using the start menu takes more time than using the short way on rustdesk, rustdesk helps me to lock the screen in a quick way.

while the screen is locked and OBS is still recording, the record will remain black, because no rendering is possible.
 
Back
Top