Linux System call on playing video

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
fasteasyfree Offline
Junior Member
Posts: 1
Joined: Apr 2013
Reputation: 0
Post: #1
A little background:

I'm running Raspbmc on my Pi. Due to the low power requirements, I'm leaving it on permanently. All my media is on a fileserver that is off/suspended when not in use.

Is it possible to perform a system call to wake the server only when attempting playback of a video? Even if it doesn't wake quickly enough to play the file first time, I can simply try again. Ideally it would only send the WOL packet if the video is on NFS share and not iPlayer/youtube etc.

Is this feasible? Or should I simply do it manually via a shortcut in favourites?

Thanks.
find quote
Bstrdsmkr Offline
Fan
Posts: 651
Joined: Oct 2010
Reputation: 12
Post: #2
Sure, this is a job for a service addon. Just subclass xbmc.Player() and in your onPlaybackStarted() function, execute the whatever code you need to wake your NFS (such as building and sending the WOL magic packet).

You should also be able to use advancedsettings.xml to crank up the curl timeout long enough that your NFS should be awake before it gives up on the first request
find quote
da-anda Offline
Team-XBMC Member
Posts: 1,396
Joined: Jun 2009
Reputation: 27
Location: germany
Post: #3
note that there already is a pull-request which adds native wol features to XBMC. might be ready for merge in upcoming merge window
find quote
wsnipex Online
Team-XBMC packaging monkey
Posts: 1,814
Joined: Jun 2011
Reputation: 50
Post: #4
there also is an advanced WOL addon
find quote