Blender Prevents OSX Mavericks From Sleeping #38702

Closed
opened 2014-02-18 15:12:23 +01:00 by Atomic · 25 comments

System Information
OSX 10.9
Intel HD4000

Blender Version
Broken: (example: 2.69.10 who can remember a hash, revision numbers were more human friendly)
Worked: (optional)

Short description of error
I am new to OSX but when I have Blender open OSX can never go to sleep or enter power management mode.

Exact steps for others to reproduce the error
Open Blender on OSX 10.9 or better.
Hide Blender so it is no longer visible on the screen.
Walk away and get coffee and talk to people at the water cooler.
Go to sleep or wait and come back to the computer and you will find that the OSX machine has never entered sleep or screen saver mode. NOTE: Blender is not rendering, it is just sitting there idle.

I notice Adobe products do not have this problem and the system works fine with them.

**System Information** OSX 10.9 Intel HD4000 **Blender Version** Broken: (example: 2.69.10 who can remember a hash, revision numbers were more human friendly) Worked: (optional) **Short description of error** I am new to OSX but when I have Blender open OSX can never go to sleep or enter power management mode. **Exact steps for others to reproduce the error** Open Blender on OSX 10.9 or better. Hide Blender so it is no longer visible on the screen. Walk away and get coffee and talk to people at the water cooler. Go to sleep or wait and come back to the computer and you will find that the OSX machine has never entered sleep or screen saver mode. NOTE: Blender is not rendering, it is just sitting there idle. I notice Adobe products do not have this problem and the system works fine with them.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @AtomP

Added subscriber: @AtomP

#65167 was marked as duplicate of this issue

#65167 was marked as duplicate of this issue

#39813 was marked as duplicate of this issue

#39813 was marked as duplicate of this issue
jens verwiebe was assigned by Dalai Felinto 2014-02-18 16:06:33 +01:00

Added subscriber: @dfelinto

Added subscriber: @dfelinto

Added subscriber: @brecht

Added subscriber: @brecht

I can't redo the problem here on a MacBook Pro with NVidia 650M GT and OS X 10.9.1. I tried the Blender 2.69 release and the latest development version.

Does this happen with the default cube, just start Blender and it doesn't go to sleep, or only particular .blend files? Do you have any addons enabled that are causing this?

I can't redo the problem here on a MacBook Pro with NVidia 650M GT and OS X 10.9.1. I tried the Blender 2.69 release and the latest development version. Does this happen with the default cube, just start Blender and it doesn't go to sleep, or only particular .blend files? Do you have any addons enabled that are causing this?

I tried with Blender open, minimized and hidden, but the machine always goes to sleep here.

I tried with Blender open, minimized and hidden, but the machine always goes to sleep here.

Added subscriber: @bart-7

Added subscriber: @bart-7

Use the following command to see which processes are keeping OS X going to sleep:

pmset -g assertions

I can actually confirm that after Blender fires up, the coreaudiod process becomes active and prevents entering sleep.

Here's the output without Blender running:

 maczilla:~ bart$ pmset -g assertions

20-02-14 11:53:09 CET

 Assertion status system-wide:
 BackgroundTask                 0
 PreventDiskIdle                0
 ApplePushServiceTask           0
 UserIsActive                   0
 PreventUserIdleDisplaySleep    0
 InteractivePushServiceTask     0
 PreventSystemSleep             0
 ExternalMedia                  0
 PreventUserIdleSystemSleep     0
 NetworkClientActive            0
 Kernel Assertions: 0x104=USB,MAGICWAKE
 id=500  level=255 0x4=USB mod=29-01-14 17:39 description=EHC1 owner=AppleUSBEHCI
 id=501  level=255 0x4=USB mod=20-02-14 10:58 description=EHC2 owner=AppleUSBEHCI
 id=502  level=255 0x100=MAGICWAKE mod=14-02-14 07:56 description=en0 owner=en0

After starting Blender, I see:

 maczilla:~ bart$ pmset -g assertions

20-02-14 11:54:15 CET

 Assertion status system-wide:
 BackgroundTask                 0
 PreventDiskIdle                0
 ApplePushServiceTask           0
 UserIsActive                   0
 PreventUserIdleDisplaySleep    0
 InteractivePushServiceTask     0
 PreventSystemSleep             0
 ExternalMedia                  0
 PreventUserIdleSystemSleep     1
 NetworkClientActive            0
 Listed by owning process:
 pid 148(coreaudiod): [0x0000000100001e8b] 00:00:04 NoIdleSleepAssertion named: "com.apple.audio.'AppleHDAEngineOutput:1B,0,1,2:0'.noidlesleep"
 Kernel Assertions: 0x104=USB,MAGICWAKE
 id=500  level=255 0x4=USB mod=29-01-14 17:39 description=EHC1 owner=AppleUSBEHCI
 id=501  level=255 0x4=USB mod=20-02-14 10:58 description=EHC2 owner=AppleUSBEHCI
 id=502  level=255 0x100=MAGICWAKE mod=14-02-14 07:56 description=en0 owner=en0
Use the following command to see which processes are keeping OS X going to sleep: `pmset -g assertions` I can actually confirm that after Blender fires up, the coreaudiod process becomes active and prevents entering sleep. Here's the output without Blender running: ``` maczilla:~ bart$ pmset -g assertions ``` 20-02-14 11:53:09 CET ``` Assertion status system-wide: BackgroundTask 0 PreventDiskIdle 0 ApplePushServiceTask 0 UserIsActive 0 PreventUserIdleDisplaySleep 0 InteractivePushServiceTask 0 PreventSystemSleep 0 ExternalMedia 0 PreventUserIdleSystemSleep 0 NetworkClientActive 0 Kernel Assertions: 0x104=USB,MAGICWAKE id=500 level=255 0x4=USB mod=29-01-14 17:39 description=EHC1 owner=AppleUSBEHCI id=501 level=255 0x4=USB mod=20-02-14 10:58 description=EHC2 owner=AppleUSBEHCI id=502 level=255 0x100=MAGICWAKE mod=14-02-14 07:56 description=en0 owner=en0 ``` After starting Blender, I see: ``` maczilla:~ bart$ pmset -g assertions ``` 20-02-14 11:54:15 CET ``` Assertion status system-wide: BackgroundTask 0 PreventDiskIdle 0 ApplePushServiceTask 0 UserIsActive 0 PreventUserIdleDisplaySleep 0 InteractivePushServiceTask 0 PreventSystemSleep 0 ExternalMedia 0 PreventUserIdleSystemSleep 1 NetworkClientActive 0 Listed by owning process: pid 148(coreaudiod): [0x0000000100001e8b] 00:00:04 NoIdleSleepAssertion named: "com.apple.audio.'AppleHDAEngineOutput:1B,0,1,2:0'.noidlesleep" Kernel Assertions: 0x104=USB,MAGICWAKE id=500 level=255 0x4=USB mod=29-01-14 17:39 description=EHC1 owner=AppleUSBEHCI id=501 level=255 0x4=USB mod=20-02-14 10:58 description=EHC2 owner=AppleUSBEHCI id=502 level=255 0x100=MAGICWAKE mod=14-02-14 07:56 description=en0 owner=en0

Some system info: OS X 10.9.1, ATI Radeon HD 5750 1024 MB video card. Tested using 2.69 Release version with the default cube scene.

Some system info: OS X 10.9.1, ATI Radeon HD 5750 1024 MB video card. Tested using 2.69 Release version with the default cube scene.

Added subscriber: @beetlegiest

Added subscriber: @beetlegiest

Mine sleeps with blender open, minimized, etc OS X 10.9.1, AMD Radeon HD 6770M 1024 MB. Tested with release and master trunk. Can't make it not sleep as a matter of fact.

Mine sleeps with blender open, minimized, etc OS X 10.9.1, AMD Radeon HD 6770M 1024 MB. Tested with release and master trunk. Can't make it not sleep as a matter of fact.
Member

Hi
It is pretty clear that coreaudio prevents sleep here:

PreventUserIdleSystemSleep     1
NetworkClientActive            0
Listed by owning process:
pid 195(coreaudiod): [0x0000000100001e8b] 00:00:04 NoIdleSleepAssertion named: "com.apple.audio.'AppleHDAEngineOutput:1B,0,1,2:0'.noidlesleep"
jens-macpro:~ jensverwiebe$ ps u -p 195
USER          PID  %CPU %MEM      VSZ    RSS   TT  STAT STARTED      TIME COMMAND
_coreaudiod   195   1,2  0,1  2566812   9528   ??  Ss   11:24am   0:29.80 /usr/sbin/coreaudiod

So i tested preferences audio and found openAL and SDL cause this, but not Jack ( and "drumroll": None )

So a workaround is to set audio to None or Jack atm. .

I will try to find out whats the background of this.

Jens

Hi It is pretty clear that coreaudio prevents sleep here: ``` PreventUserIdleSystemSleep 1 NetworkClientActive 0 Listed by owning process: pid 195(coreaudiod): [0x0000000100001e8b] 00:00:04 NoIdleSleepAssertion named: "com.apple.audio.'AppleHDAEngineOutput:1B,0,1,2:0'.noidlesleep" ``` ``` jens-macpro:~ jensverwiebe$ ps u -p 195 USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND _coreaudiod 195 1,2 0,1 2566812 9528 ?? Ss 11:24am 0:29.80 /usr/sbin/coreaudiod ``` So i tested preferences audio and found openAL and SDL cause this, but not Jack ( and "drumroll": None ) **So a workaround is to set audio to None or Jack atm. .** I will try to find out whats the background of this. Jens
Member

K, found this from stackoverflow, should be implemented in audaspace i guess:

To participate in power management decisions, you'll need to add your device driver to the power management plane, typically in your overridden IOService::start(provider) method:

PMinit();
provider->joinPMtree(this);
registerPowerDriver(this, powerStates, numPowerStates);
where powerStates and numPowerStates specifies an array of power states you want your device to be able to be in. You'll probably not want more than 2 for a virtual device, and maybe you even only need one. I suspect a superclass of your class is setting states that are inhibiting sleep. Once you've registered for power management, your driver will be expected to handle the power management methods such as IOService::setPowerState().

Wiil take a deeper look hopefully before 2.7 release.

Will add Nexyon as he's the module owner.

Jens

K, found this from stackoverflow, should be implemented in audaspace i guess: ``` To participate in power management decisions, you'll need to add your device driver to the power management plane, typically in your overridden IOService::start(provider) method: PMinit(); provider->joinPMtree(this); registerPowerDriver(this, powerStates, numPowerStates); where powerStates and numPowerStates specifies an array of power states you want your device to be able to be in. You'll probably not want more than 2 for a virtual device, and maybe you even only need one. I suspect a superclass of your class is setting states that are inhibiting sleep. Once you've registered for power management, your driver will be expected to handle the power management methods such as IOService::setPowerState(). ``` Wiil take a deeper look hopefully before 2.7 release. Will add Nexyon as he's the module owner. Jens
Member

Added Jörg ( not Peter, sorry ) as he needs to attend this for his audaspace library too.

Jens

Here's a suggestion:

#import <IOKit/pwr_mgt/IOPMLib.h>


kIOPMAssertionTypeNoDisplaySleep prevents display sleep, kIOPMAssertionTypeNoIdleSleep prevents idle sleep


reasonForActivity is a descriptive string used by the system whenever it needs to tell the user why the system is not sleeping. For example,
"Mail Compacting Mailboxes" would be a useful string. NOTE: IOPMAssertionCreateWithName limits the string to 128 characters.

CFStringRef* reasonForActivity= CFSTR("Describe Activity Type");

IOPMAssertionID assertionID;
IOReturn success = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, 
                                    kIOPMAssertionLevelOn, reasonForActivity, &assertionID); 
if (success == kIOReturnSuccess)
{

  *Add the work you need to do without*  the system sleeping here.

    success = IOPMAssertionRelease(assertionID);
    //The system will be able to sleep again. 
}

Sources:

Added Jörg ( not Peter, sorry ) as he needs to attend this for his audaspace library too. Jens Here's a suggestion: #import <IOKit/pwr_mgt/IOPMLib.h> ``` ``` *kIOPMAssertionTypeNoDisplaySleep prevents display sleep,* kIOPMAssertionTypeNoIdleSleep prevents idle sleep ``` ``` *reasonForActivity is a descriptive string used by the system whenever it needs* to tell the user why the system is not sleeping. For example, *"Mail Compacting Mailboxes" would be a useful string.* NOTE: IOPMAssertionCreateWithName limits the string to 128 characters. ``` CFStringRef* reasonForActivity= CFSTR("Describe Activity Type"); IOPMAssertionID assertionID; IOReturn success = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, reasonForActivity, &assertionID); if (success == kIOReturnSuccess) { ``` *Add the work you need to do without* the system sleeping here. ``` success = IOPMAssertionRelease(assertionID); //The system will be able to sleep again. } ``` Sources: - https://developer.apple.com/library/mac/qa/qa1340/_index.html - http://stackoverflow.com/questions/10071780/handle-idle-sleep-from-audio-virtual-driver-mac-osx - http://stackoverflow.com/questions/8460033/what-is-the-correct-way-to-prevent-sleep-on-os-x

Added subscribers: @neXyon, @ThomasDinges

Added subscribers: @neXyon, @ThomasDinges

I'm not sure if adding such calls would solve the problem, it seems to be for preventing the OS from sleeping but we need to do the opposite. I think that it is the OpenAL or SDL libraries holding things up and that a fix can only be done there. But these are libraries typically used for games which will keep the OS awake anyway.

Maybe the solution is to lazily initialize the audio system and shut it down after it is not used for some time? Maybe that's too slow for starting playback, I don't know.

I'm not sure if adding such calls would solve the problem, it seems to be for preventing the OS from sleeping but we need to do the opposite. I think that it is the OpenAL or SDL libraries holding things up and that a fix can only be done there. But these are libraries typically used for games which will keep the OS awake anyway. Maybe the solution is to lazily initialize the audio system and shut it down after it is not used for some time? Maybe that's too slow for starting playback, I don't know.

Added subscriber: @mont29

Added subscriber: @mont29

Added subscriber: @RustyWright

Added subscriber: @RustyWright

◀ Merged tasks: #39813.

◀ Merged tasks: #39813.

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

Added subscriber: @Sergey

Added subscriber: @Sergey

For sure we can try working this around, but i'm not sure why those libraries will ever affect on sleep on OSX, it doesn't happen on other systems..

Workaround would be to use None system backend as well.

Thanks for the report, but since the issue is actually in a library we don't maintain moving to a TODO http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Install-OS#Mac_OS_X

For sure we can try working this around, but i'm not sure why those libraries will ever affect on sleep on OSX, it doesn't happen on other systems.. Workaround would be to use None system backend as well. Thanks for the report, but since the issue is actually in a library we don't maintain moving to a TODO http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Install-OS#Mac_OS_X
Member

Added subscribers: @RedpaX, @jenkm

Added subscribers: @RedpaX, @jenkm
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
11 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#38702
No description provided.