Spotify prevents Mac from going to sleep

Hi,

 

running the Spotify client prevents my Mac from going to sleep, even when no song is being played.

By typing "pmset -g assertions" into the terminal window, you'll get a list of diagnostic information regarding power save mode. As long as Spotify is running, it contains the the line

  PreventUserIdleSystemSleep named: "com.apple.audio.'AppleHDAEngineOutput:1B,0,1,2:0'.noidlesleep" 

 

This would be the expected behavior when a song is being played but seems to be a bug otherwise.

 

A fix would be nice!

 

Thanks,

 

Norb

Child Item
Child Item
Child Item

Accepted answers

Yeah, it's a bummer.  I now use hotcorners and have the ScreenSaver app in my dock just so I can activate it manually.  But then there are times I fall asleep on my couch and wake up to my TV on and spotify open and think "Yep, can't wait until that's burned-in forever"

All comments

Please look at this!

After much time wondering why my Mac wouldn't sleep, I finally figured out the same: the Mac Spotify client prevents sleep.

 

I agree. A fix would be nice here. Preventing sleep wastes a lot of energy.

I tried logging this issue as a bug.

 

Here is the correspondence:

 

Me

======================================================

Spotify prevents mac from sleeping.


For more information see:

https://getsatisfaction.com/spotify/topics/spotify_prevents_my_mac_from_sleeping

http://community.spotify.com/t5/Desktop-Mac/Spotify-prevents-Mac-from-going-to-sleep/m-p/61923/highlight/true#M2671

http://community.spotify.com/t5/Spotify-Ideas/Allow-OS-X-Lion-to-sleep-when-Spotify-is-open/idi-p/81335

======================================================

 

 


 

Spotify

======================================================

Thanks for contacting Spotify. I'm sorry to hear you have been experiencing issues.

Lets get this fixed for you.

It's a simple procedure, but often effective. Have you performed a clean reinstallation following these instructions.

1. Quit Spotify
2. In the finder, locate and delete the following folders:
~/Library/Caches/com.spotify.Client
~/Library/Application Support/Spotify
3. Locate and delete the Spotify app (from the application folder)
4. Empty trash, then restart
5. Download and install Spotify latest version: https://www.spotify.com/download/

OSX LION users:
Apple have masked the user "Library" folder to prevent accidental deletion. You can access it by choosing 'Go', from the top menu in the Finder. Hold down 'alt' key, and the library should appear as a folder you can now open.

What operating system are you running on your Mac? 
What version of Spotify are you running on your device?

Are you running any third party Spotify software, like a remote program?

Does the issue occur when you have music playing via Spotify, or just when the program open?

Do you have SIMBL running?

SIMBL can be hidden from view sometimes, so to be sure, can you perform this task for me please:

1. Delete the entire folders from the following locations:
- Macintosh HD/Library/Application Support/SIMBL
&
- [USER FOLDER]/Library/Application Support/SIMBL
2. Uninstall Spotify
3. Restart your computer
4. Install Spotify
*please take care to ensure the removal of the following as well as some users have reported issue continuing until removal of these
/Applications/SpotRemote Server.app
/Library/ApplicationSupport/SIMBL/Plugins/SpotifyRemotePlugin.bundle
To access hidden files please type the following in Terminal:
defaults write com.apple.Finder AppleShowAllFiles YES
to hide them again please type:
defaults write com.apple.Finder AppleShowAllFiles NO

OR

sudo rm -rf "/Library/Application
Support/SIMBL/Plugins/SpotifyRemotePlugin.bundle"
/private/var/db/receipts/com.axelmoller.spotremote.*
/private/var/db/receipts/com.rootateverything.spotifyremote.spotRemot*
Kind regards 

Louis Napoletani 

Spotify Customer Service - Cambridge
======================================================

Me
======================================================
Thank you. I can confirm I don't have spotify remote software or SIMBL installed or running. I am using OS X Lion (10.7.4).Spotify version is 0.8.3.222. 
I do not want to uninstall Spotify because I have something like 1700 songs cached in offline playlists that I believe are deleted as part of your removal process.
Before I'm forced into re-downloading these playlists, can you please confirm you are offering this advice because you cannot reproduce the issue yourself?
The first link I included when originally logging the bug gives good instructions doing this:
1. Open Terminal and type "pmset -g assertionslog". This will display info about any processes that are preventing your Mac from sleeping. You should see something like this: 

Logging all assertion changes. 
9/27/11 12:41:43 PM EDT 
Assertion status system-wide: 
ChargeInhibit 0 
PreventUserIdleDisplaySleep 0 
PreventUserIdleSystemSleep 0 
NoRealPowerSources_debug 0 
CPUBoundAssertion 0 
EnableIdleSleep 1 
PreventSystemSleep 0 
DisableInflow 0 
DisableLowPowerBatteryWarnings 0 
ExternalMedia 0 

Kernel Assertions: None 

2. Launch Spotify. 
3. Start playing a song. 
4. Go back to the Terminal window in step 1. You will see something like this: 

9/27/11 12:42:57 PM EDT 
Assertion status system-wide: 
ChargeInhibit 0 
PreventUserIdleDisplaySleep 0 
PreventUserIdleSystemSleep 1 
NoRealPowerSources_debug 0 
CPUBoundAssertion 0 
EnableIdleSleep 1 
PreventSystemSleep 0 
DisableInflow 0 
DisableLowPowerBatteryWarnings 0 
ExternalMedia 0 

Listed by owning process: 
pid 117: [0x0000012c00000075] PreventUserIdleSystemSleep named: "com.apple.audio.'AppleHDAEngineOutput:8,0,1,1:0'.noidlesleep" 

5. Stop the song. Note that coreaudio is still preventing idle sleep. 
6. Quit Spotify. 
7. Go back to the Terminal window in step 1. You will see something like this: 

9/27/11 12:44:05 PM EDT 
Assertion status system-wide: 
ChargeInhibit 0 
PreventUserIdleDisplaySleep 0 
PreventUserIdleSystemSleep 0 
NoRealPowerSources_debug 0 
CPUBoundAssertion 0 
EnableIdleSleep 1 
PreventSystemSleep 0 
DisableInflow 0 
DisableLowPowerBatteryWarnings 0 
ExternalMedia 0 

Kernel Assertions: None 

8. Your Mac will now sleep. 

My guess is Spotify wants to prevent the Mac from sleeping while it's playing music, but it continues to do so even when the music has stopped.

I eagerly await the results of your own tests. I can see with other media playing apps that pausing/stopping sets PreventUserIdleSystemSleep back to 0, so I really think it's an issue with Spotify.
======================================================

 

 

 

 

 

Spotify

======================================================

I have tested this here and also tested it with different preferences turned on and off to see if it's any of those causing this issue.

We have looked into this and have submitted it to our senior team to look in to as well.

Please bare with us while we figure this out.

Thank you very much for bringing this to our attention.

Kind regards
Oliver 

======================================================

 

 

 

 

That is the last email I got,9 days ago. Fingers crossed it'll at least get recognised soon!

Thanks snooty!

Any news? I'm having the same problem with my iMac. Since I have a fast internet connection I have no problem doing a full delete and then re-downloading the tracks but it didn't solve the problem unfortunately. If I run pmset I still see Spotify preventing sleep.

not heard anything back.

 

is there any chance a forum moderator could give this some attention?

 

is there a proper bug tracking system for spoitfy?

I have investigated a little bit further. If there is no track in the queue, Spotify will not prevent sleep. Please fix this as soon as possible.

 

It is amazing that a bug like this can still exist. Do you realise that Spotify is creating a lot of pollution by not letting computers sleep?

Because of this, I have successfully let my spotify premium expire along with my credit card. Well done Spotify.

will this ever get looked at?

Bug hasn't been fixed yet... 😞

hello????????????????

Forgot to update you guys. This bug will not be fixed.That was the answer I got from Spotify. They acknowledge the bug, saying that it only affects certain iMacs. They say "it's too hard to fix". Great pride in their development skills... Researching the issue I've found that it affects some other sound applications as well so it's definitely an Apple thing. The question is if it could be solved by Apple rather than Spotify.

It doesn't affect only certain iMacs. I use Spotify on a Mac Pro and have the same problem. They should get a Mac audio development expert... 😞

Oh my god. Sorry, but it isn't a hard feature to implement, i.e. i really doubt Apple have made developers jump through hoops to do this. I *can* believe that because of some crazy practices that spotify employs it makes it difficult within their existing framework, but that's their fault, but it's by no means Apple's. it does not affect iMacs only, i have a macbook air.

this is not something other media player developers have struggled with.

If you genuinely think that it is Apple's fault then I urge you to raise it and discuss this with them. I'm sure as a fairly big player you can get more direct access. I'm a developer at a company which is a Microsoft partner and we've had Microsoft look at issues in the past.

I totally agree snooty. It feels very unprofessional on their end. You should notify them though that this isn't only an issue on iMacs. One thing though. They hinted that it's due to the fact that the client is polling the server when paused and that this is something they won't change.

Interesting hint. I don't want to overplay the "I'm a developer thing" as I have literally no mac development experience, nor have i worked on a media player.  But that the application is polling the server when paused doesn't seem like a valid reason to prevent idle sleep to me. All sorts of applications poll servers all the time - e.g. mail clients, the operating system itself as it checks for updates, etc. etc. Perhaps it's a case of chinese whispers and there's more to it than that, but right now it sounds like a poor excuse.

 

I may see if there's any open developer documentation of preventing idle sleep on mac os x....

I agree that it shouldn't but it just might... Could be due to the P2P part of Spotify. They want everyone's computer to stay awake so that they save on bandwidth.

 

If you'll work a bit on the problem maybe you could contact the developers of Boom. They're a much smaller company that seems to be on their toes that seems to have the same problem though: http://globaldelight.com/globaldelightforum/discussion/130/boom-1-3-preventing-mac-sleep/p1 

The getsatisfaction link earlier had a comment suggesting creating an AppleScript to quit Spotify after some time of not playing. I have modified that script, and you can find it below.

 

  • Open AppleScript.
  • Copy in the script below to a new script file.
  • Compile it and Export it as an Application (Be sure to select "Stay open after run").
  • Launch the application you just created, and you're good to go. You can even set it up to launch on login (It's an option in the dock menu).
  • You can adjust the "1800" seconds (30 minutes of Spotify being paused) and "600" seconds (10 minutes to start playing Spotify before it quits) values to meet your needs.


on idle 
tell application "System Events" 
if not (exists (some process whose name is "Spotify")) then 
return -- Spotify not running 
end if 
end tell 

tell application "Spotify" 
if player state is playing then 
delay 1800 -- 30 mins 
else 
delay 600 -- 10 min buffer to start playing 
if player state is not playing then 
quit 
end if 
end if 
end tell 
end idle

This is still an issue.  I just bought a mac mini, since I use it for my TV I'm concerned about scren burn-in.

 

Spotify is absolutely the issue.  Before launching spotify I see: 

 

$ pmset -g assertions
12/21/12 8:59:19 PM PST  
Assertion status system-wide:
   PreventUserIdleDisplaySleep    0
   PreventSystemSleep             1
   PreventUserIdleSystemSleep     1
   ExternalMedia                  0
   UserIsActive                   0
   ApplePushServiceTask           0
   BackgroundTask                 0

 

Watching the assertions log, when I launch spotify and click play I see:

 

12/21/12 8:59:36 PM PST  
Assertion status system-wide:
   PreventUserIdleDisplaySleep    1
   CPUBoundAssertion              0
   PreventSystemSleep             1
   PreventUserIdleSystemSleep     1
   ExternalMedia                  0
   UserIsActive                   0
   ApplePushServiceTask           0
   BackgroundTask                 0

Listed by owning process:
  pid 129(coreaudiod): [0x0000000100000189] 00:00:00 NoIdleSleepAssertion named: "com.apple.audio.'AppleHDAEngineOutputDP:1B,3,1,2:0:{D94D-2702-01010101}'.noidlesleep" 
  pid 129(coreaudiod): [0x000000050000018a] 00:00:00 NoDisplaySleepAssertion named: "com.apple.audio.'AppleHDAEngineOutputDP:1B,3,1,2:0:{D94D-2702-01010101}'.nodisplaysleep" 

 

If anyone knows how to block this assertion when using Spotify, would be most helpful.

 

HOW CAN THIS STILL BE AN ISSUE?

Yeah, it's a bummer.  I now use hotcorners and have the ScreenSaver app in my dock just so I can activate it manually.  But then there are times I fall asleep on my couch and wake up to my TV on and spotify open and think "Yep, can't wait until that's burned-in forever"

You can always create the AppleScript above and leave it running to auto-quit Spotify after some time of not playing.

The problem is while it is playing, the screensaver will never activate.  

That's not a problem for me. I'm not even sure if I have a screensaver. I just set my Mac up to turn off the display. Which works fine while Spotify is playing.

 

PreventUserIdleDisplaySleep 1

 

Prevents both screen saver and display sleep, if it works for you then great, but there's an issue with the product that effects the rest of us in this thread.  "Works for me" is never a solution.

 

 

I wonder if it's related to having an external display connected. Maybe you're having the issue on your MacBook screen? Nonetheless, I see it is an issue and should be fixed. With the time that this thread has been going, I don't see anything being done by the Spotify team; I was hoping to give you a possible workaround.
Child Item
Child Item