Kodi Community Forum
Linux Temporarily disable power saving (turn off screen)? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52)
+---- Thread: Linux Temporarily disable power saving (turn off screen)? (/showthread.php?tid=211713)



Temporarily disable power saving (turn off screen)? - BillCosby - 2014-12-18

Hello everyone,

I am running XBMC 13 standalone on a HTPC with Arch Linux installed.
I enabled xbmc to turn the screen off in the power saving options, but I disabled the screensaver (set it to "None") since screensavers don't make sense for my LCD.

When watching movies etc. it is all fine, but other programs will try to use programs like "xdg-screensaver" to turn screensaving/power management off, however, it won't do much and XBMC still keeps turning the screen off while these programs are running.
It seems XBMC doesn't work with xdg-screensaver?! What else could I do?

regards,
Bill


RE: Temporarily disable power saving (turn off screen)? - negge - 2014-12-18

Can't you just uninstall xdg-screensaver if you no screensaver is what you want?


RE: Temporarily disable power saving (turn off screen)? - BillCosby - 2014-12-19

(2014-12-18, 23:17)negge Wrote: Can't you just uninstall xdg-screensaver if you no screensaver is what you want?
It is not the screensaver which is invoked, XBMC turns off the screen, and that is what I want, if my HTPC is idle. The problem is that XBMC thinks my HTPC is idle when other programs run, e.g. a game, ans subsequently turns off the screen. xdg-screensaver is a util to tell X that it should not use any monitor power saving functions, but XBMC ignores this.

To rephrase: is there a way to usa a script (Python/Bash) to turn XBMC's power management off/on?


RE: Temporarily disable power saving (turn off screen)? - wsnipex - 2014-12-19

I had a quick look and as it seems, there is no way to disable the screensaver temporarily. You can activate it though Wink


RE: Temporarily disable power saving (turn off screen)? - BillCosby - 2014-12-19

Hm, I thought about simply changing the XML settings file with a script, but then I somehow need to tell xbmc to apply the changed settings, is this possible? And if yes, how?


RE: Temporarily disable power saving (turn off screen)? - wsnipex - 2014-12-20

no, changing the xml directly won't take effect while kodi is running.
Thinking about it, it _might_ be possible to change the setting on the fly with json rpc.


RE: Temporarily disable power saving (turn off screen)? - BillCosby - 2014-12-20

(2014-12-20, 09:20)wsnipex Wrote: Thinking about it, it _might_ be possible to change the setting on the fly with json rpc.
I thought about this too, but http://kodi.wiki/view/JSON-RPC_API/v6 doesn't list any method calls for the namespace "Settings", that's one reasone why I asked here.
Is there documentation for the methods in the namespace "Settings"?


RE: Temporarily disable power saving (turn off screen)? - wsnipex - 2014-12-20

Code:
# get all settings (and pretty print it)
wget --header='Content-Type: application/json' --post-data '{"jsonrpc": "2.0", "method": "Settings.GetSettings", "params": {"level": "expert"}, "id": "1"}' http://localhost:8080/jsonrpc -O - | python -m json.tool

# get screensaver idle time
wget --header='Content-Type: application/json' --post-data '{"jsonrpc": "2.0", "method": "Settings.GetSettingValue", "params": {"setting": "screensaver.time"}, "id": "1"}' http://localhost:8080/jsonrpc -O - -q

#set screensaver to None
wget --header='Content-Type: application/json' --post-data '{"jsonrpc":"2.0","method":"Settings.SetSettingValue", "params":{"setting":"screensaver.mode","value":""},"id":1}' http://localhost:8080/jsonrpc -O - -q

#disable "put display to sleep when idle"
wget --header='Content-Type: application/json' --post-data '{"jsonrpc":"2.0","method":"Settings.SetSettingValue","params":{"setting":"powermanagement.displaysoff","value":0},"id":1}'http://localhost:8080/jsonrpc -O - -q



RE: Temporarily disable power saving (turn off screen)? - BillCosby - 2014-12-20

Thank you very much, however I don't think it works.

I did:
Code:
curl -s -H 'Content-Type: application/json;' --data-binary '{"jsonrpc":"2.0","method":"Setting.powermanagement.displaysoff","value":0},"id":1}' 'http://localhost:8090/jsonrpc'
And it doesn't seem to apply this setting, at least if I go into settings in XBMC it still shows me my old values. I don't get any error message or anything though.
I did try to change "Setting" to "Settings" as this is what the namespace is called in the wiki, however, still all the same. Am I doing something wrong?

regards and thank you for your help.


RE: Temporarily disable power saving (turn off screen)? - BillCosby - 2014-12-20

Ok my bad, I got it, it is:

Code:
'{"jsonrpc":"2.0","method":"Settings.SetSettingValue","params":{"setting":"powermanagement.displaysoff","value":-VAL},"id":1}'

Wasn't thinking, now it seems to work, I'll need to test it now Big Grin
But thank you so far.


RE: Temporarily disable power saving (turn off screen)? - wsnipex - 2014-12-20

you passed the test Tongue
it was wrong in my post, must have been a c/p error.