DirectX Device Lost Error (1 Viewer)

robbo100

Retired Team Member
  • Premium Supporter
  • May 5, 2009
    1,290
    309
    UK
    Home Country
    United Kingdom United Kingdom
    Hi there,

    Just recently I have started having a problem whereby when I finish watching TV, I can not get it to restart again. This is usually after the system has gone to sleep and woken back up again, and the problem started coincidentally with my updating the powerscheduler++ plugin. I ended up doing a complete re-install to recover back to the baseline powerscheduler (the one supplied with MP), but still had the problem.

    Further investigation shows that it is maybe linked to the refresh rate changer. Essentially, from what I can tell, everytime the system changes refresh rate, I get the following error in the error.log file:

    2010-12-18 19:16:32.484375 [ERROR][MPMain(1)]: Main: Device lost - Error in the application.
    -2005530520 (D3DERR_DEVICELOST)
    at Microsoft.DirectX.Direct3D.Device.PresentInternal(tagRECT* sourceRectangle, tagRECT* destRectangle, IntPtr overrideWindow)
    at Microsoft.DirectX.Direct3D.Device.PresentInternal(tagRECT* sourceRectangle, tagRECT* destRectangle, Control overrideWindow)
    at Microsoft.DirectX.Direct3D.Device.Present()
    at MediaPortalApp.Render(Single timePassed)

    When I get this error, I can not get MP to play TV/video and even a full re-boot doesn't fix the problem. I have to re-boot, run the TV Server config, preview a TV programme, close the TV Server config, then run MP and it works! Presumably running the config and re-initialises something??

    I have now put a tick in the refreshrate changer option for "Use device reset" and although I continue to get the error message every time I press stop whilst the TV is playing, it seem to have worked round the problem (although I have not done a full test yet to ensure WAF, and clearly have not actually "fixed" the problem cause).

    Does anyone know what might have caused this new problem and how I might be able to fix the root cause? Could a reinstall of Direct X help?

    Logs attached.

    :D

    MediaPortal Version: 1.1.2.0
    MediaPortal Skin: X-Factor
    Windows Version: XP SP3
    CPU Type: Intel E7400
    HDD: 700 GB on 2 drives (3 volumes) locally with 1GB FreeNAS
    Memory: 2 GB DDR2
    Motherboard: Gigabyte GA-EP41-UD3L
    Video Card: NVIDIA 9400GT
    Video Card Driver: NVIDIA 195.81
    Sound Card: Onboard REALTEK
    Sound Card AC3: SPDIF Optical Out
    Sound Card Driver: Latest
    1. TV Card: Pinnacle 300i
    1. TV Card Type: DVB-T
    1. TV Card Driver: Latest
    2. TV Card: Compro Videomate S350
    2. TV Card Type: DVB-S
    2. TV Card Driver: Latest
    3. TV Card: Hauppague WinTV HD S2
    3. TV Card Type: DVB-S2
    3. TV Card Driver: Latest
    4. TV Card:
    4. TV Card Type:
    4. TV Card Driver:
    MPEG2 Video Codec: Cyberlink 10
    MPEG2 Audio Codec: ffdshow
    h.264 Video Codec: Cyberlink 10
    Satelite/CableTV Provider: UK Freesat
    HTPC Case: Bog standard PC case with wires running through the wall to lounge
    Cooling:
    Power Supply:
    Remote: Cyberlink cheapo
    TV: LG 47LE5300 LCD LED
    TV - HTPC Connection: HDMI
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    I have now put a tick in the refreshrate changer option for "Use device reset" and although I continue to get the error message every time I press stop whilst the TV is playing, it seem to have worked round the problem (although I have not done a full test yet to ensure WAF, and clearly have not actually "fixed" the problem cause).

    Does anyone know what might have caused this new problem and how I might be able to fix the root cause?

    Windows XP uses DirectX 9 and it wont support changing display mode or refresh rate on the fly, but instead it will issue "device lost" and requires application to completely restart the rendering (textures need to be reloaded etc.). MP1 doesn't always behave so nicely with that.

    Windows Vista and Windows 7 have DirectX 9 Ex available. It supports virtual D3D devices which don't trigger device lost / complete reset on refresh rate change.

    In short, refresh rate changer in MP is not always working correctly with Windows XP because of the limitations in the DirectX itself and the Skin Engine code in MP. If possible test how Windows 7 behaves otherwise (that specific issue should be gone).

    Could a reinstall of Direct X help?

    No.
     

    robbo100

    Retired Team Member
  • Premium Supporter
  • May 5, 2009
    1,290
    309
    UK
    Home Country
    United Kingdom United Kingdom
    Tourettes,

    Thanks for a very quick and informative reply.

    In short, refresh rate changer in MP is not always working correctly with Windows XP because of the limitations in the DirectX itself and the Skin Engine code in MP.

    Thinking back, I also installed an update to my skin (X-Factor) at about the same time to make it compatible with the latest FanArtHandler version. Is it conceivable that the new X-Factor dll could have made this normal error more problematic for me?

    Thanks

    Rob
     

    robbo100

    Retired Team Member
  • Premium Supporter
  • May 5, 2009
    1,290
    309
    UK
    Home Country
    United Kingdom United Kingdom
    So do the symptoms I described (requiring the re-boot and run of the config) seem to match with your expectations with this problem? Or do you think this might be completely unrelated to my problem?

    Thanks again

    Robbo100
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    So do the symptoms I described (requiring the re-boot and run of the config) seem to match with your expectations with this problem? Or do you think this might be completely unrelated to my problem?

    Reboot and running config should't be required in any case. Only restart of MediaPortal should be required in the worst case on Windows XP when refresh rate is changed and the Skin Engine "panics". Those two don't make any sence... I find it uite odd that those are helping. It might be something else that breaks, but I have no clue what or why.
     

    robbo100

    Retired Team Member
  • Premium Supporter
  • May 5, 2009
    1,290
    309
    UK
    Home Country
    United Kingdom United Kingdom
    Well, I will have to see how it goes over the next couple of days and see if it still "breaks" after standby and recovery.

    I am confused what could have caused this all of a sudden...

    I will report back as to how the system performs.

    Robbo100
     

    robbo100

    Retired Team Member
  • Premium Supporter
  • May 5, 2009
    1,290
    309
    UK
    Home Country
    United Kingdom United Kingdom
    Well, in the end I did a clean install of XP and it seems to be fine now. It is back to normal (so I don't have to re-start the device each time I press stop).

    No idea what caused it in the first place.

    Cheers

    Robbo100
     

    robbo100

    Retired Team Member
  • Premium Supporter
  • May 5, 2009
    1,290
    309
    UK
    Home Country
    United Kingdom United Kingdom
    Enable CRC Check - Causes TV Service Hang

    Tourettes

    I believe I have found the root cause. Hopefully this might help others with similar problems in the future.

    After more investigation in the system after the XP reinstall I started getting the problem again.

    The exact symptoms were that if I watched TV it worked fine, and even if I stopped TV, it would continue working as long as I started watching TV again within about 10 minutes. However, if I listened to music, or watched a pre-recorded video/movie, then when I tried to watch TV agian it was broken.

    The 10 minute period was the key for finding the problem, as I had the TV Server DVB EPG grabber to start grabbing after 10 minutes idle time. I disabled the "Enable CRC check" option and this seemed to resolve the issue (clearly my provider does not support this function). It seemed that the TV Service was hanging during some EPG grabbing which was then causing the problem.

    It was more difficult to diagnose because I was also suffering from MP frontend crashing randomly due to the recent InfoService bug (along with the fact the the CRC problem did not happen every time that it grabbed EPG). The DirectX error message was just another piece of the puzzle which helped to take my eye away from the real problem :confused:

    My system is now back to running perfectly - I LOVE MP (and love to hate it sometimes!) :D

    If anything, doing a re-install was worth it to force me to have a good clean system, and I have now done a system drive image to restore back to incase of a future crash. :mad:

    Thanks Tourettes for your help (again).
     

    Users who are viewing this thread

    Top Bottom