[Approved] Powerscheduler network monitoring (share + traffic) (1 Viewer)

JBravo

MP Donator
  • Premium Supporter
  • November 11, 2007
    269
    27
    Sweden Sweden
    I think I sorted it out.

    Returning 'true' in the WndProc() method causes the event to be consumed, this could be good for e.g. key presses but not for power events.

    The included patch for the PS client plugin fixes the problem above.

    I would appreciate if someone of the Dev's could verify that this is a error. If that's the case the TVplugin has the same error.

    /jonas
     

    Attachments

    JBravo

    MP Donator
  • Premium Supporter
  • November 11, 2007
    269
    27
    Sweden Sweden
    I have updated my patches to MP 1.0.2 (SVN 22555). See https://forum.team-mediaportal.com/general-development-no-feature-request-here-48/patch-power-scheduler-multiseat-addon-wol-52155/ for more info.

    The fix for WndProc() method mentioned in the previous post is also included (for both PS client plugin and TV plugin).

    The PS client keep alive patch is already commited to SVN by misterd, https://forum.team-mediaportal.com/submit-patches-mediaportal-tv-server-etc-325/power-scheduler-keep-alive-fix-60782/, so I removed it from here.
     

    Attachments

    ARE2

    Portal Pro
    May 9, 2008
    166
    16
    Germany
    Poland Poland
    Hi,

    short question of a very interested User ;) Will that fix maybe be implemented in one of the next MP Alpha SVNs for testing? Cause that sounds as the perfect fix for my scenario :) -> 1 Server hibernated when not used and a client that has to wake it up when MP starts on it... furthermore MP on client side should wait till server is up from hibernate... on my machine up to 45 seconds.

    Right now I've made some very dirty scripts by myself that do the job by sending WOLs to the server, but I'm no coder and so I couldn't solve the prob. on the client side, that mp doesn't really wait till the server is totally up. Cause now I have to restart MP on the client manually when Server is really rechable... totally nervwrecking but better than nothing... so your Patch, if I understand that right would do the trick!? :)

    Regards
    ARE2
     

    romadd64

    MP Donator
  • Premium Supporter
  • October 24, 2007
    82
    15
    Italy Italy
    JBravo,

    I gave a quick check to your source code, and I haven't seen a visual feedback to the user on what happens.
    Would not be better (for WAF) to have a message box saying something like "Waiting for the TvServer waking up..." with a counter showing remaining wait time ?

    Thanks, romadd64
     

    JBravo

    MP Donator
  • Premium Supporter
  • November 11, 2007
    269
    27
    Sweden Sweden
    romadd64
    There will unfortunately not be any visual feedback. The WOL part executes when the start screen is shown i.e 'loading window plugins'. On the other hand waking the server from S3 takes about 3s.

    ARE2
    The timeout waitning for the server is currently 10s. The timeout could however easy be made configurable.
     

    romadd64

    MP Donator
  • Premium Supporter
  • October 24, 2007
    82
    15
    Italy Italy
    Jbravo,

    thanks for your quick response.

    Two point to consider :

    1)
    I think that waking from S3 in 3s should not be the only scenario considered.
    There are many TV cards that do not work well with S3, and in this case there are some solutions :

    1 - Set TVServer PowerScheduler to reinitialize tuners on resume.
    2 - If 1 doesn't work, use devcon to disable the TV card on suspend and enable on resume
    3 - If 2 doesn't work, doesn't use suspend but shutdown.

    These solutions range from faster to slower in making available the TVServer.
    And between the first successful ping (S.O. up) and when TvServer becomes available, it can take several seconds.
    So my proposal is to have 2 configurable timeouts : one for the successful ping and one for connecting to TVServer (after the successful ping).

    2)
    What scenario do you consider on TvClient ? If you put it to S3, on resume TVPlugin isn't reloaded.
    And if the TVClient is quickier than TVServer (for the reasons expressed at point 1), a visual feedback could be very useful.


    Thanks again,
    romadd64
     

    JBravo

    MP Donator
  • Premium Supporter
  • November 11, 2007
    269
    27
    Sweden Sweden
    romadd64
    I see your concern.

    I can add a configurable timeout for the time to wait on a repsonse (successfull ping) from the tv server.

    I suspect there already is a timeout for trying to connect to the tv-server, at least the client eventually gives up when a connection to the server can't be established...

    About the visual feedback I'm not so sure, the server is started when the Onresume() method in the tvplugin is called. I don't thinks there's a possibility to show any UI at this point.

    Edit:
    Did some more thinking about the visual feedback. I think its hard to implement (add least compared to this patch).

    Today the MP client will not start-up until an connection to the server is established or the connection times out. The same goes for resuming from standby. That is, the MP client will not be in an state "waiting for server connection" when up and running.

    And more, there is no visual feedback today when starting/resuming from standby. Not even in a single seat installation.

    You can of course post this as an improvement in the improvement sub forum. I think it would be good to have more info when starting/resuming.
     

    romadd64

    MP Donator
  • Premium Supporter
  • October 24, 2007
    82
    15
    Italy Italy
    JBravo,
    I appreciate your willingness.

    The timeout on TVServer connection exists, but as I remember at the moment isn't user configurable.

    About the visual feedback, I hope some developer can help us on the feasibility of the thing.

    Thanks,
    romadd64
     

    arion_p

    Retired Team Member
  • Premium Supporter
  • February 7, 2007
    3,373
    1,626
    Athens
    Greece Greece
    Country flag
    Hi Jonas,

    I have started to evaluate your patch in order to include it in the upcoming Beta, and I have a few questions:

    1. NetworkMonitorHandler is using a timer that ticks every second. I find that a bit excessive. Is there a reason for doing so frequent polling? Couldn't we use for example PS's Elapsed event which fires every minute?
    2. In HandleWakeUpTvServer, you try to resolve the server IP address to a MAC address before waking up the server. This is almost certain to fail (unless the server went on standby a few seconds ago). Is there a reason for that?

    Cheers,

    Arion

    Edit:
    Please also provide some documentation for the patch to update the wiki.
     

    JBravo

    MP Donator
  • Premium Supporter
  • November 11, 2007
    269
    27
    Sweden Sweden
    Hi Arion,

    Some quick answers to your questions;

    1. The reason for the 1 s timer is that the download and upload speed is calculated as dlValue - dlValueOld [values in bytes], and since we calculate the speed each second we get bytes/s directly. It should be possible to increase the timeout to some extent and calculate the speed as (dlValue - dlValueOld) / timeout. However, the timeout should not be too high since the average speed under e.g 1 min could be much lower than the peaks.

    2. I hope I remember this one correctly...the reason is to be able to update the stored MAC address in the "auto mac" case. If the server changes hw the MAC address needs to be updated, this is done be first starting the server (manually) and then start the client. (A note in the wiki would be in its place :).

    Romadd64 did have some good comments about the timeout waiting for the server to wake up, currently the timeout is 10s (which is more than enough in my system) but I think the timeout should be made configurable or at least extended.

    Regards
    /jonas
     

    Users who are viewing this thread

    Similar threads

    Top Bottom