XBMC Community Forum
Automatic WakeOnLan upon accessing MySql or FileShares - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Feature Suggestions (/forumdisplay.php?fid=9)
+--- Thread: Automatic WakeOnLan upon accessing MySql or FileShares (/showthread.php?tid=124340)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41


RE: Automatic WakeOnLan upon accessing MySql or FileShares - Solo0815 - 2012-04-11 21:37

We are after "Eden" -> implement it!


RE: Automatic WakeOnLan upon accessing MySql or FileShares - kricker - 2012-04-12 19:33

I find this patch very intriguing. This si something I have been wanting for a very long time. I plan make a build with this patch today and see how it performs.

Can you explain the <tmout>700</tmout> option a bit more? Why would we need to constantly send wake-up packets to the server?


RE: Automatic WakeOnLan upon accessing MySql or FileShares - t4_ravenbird - 2012-04-12 20:43

(2012-04-12 19:33)kricker Wrote:  I find this patch very intriguing. This si something I have been wanting for a very long time. I plan make a build with this patch today and see how it performs.

Can you explain the <tmout>700</tmout> option a bit more? Why would we need to constantly send wake-up packets to the server?

Thanks!
The 'timeout' specified does not mean that a new wake-up is done at this interval.
Instead is defines the time (in seconds) of inactivity that should pass before a new wake-up is sent.
So, for as long as files are beeing accessed on the server there will not (ever) be re-sent a wake-up, the wake-up will be done after activity stops and has been idle for the time set in 'tmout'

The idea is that if you have a server that is set to go into suspend-mode after e.g 30 minutes of inactivity then you can setup XBMC to send a new wake-up if XBMC detects that no access has been done towards that server for more than e.g 25 minutes (to make sure we wake it up again)
This new wake-up will not be done just because the timer expires, instead it will be done 'just-in-time' when a file-access is done after the timer has expired.


Hope that makes it clearer?


RE: Automatic WakeOnLan upon accessing MySql or FileShares - kricker - 2012-04-12 21:06

I think so.

I have such a server. After 20 minutes of the all disks being idle, the server goes to sleep.

With this setting then, if the timer expires, the new wake event will be sent when I try to access files from the server again. If I don't access that server again the packet will not be sent.


RE: Automatic WakeOnLan upon accessing MySql or FileShares - kricker - 2012-04-13 19:44

So with t4_ravenbird's modified files I created a patch for the current master branch. With my preliminary testing things are looking good. I am not using mySQL, just the default XBMC databases. I let my server fall asleep, then tried to play a file from it. The server woke up and then played back perfectly fine.


RE: Automatic WakeOnLan upon accessing MySql or FileShares - kricker - 2012-04-13 20:01

@t4_ravenbird

Could this be extended to also wake the server before a library update is done as well as a clean library request?


RE: Automatic WakeOnLan upon accessing MySql or FileShares - t4_ravenbird - 2012-04-13 20:43

(2012-04-12 21:06)kricker Wrote:  ...
With this setting then, if the timer expires, the new wake event will be sent when I try to access files from the server again. If I don't access that server again the packet will not be sent.

Yes. Exactly.

(2012-04-13 20:01)kricker Wrote:  @t4_ravenbird

Could this be extended to also wake the server before a library update is done as well as a clean library request?

As I have imagined it that would be redundant? I would think it should work as it is now, whenever the scanning needs to access the server, the same on-access-wake should kick in ..

*
However, if using MySql, I am afraid there will be more issues. The MySql coding just opens the db-connection and will never detect any broken connection (and since it never tries a re-connect there is no place for me to add a retransmission of the wakeup)


RE: Automatic WakeOnLan upon accessing MySql or FileShares - da-anda - 2012-04-14 13:43

IIRC there already is a older ticket in the bugtracker that added WOL support. I posted some additional ideas/concepts there IIRC. As far as I remember I had this ideas back then:
  • WOL is not a geek-only thing nowadays, so add a GUI setting that allows to manage several WOL clients, based on their IP/DNS/UNC or whatever. So that any share defined for one of the configured clients will automatically trigger WOL requests on first access
  • add a option/flag to the client configuration to auto-wakeup it on XBMC startup (has been requested in the forums IIRC)
  • each client should have a "timeout" or "startup delay" configured, so that XBMC knows how long it has to wait to try playback again after first attempt. Maybe this can alternatively be done by just pinging the target for a certain amount of time - no idea.
  • add a dialog if the media is on a WOL device and ask the user if the device should wake up (this might be optional/configurable by device)
  • while waiting for the wakeup, ask the user what he likes to do in the meantime. Like if the media to be played is a movie, ask if one want's to watch f.e. the according trailer (online) while waiting for the device (create a playlist with the trailer and queue the movie). Or not a trailer, but a short trivia about the movie, or music or whatever (maybe have entry points for addons here, like the trailers addon, trivia addon etc)



RE: Automatic WakeOnLan upon accessing MySql or FileShares - Ned Scott - 2012-04-14 20:13

Could something like this be adapted to help spin up drives before accessing them? IIRC, some users have funky NAS devices that don't spin up very fast and something in this transition causes XBMC to either think the file is gone or even crash.


RE: Automatic WakeOnLan upon accessing MySql or FileShares - t4_ravenbird - 2012-04-15 10:59

(2012-04-14 13:43)da-anda Wrote:  IIRC there already is a older ticket in the bugtracker that added WOL support.

OK. The additions I have made builds on that allready existing wol support in XBMC. It is not a duplicate implementation but more in line with some of the additonal ideas you mention