Call for tester for 1.4.0 features and fixes (3 Viewers)

Status
Not open for further replies.

disaster123

MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    alright[DOUBLEPOST=1365448291][/DOUBLEPOST]Added return to the minimizewindow function but it does not help at all. Minidisplay still missing in log while shutting down.

    Code:
    [2013-04-08 21:09:46,219] [Log ] [15 ] [DEBUG] - PSClientPlugin: Shutdown thread is running: Hibernate, force: False
    [2013-04-08 21:09:46,220] [Log ] [15 ] [DEBUG] - PSClientPlugin: Informing handlers about UserShutdownNow
    [2013-04-08 21:09:46,242] [Log ] [15 ] [INFO ] - PSClientPlugin: Shutdown is allowed True ; forced: False
    [2013-04-08 21:09:46,246] [Log ] [15 ] [DEBUG] - PSClientPlugin: No pending events found in the future which should wakeup the system
    [2013-04-08 21:09:46,249] [Log ] [15 ] [INFO ] - PSClientPlugin: Entering shutdown Hibernate ; forced: False
    [2013-04-08 21:09:46,255] [Log ] [11 ] [DEBUG] - WindowsController: Performing ExitWindows Hibernate, force: False
    [2013-04-08 21:09:47,271] [Log ] [MPMain ] [INFO ] - Main: WM_POWERBROADCAST: 4
    [2013-04-08 21:09:47,271] [Log ] [MPMain ] [INFO ] - Main: Suspending operation.
    [2013-04-08 21:09:47,272] [Log ] [MPMain ] [INFO ] - Main: Stopping playback
    [2013-04-08 21:09:47,273] [Log ] [MPMain ] [DEBUG] - Main: SaveLastActiveModule - enabled False
    [2013-04-08 21:09:47,274] [Log ] [MPMain ] [INFO ] - Main: Stopping Input Devices
    [2013-04-08 21:09:47,276] [Log ] [MPMain ] [INFO ] - Main: Stopping AutoPlay
    [2013-04-08 21:09:47,279] [Log ] [MPMain ] [INFO ] - open folderdatabase
    [2013-04-08 21:09:47,283] [Log ] [MPMain ] [INFO ] - picture database opened
    [2013-04-08 21:09:47,284] [Log ] [MPMain ] [INFO ] - Main: VideoDatabaseV5.db3 sqllite database cache flushed to disk.
    [2013-04-08 21:09:47,287] [Log ] [MPMain ] [INFO ] - Main: OnSuspend - Done
    [2013-04-08 21:09:47,287] [Log ] [MPMain ] [INFO ] - TVHome.WndProc(): Windows is suspending
    [2013-04-08 21:09:47,287] [Log ] [MPMain ] [DEBUG] - TVHome.OnSuspend()
    [2013-04-08 21:09:47,288] [Log ] [MPMain ] [INFO ] - TvNotify: stop
    [2013-04-08 21:09:47,288] [Log ] [MPMain ] [DEBUG] - TVHome: HeartBeat Transmitter stopped.
    [2013-04-08 21:09:47,328] [Log ] [MPMain ] [DEBUG] - PSClientPlugin: No pending events found in the future which should wakeup the system
    [2013-04-08 21:09:47,369] [Log ] [MPMain ] [DEBUG] - Main: WM_ACTIVATE
    [2013-04-08 21:09:47,370] [Log ] [MPMain ] [INFO ] - Main: Deactivation Request Received
    [2013-04-08 21:09:47,371] [Log ] [MPMain ] [DEBUG] - D3D: OnLostFocus()
    [2013-04-08 21:09:49,123] [Log ] [MPMain ] [DEBUG] - Main: WM_DEVICECHANGE (Event: 32772)
    [2013-04-08 21:09:49,143] [Log ] [MPMain ] [DEBUG] - Main: WM_DEVICECHANGE (Event: 32772)
    [2013-04-08 21:09:49,143] [Log ] [MPMain ] [INFO ] - Main: Audio Renderer AMD High Definition Audio Device removed
    [2013-04-08 21:09:49,170] [Log ] [MPMain ] [DEBUG] - Main: WM_DEVICECHANGE (Event: 32772)
    [2013-04-08 21:09:49,189] [Log ] [MPMain ] [DEBUG] - Main: WM_DEVICECHANGE (Event: 32772)
    [2013-04-08 21:09:51,376] [Log ] [GenericPCQueue] [DEBUG] - MPControlPlugin: Received Message "ServerSuspend"
     

    FreakyJ

    Retired Team Member
  • Premium Supporter
  • July 25, 2010
    4,024
    1,420
    Home Country
    Germany Germany
    So I tested the volume handler thing with the version 16a again and it is working here ;)
    But I also can't find this log line:
    Log.Info("Main: OnResume - Could not initialize volume handler: ", exception.Message);

    So maybe no exception on my side... strange
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    To me it happens as MP tries to initialize the volume handler with the HDMI Audio device which is NOT present at this time as the HDMI Connection is not already established.
     

    FreakyJ

    Retired Team Member
  • Premium Supporter
  • July 25, 2010
    4,024
    1,420
    Home Country
    Germany Germany
    maybe you can write down you steps to reproduce?
    What I've done:
    - watching Tv (the option stop playback is disabled)
    - unplug hdmi /replug hdmi
    - picture is there, but without sound
    - turning the volume up and down, saw the bars but nothing happen (as expected)
    - stopped playback
    - started again => sound was there
    - checked logs: no exceptions, nothing :)
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    i've option stop playback checked. I press the button on my remote for going to hibernate. Then whole windows hibernates. I then just switch the htpc on again. In around 50% volume works and the other 50% it gives me an exception. I have to restart MP to get sound again.[DOUBLEPOST=1365449009][/DOUBLEPOST]Regarding Minidisplay - it uses SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(this.SystemEvents_PowerModeChanged); and the other who work fine uses wndproc.
     

    FreakyJ

    Retired Team Member
  • Premium Supporter
  • July 25, 2010
    4,024
    1,420
    Home Country
    Germany Germany
    can't that case right now, have some ongoing recordings, but maybe you can still test the "offical" binaries and report back :)
    Maybe also provide logs if you not already done that :p
     

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    4,646
    3,102
    Nuenen
    Home Country
    Netherlands Netherlands
    While checking for issues with btweb, I did notice in MP 1.4 that command line parameters weren't parsed. Is this correct?
    I have /fullscreen and /screen=1, but neither of them had any influence on screen selection/window size
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    Mhm minidisplay always works if i enable extensive logging - race condition? No time to get the SystemEvent in thread whithout logging?
     

    Scythe42

    Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    51
    Berlin
    Home Country
    Germany Germany
    Log.Info("Main: OnResume - Could not initialize volume handler: ", exception.Message);

    So maybe no exception on my side... strange
    Does not happen on all systems in all cases. All Volume Handler initialization should be in try/catch blocks, so that no exception gets thrown. Also everytime after an audio renderer disconnects/connects I try to create new volume handler.

    That should do the trick and did for you and I think lightning as well. Don't know why disaster is even seeing the exception because none is thrown.

    I need someone else to confirm that there still is a problem.
     
    Last edited:

    Scythe42

    Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    51
    Berlin
    Home Country
    Germany Germany
    Mhm minidisplay always works if i enable extensive logging - race condition? No time to get the SystemEvent in thread whithout logging?
    Yep, race condition.

    When suspending Windows, it shuts down the message pump at some point when all forms processed the message. The OnSomething (forgot the exact name) event handler for power management events only works while the message pump for a form is running. And as the Mini Display is not really running in its own form this kind of event handler should have never been used here. To work properly on all conditions the Mini Display Plugin would need to create an invisible form (and that would be really really ugly).

    Probably logging something prevents the message pump from shutdown or delay it a bit until information is actually written to the log.

    A proper fix would be that MP actually broadcasts its own suspend message to all plugins in case they have running threads and need to do stuff. In Core MP the MiniDisplay is the only part of the whole code relying on the .NET Event Handler in regards to Power Management events.

    I'll browse a bit over the mini display code to check what it does different when the switch is checked. In the end we have a bug in the MiniDisplay code base. That it worked on 1.3.0 could be the related to some other changes in master as well or was just sheer luck. Probably the OnSuspend() is now a few ms too fast.

    Also note that WndProc() provides a proper return code that the message has been processed. I do not know if it did this before. That might speed suspending a bit up and before Windows waited for MP a few ms longer before shutting down the message pump for it on its own (bad thing, as we need to do stuff).

    What you could try:
    • Remove the " msg.Result = (IntPtr)1;" at the end of "case WM_POWERBROADCAST:", that should be right at the top of WndProc() in MediaPortal.cs
    • Add a "thread.sleep(1000)" to OnSuspend() in MediaPotal.cs with the intent of the MP form not shutting down too quickly as a test case. That would delay the return code in regards to WM_POWERBROADCAST.

    Let me know how these two things work out.
     
    Last edited:
    Status
    Not open for further replies.

    Users who are viewing this thread

    Top Bottom