PowerScheduler client and mouse inactivity | Page 2

Discussion in 'Newcomers Forum' started by Shoey Peachew, February 17, 2008.

  1. dero
    • Premium Supporter

    dero Retired Team Member

    Joined:
    January 16, 2007
    Messages:
    75
    Likes Received:
    1
    Occupation:
    algorithm engineer
    Ratings:
    +1 / 0
    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
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Paranoid Delusion
    • Premium Supporter

    Paranoid Delusion Moderation Manager

    Joined:
    June 13, 2005
    Messages:
    13,062
    Likes Received:
    1,481
    Gender:
    Male
    Occupation:
    Electrical Engineer
    Location:
    Cheshire
    Ratings:
    +1,482 / 0
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    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
     
  4. dero
    • Premium Supporter

    dero Retired Team Member

    Joined:
    January 16, 2007
    Messages:
    75
    Likes Received:
    1
    Occupation:
    algorithm engineer
    Ratings:
    +1 / 0
    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 (Text):
    1.     /// <summary>
    2.     /// struct for GetLastInpoutInfo
    3.     /// </summary>
    4.     internal struct LASTINPUTINFO
    5.     {
    6.       public uint cbSize;
    7.       public uint dwTime;
    8.     }
    9.  
    10.     /// <summary>
    11.     /// The GetLastInputInfo function retrieves the time of the last input event.
    12.     /// </summary>
    13.     /// <param name="plii"></param>
    14.     /// <returns></returns>
    15.     [DllImport("user32.dll")]
    16.     static extern bool GetLastInputInfo(ref LASTINPUTINFO plii);
    17.  
    18.     /// <summary>
    19.     /// Returns the current tick as uint (pref. over Environemt.TickCount which only uses int)
    20.     /// </summary>
    21.     /// <returns></returns>
    22.     [DllImport("kernel32.dll")]
    23.     static extern uint GetTickCount();
    24.  
    25.     /// <summary>
    26.     /// This functions returns the time of the last user input recogniized,
    27.     /// i.e. mouse moves or keyboard inputs.
    28.     /// </summary>
    29.     /// <returns>Last time of user input</returns>
    30.     DateTime GetLastInputTime()
    31.     {
    32.       LASTINPUTINFO lastInputInfo = new LASTINPUTINFO();
    33.       lastInputInfo.cbSize = (uint) Marshal.SizeOf(lastInputInfo);
    34.  
    35.       if (!GetLastInputInfo(ref lastInputInfo))
    36.       {
    37.         return DateTime.MinValue;
    38.       }
    39.  
    40.       long lastKick= lastInputInfo.dwTime;
    41.       long tick = GetTickCount();
    42.  
    43.       long delta = lastKick - tick;
    44.  
    45.       if (delta > 0)
    46.       {
    47.      
    48.   // there was an overflow (restart at 0) in the tick-counter!
    49.         delta = delta - uint.MaxValue - 1;
    50.       }
    51.  
    52.       return DateTime.Now.AddMilliseconds( delta );
    53.     }
    54.  
    Regards

    dero
     
  5. mfalk

    mfalk Portal Pro

    Joined:
    July 10, 2006
    Messages:
    122
    Likes Received:
    4
    Ratings:
    +4 / 0
    Home Country:
    Denmark Denmark
    Show System Specs
    Code works fine here. It updates everytime i move the mouse or press a button.

    What issues do you see?

    br
    Michael
     
  6. dero
    • Premium Supporter

    dero Retired Team Member

    Joined:
    January 16, 2007
    Messages:
    75
    Likes Received:
    1
    Occupation:
    algorithm engineer
    Ratings:
    +1 / 0
    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
     
  7. Paranoid Delusion
    • Premium Supporter

    Paranoid Delusion Moderation Manager

    Joined:
    June 13, 2005
    Messages:
    13,062
    Likes Received:
    1,481
    Gender:
    Male
    Occupation:
    Electrical Engineer
    Location:
    Cheshire
    Ratings:
    +1,482 / 0
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    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
     
  8. dero
    • Premium Supporter

    dero Retired Team Member

    Joined:
    January 16, 2007
    Messages:
    75
    Likes Received:
    1
    Occupation:
    algorithm engineer
    Ratings:
    +1 / 0
    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
     
    • Like Like x 1
  9. Shoey Peachew

    Shoey Peachew Portal Member

    Joined:
    June 8, 2006
    Messages:
    20
    Likes Received:
    1
    Ratings:
    +1 / 0
    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.
     
  10. Paranoid Delusion
    • Premium Supporter

    Paranoid Delusion Moderation Manager

    Joined:
    June 13, 2005
    Messages:
    13,062
    Likes Received:
    1,481
    Gender:
    Male
    Occupation:
    Electrical Engineer
    Location:
    Cheshire
    Ratings:
    +1,482 / 0
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    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.
     
  11. dero
    • Premium Supporter

    dero Retired Team Member

    Joined:
    January 16, 2007
    Messages:
    75
    Likes Received:
    1
    Occupation:
    algorithm engineer
    Ratings:
    +1 / 0
    Home Country:
    Germany Germany
    Sure that playback was not running? (i.e. the user input log was triggered by mouse/keyboard moves)

    Regards

    dero
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!