PowerScheduler client and mouse inactivity (1 Viewer)

dero

Retired Team Member
  • Premium Supporter
  • January 16, 2007
    75
    1
    Germany Germany
    @ Shoey Peachew:

    I looked at your error.log, you've got serious problems since the PSClientPlugin couldn't connect to the TV3-Engine:

    -------
    2008-02-17 13:23:56.029210 [ERROR][MPMain]: Unable to start plugin:MediaPortal.Plugins.Process.PowerSchedulerClientPlugin exception:confused:ystem.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
    at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
    at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
    at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
    --- End of inner exception stack trace ---
    ----------

    Moreover, your tvserver_tv.log is not from the beginning (you started setuptv which kills the log). Please restart TV3, MP, play around with your mouse for 5 minutes and then post the logs.


    @ all:

    I coded parts of TV3's PowerScheduler plugin and client-plugin (e.g. controling user inactivity). The guys having problems: Single-seated? Please post TV3 and MP logs, and post your PS-settings for both TV3 and MP.

    Regards

    Dero
     

    Paranoid Delusion

    Moderation Manager
  • Premium Supporter
  • June 13, 2005
    13,062
    2,978
    Cheshire
    United Kingdom United Kingdom
    I looked at your error.log, you've got serious problems since the PSClientPlugin couldn't connect to the TV3-Engine:
    Would that occur if MP itself not running, what are then the exact prerequisites for detecting mouse\keyboard.

    This is how i tested my single seat setup.

    MP closed down, browsing internet, mouse\keyboard activity non stop to technically keep tvserver from closing, no programs listed for exception.

    These are tvserver powerscheduler settings.

    Capture4.JPG Capture5.JPG Capture6.JPG Capture7.JPG

    View attachment 17296

    If i change setting to not allow standby whilst iexplore running no problem.

    Thanks
     

    dero

    Retired Team Member
  • Premium Supporter
  • January 16, 2007
    75
    1
    Germany Germany
    Hm, that's strange. Somehow the mouse/keyboard detection does not work...

    Anyone of you able to do test this C#-sniplet on his system? (The result of GetLastInputTime)

    Code:
        /// <summary>
        /// struct for GetLastInpoutInfo
        /// </summary>
        internal struct LASTINPUTINFO
        {
          public uint cbSize;
          public uint dwTime;
        }
    
        /// <summary>
        /// The GetLastInputInfo function retrieves the time of the last input event.
        /// </summary>
        /// <param name="plii"></param>
        /// <returns></returns>
        [DllImport("user32.dll")]
        static extern bool GetLastInputInfo(ref LASTINPUTINFO plii);
    
        /// <summary>
        /// Returns the current tick as uint (pref. over Environemt.TickCount which only uses int)
        /// </summary>
        /// <returns></returns>
        [DllImport("kernel32.dll")]
        static extern uint GetTickCount();
    
        /// <summary>
        /// This functions returns the time of the last user input recogniized,
        /// i.e. mouse moves or keyboard inputs.
        /// </summary>
        /// <returns>Last time of user input</returns>
        DateTime GetLastInputTime()
        {
          LASTINPUTINFO lastInputInfo = new LASTINPUTINFO();
          lastInputInfo.cbSize = (uint) Marshal.SizeOf(lastInputInfo);
    
          if (!GetLastInputInfo(ref lastInputInfo))
          {
            return DateTime.MinValue;
          }
    
          long lastKick= lastInputInfo.dwTime;
          long tick = GetTickCount();
    
          long delta = lastKick - tick;
    
          if (delta > 0)
          {
          
      // there was an overflow (restart at 0) in the tick-counter!
            delta = delta - uint.MaxValue - 1;
          }
    
          return DateTime.Now.AddMilliseconds( delta );
        }
    Regards

    dero
     

    mfalk

    Portal Pro
    July 10, 2006
    122
    4
    Denmark Denmark
    Code works fine here. It updates everytime i move the mouse or press a button.

    What issues do you see?

    br
    Michael
     

    dero

    Retired Team Member
  • Premium Supporter
  • January 16, 2007
    75
    1
    Germany Germany
    Yeah, works fine for you and me!

    It's part of the algorithm in PS-Plugin that detects the user activity.
    I try to figure out what's wrong with Shoey Peachew.
    That this sniplet might not work on his PC, this is my only clue...



    Regards

    Dero
     

    Paranoid Delusion

    Moderation Manager
  • Premium Supporter
  • June 13, 2005
    13,062
    2,978
    Cheshire
    United Kingdom United Kingdom
    Hi dero

    Where you refering to my logs as well, BTW i'm using Vista Ultimate32, will try with xp and see if same results.

    ps. your other post above with code, just goes rightover the top of my head, hardware yes, software no.

    Cheers
     

    dero

    Retired Team Member
  • Premium Supporter
  • January 16, 2007
    75
    1
    Germany Germany
    @ Paranoid, @ Shoey:

    Actually, both of your logs seem buggy...
    (And indeed, the bug could be caused by Vista?)

    In your log, you see regulary "user input detected" while playback is running. This is sent from MP to the TV3-PS while playback is active (and resets the standby timer).

    However, as soon as you stop the playback, the "user input detected" messages decease, but the should occur every minute as long as you move the mouse or hit a key. Finally, after 15 minutes the shutdown threads kicks off since the system is now idle (no importent process running) and unattended (no user present).

    Regards

    dero
     

    Shoey Peachew

    Portal Member
    June 8, 2006
    20
    1
    @ Shoey Peachew:

    snip- I looked at your error.log, you've got serious problems since the PSClientPlugin couldn't connect to the TV3-Engine:
    That doesn't suprise me since I've installed/uninstalled so many different version of MP(svn), skins and plugins since I started this. As it stands now, I've got everything working and I'm still trying different plugins. When I'm done experimenting I'll restore my OS with Vista backup and reinstall MP for a fresh start. Thanks.
     

    Paranoid Delusion

    Moderation Manager
  • Premium Supporter
  • June 13, 2005
    13,062
    2,978
    Cheshire
    United Kingdom United Kingdom
    Actually, both of your logs seem buggy...
    (And indeed, the bug could be caused by Vista?)
    2008-02-18 19:53:36.546875 [11]: PowerScheduler: User input detected at 18/02/2008 19:53:35

    Using xp, same hardware MPTVServer versions as Vista.

    So definately points at being a Vista exclusive problem.
     

    dero

    Retired Team Member
  • Premium Supporter
  • January 16, 2007
    75
    1
    Germany Germany
    Sure that playback was not running? (i.e. the user input log was triggered by mouse/keyboard moves)

    Regards

    dero
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    bta489 [solved] System goes to Standby during Amazon Prime Playback OnlineVideos 2
    framug [Rejected] Fix PowerScheduler plugin for MP2 single seat Submit: Code Patches 9
    L Mediaportal 1.21 and Windows 10: user schedules de-activated when powerscheduler plugin is selected General Support 1
    D Media Portal wake schedule General Support 29
    P Blocking TV recordings on client? General 5
    -Merkur- MP2 Client startet nicht, "libXBMC_addon.dll" fehlt Allgemeines Support- und Diskussionsforum 1
    C Current NUC or Intel Stick as an MP client for HD playback - minimum requirements? General 6
    CanadianEh MP TV server rebuild with Colossus 2 - Kodi clients receive PMT error when playing videos recoreded by Colossus 2 TV-Server 1
    O [Question] Advice Wanted on Developing a Client Application for a Disabled Family Member MPExtended 7
    ge2301 [WiP] MP2Web - A platform independent web client for MP2 MediaPortal 2 68
    M [solved] WTV Files does not play on client, MPEG files works well General 1
    ge2301 Android based client for MP2 MediaPortal 2 3
    T Client / Server slow channel-to-channel change (zapping) General Support 1
    horned_reaper Standby is prevented by MediaPortal client General Support 0
    P [solved] MP2 new install, 2 x hdhomerun tuners, client on same PC unable to view TV & recordings Newcomers Forum 8
    J Where the heck is the Client side setup? General 2
    T Server / client channel logo location Installation, configuration support 6
    framug [solved] Some changes/fix in MP1 configuration client and server Submit: code patches (MediaPortal/TV-Server/etc.) 14
    C Streaming to clients over Wifi. MP1 or MP2? Newcomers Forum 0
    Golf4 Client verliert immer wieder die Verbindung Allgemeines Support- und Diskussionsforum 4
    A Synchronizing client databases MediaPortal 1 Talk 10
    P Streaming to two clients from the same card Newcomers Forum 1
    TLD Can not watch tv from remote clients Television (MyTV frontend and TV-Server) 19
    R [further infos missing] some movies freezing evry seconds Submit: Bug Reports 9
    R [solved] MP2 Client ist extrem langsam Allgemeines Support- und Diskussionsforum 5
    Similar threads

























    Top Bottom