Weird GPU crash -- possible cause: resizing media (1 Viewer)

RoChess

Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,348
    1,828
    Country flag
    • Thread starter
    • Moderator
    • #1
    I've been dealing with weird crashes. The display would go into a checkerboard, or mainly a giant purple banner across the screen. Audio would then play a few more seconds, and then eventually MediaPortal restarts and I can resume play and never experience the crash again, until the next time I power up the HTPC. Totally expected it to be hardware related all this time, and don't have time yet to test replacement parts, but because it is so consistent I've started to see better patterns that I need to investigate more.

    HTPC is outputting at 4K resolution with Windows OS set to 200% scaling (bringing that up, cuz it has lead to issues before such as splash-screen version label positioning, which @ajs has fixed now). The logs show a 3D crash, but there are weird entries right before when MediaPortal calculates the offsets, and resize X-coordinates are way off in a negative point and that is when crash happens.

    What I found out recently is that when I play just widescreen 4K files then it does not crash. Need way more tests to confirm, but it seems to be that way, which is why I'm creating this thread, to hopefully find others with the same issue that can help debug with a wider range of hardware.

    Checkerboard happens in a flash, so I never find the time to get camera in time, but Google image search allowed me to find one that looked close enough:



    I keep updating Radeon 2020 drivers, and the 1/3rd height purple stripe across the screen horizontal near the bottom is the more current crash result, but not able to find an image on that. That seems to be relating to DXVA though, as I've seen that shade of pink before in the past on DXVA issues.

    MediaPortal Error log crash entry is always something like:

    Code:
    [2020-05-02 22:47:34,162] [Log    ] [MPMain   ] [ERROR] - Exception: Error in the application.
    -2005530508 (Unknown)
       at Microsoft.DirectX.Direct3D.Device.PresentInternal(tagRECT* sourceRectangle, tagRECT* destRectangle, IntPtr overrideWindow)
       at Microsoft.DirectX.Direct3D.Device.Present()
       at MediaPortal.D3D.RecoverDevice()  Message: Error in the application.  Site   : Void PresentInternal(Microsoft.DirectX.PrivateImplementationDetails.tagRECT*, Microsoft.DirectX.PrivateImplementationDetails.tagRECT*, IntPtr)  Source : Microsoft.DirectX.Direct3D  Stack Trace:     at Microsoft.DirectX.Direct3D.Device.PresentInternal(tagRECT* sourceRectangle, tagRECT* destRectangle, IntPtr overrideWindow)
       at Microsoft.DirectX.Direct3D.Device.Present()
       at MediaPortal.D3D.RecoverDevice()
    Attached is FULL mediaportal.log showing 2x Lost-in-Space 4K episodes playing fine, then I launched Stephen Colbert episode in 1080p and moments later it crashes the GPU, restarts MediaPortal and then I can play everything fine (including the episode that crashed).

    One thing that strikes me as odd is the overlay positioning calculation:

    Code:
    Lost in Space 2x01:
    
           [2020-05-02 21:13:15,509] [Log    ] [MPMain   ] [INFO ] - overlay: src        : (0,0)-(0,0)
           [2020-05-02 21:13:15,509] [Log    ] [MPMain   ] [INFO ] - overlay: dst        : (0,-2147483648)-(3840,0)
    
           [2020-05-02 21:13:16,062] [Log    ] [MPMain   ] [INFO ] - overlay: src        : (0,0)-(0,0)
           [2020-05-02 21:13:16,063] [Log    ] [MPMain   ] [INFO ] - overlay: dst        : (0,-2147483648)-(3840,0)
    
           [2020-05-02 21:13:16,310] [Log    ] [MPMain   ] [DEBUG] - PlaneScene: src        : (0,0)-(3840,1744)
           [2020-05-02 21:13:16,311] [Log    ] [MPMain   ] [DEBUG] - PlaneScene: dst        : (0,207)-(3840,1953)
    
    Lost in Space 2x02:
    
           [2020-05-02 22:02:04,876] [Log    ] [MPMain   ] [INFO ] - overlay: src        : (0,0)-(0,0)
           [2020-05-02 22:02:04,877] [Log    ] [MPMain   ] [INFO ] - overlay: dst        : (0,-2147483648)-(3840,0)
    
           [2020-05-02 22:02:05,315] [Log    ] [MPMain   ] [INFO ] - overlay: src        : (0,0)-(0,0)
           [2020-05-02 22:02:05,316] [Log    ] [MPMain   ] [INFO ] - overlay: dst        : (0,-2147483648)-(3840,0)
    
           [2020-05-02 22:02:05,426] [Log    ] [54       ] [DEBUG] - PlaneScene: src        : (0,0)-(3840,1744)
           [2020-05-02 22:02:05,427] [Log    ] [54       ] [DEBUG] - PlaneScene: dst        : (0,207)-(3840,1953)
    
    Stephen Colbert:
    
           [2020-05-02 22:47:19,591] [Log    ] [MPMain   ] [INFO ] - overlay: src        : (0,0)-(0,0)
           [2020-05-02 22:47:19,592] [Log    ] [MPMain   ] [INFO ] - overlay: dst        : (0,-2147483648)-(3840,0)
    
           [2020-05-02 22:47:19,877] [Log    ] [MPMain   ] [INFO ] - overlay: src        : (0,0)-(0,0)
           [2020-05-02 22:47:19,878] [Log    ] [MPMain   ] [INFO ] - overlay: dst        : (0,-2147483648)-(3840,0)
    
           [2020-05-02 22:47:20,047] [Log    ] [124      ] [DEBUG] - PlaneScene: src        : (0,0)-(1920,1080)
           [2020-05-02 22:47:20,048] [Log    ] [124      ] [DEBUG] - PlaneScene: dst        : (0,0)-(3840,2160)
    Really hoping I'm not the only one :censored:
     

    Attachments

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,068
    1,276
    Southampton
    United Kingdom United Kingdom
    Country flag
    One thing that strikes me as odd is the overlay positioning calculation
    I have noticed an error in MP's calculation of the video screen size. It occurs sometimes when switching between full screen and windowed. This is what I said in a post dated 2018-11-21:

    Looking at the logs, the screen size starts off as 1920x1080, but somewhere it seems to change to 1920x1030, with the video being mapped onto 1875x1030.

    I notice this because it causes black vertical bars on the left and right edges of the full-screen video. The MP panels don't have these black bars, but my skin layout calculations are affected, and I end up with one less row in lists (e.g. in the "Recorded TV" panel).

    I have not found any way to reset this other than exiting MP and restarting.

    -- from CyberSimian in the UK
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    12,446
    7,140
    Kyiv
    Ukraine Ukraine
    Country flag
    -2005530508 (Unknown)
    Error -2005530508 in the log, which means "D3DERR_DEVICEHUNG", "Hardware adapter reset by OS" :)

    Code:
        // ERR_DEVICEHUNG indicates that the device that returned this code caused
        // the hardware adapter to be reset by the OS. Most applications should
        // destroy the device and quit. Applications that must continue should
        // destroy all video memory objects (surfaces, textures, state blocks etc)
        // and call Reset() to put the device in a default state. If the
        // application then continues rendering in the same way, the device will
        // return to this state.
        // Applies to Direct3D 9Ex only.
        ERR_DEVICEHUNG = -2005530508
    @Sebastiii :coffee::whistle:
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,348
    1,828
    Country flag
    • Thread starter
    • Moderator
    • #4
    Error -2005530508 in the log, which means "D3DERR_DEVICEHUNG", "Hardware adapter reset by OS" :)
    Totally aware that this is hardware related, but the problem is that it only appears to happens on specific media files (the non-4K ones that get upscaled based on recent testing), and it was never an issue in the past. The problem is that system was offline for quite a while until I fixed HDD failure (was using a Roku and nNidia Shield with Kodi for a while) and a massive amount of items got updated once system was on-line again to scan for updates, including OS, drivers, MediaPortal, and all the plugins.

    And of course hardware could in extreme rare case have degraded to cause this issue at a hardware level, albeit unlikely.

    Just difficult to imagine it is hardware though as when the crash happens within minutes after a cold-boot when playing upscaled media, but after MediaPortal restarts automatically then it never crashes again. Can play upscaled and 4K media 24/7 without issues, but the moment I power system down, then the next time it boots up I'm just waiting for the crash, which is annoying to say the least.

    Just don't have the time to spend days in reinstalling OS, trying different chipset/video drivers revisions, wide range of MediaPortal versions, plugin versions, etc. We're talking thousands of combinations it can be due to the many conditions at play. Plan to try a select few though, just to test/see, but just won't have the time for that for a while, so was hoping running some MediaPortal test builds that extra log entries could provide more insights.

    Or should I just run into Trace mode for a while? The issue is random, but extremely reliable to test for as it always happens within minutes of playing upscaled media.
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,348
    1,828
    Country flag
    • Thread starter
    • Moderator
    • #5
    I'm curious now what would happen if DirectX 12 is forced, but that's probably not an easy thing to try.

    Not like DX9 is needed, because even Windows 7 got a backport of DX12, so any active supported OS (and Win7 is really on it's last limbs) supports DX12, so it would be a matter of hardware support, and curious now how many MediaPortal users are still relying on hardware that doesn't support DirectX 10, 11, or 12.

    I would think that relying on more modern versions would speed things up, especially if MediaPortal gets ported to .NET5

    Just thinking out loud :whistle:
     

    HTPCSourcer

    MP2 Product Manager
  • Team MediaPortal
  • May 16, 2008
    11,431
    2,334
    Germany Germany
    Country flag
    Not like DX9 is needed, because even Windows 7 got a backport of DX12
    Things are a little bit more complicated. DX12 lacks certain DShow filters that the current MP code requires to play video and TV. These filters have not been completely removed by Microsoft but are now part of the Windows platform itself. While this could in principle be addressed by the MP software, you would then need to adopt different Windows versions.

    In the end it needs somebody who looks at it and adjusts the code.
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    12,446
    7,140
    Kyiv
    Ukraine Ukraine
    Country flag
    I think we need wait @Sebastiii Maybe he knows how to get around this error so that the media portal does not fall, or maybe he just started playing the file from the place it occurred.
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,447
    10,273
    France
    France France
    Country flag
    Hi, nope I have don't a solution when this error happen, I remember trying to reset GPU under MP but need to have MP restarted not like audio hardware.
    It was often related to Intel when refresh rate kick in but here it's an ATI but maybe it's 4K related, I can't debug this, I don't have any 4k hardware :(
    The error happen when audio hardware is removed, I would say that maybe a driver is causing it.
    Hard to tell :(
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,348
    1,828
    Country flag
    • Thread starter
    • Moderator
    • #9
    I don't have any 4k hardware :(
    If it keeps annoying me enough I'll have to help you with that :whistle:

    The error happen when audio hardware is removed, I would say that maybe a driver is causing it.
    Hard to tell :(
    That's weird, because video locks up first with audio still playing for a few more seconds before MediaPortal restarts, but this will give me a few more avenues to test for. The main difference is that when I was on 1.19-1.21 without this issue that it was HTPC -> Marantz -> LG 65" 4K, and now it's an Optoma HD27HDR projector which on the input side pretends to be a 4K projector, but has 1080p output. Want one of those 4K native laser projectors, but price needs to drop a lot first.

    So, once I get around to drill more holes and add more molly-bolts to the TV-mount the TV will be available again, but in the meantime I'll switch HTPC to 1080p for a while to see if crash disappears.

    Well aware that for a developer reproducibility is key to even begin contemplating a solution, as logs are often not enough, or at least to have a verifiable way to check if bug got fixed. Will try to get more scenarios to go through, but it is just sooooo freaking time-consuming, and I have to balance it with work, and preferring to use MediaPortal to watch media :rolleyes:
     

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

    OP Similar threads Forum Replies Date
    R Directx 9.0 June 2010 does not install on Windows 10 x64, ends up with weird failure / no debug file Installation, configuration support 0
    R Weird sleep/resume loop General Support 4
    RoChess Random GPU crash leads to MePo restart, but works fine afterwards MediaPortal 1 14
    S Gpu/hdtv/mp setup help please Newcomers Forum 3
    F MediaPortal 1.16 server crashing due to user error? General Support 5
    L Service keeps crashing General 5
    U [solved] MediaPortal crashing on startup General Support 10
    torone Dritter versuch mit Mediaportal 2 Allgemeines Support- und Diskussionsforum 1
    W [solved] MP suddenly Crashes when starting live TV on most channels and on recordings from the same channels General Support 20
    W [solved] MP suddenly Crashes when starting live TV on some channels and on some recordings Television (MyTV frontend and TV-Server) 1
    D [solved] Changed username in Win10, now TV Server config crashes on fresh install Installation, configuration support 1
    ajs Trakt error when start with MP crash Trakt 1
    R TV server crash with WintTV quadHD General 0
    Dark Eyes TVService locks up or fails to restart on resuming from sleep, and crashes when grabbing EPG Installation, configuration support 7
    atlantic [solved] MP1.24 Pre released crash in TV General Support 12
    R [fixed] [MP2-819] MP2 Server crashes on ATSC OTA channel scan Submit: Bug Reports 33
    doskabouter 1.23.0 Crash when skipping in a dvd Bugreports 3
    J [fixed] [MP2-833] 2.2.2 server crash during import Submit: Bug Reports 50
    P MP2 TV Server crashes when starting - throws error remoting exception General 2
    G MP Crashed during setting up recording. Newcomers Forum 1
    Rob Hexenmeister DVD Skip steps causing crash General Support 2
    badboyxx MP 1.22 final is crashing when jumping forward while playing DVD-Iso watch/edit Videos 26
    Terra Crash when opening ACTORS list My TVSeries 3
    Terra Crash when searching movies, reproducable Moving Pictures 2
    KlausWirn Music crash Bass crash no change to play music Installation, configuration support 2
    Similar threads

























    Top Bottom