More > JRiver Media Center 21 for Linux
MC21 not preventing system standby during playback
mwillems:
--- Quote from: Mike Noe on August 18, 2015, 06:20:10 pm ---This is all implemented by the KDE daemon, I believe, as the standard, so shouldn't this be implemented on each DE that supports the freedesktop standards?
--- End quote ---
The dbus interface should work (at least on KDE, Gnome, and XFCE), which is why I mentioned that the dbus method is the "right" way to do it. I just have never interacted with dbus before and have no idea how dbus calls/methods even work (I'm not a pro at this, I'm just paddling around).
I don't think MC currently even tries to submit an inhibitor lock, I'm talking about scripting workarounds.
Mike Noe:
--- Quote from: mwillems on August 18, 2015, 06:25:05 pm ---The dbus interface should work (at least on KDE, Gnome, and XFCE), which is why I mentioned that the dbus method is the "right" way to do it. I just have never interacted with dbus before and have no idea how dbus calls/methods even work (I'm not a pro at this, I'm just paddling around).
I don't think MC currently even tries to submit an inhibitor lock, I'm talking about scripting workarounds.
--- End quote ---
Okay, yeah, gotcha, I'm using QT/KF5(C++) to write some apps right now...QT makes it quite simple to "hook up to the dbus" (I guess all the "frameworks" do, really). But basically, what you're doing in your script, I'm doing in my app. It checks the PlayingNow Info for each zone on the server(localhost), checks state and file type and then attempts the dbus call iff video is playing (and current inhibit status).
terrym@tassie:
I also discovered that a lock could work if the command "sudo systemd-inhibit --what=sleep sleep 20m" is issued from the terminal but unfortunately after the lock is removed the system does not then suspend as normal. I also agree that the 15 minute minimum for suspend makes it an absolute pain for testing!
The caffeine dbus approach is surely the way to go with this, the gnome desktop extension version allows configuration of apps (such as vlc) to be added so it activates when they are started. This is not totally ideal as it just detects that the app is running and inhibits suspend for the whole time the app is running rather than just when play activity is detected.
Unfortunately MC does not even appear as one of the apps that can be selected to do even this basic level of suspend inhibit.
As I said in my OP I'm very new to Linux so delving into the inner workings and modifying desktop extensions to suit are still beyond me a this stage.
Looking at the javascript for the dbus method used by caffeine though, it really doesn't look like it should be too difficult for a C++ application like MC to use the dbus to perform sleep inhibit on all the major Linux desktops.
https://github.com/eonpatapon/gnome-shell-extension-caffeine/blob/master/caffeine%40patapon.info/extension.js
Mike Noe:
if you guys are still playing around with scripting this, try using dbus-send with these "object paths" (I'm not really up on dbus-send syntax):
"org.freedesktop.PowerManagement", "/org/freedesktop/PowerManagement", "org.freedesktop.PowerManagement.Inhibit"
Use method "Inhibit" and pass two args (appname, reason) to set up the powermanagement inhibition
Use method "HasInhibit" to query that it was added (or in the case of of your DE, there might be a notification message of some sort)
Use method "Uninhibit" to remove the inhibition.
Seems to work here on openSuse Plasma5 but I'm doing it from an app....(the powermgt tray icon shows that my app is blocking power management features)
--- Code: --- QDBusInterface *interface = new QDBusInterface("org.freedesktop.PowerManagement", "/org/freedesktop/PowerManagement", "org.freedesktop.PowerManagement.Inhibit", bus, this);
QDBusReply<uint> cookie = interface->callWithArgumentList(QDBus::Block, "Inhibit", QList<QVariant>() << "mcwsRemote" << "playing video");
qDebug() << cookie;
QDBusReply<bool> reply = interface->call("HasInhibit");
qDebug() << reply;
.
.
.
interface->call("UnInhibit", cookie.value());
.
.
interface->deleteLater();
--- End code ---
Edit: Oh yeah, if you haven't already found it, D-Feet is a great little tool for dbus work/play.
terrym@tassie:
Can I just get clarification that this idling to sleep/suspend is only affecting Debian 8.1 Jessie (AMD64 and i386)?
It is a bit of a nuisance and when I moved my client PCs from Windows to linux I chose Debian distros as I thought they were the best supported distros for MC.
Would I be better using a different linux distro so I don't get this issue?
I equally don't want to go through the hassle of changing distros if this is about to be fixed in MC21- so any timescale for a fix?
My current workaround is to use the Gnome desktop with the caffeine extension and manually inhibit suspend (although I don't always remember to switch it off again) and Gnome is a bit cpu intensive for my old i386 netbook client.
It is pretty fundamental that a media player inhibits sleep during playback (though to be fair vlc doesn't on Debian 8.1).
Thanks
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version