Stopping Sleep When MinimServer actively streaming
|
04-10-2025, 17:34
Post: #1
|
|||
|
|||
Stopping Sleep When MinimServer actively streaming
My setup is fairly simple, I have a small form factor PC running MinimServer, a NAS with my ripped music and a Naim Mu-So which I control from the Naim app. I use Control Panel/Power Options to set 'Put the computer to sleep' at 4 hours.
However, often, my music listening goes beyond this and my PC goes to sleep mid session. I know it is relatively simple to get up and wake it, but it's awkward if there are guest round, etc.. I'd like a script (e.g. Powershell or similar) that I could set to run periodically that would set 'Put the computer to sleep' to 'Never' when MinimServer is actively streaming, but back to say 20 min when streaming has finished and no music is being played. I have tried all sorts of tactics, interestingly helped by Copilot, but can't reliably tell when MinimServer is active. Has anyone solved this - I see lots of posts about MinimServer preventing sleep, but I have the oposite issue - the PC goes to sleep when I'd rather it stayed awake. How can I detect that MinimServer is active? Any thoughts? Thanks in advance. |
|||
04-10-2025, 20:10
Post: #2
|
|||
|
|||
RE: Stopping Sleep When MinimServer actively streaming
It sounds like Windows is monitoring direct physical interaction with your PC (keyboard/mouse) to detect when it is active. Automatic sleep on macOS also works like this.
Could you run MinimServer on your NAS instead of your PC? What kind of NAS is it? |
|||
04-10-2025, 20:37
Post: #3
|
|||
|
|||
RE: Stopping Sleep When MinimServer actively streaming
Hi
The PC is headless, I have it set up so that it automatically logs on to a user and runs MininServer when it is switched on. The NAS is a UGREEN DXP2800, quite a competent machine but I am going to have to learn docker to get MinimServer on to it. So the challenge is that there is effectively nothing other than MinimServer running on the PC, so Windows thinks it is inactive (because MinimServer is so efficient at serving music to the renderer) and so Windows initiates Sleep thinking there is no activity. |
|||
09-10-2025, 04:22
(This post was last modified: 09-10-2025 04:45 by chaconne.)
Post: #4
|
|||
|
|||
RE: Stopping Sleep When MinimServer actively streaming
If I were going to try this I would look into monitoring outgoing network traffic. For a very crude approach, run
Quote:netstat -e and parse the output. Run it every few minutes and remember the previous value, and you can calculate how many bytes were sent in that interval. This may give you some false positives if the PC is doing other work, but in that case you probably don't want it going to sleep either. You could get more precise by only monitoring the right port numbers and/or protocols, or if you're up to a little C programming you could replace netstat.exe with something more specific, but those would only be marginal improvements. P.S. I just ran a web search on powershell+monitor+network+traffic and found these links Gathering Network Statistics with PowerShell and Network Traffic Monitoring in Windows 11 Using PowerShell Have fun! |
|||
09-10-2025, 08:13
Post: #5
|
|||
|
|||
RE: Stopping Sleep When MinimServer actively streaming
Thanks, I’ll give that a go and report back. I have tried a couple of similar approaches, but it looks like MinimServer is quite ‘bursty’ and only intermittently sends data to the renderer, so it is quite hard to catch.
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)