PowerScheduler client and mouse inactivity (1 Viewer)

dero

Retired Team Member
  • Premium Supporter
  • January 16, 2007
    75
    1
    Home Country
    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
    Home Country
    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.JPGCapture5.JPGCapture6.JPGCapture7.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
    Home Country
    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
    Home Country
    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
    Home Country
    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
    Home Country
    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
    Home Country
    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
    Home Country
    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
    Home Country
    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

    Top Bottom