Can't see option "Prevent OS from sleeping when streaming"

For help and support with Universal Media Server
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
sinbad21
Posts: 3
Joined: Mon Nov 14, 2016 5:52 am

Can't see option "Prevent OS from sleeping when streaming"

Post by sinbad21 »

Hi,

I use 6.5.1 version of UMS under OS X 10.12.1 (macOS Sierra). In General tab / advanced options there is no "Prevent OS from sleeping when streaming" option displayed. And when I stream a video, the computer sleeps after 10 minutes, because my power management setting is set to 10 minutes.

I also tried to add manually the option in UMS.conf (prevents_sleep_mode = 1), but it doesn't work.

Thanks for your help.
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: Can't see option "Prevent OS from sleeping when streaming"

Post by Nadahar »

This option is only available under Windows. I guess your only option is to change your power management settings when running UMS.
sinbad21
Posts: 3
Joined: Mon Nov 14, 2016 5:52 am

Re: Can't see option "Prevent OS from sleeping when streaming"

Post by sinbad21 »

That's a pity, is there a technical reason to that ?
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: Can't see option "Prevent OS from sleeping when streaming"

Post by Nadahar »

I don't know if you can prevent sleep from Java in OS X or not. There might be a way, but none of the developers use OS X so we generally have little or no knowledge of OS X specific functions. Java is supposed to be OS agnostic, so you have to pull "hacks" to interface with the OS on any platform making such tasks generally harder than it would be from a native application. Apple is generally not very open about anything, and many things are badly documented. The sum of these factors are probably the reason why this is like it is.

There seems there is a way to do this though, but doing something like this from Java is a whole different ball game since you can't call system API functions like

Code: Select all

IOPMAssertionCreateWithName
.

UMS is open source, so anyone can contribute code if they want to: https://github.com/UniversalMediaServer ... rver/pulls

Edit: This question indicates that it can be achieved by calling

Code: Select all

pmset noidle
...but things like this are very difficult to get working without having the OS available for testing.
sinbad21
Posts: 3
Joined: Mon Nov 14, 2016 5:52 am

Re: Can't see option "Prevent OS from sleeping when streaming"

Post by sinbad21 »

Thank you for the answer. For the moment I use Amphetamine, a program that prevents the mac from entering sleep. Apart from this small problem UMS works perfectly well under OS X.
michaelt
Posts: 155
Joined: Tue Feb 03, 2015 11:18 am
Location: lost in the depths of my mind

Re: Can't see option "Prevent OS from sleeping when streaming"

Post by michaelt »

Nadahar wrote:Edit: This question indicates that it can be achieved by calling

Code: Select all

pmset noidle
...but things like this are very difficult to get working without having the OS available for testing.
I am back on a limited basis.
I will try to look into this.
MacPro5,1 - 2.8 GHz, 32 GB, 20TB, OS X 10.11.6,
. . . . and a few others.
Samsung UN55C8000
Home Theater (WIP): OS X based now, dedicated Linux later.
michaelt
Posts: 155
Joined: Tue Feb 03, 2015 11:18 am
Location: lost in the depths of my mind

[Solved] Prevent OS from sleeping when streaming

Post by michaelt »

Good news: found a solution. The "pmset noidle" was not an option.
This solution is not an 'option' nor just when streaming, it's always active. The system is always available not just when accessed. To do otherwise is much more complicated and is rarely needed.
Caveat: portables must leave display open, otherwise it will 'force sleep' (heat issue) overriding this.

Bad news: I don't know how to submit the change!!
I am in NetBeans and got as far as the "Commit".
What's next?
Got a pointer to a "HowTo"?
Anybody anything?
MacPro5,1 - 2.8 GHz, 32 GB, 20TB, OS X 10.11.6,
. . . . and a few others.
Samsung UN55C8000
Home Theater (WIP): OS X based now, dedicated Linux later.
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: Can't see option "Prevent OS from sleeping when streaming"

Post by Nadahar »

I'm not sure what you have and haven't done. First you need to "fork" UMS on GitHub. Then you need to check out your fork with git, make your changes and commit and then use git push to update your fork on GitHub. Once that's done, you can click "Create pull request" on the GitHub page of your fork, and a new pull request will be created on UMS' GitHub page.

If you have already checked out "master" directly from the UMS repo (without creating a fork) and committed your changes locally and don't want to do it again, you can still create a fork on GitHub but don't check it out. Instead, update your git remote address to point to your fork and push the changes there. Then create the PR...

There is so many details to cover here that I can't simply start explaining them all. If there's a step/some details you can't figure out, please describe the situation and I'll try to help.
michaelt
Posts: 155
Joined: Tue Feb 03, 2015 11:18 am
Location: lost in the depths of my mind

Re: Can't see option "Prevent OS from sleeping when streaming"

Post by michaelt »

Thanx. You covered all the details I needed. I'll do the second form - I didn't fork.
MacPro5,1 - 2.8 GHz, 32 GB, 20TB, OS X 10.11.6,
. . . . and a few others.
Samsung UN55C8000
Home Theater (WIP): OS X based now, dedicated Linux later.
michaelt
Posts: 155
Joined: Tue Feb 03, 2015 11:18 am
Location: lost in the depths of my mind

Re: Can't see option "Prevent OS from sleeping when streaming"

Post by michaelt »

Disregard last transmission!

I could not get through the second form of instructions from where I was.

Since my changes are small, I decided to delete and start over clean, the 'preferred' way.
Much better.
Nadahar wrote:... First you need to "fork" UMS on GitHub.
Done.
Then you need to check out your fork with git
Here I took the NB way: Menu > Team > Git > Clone… and Step through all three screens.
Screen Shot 2017-01-06 at 12.27.41 PM.png
Screen Shot 2017-01-06 at 12.27.41 PM.png (61.29 KiB) Viewed 13606 times
, make your changes
Done.
and "commit"
Done.
Screen Shot 2017-01-05 at 7.21.02 PM.png
Screen Shot 2017-01-05 at 7.21.02 PM.png (68.23 KiB) Viewed 13617 times
and then use git "push to upstream" to update the fork on GitHub.
Done.
Screen Shot 2017-01-06 at 12.06.29 PM.png
Screen Shot 2017-01-06 at 12.06.29 PM.png (94.57 KiB) Viewed 13607 times
Once that's done, you can click "Create pull request" on the GitHub page of your fork, and a new pull request will be created on UMS' GitHub page. Then create the PR...
Done.

I'll update as I go.
Q: in the first step, why the fork and not a branch?

Thanx for hanging in there with me.
Last edited by michaelt on Sat Jan 07, 2017 7:45 am, edited 6 times in total.
MacPro5,1 - 2.8 GHz, 32 GB, 20TB, OS X 10.11.6,
. . . . and a few others.
Samsung UN55C8000
Home Theater (WIP): OS X based now, dedicated Linux later.
Post Reply