More > JRiver Media Center 21 for Linux
Any prospect of Media Center preventing idling to suspend during playback?
terrym@tassie:
With MC22 looming I thought I would raise again the issue I originally reported here http://yabb.jriver.com/interact/index.php?topic=99466.0
It is very annoying that when using MC on Linux Mint or Debian Jessie that the system will idle to suspend state even if MC is playing back a file.
It is a standard feature of the Windows version that it keeps the system awake during playback but allows it to suspend if inactive.
As far as I am aware from the discussion the last time I raised this, the only Linux distro that MC can keep awake during playback is Debian Wheezy.
Is this still correct?
I would really like to be able set my Linux clients to aggressive suspend settings so that if I wander off and the playlist I was playing finishes then the system will rapidly idle to suspend state with the consequent savings in power.
BryanC:
If you are comfortable with shell commands, you could repurpose something similar to this, depending on your distro.
Edit: This is also an option: https://github.com/hobarrera/caffeine-ng or https://launchpad.net/caffeine/
terrym@tassie:
Thanks for the further work around suggestions Bryan, but I was asking that this be done WITHIN MC, not as scripted add-ons that rely on mcws to detect whether MC is playing etc etc.
It just seems fundamental to me that a media player doesn't appear to be idle to the OS if it is playing something.
(or perhaps the rest of the world just leave their Linux boxes on 24/7?)
BryanC:
It's actually kind of a funky problem since it appears (by my limited research) that systemd uses a measure of idle time that is dependent on the mouse and keyboard movement. Hence the need for caffeine (Mac OSX actually has this built in) or other workarounds.
I wrote a pretty simple systemd service file that checks whether or not Pulse is playing audio and then inhibits the suspend if it is. This has the added benefit of being a system-wide change so if you are (for instance) playing music through YouTube the computer won't sleep.
Place into /etc/systemd/system/prevent_sleep.service
--- Code: ---[Unit]
Description=Inhibit suspend when pulse is playing audio
Before=sleep.target
[Service]
Type=oneshot
ExecStart=/usr/bin/sh -c "! pacmd list-sink-inputs | grep -q -c 'state: RUNNING'"
[Install]
RequiredBy=sleep.target
--- End code ---
systemctl daemon-reload
systemctl enable prevent_sleep.service
That should work and be about as elegant a solution as you can get at this point I think.
mwillems:
--- Quote from: BryanC on June 06, 2016, 09:41:50 pm ---It's actually kind of a funky problem since it appears (by my limited research) that systemd uses a measure of idle time that is dependent on the mouse and keyboard movement. Hence the need for caffeine (Mac OSX actually has this built in) or other workarounds.
I wrote a pretty simple systemd service file that checks whether or not Pulse is playing audio and then inhibits the suspend if it is. This has the added benefit of being a system-wide change so if you are (for instance) playing music through YouTube the computer won't sleep.
Place into /etc/systemd/system/prevent_sleep.service
--- Code: ---[Unit]
Description=Inhibit suspend when pulse is playing audio
Before=sleep.target
[Service]
Type=oneshot
ExecStart=/usr/bin/sh -c "! pacmd list-sink-inputs | grep -q -c 'state: RUNNING'"
[Install]
RequiredBy=sleep.target
--- End code ---
systemctl daemon-reload
systemctl enable prevent_sleep.service
That should work and be about as elegant a solution as you can get at this point I think.
--- End quote ---
Just wanted to chime in and say that's really elegant Bryan. I'm setting it up tomorrow ;D
Navigation
[0] Message Index
[#] Next page
Go to full version