Page 1 of 2

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

Posted: Tue Nov 15, 2016 10:07 am
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.

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

Posted: Tue Nov 15, 2016 8:20 pm
by Nadahar
This option is only available under Windows. I guess your only option is to change your power management settings when running UMS.

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

Posted: Wed Nov 16, 2016 1:05 am
by sinbad21
That's a pity, is there a technical reason to that ?

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

Posted: Wed Nov 16, 2016 2:30 am
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.

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

Posted: Wed Nov 16, 2016 5:42 am
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.

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

Posted: Tue Dec 06, 2016 8:41 am
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.

[Solved] Prevent OS from sleeping when streaming

Posted: Wed Jan 04, 2017 10:41 am
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?

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

Posted: Wed Jan 04, 2017 11:06 am
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.

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

Posted: Wed Jan 04, 2017 11:26 am
by michaelt
Thanx. You covered all the details I needed. I'll do the second form - I didn't fork.

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

Posted: Thu Jan 05, 2017 11:32 am
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 13767 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 13778 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 13768 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.