OSMC waking my HTPC

Im having an issue which i’ve narrowed down to OSMC on my RPi2. My setup is as follows:

  • HTPC running MySQL and is where all my media is stored. Should sleep unless it’s being used
  • RPi2 running OSMC which connects to the MySQL database and should wake the HTPC when media is being played

Now my HTPC is constantly waking up and i’ve found it’s OSMC doing it. Heres a piece of the log which does it:

Announcement: OnScreensaverActivated from xbmc
21:13:56 401.395355 T:1958498864   DEBUG: GOT ANNOUNCEMENT, type: 4, from xbmc, message OnScreensaverActivated
21:13:56 401.402252 T:1958498864   DEBUG: ------ Window Init () ------
21:14:17 423.225555 T:1786528800   DEBUG: script.module.osmcsetting.updates :  - blurp 53 - Home.xml
21:17:01 587.052795 T:1570526240   DEBUG: Previous line repeats 3 times.
21:17:01 587.053101 T:1570526240   DEBUG: webserver: request received for /jsonrpc
21:17:38 623.396912 T:1786528800   DEBUG: Previous line repeats 3 times.
21:17:38 623.397156 T:1786528800   DEBUG: script.module.osmcsetting.updates :  - blurp 53 - Home.xml
21:18:12 657.473511 T:1570526240   DEBUG: webserver: request received for /jsonrpc
21:18:28 673.443665 T:1786528800   DEBUG: Previous line repeats 4 times.
21:18:28 673.443909 T:1786528800   DEBUG: script.module.osmcsetting.updates :  - blurp 53 - Home.xml
21:18:29 674.731079 T:1570526240   DEBUG: webserver: request received for /jsonrpc
21:18:40 686.092957 T:1752974368   DEBUG: Previous line repeats 2 times.
21:18:40 686.093201 T:1752974368  NOTICE: WakeOnAccess [192.168.0.20] trigged by accessing : MySQL : MyVideos93
21:18:41 687.146729 T:1752974368    INFO: WakeOnLan - Magic packet send to '40:8D:5C:17:6D:F3'
21:18:49 694.927979 T:1570526240   DEBUG: webserver: request received for /jsonrpc
21:18:55 700.940796 T:1752974368   DEBUG: Previous line repeats 1 times.
21:18:55 700.941162 T:1752974368  NOTICE: WakeOnAccess sequence completed, server started
21:18:56 701.317322 T:1752974368   DEBUG: RunQuery took 361 ms for 117 items query: select * from movie_view  WHERE ((movie_view.playCount IS NULL OR movie_view.playCount < 1))
21:18:56 701.730408 T:1752974368   DEBUG: RunQuery took 7 ms for 38 items query: select * from episode_view  WHERE ((episode_view.playCount IS NULL OR episode_view.playCount < 1))
21:18:56 702.061646 T:1752974368   DEBUG: RunQuery took 1 ms for 0 items query: select * from musicvideo_view
21:18:56 702.070618 T:1752974368   DEBUG: GetAlbumsByWhere query: SELECT albumview.* FROM albumview  WHERE albumview.strReleaseType = 'album'
21:18:56 702.111145 T:1752974368   DEBUG: GetAlbumsByWhere - query took 40 ms
21:18:56 702.275635 T:1752974368   DEBUG: GetArtistsByWhere query: SELECT artistview.* FROM artistview  WHERE (artistview.idArtist IN (SELECT song_artist.idArtist FROM song_artist) OR artistview.idArtist IN (SELECT album_artist.idArtist FROM album_artist)) and artistview.strArtist != '' and artistview.strArtist <> 'Various artists'
21:18:57 702.330933 T:1752974368   DEBUG: Time to retrieve artists from dataset = 56
21:18:57 702.415955 T:1752974368   DEBUG: GetSongsByWhere query = SELECT songview.* FROM songview  WHERE ((CAST(songview.iTimesPlayed as DECIMAL(5,1)) < 1))
21:18:57 703.090454 T:1570526240   DEBUG: webserver: request received for /jsonrpc
21:18:57 703.264038 T:1752974368   DEBUG: GetSongsByWhere() - took 850 ms
21:18:58 703.528320 T:1700000800  NOTICE: Thread JobWorker start, auto delete: true
21:18:59 704.348694 T:1752974368   DEBUG: Skin Widgets: Total time needed to request random queries: 0:00:18.258892
21:19:01 707.122192 T:1570526240   DEBUG: webserver: request received for /jsonrpc
21:19:18 723.489807 T:1786528800   DEBUG: Previous line repeats 4 times.
21:19:18 723.490295 T:1786528800   DEBUG: script.module.osmcsetting.updates :  - blurp 53 - Home.xml
21:19:20 726.129395 T:1606968352   DEBUG: webserver: request received for /jsonrpc
21:19:20 726.187195 T:1624503328   DEBUG: Previous line repeats 1 times.

This is preventing my HTPC from sleeping like it should. My question is how can I stop these constant requests from waking my HTPC?

System > Power Saving > Try to wakeup remote server on access turn that to off

might have to enable expert settings in kodi

If I turn that off, it won’t wake the HTPC when I try watch a movie which is what it should be doing.

I need it to wake it up when I try access something, not by doing it on it’s own frequently updating things. Is there a setting for how often it does these updates?

You can use a addon called XBMC Library Auto Update has more control over when you want Kodi to update its in the Kodi Repository under Addons

Would that change the frequency of this particular update it’s doing? It looks as though it’s updating the widget for “Recently added movies” etc…

I think you have a misplaced expectation here.

If your HTPC was only acting as a file server then yes, it would only wake when trying to actually play media.

However if you are also using a MySQL install on the Pi there will be periodic background SQL queries that will keep waking the server.

This will be from things like the skin updating things like recently added and so on.

IMHO with a MySQL install I would not have an expectation of the MySQL server being able to sleep for any length of time.

@Rhys

My suggestion if you use a MYSQL solution I would install the MYSQL server on the PI it self

I think you are right - my expectations are slightly off as it is running the MySQL server, i’ve had a poke around the Confluence skin and even that is regularly updating the “recently played/added” widgets from MySQL.

Although I completely disabled the plugin “Skin Widgets” last night and it looks as though there were no wakeup requests throughout the night at all. I’m guessing as a result of that my “recently played/added” will not be updating and will become very outdated, which is a bit annoying.

I don’t know why I didn’t think of this sooner and would certainly resolve this annoying problem.

If I were to run MySQL along OSMC on a RPi2, what would the performance be like?
Also, I assume I can run these both off the 16gb microsd card it’s currently using?

Thanks for your help.

I have it running on the RPi2 and can not see a major performance issue. The only thing is MYSQL depending on your configuration takes 50-90M of RAM but the CPU usage is not the issue

Yes if the Pi is the machine that is always on (and has low power consumption) then running the MySQL server there and sharing that to the HTPC does make a lot of sense.