[Bug] GraphicsDevice: Lost DirectX device (1 Viewer)

FreakyJ

Retired Team Member
  • Premium Supporter
  • July 25, 2010
    4,024
    1,420
    Home Country
    Germany Germany
    Hey,

    I was playing a bit with the skinengine and tried just for fun to build something like a coverflow :p
    But if I have this xaml code (in the HelloWorldPlugin, nothing changes on the code behind):

    Code:
    <DockPanel
        xmlns="www.team-mediaportal.com/2008/mpf/directx"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Context="{Model Id=5726DA5A-70D5-458f-AF67-611293D97912}" LastChildFill="False">
      <Label Content="This is the sample screen of the HelloWorld plugin" FontSize="40" DockPanel.Dock="Top" HorizontalAlignment="Center"/>
      <StackPanel DockPanel.Dock="Left" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
        <Button Content="Press me" Style="{ThemeResource ButtonWideStyle}" Margin="10"
            HorizontalAlignment="Right" VerticalAlignment="Center"
            Command="{Command ChangeHelloWorldString}"/>
        <Label Content="{Binding HelloString}" Margin="10"
            HorizontalAlignment="Left" VerticalAlignment="Center"/>      
      </StackPanel>
    
    
        <StackPanel x:Name="coverFlow" DockPanel.Dock="Center" Orientation="Horizontal" Grid.Column="1" Grid.Row="0">
            <StackPanel Orientation="Vertical" Grid.Column="1" Grid.Row="0">
                <Rectangle Width="150" Height="150" Stroke="Black" Margin="0,0,0,0">
                    <Rectangle.Fill>
                        <VisualBrush>
                            <VisualBrush.Visual>
                                <Image x:Name="BackdropImageBackground" Stretch="Uniform" Source="cover.jpg"/>
                            </VisualBrush.Visual>
                        </VisualBrush>
                    </Rectangle.Fill>
                </Rectangle>
                <Rectangle Width="150" Height="150" Stroke="Black" Margin="0,-25,0,0">
                    <Rectangle.Fill>
                        <VisualBrush>
                            <VisualBrush.Visual>
                                <Image x:Name="BackdropImageBackground" Stretch="Uniform" Source="cover.jpg"/>
                            </VisualBrush.Visual>
                        </VisualBrush>
                    </Rectangle.Fill>
                    <Rectangle.LayoutTransform>
                        <TransformGroup>
                            <ScaleTransform ScaleX="1" ScaleY="-0.75"/>
                        </TransformGroup>
                    </Rectangle.LayoutTransform>
                    <Rectangle.OpacityMask>
                        <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0">
                            <GradientStop Offset="0.0" Color="#00000000" />
                            <GradientStop Offset="1.0" Color="#A0000000" />
                        </LinearGradientBrush>
                    </Rectangle.OpacityMask>
                </Rectangle>
                <StackPanel.LayoutTransform>
                    <TransformGroup>
                        <SkewTransform CenterX="25" CenterY="25" AngleX="0" AngleY="45" />
                    </TransformGroup>
                </StackPanel.LayoutTransform>
            </StackPanel>
            <!-- Front Cover -->
            <StackPanel x:Name="FrontCover" Orientation="Vertical" Grid.Column="1" Grid.Row="0">
                <Rectangle x:Name="FrontCoverRectangle" Width="150" Height="150" Stroke="Black" Margin="0,0,0,0">
                    <Rectangle.Fill>
                        <VisualBrush>
                            <VisualBrush.Visual>
                                <Image x:Name="FrontCoverImg" Stretch="Uniform" Source="cover.jpg"/>
                            </VisualBrush.Visual>
                        </VisualBrush>
                    </Rectangle.Fill>
                </Rectangle>
                <Rectangle x:Name="FrontCoverRectangle2" Width="150" Height="150" Stroke="Black" Margin="0,-25,0,0">
                    <Rectangle.Fill>
                        <VisualBrush>
                            <VisualBrush.Visual>
                                <Image x:Name="FrontCoverImg2" Stretch="Uniform" Source="cover.jpg"/>
                            </VisualBrush.Visual>
                        </VisualBrush>
                    </Rectangle.Fill>
                    <Rectangle.LayoutTransform>
                        <TransformGroup>
                            <ScaleTransform ScaleX="1" ScaleY="-0.75"/>
                        </TransformGroup>
                    </Rectangle.LayoutTransform>
                    <Rectangle.OpacityMask>
                        <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0">
                            <GradientStop Offset="0.0" Color="#00000000" />
                            <GradientStop Offset="1.0" Color="#A0000000" />
                        </LinearGradientBrush>
                    </Rectangle.OpacityMask>
                </Rectangle>
            </StackPanel>
        </StackPanel>
    
    
    </DockPanel>

    I'm getting tons of this error and the GUI freezes:

    [2011-01-21 16:12:06,516] [12885 ] [InputMgr ] [INFO ] - WorkflowManager: Screen 'home' successfully shown
    [2011-01-21 16:12:06,516] [12885 ] [AMQ 'ScreenManager'] [DEBUG] - ScreenManager: Showing screen 'home'...
    [2011-01-21 16:12:06,629] [12999 ] [DX Render] [DEBUG] - DirectX MainForm: Render thread stopped
    [2011-01-21 16:12:06,689] [13059 ] [Main ] [DEBUG] - DirectX MainForm: Stoping render thread
    [2011-01-21 16:12:06,689] [13059 ] [Main ] [DEBUG] - DirectX MainForm: Starting render thread
    [2011-01-21 16:12:06,702] [13071 ] [DX Render] [WARN ] - GraphicsDevice: Lost DirectX device
    SlimDX.Direct3D9.Direct3D9Exception: D3DERR_INVALIDCALL: Invalid call (-2005530516)
    bei SlimDX.Result.Throw[T](Object dataKey, Object dataValue)
    bei SlimDX.Result.Record[T](Int32 hr, Boolean failed, Object dataKey, Object dataValue)
    bei SlimDX.Result.Record[T](Int32 hr, Object dataKey, Object dataValue)
    bei SlimDX.Direct3D9.Device.BeginScene()
    bei MediaPortal.UI.SkinEngine.DirectX.GraphicsDevice.Render(Boolean doWaitForNextFame)
    [2011-01-21 16:12:06,829] [13199 ] [DX Render] [DEBUG] - DirectX MainForm: Render thread stopped
    [2011-01-21 16:12:06,907] [13276 ] [Main ] [DEBUG] - DirectX MainForm: Stoping render thread
    [2011-01-21 16:12:06,907] [13276 ] [Main ] [DEBUG] - DirectX MainForm: Starting render thread
    [2011-01-21 16:12:06,919] [13289 ] [DX Render] [WARN ] - GraphicsDevice: Lost DirectX device
    SlimDX.Direct3D9.Direct3D9Exception: D3DERR_INVALIDCALL: Invalid call (-2005530516)
    bei SlimDX.Result.Throw[T](Object dataKey, Object dataValue)
    bei SlimDX.Result.Record[T](Int32 hr, Boolean failed, Object dataKey, Object dataValue)
    bei SlimDX.Result.Record[T](Int32 hr, Object dataKey, Object dataValue)
    bei SlimDX.Direct3D9.Device.BeginScene()
    bei MediaPortal.UI.SkinEngine.DirectX.GraphicsDevice.Render(Boolean doWaitForNextFame)
    [2011-01-21 16:12:06,941] [13310 ] [DX Render] [DEBUG] - DirectX MainForm: Render thread stopped
    [2011-01-21 16:12:07,019] [13389 ] [Main ] [DEBUG] - DirectX MainForm: Stoping render thread
    [2011-01-21 16:12:07,019] [13389 ] [Main ] [DEBUG] - DirectX MainForm: Starting render thread
    [2011-01-21 16:12:07,054] [13424 ] [DX Render] [WARN ] - GraphicsDevice: Lost DirectX device

    etc....

    But if you delete the second Rectangle blog:
    Code:
    <Rectangle x:Name="FrontCoverRectangle2"...... etc...
    it will work. I also tried to copy the first rectangle, but had the same error...

    Steps to reproduce:
    use my HelloWorldPlugin (attached), start MP2 and klick on "HelloWorld". You will see that the gui freezes and you get tons of the error above =)

    Attachment:
    1. last two logfiles
    2. my Plugin

    If something is missing, let me know =)
     

    Attachments

    • HelloWorld.rar
      274.4 KB

    Albert

    MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    46
    Freiburg im Breisgau, Germany
    Home Country
    Germany Germany
    AW: GraphicsDevice: Lost DirectX device

    We have at least two problems here:
    1) The actual problem which produces the DX invalid call error
    2) The SkinEngine doesn't recover from the problem, even if you press ESC to return to the home screen

    Baboonanza? Can you check that?
     

    FreakyJ

    Retired Team Member
  • Premium Supporter
  • July 25, 2010
    4,024
    1,420
    Home Country
    Germany Germany
    AW: GraphicsDevice: Lost DirectX device

    This Bug still exists... I had to update the .xaml file due to changes in the skin engine, but MP2 completely freezes and doesn't respond anymore

    [2011-03-08 10:31:46,532] [619036 ] [DX Render] [DEBUG] - DirectX MainForm: Render thread stopped
    [2011-03-08 10:31:46,609] [619113 ] [Main ] [DEBUG] - DirectX MainForm: Stoping render thread
    [2011-03-08 10:31:46,610] [619114 ] [Main ] [DEBUG] - DirectX MainForm: Starting render thread
    [2011-03-08 10:31:46,611] [619115 ] [DX Render] [WARN ] - GraphicsDevice: Lost DirectX device
    SlimDX.Direct3D9.Direct3D9Exception: D3DERR_INVALIDCALL: Invalid call (-2005530516)
    bei SlimDX.Result.Throw[T](Object dataKey, Object dataValue)
    bei SlimDX.Result.Record[T](Int32 hr, Boolean failed, Object dataKey, Object dataValue)
    bei SlimDX.Direct3D9.Device.BeginScene()
    bei MediaPortal.UI.SkinEngine.DirectX.GraphicsDevice.Render(Boolean doWaitForNextFame)
    [2011-03-08 10:31:46,632] [619136 ] [DX Render] [DEBUG] - DirectX MainForm: Render thread stopped
    [2011-03-08 10:31:46,725] [619229 ] [Main ] [DEBUG] - DirectX MainForm: Stoping render thread
    [2011-03-08 10:31:46,725] [619229 ] [Main ] [DEBUG] - DirectX MainForm: Starting render thread
    [2011-03-08 10:31:46,727] [619231 ] [DX Render] [WARN ] - GraphicsDevice: Lost DirectX device
    SlimDX.Direct3D9.Direct3D9Exception: D3DERR_INVALIDCALL: Invalid call (-2005530516)
    bei SlimDX.Result.Throw[T](Object dataKey, Object dataValue)
    bei SlimDX.Result.Record[T](Int32 hr, Boolean failed, Object dataKey, Object dataValue)
    bei SlimDX.Direct3D9.Device.BeginScene()
    bei MediaPortal.UI.SkinEngine.DirectX.GraphicsDevice.Render(Boolean doWaitForNextFame)

    I attached the new test Plugin and the logfiles ;)

    Edit:

    The end of the logfile is interesting for you, the beginning 3 or 4 skin engine errors are from the tests to adapt the old .xaml file to the new requirements =)
     

    Attachments

    • HelloWorld.rar
      274.4 KB

    Smeulf

    Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Hi FreakyJ,

    Does this bug still exists or is it now fixed for you ?

    Cheers.
     

    FreakyJ

    Retired Team Member
  • Premium Supporter
  • July 25, 2010
    4,024
    1,420
    Home Country
    Germany Germany
    AW: GraphicsDevice: Lost DirectX device

    I tried to test it again, but there changed a lot in MP2 so the Plugin isn't compatible anymore oO
    After my tests I will take some time to have a closer look on that again ;)
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Can you please try to reproduce this in AA / MP2_Alpha_1 branch? There were changes on D3D exception handling, and I hope this issue is also solved this way
     

    FreakyJ

    Retired Team Member
  • Premium Supporter
  • July 25, 2010
    4,024
    1,420
    Home Country
    Germany Germany
    Ah yeah, the last time i tried it you changed so much that my plugin doesn't work anymore...
     

    Users who are viewing this thread

    Top Bottom