MP Crashes every time I turn TV off - than back on (windows program error) (1 Viewer)

Owlsroost

Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    @Owlsroost I wonder if the comment in this issue gives us some clues:
    https://issues.team-mediaportal.com/browse/MP1-2378

    I think that issue is why there is now a 'Stop playback on removal of audio renderer' tickbox in MP Config -> startup/resume settings (so maybe that Jira issue should be closed ?).

    If I'm understanding it correctly, the crash being discussed here is happening when MP is not playing anything - it's (possibly) MP's response to the device removal/insertion messages which is causing it, so maybe that's where we should put the extra logging (in the message handling/response code) - at least it might give us a more precise indication when it crashes ?
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    I think that issue is why there is now a 'Stop playback on removal of audio renderer' tickbox in MP Config -> startup/resume settings (so maybe that Jira issue should be closed ?).
    Maybe... but it looks like the EC_ codes that Scythe42 mentioned are not actually used in our code... so I'm not certain. The audio renderer add/remove detection seems to be based on WM_DEVICECHANGE.

    If I'm understanding it correctly, the crash being discussed here is happening when MP is not playing anything - it's (possibly) MP's response to the device removal/insertion messages which is causing it, so maybe that's where we should put the extra logging (in the message handling/response code) - at least it might give us a more precise indication when it crashes ?
    You're right - I think I'm too tired and getting these threads mixed up. Sorry.

    @Scythe42 we could really use your input here. Please. :)
     

    dquancey

    Portal Member
    July 31, 2009
    23
    1
    Home Country
    I've tested optical out today. Htpc > amp.
    Then HDMI from htpc > TV.

    Works flawlessly in mediaportal. Fingers crossed anyway.

    I don't want to route my audio out via this way, rather it be HDMI so I can have full CEC and HDMI control.

    So if you guys in the know could look for a fix, I'd love to give it a try.
     

    Owlsroost

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    I've tested optical out today. Htpc > amp.
    Then HDMI from htpc > TV.

    Works flawlessly in mediaportal. Fingers crossed anyway.

    I don't want to route my audio out via this way, rather it be HDMI so I can have full CEC and HDMI control.

    So if you guys in the know could look for a fix, I'd love to give it a try.

    OK, so I think that confirms it's an audio renderer related problem causing the crashes.

    In the all-HDMI PC->AVR->TV setup, was the HDMI audio the only audio playback device available, or was there another audio device (e.g. motherboard audio) available as well ?
     

    dquancey

    Portal Member
    July 31, 2009
    23
    1
    Home Country
    There was SPDIF/Digital, which is what I'm currently using. But other than that, HDMI was the only other.

    Might be relevant, but when switching the amp on, with audio and video causing problems, the TV states its 420p then 578p then 1080p. Cycles for roughly 3 secs. Not sure if that causes a problem?
     

    Owlsroost

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    Might be relevant, but when switching the amp on, with audio and video causing problems, the TV states its 420p then 578p then 1080p. Cycles for roughly 3 secs. Not sure if that causes a problem?

    It shouldn't, but (somehow) it probably is, in the sense that something somewhere in MP isn't handling it properly (or there is a memory leak etc after a few iterations).
     

    Scythe42

    Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    50
    Berlin
    Home Country
    Germany Germany
    @Scythe42 we could really use your input here. Please. :)

    Current MediaPortal.cs only works on detecting hardware changes as some kind of solution for this long standing issues as it already has means to deal with PnP Events. But the issue is DirectShow related. The stopping is a workaround and can be removed together with the Cofiguration.exe options once a proper error handling is added. But leave the detection of which device was removed for trouble shooting issues in the future.

    Please check http://msdn.microsoft.com/en-us/library/windows/desktop/dd375626(v=vs.85).aspx how to do it with example code.

    For our code the easiest way would be to setup DS events as a private app event using SetWindowNotify for WM_GRAPHNOTIFY messages and deal with them in the WndProc of MediaPortal.cs. This needs to be done in all players when the graph is setup and on grahp stopping the handle needs to be released of course.

    Then on a WM_GRAHPHNOTIFY message you do a while loop as long as GetEvent has messages in the queue and process all the EC messages.

    See http://msdn.microsoft.com/en-us/library/windows/desktop/dd377532(v=vs.85).aspx for a full example.

    Currently WM_GRAPHNOTIFY is not checked as the players do not setup the notification at all.

    The same problem as with HDMI would for example occur with USB headphones or speakers for example s well.

    I am not sure if MP needs to do some additional stuff when the default direct show device changes as a result of the removal of an audio renderer. But one step at a time.

    First DirectSHow needs error handling. It currently does not have a proper one.
     
    Last edited:

    slikvik

    Portal Pro
    May 8, 2006
    54
    10
    Hi Guys,

    Just wanted to say that in conjunction with the other problem I'm having which we're discussing in another thread (to do with desktop showing on S3 resume), I'm also having this problem on an irregular basis. I haven't got logs for you yet (the ones in the other thread are purposely without this crash so as not to confuse matters), but I was trying last night to see if I could actively replicate the problem.

    The reason for this post is to say that I am also using an Intel HD (3000 in my case) with HDMI out - including audio - to an AMP and then to the TV. It seems quite a common setup in both this and the issue in the other thread and I don't know if it's relevant or just a popular setup for a HTPC.
     

    shackrock

    Portal Pro
    December 27, 2008
    291
    12
    Raleigh, NC
    Home Country
    United States of America United States of America
    Hi all. Finally have a bunch of logs for this. A majority of them are just like my OP - however the latest one here (30_09_13__08_28) happened while just sitting on the main MP screen with the TV on. No idea why this randomly crashed...

    Hope this helps...

    Thanks,
    Scott
     

    Owlsroost

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    The latest one is obvious in the logs:

    Code:
    [2013-09-30 08:26:01,086] [Error  ] [MusicShareWatcher] [ERROR] - MediaPortal: Unhandled exception occured
    [2013-09-30 08:26:01,086] [Log    ] [MusicShareWatcher] [ERROR] - Exception: System.IO.FileNotFoundException: Error reading the \\solonas\DEC2010\Solo_iTunes_LIB\iTunes Music directory.
      at System.IO.FileSystemWatcher.StartRaisingEvents()
      at System.IO.FileSystemWatcher.set_EnableRaisingEvents(Boolean value)
      at MediaPortal.MusicShareWatcher.MusicShareWatcherHelper.WatchShares()
      at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
      at System.Threading.ExecutionContext.runTryCode(Object userData)
      at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
      at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
      at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
      at System.Threading.ThreadHelper.ThreadStart()  Message: Error reading the \\solonas\DEC2010\Solo_iTunes_LIB\iTunes Music directory.  Site  : Void StartRaisingEvents()  Source : System  Stack Trace:    at System.IO.FileSystemWatcher.StartRaisingEvents()
      at System.IO.FileSystemWatcher.set_EnableRaisingEvents(Boolean value)
      at MediaPortal.MusicShareWatcher.MusicShareWatcherHelper.WatchShares()
      at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
      at System.Threading.ExecutionContext.runTryCode(Object userData)
      at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
      at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
      at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
      at System.Threading.ThreadHelper.ThreadStart()
    [2013-09-30 08:26:01,476] [Log    ] [MPMain  ] [INFO ] - Main: Deactivation request received
    [2013-09-30 08:28:04,888] [Log    ] [MPMain  ] [INFO ] - Main: Activation reuqest received

    ....the MusicShareWatcher plugin had 'FileNotFoundException: Error reading the \\solonas\DEC2010\Solo_iTunes_LIB\iTunes Music directory.'
     

    Users who are viewing this thread

    Top Bottom