More > JRiver Media Center 21 for Linux
Any prospect of Media Center preventing idling to suspend during playback?
terrym@tassie:
BryanC I'd like to try your elegant solution but I've hit a snag on Linux Mint 17.3 as there is no systemctl command.
Any suggestions on how I enable the service? (I have created the file prevent_sleep.service in /etc/systemd/system).
What I can't do is execute the commands:
systemctl daemon-reload
systemctl enable prevent_sleep.service
Thanks
Terry
BryanC:
--- Quote from: terrym@nz on June 07, 2016, 03:52:01 pm ---BryanC I'd like to try your elegant solution but I've hit a snag on Linux Mint 17.3 as there is no systemctl command.
Any suggestions on how I enable the service? (I have created the file prevent_sleep.service in /etc/systemd/system).
What I can't do is execute the commands:
systemctl daemon-reload
systemctl enable prevent_sleep.service
Thanks
Terry
--- End quote ---
Ah you are using a distro based on a legacy LTS version of Ubuntu that is using upstart and not systemd. Although I'm not familiar with upstart, something like this is much easier to implement if upstart does in fact still use pm-utils (unlike systemd).
Simply create:
/etc/pm/sleep.d/00check_audio.sh
--- Code: ---#!/bin/bash
if `pacmd list-sink-inputs | grep --quiet -c 'state: RUNNING'` ; then
exit 1
else
exit 0
fi
--- End code ---
You will need to sudo chmod +x /etc/pm/sleep.d/00check_audio.sh in order to make it executable and then pm-utils should check the playback state automatically when the system tries to sleep.
terrym@tassie:
Well done BryanC! Using the script in /etc/pm/sleep.d does indeed inhibit suspend on Mint 17.3 xfce. Kudos to you.
I don't actually use Pulse, preferring to go direct to the alsa device without resampling so my script looks this:
--- Code: ---#!/bin/bash
if `cat /proc/asound/card0/pcm0p/sub0/status | grep --quiet -c 'state: RUNNING'` ; then
exit 1
else
exit 0
fi
--- End code ---
Thanks again for a simple and elegant solution to the problem. (Note: I think this should be stickied, it is bound to be of use to other users)
Terry
Mike Noe:
FYI, somewhat related, I just moved to Linux 4.7.0-rc2-1.gfd100c9-default (openSuse TW x86-64) and for whatever reason, the screen turn off inhibit seems to be working now without disabling power management in the DE. I've only tested Plasma5 at this point.
I have a two screen setup, monitor is DVI, HDTV is connected thru a Receiver, HDMI from the video card. Playback is thru the HDMI. Before, this update, even when playing audio via HDMI, the power managment would turn off both outputs (HDMI/DVI) at the specified timeout for idle, thus interrupting playback. After this kernel update, there is a small hiccup when the power management kicks in to disable card outputs, but then it comes right back and continues playing.
Navigation
[0] Message Index
[*] Previous page
Go to full version