Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 5 of 5
  1. #1
    Senior Member Tony T's Avatar
    Join Date
    Nov 2009
    Posts
    953

    LMS Prevent Sleep - macOS Catalina

    Just upgraded to macOS Catalina
    Trying to get LMS from preventing sleep. Had this problem with El Capitain, and resolved it
    with sudo nvram boot-args="darkwake=0", but this is not working with Catalina
    Last edited by Tony T; 2019-12-04 at 04:59.
    Tony
     SBTouch ♪ SBRadio ♬

  2. #2
    Senior Member Tony T's Avatar
    Join Date
    Nov 2009
    Posts
    953
    Quote Originally Posted by mherger View Post
    > Ô€ŽI'm not sure if prevent standby plugin is actually working.
    > The log says it is ("[19-12-03 12:12:34.0015]
    > Slim::Plugin::PreventStandby::Plugin::checkClientA ctivity (146)
    > Preventing System StandbyÔ€Ž"
    > but pmset -g doesn't indicate that caffeinate is preventing sleep.


    Would you see from the log which command it is using to prevent standby?



    Michael
    I put the log on "Info" and it reported that Prevent Standby was running, but looking at the OSX.pm module, I see now that I should have set it on debug….give me a minute…
    ….It says caffeinate is being used: "Going to use '/usr/bin/caffeinate -i' to prevent standby

    I also have Allow standby after how many idle minutes? to 9 and Prohibit standby if players are on? unchecked (but I tried it with check also)

    Edit: Trying again, 30 seconds in, pmset -g is now reporting "sleep 1 (sleep prevented by caffeinate)"
    But… 30 seconds later, the Mac-mini goes back to sleep.
    Last edited by Tony T; 2019-12-04 at 06:19.
    Tony
     SBTouch ♪ SBRadio ♬

  3. #3
    Senior Member Tony T's Avatar
    Join Date
    Nov 2009
    Posts
    953
    Found the problem, fixed.

    The Prevent System Standby (v3.0) Plugin (OSX.pm line 27/28) uses the caffeinate with the -i flag (Create an assertion to prevent the system from idle sleeping)
    By changing the flag to -s (Create an assertion to prevent the system from sleeping. This assertion is valid only when system is running on AC power), the plugin now prevents my system from sleeping.

    Michael, can the Prevent System Standby be updated for this?
    Both the -i and -s command can be run for both assertions with caffeinate -is (you can see both are working with "pmset -g assertions | grep caffeinate"
    Last edited by Tony T; 2019-12-06 at 05:08.
    Tony
     SBTouch ♪ SBRadio ♬

  4. #4
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,324

    LMS Prevent Sleep - macOS Catalina

    > The Prevent System Standby (v3.0) Plugin (line 27/28) uses the
    > caffeinate with the -i flag (Create an assertion to prevent the system
    > from idle sleeping)
    > By changing the flag to -s (Create an assertion to prevent the system
    > from sleeping. This assertion is valid only when system is running on AC
    > power), the plugin now prevents my system from sleeping.


    Now that's interesting. Because the last change to that file was almost
    four years ago - to replace -s with -i:

    https://github.com/Logitech/slimserv...1693cb5d299c6a

    The commit message then said "kIOPMAssertionTypePreventSystemSleep no
    longer supported".

    --

    Michael

  5. #5
    Senior Member Tony T's Avatar
    Join Date
    Nov 2009
    Posts
    953
    Quote Originally Posted by mherger View Post
    > The Prevent System Standby (v3.0) Plugin (line 27/28) uses the
    > caffeinate with the -i flag (Create an assertion to prevent the system
    > from idle sleeping)
    > By changing the flag to -s (Create an assertion to prevent the system
    > from sleeping. This assertion is valid only when system is running on AC
    > power), the plugin now prevents my system from sleeping.


    Now that's interesting. Because the last change to that file was almost
    four years ago - to replace -s with -i:

    https://github.com/Logitech/slimserv...1693cb5d299c6a

    The commit message then said "kIOPMAssertionTypePreventSystemSleep no
    longer supported".

    --

    Michael
    Hmmm… I wonder if that's why I couldn't get it to work in El Capitain without darkwake=0

    The best solution would be the plugin to use caffeinate -is or to have an option in settings to prevent "system idle sleep" or "system sleep"

    Both are supported in Catalina:

    Here's my edit in OSX.pm
    if ( $command = Slim::Utils::Misc::findbin('caffeinate') ) {
    $command .= ' -is';
    }
    Here's what pmset reports:
    Code:
    mac-mini:~ Tony$ pmset -g assertions | grep caffeinate
       pid 22815(caffeinate): [0x000085aa00018c65] 00:00:27 PreventUserIdleSystemSleep named: "caffeinate command-line tool"  
    	Details: caffeinate asserting forever
    	Localized=THE CAFFEINATE TOOL IS PREVENTING SLEEP.
       pid 22815(caffeinate): [0x000085aa00078c66] 00:00:27 PreventSystemSleep named: "caffeinate command-line tool"  
    	Details: caffeinate asserting forever
    	Localized=THE CAFFEINATE TOOL IS PREVENTING SLEEP.
    mac-mini:~ Tony$
    Last edited by Tony T; 2019-12-06 at 08:13.
    Tony
     SBTouch ♪ SBRadio ♬

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •