Sleep
#1
Ive searched the forums but can't seem to find much on this topic.
I have XBMC installed on a Mac Mini. I also have some other services running on the mini, such as AirVideo, iTunes share, etc. The problem I'm having is that while XBMC is running, the system never goes to sleep (from the system power saving settings). The system will go to sleep if I use the suspend setting inside XBMC itself, but then will not wake properly for previously mentioned services, and/or suspends despite other services being used.

Why doesnt XBMC simply respect the system power saving settings, instead of inventing its own (inferior) version?
Is there anyway to fix this, other than having to shut XBMC down every time I want the system to be able to sleep?

Thanks!
Reply
#2
rubaj,

I have been using Eden RC1 and on my iMac it and it does go to sleep at the time set in Energy Saver when XBMC is running. I am running OS X 10.7.3. I was having an issue for a while where my Wi-Fi was preventing my iMac from going to sleep. Apple resolved that issue with the recent Wi-Fi update that came out a few days ago.

If it were me, I would try to ioslate the problem by starting without having the extras running at the same time XBMC is running. Add each extra back in and see when the Mac-Mini won't go to sleep. You might also try resetting PRAM and SMC. I hope this helps.
Kodi 17, Transparency Skin
PogoPlug v4 running Arm Linux 4.4.63 as MySQL (mariadb) server.
Mac OS 10.12.5
2015 27" iMac 3.3 GHz Quad, 16GB RAM, 1TB SSD
2015 13" Macbook Pro, 8GB RAM, 256GB SSD
AppleTV 4 TV OS 10
Reply
#3
Hi winestock
Thanks for the reply.

I'm very surprised to hear that sleep works for you with XBMC; I was under the impression that it didn't work for anyone. Good to know!

That being said, I have done extensive testing of the various possible causes for what is preventing sleep, and it very clearly is XBMC. I have completely uninstalled and reinstalled, and tried it in different user accounts. Perhaps it is something special about my setup that is causing the issue.

I'd love to hear from other people and see how many have sleep issues (with XBMC) and how many don't.

Thanks
Reply
#4
I can confirm this. It puts an assertion into the sleep timer to prevent it from sleeping (PMSET -G ASSERTIONS) will show it, and also show it disappear when you exit XBMC.

The way this should work is that XBMC would just remove it's assertion from the sleep timer when the timer count is reached instead of forcing sleep. When it does this, the only way to 'wake' it is to hit the power button on the Mac.

These assertions from what I understand allow any app to insert a 'dont sleep' flag. When all flags are gone, the mac will sleep. A simple yet elegant solution to allow apps to keep a Mac awake. Unfortunately XBMC seems to issue a forced hibernate regardless of any existing assertions. This affects any streaming from iTunes for instance where the Mac just falls asleep mid stream.
Reply
#5
If XBMC is fullscreen, then it 'own' sleep, when windowed, it kicks ownership back to OSX. That is by design.
Reply
#6
Any chance of just modifying it to use the OS Idle timer and OS sleep assertions? It limits the functionality of the PC running XBMC if the PC is just put to sleep regardless of other apps on the box.

I posted more information in my own thread in case it was unrelated to this one.

http://forum.xbmc.org/showthread.php?tid=139738

Kind of an odd decision to rely on fullscreen/windows to change this behavior but there may be considerations I'm not aware of. OS X has a very good mechanism for sleep and preventing it already, and this seems a little 'clunky' for lack of a better word. I have other apps on my HTPC that also run in the background which are interrupted by this forced sleep mode from XBMC. If I disable the sleep in XBMC then the Mac won't sleep at all.

Hoping you guys can work some magic to just remove the assertion once the XBMC timer runs out, and allow the OS X idle timer to start counting down instead so that other apps on the OS are not affected by this.

Thanks!
Reply
#7
Not really an odd choice, if you are running XBMC, odds are you want that in control.
Reply
#8
Yes but it ignores any other apps on the PC and forces it to sleep. It's not very friendly in that respect. You can either disable the sleep timer and your Mac will never sleep, which isn't a good option, or turn it on and hope that you have nothing running on your PC that the sleep will interrupt. Running in windowed mode on a media center mac hooked up to an HDTV isn't an option.

What I'm suggesting is that you just remove the assertion that prevents sleep when the XBMC sleep timer runs out, and allow the OS to take control then. That way it's OS friendly, observes the OS settings as well as the XBMC settings, and gives more choice to the end user. As it is right now, even copying a batch of large files to the PC while the timer runs out will put it to sleep mid copy. It's just not a good way to handle sleep as it works against the OS in general and assumes no other processes running on the PC (streaming, file copies, backups, etc).

Using the above suggested fix, if someone wants immediate sleep after XBMC is 'idle', they could always set the OS idle timer to 1 minute. As it is now, there is no flexibility. You either have a mac that's on 24x7 (never sleeps), or a Mac who's running apps and processes are ignored when IBMC's idle timer runs out. I suggested the maximized/windowed choice was odd since I would imagine that most folks use XBMC full screen for media centers, not as a general media player in windowed mode.

Hopefully that makes sense?
Reply
#9
Let me re-phrase, if XBMC is in FullScreen and in front, XBMC rules.

Reply
#10
Where can I submit a 'feature' request then? As it is, especially with new BD rips, everything is failing since it falls asleep while streaming from other apps, before backups finish, during file copies, etc.

Edit: Nevermind. Found the forum. Hopefully that is the correct place.
Reply
#11
Aehhhh ... see any other apps? For example some encoder tools (maybe even handbreak). They got an option like "Poweroff system after done" or so. It does so without paying attention to other processes aswell.

If we don't suspend it that way - the next user will tell us "since the last change in the sleep timer my mac doesn't suspend anymore because other apps prevent it - i don't want this behaviour i want XBMC to rule the world an suspend even if other apps don't want to".

You can spin it like you want. We will not find a solution everyone will be happy with (and we didn't find for other things too). Thats when we stop flipping the switch back and forth.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#12
This doesn't have to be an either/or situation. A simple switch to force sleep or not and you could even leave the default as-is. It sounds like the code already does what I'm requesting in windowed mode so that piece is done. A simple switch in full screen to force sleep or not.

Thanks.
Reply
#13
(2012-09-05, 01:16)davilla Wrote: Let me re-phrase, if XBMC is in FullScreen and in front, XBMC rules.

That's understood.
What is needed is XBMC to "rule" more democratically and instead of commanding:" EVERYBODY GO TO SLEEP" .. just to say: "OK I'M DONE HERE.. IF EVERYBODY ELSE IS DONE AS WELL THEN... WE CAN GO TO SLEEP"




(2012-09-05, 13:35)Memphiz Wrote: Aehhhh ... see any other apps? For example some encoder tools (maybe even handbreak). They got an option like "Poweroff system after done" or so. It does so without paying attention to other processes aswell.

If we don't suspend it that way - the next user will tell us "since the last change in the sleep timer my mac doesn't suspend anymore because other apps prevent it - i don't want this behaviour i want XBMC to rule the world an suspend even if other apps don't want to".

You can spin it like you want. We will not find a solution everyone will be happy with (and we didn't find for other things too). Thats when we stop flipping the switch back and forth.

who wants his machine suspense in the middle of something?? Other programs do that but usually it's more of a.. you'll be the last app standing while I go to bed or to dinner, so remember to shut down when done. But Xbmc usually his not the only thing running. for instance I'll never set up my torrent client to shut down when done.. 'cause I might be watching a movie on xbmc as well as I'll never set up xbmc to stop the machine... I might be downloading something... but if neither of the programs is doing anything the machine will rightfully go to sleep.

So... noboby could complain because if you have only xbmc running, when the flag's off... another X min and you have sleep.
..if you have servers or downloaders or anything with a flag up... no sleep.

I think this is the right way to go... if people think F1 cars should run on 3 wheels.. guess what.. F1 cars have 4. that's the best setup, period.
Image Image
Did I Help? Add to my reputation
Reply
#14
That was what I was requesting. Putting XBMC on your computer essentially makes it useless for any other purpose as it will sleep no matter what it's doing, or if you disable sleep options in XMBC, it will never sleep. Wonky.

You would think that if you disable sleep it would leave it to the OS to decide, but it doesn't. It leaves an assertion in the system that prevents sleep. If you turn the sleep on it sleeps after the timer runs out regardless of whats happening including backups, file copies, etc.

For some reason they will allow the OS to control things, but only if you run XBMC in Windowed Mode, but for the life of me I have no idea why anyone would ever run it in Windowed Mode on an HTPC.
Reply
#15
agreed.

that would be a very nice feature.

..i'd say at least put an option like "fullscreen standby" >> "flag mode" or "absolute control".
Image Image
Did I Help? Add to my reputation
Reply

Logout Mark Read Team Forum Stats Members Help
Sleep0