PDA

View Full Version : Stop Mac (Leapord) from sleeping while Squeezebox is running



kalmdown
2008-01-31, 22:34
Is there a way to stop the Mac from going to sleep while I'm streaming to the Squeezebox?

danco
2008-02-01, 02:43
I've never been quite sure what a machine has to watch to stop it sleeping. I thought hard drive activity should be enough, but it doesn't always seem to be.

Anyway, if needed the thing can be done with a few components.

Get a program called Jiggler (free) that stops the machine sleeping while it is running.

Get Execute Script, a plugin for SS.

Write a couple of scripts (I can give details) that start and stop Jiggler.

Use Execute Script to run the scripts when needed.

Husted
2008-02-01, 05:31
I use http://lightheadsw.com/caffeine/, I don't have any scripts to turn it on and off so it would be great if someone could post one.
I'm using 10.5.1 and SC7.

danco
2008-02-01, 08:26
I took a glance at caffeine, and find that it is a menu bar item.

I don't know how to write an AppleScript that will act on such items, though I do know what to do to access ordinary menu items. I would find such a script useful in other situations.

Once one has a suitable AppleScript, it has to be turned into a shell script, but that is easy.

If it is important enough to you, and no-one provides a suitable AppleScript, get Jiggler as well and I can give you the details of a script.

ks10
2008-02-01, 14:06
... i don't want that the mac is falling to sleep while streaming. i found bandwith sleeper. it checks the network activity. you can adjust the rate when it sends the mac to sleep. unfortunately the app isn't active when you wake up the computer. you've to manualy start it. that would be the best solution for me.

actually i don't use the sleep function. all of my hardware is cut off the power while not in use over the night. if the squeezebox goes off (really off) the mac realizes the loss of sb3s ip-adress und shuts down (via poff).

danco
2008-02-02, 02:56
Bandwidth sleeper was not available when I checked. Here is the script I use for Jiggler, which can be changed for other programs. I am trying to find out what is needed for Caffeine, which works differently.

#!/bin/bash
osascript -e 'tell application "Jiggler" to activate' -e 'quit application "Terminal" saving no'

Notes.
1. The script consists of two lines, one beginning with #!, the other with osascript (the forum might split the second line over two). Note the differences between ' and ", and make sure your text editor does not make these into curly quotes.

2. Make sure to use a text editor that accepts Unix line endings - many do, but a few use the older ending (Unix ends with Line Feed, which modern Macs accept, but old programs end lines with Carriage Return).

3. The script gets put in the Scripts folder in the SlimDevices (or SqueezeCenter) folder in your Library.

4. Set it (using Get Info) to open in Terminal.

5. It has to be made executable, which requires use of Terminal. Open Terminal and type

chmod a+x
followed by a space
and then drag the file into the Terminal window (a clever Mac trick; this provides the full path to the file without you having to type it in).
Press Return, and the file is executable, and can be run by the Execute Script plugin.

To turn Jiggler off, the script is

#!/bin/bash
osascript -e 'quit application "Jiggler"' -e 'quit application "Terminal" saving no'

I can explain what is going on if anyone wants more details.

Robert57
2008-02-02, 18:12
I too am preparing to get a new Mac Mini to run Slimserver. I see on Macworld's site that a $20 software called Connect360 has a feature to disable Mac's sleep mode while streaming. Has anyone tried this? This looks a lot less intimidating than writing new scripts.

http://www.macworld.com/article/58582/2007/06/connect360.html

danco
2008-02-03, 01:35
That may well not work if you don't have an XBox to connect to.

I know that writing scripts can be intimidating.

That's why I spelled out all the details.

Of course, giving so much detail can also be intimidating!

Peter Stockwell
2009-03-26, 05:54
I recently got a squeezebox and am running squeezecenter on a mac. I've taken to closing the terminal application that opens when squeezecenter starts up. Is this a good or a bad thing ?

I have the problem that when the mac sleeps then the streaming to the squeezebox stops. Would leaving terminal open prevent the mac going to sleep? The music files are organised by iTunes and the music library is on a firewire connected drobo.

Do I have to download another application and set a script in Squeezecenter to fix my problem ?

Thanks

Peter

avta
2009-03-26, 07:14
Kalmdown:
Go to System Preferences and choose Energy Saver. There you will be able to control sleeping.

Eric Seaberg
2009-03-27, 20:12
I too am preparing to get a new Mac Mini to run Slimserver. I see on Macworld's site that a $20 software called Connect360 has a feature to disable Mac's sleep mode while streaming. Has anyone tried this? This looks a lot less intimidating than writing new scripts.

http://www.macworld.com/article/58582/2007/06/connect360.html

I've had the server running on a Mac MINI for 2.5 years, never turning it off and never having it go to sleep. As someone has already mentioned, go to ENERGY SAVER and tell it NEVER on everything.

Good luck. The MINI makes a GREAT server!!