Le 16 mars 2011 à 19:00, Laurent Daudelin a écrit :

> On Mar 16, 2011, at 09:35, Matt Gough wrote:
> 
>> On 16 Mar 2011, at 15:32, Kyle Sluder wrote:
>> 
>>> On Wed, Mar 16, 2011 at 5:37 AM, Matt Gough <mgo...@humyo.com> wrote:
>>>> So it seems that something else is preventing idle sleep, but I've no idea 
>>>> how to find the culprit. Is there some defaults setting I can use that 
>>>> will log what the OS wants to do at sleep time and what is blocking it?
>>> 
>>> According to the I/O Kit Power Management Release Notes, `pmset -g`
>>> should list all outstanding power management assertions.
>>> http://developer.apple.com/library/mac/#releasenotes/Darwin/RN-IOKitPowerManagment/_index.html
>>> 
>>> I'd say try that and see if it tells you who's preventing system sleep.
>>> 
>>> --Kyle Sluder
>> 
>> 
>> Thanks to everyone for the suggestions so far.
>> 
>> Alas, pmset -g it doesn't show any active assertions (I know it can do as I 
>> slapped one in my code and it showed up).
>> 
>> I have also tried turning off ttyskeepawake, but to no avail.
>> 
>> I didn't mention in my previous email that I have no problem with display 
>> sleep working correctly, its just idle sleep that is misbehaving.
>> 
>> Looking through the logs, I can't see any power related ones.
>> 
>> Apart from user interactions, what other sorts of activity automatically 
>> prevent idle sleep?
> 
> Many things can prevent sleep. On my MacBook Pro, when I do a clean install 
> and don't run too many applications (Mail, Safari, iChat, Skype), the system 
> will sometimes go to sleep according to my settings in Energy Saver. As soon 
> as I start running additional processes like Growl or DropBox, the system 
> will not go to sleep under any circumstances, even when running on battery. I 
> think the problem is in the system. I did file a bug on this over a year ago. 
> It was declared a duplicate of another and dev support told me it was a known 
> issue. I checked the status a couple of months ago and it was still open. 
> When I checked with them, they told me it was still being work on. That tells 
> me that the engineers just simply gave up on Snow Leopard and are spending 
> almost all their time on Lion. Still, that's a bit upsetting to have a laptop 
> that won't go to sleep because there are a few processes running. What's the 
> purpose of having a sleep feature if you have to quit all running processes?
> 
> And before someone says "you probably have something that keeps the system 
> active", I went through a lot of analysis with developer support, providing 
> them many pmset and console logs and among all processes that were running, 
> there wasn't one keeping the system busy.

Just calling UpdateSystemActivity() once every minute is enough to prevent 
sleeping. no need to keep the system busy nor to install PMNotification visible 
in pmset.
And checking if a running process call this function from time to time it is 
not trivial.

-- Jean-Daniel




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to