Jens Pedersen
2007-05-23 13:15:03 UTC
I use the VMR9 with a custom allocater/presenter and have a problem with
device reset.
I make surfaces with AllocateSurfaceHelper and a private texture as a render
target.
I set up the VMR9 to MixerPref9_RenderTargetYUV hoping that VMR9 will not
change the render target.
(See http://www.gamedev.net/community/forums/topic.asp?topic_id=380264)
When PresentImage is called, I StretchRect the image from the source to
my private texture. The private texture is then used in my own render loop
in a separate thread to render the final image.
This works fine.
BUT. When I make a lost device event with Ctrl-Alt-Del something goes wrong.
I release all the textures, vertex buffers, state buffers I have allocated.
(As control I write all the addresses each time I make a new buffer
and when it is released, and check the returned reference count is 0)
I wait for TestCooperativeLevel to return D3DERR_DEVICENOTRESET
and call Reset.
Then I get the debug print shown below.
I really don't think I have directly allocated any of the surfaces mentioned.
None of the surfaces I allocate have that size
and none of the addresses is the same as the addresses of any of the
surfaces I allocate.
Q1: Where is these surfaces allocated?
Q2: How do I release these surfaces?
Q3: Is there any way I can use the information in the debug prints to get
closer?
Q4: Can I configure VMR9 to avoid the problem?
--
Jens
BK Medical
Debug print:
Direct3D9: (ERROR) :The following D3DPOOL_DEFAULT surfaces/buffers/textures
still exist
Direct3D9: (ERROR) : D3DRTYPE_SURFACE
Direct3D9: (ERROR) : Memory Address: 0e3ad500 lAllocID=682
dwSize=00000050, (pid=00000ba0)
Direct3D9: (ERROR) : Stack Back Trace
Direct3D9: (ERROR) : [0] : Address 0DC76C86
Direct3D9: (ERROR) : [1] : Address 0DD4AB63
Direct3D9: (ERROR) : [2] : Address 0DCAF99D
Direct3D9: (ERROR) : [3] : Address 0DCBE3A2
Direct3D9: (ERROR) : [4] : Address 748C5683
Direct3D9: (ERROR) : [5] : Address 748C5BBA
Direct3D9: (ERROR) : [6] : Address 748C659D
Direct3D9: (ERROR) : [7] : Address 748BCEB0
Direct3D9: (ERROR) : [8] : Address 748BED18
Direct3D9: (ERROR) : [9] : Address 5E046675
Direct3D9: (ERROR) : [10] : Address 5E03B74A
Direct3D9: (ERROR) : [11] : Address 5E048670
Direct3D9: (ERROR) : [12] : Address 5E0481D0
Direct3D9: (ERROR) : [13] : Address 5E0482BB
Direct3D9: (ERROR) : [14] : Address 5E04838D
Direct3D9: (ERROR) : [15] : Address 5E049A29
Direct3D9: (ERROR) : D3DRTYPE_SURFACE
Direct3D9: (ERROR) : Memory Address: 0e3ad140 lAllocID=672
dwSize=00000050, (pid=00000ba0)
Direct3D9: (ERROR) : Stack Back Trace
Direct3D9: (ERROR) : [0] : Address 0DC76C86
Direct3D9: (ERROR) : [1] : Address 0DD4AB63
Direct3D9: (ERROR) : [2] : Address 0DCAF99D
Direct3D9: (ERROR) : [3] : Address 0DCBE3A2
Direct3D9: (ERROR) : [4] : Address 748C369E
Direct3D9: (ERROR) : [5] : Address 748C5B17
Direct3D9: (ERROR) : [6] : Address 748C659D
Direct3D9: (ERROR) : [7] : Address 748BCEB0
Direct3D9: (ERROR) : [8] : Address 748BED18
Direct3D9: (ERROR) : [9] : Address 5E046675
Direct3D9: (ERROR) : [10] : Address 5E03B74A
Direct3D9: (ERROR) : [11] : Address 5E048670
Direct3D9: (ERROR) : [12] : Address 5E0481D0
Direct3D9: (ERROR) : [13] : Address 5E0482BB
Direct3D9: (ERROR) : [14] : Address 5E04838D
Direct3D9: (ERROR) : [15] : Address 5E049A29
Direct3D9: (ERROR) : D3DRTYPE_SURFACE
Direct3D9: (ERROR) : Memory Address: 0e3acc20 lAllocID=657
dwSize=00000050, (pid=00000ba0)
Direct3D9: (ERROR) : Stack Back Trace
Direct3D9: (ERROR) : [0] : Address 0DC76C86
Direct3D9: (ERROR) : [1] : Address 0DD4AB63
Direct3D9: (ERROR) : [2] : Address 0DCAF99D
Direct3D9: (ERROR) : [3] : Address 0DCBE3A2
Direct3D9: (ERROR) : [4] : Address 748B9C98
Direct3D9: (ERROR) : [5] : Address 748BC70D
Direct3D9: (ERROR) : [6] : Address 748BCE2A
Direct3D9: (ERROR) : [7] : Address 748BED18
Direct3D9: (ERROR) : [8] : Address 5E046675
Direct3D9: (ERROR) : [9] : Address 5E03B74A
Direct3D9: (ERROR) : [10] : Address 5E048670
Direct3D9: (ERROR) : [11] : Address 5E0481D0
Direct3D9: (ERROR) : [12] : Address 5E0482BB
Direct3D9: (ERROR) : [13] : Address 5E04838D
Direct3D9: (ERROR) : [14] : Address 5E049A29
Direct3D9: (ERROR) : [15] : Address 5E03B152
Direct3D9: (ERROR) : D3DRTYPE_SURFACE
Direct3D9: (ERROR) : Memory Address: 0e3aca60 lAllocID=655
dwSize=00000050, (pid=00000ba0)
Direct3D9: (ERROR) : Stack Back Trace
Direct3D9: (ERROR) : [0] : Address 0DC76C86
Direct3D9: (ERROR) : [1] : Address 0DD4AB63
Direct3D9: (ERROR) : [2] : Address 0DCAF99D
Direct3D9: (ERROR) : [3] : Address 0DCBE3A2
Direct3D9: (ERROR) : [4] : Address 748B9C98
Direct3D9: (ERROR) : [5] : Address 748BC70D
Direct3D9: (ERROR) : [6] : Address 748BCE2A
Direct3D9: (ERROR) : [7] : Address 748BED18
Direct3D9: (ERROR) : [8] : Address 5E046675
Direct3D9: (ERROR) : [9] : Address 5E03B74A
Direct3D9: (ERROR) : [10] : Address 5E048670
Direct3D9: (ERROR) : [11] : Address 5E0481D0
Direct3D9: (ERROR) : [12] : Address 5E0482BB
Direct3D9: (ERROR) : [13] : Address 5E04838D
Direct3D9: (ERROR) : [14] : Address 5E049A29
Direct3D9: (ERROR) : [15] : Address 5E03B152
Direct3D9: (ERROR) : D3DRTYPE_SURFACE
Direct3D9: (ERROR) : Memory Address: 0e3ac8a0 lAllocID=653
dwSize=00000050, (pid=00000ba0)
Direct3D9: (ERROR) : Stack Back Trace
Direct3D9: (ERROR) : [0] : Address 0DC76C86
Direct3D9: (ERROR) : [1] : Address 0DD4AB63
Direct3D9: (ERROR) : [2] : Address 0DCAF99D
Direct3D9: (ERROR) : [3] : Address 0DCBE3A2
Direct3D9: (ERROR) : [4] : Address 748B9C98
Direct3D9: (ERROR) : [5] : Address 748BC70D
Direct3D9: (ERROR) : [6] : Address 748BCE2A
Direct3D9: (ERROR) : [7] : Address 748BED18
Direct3D9: (ERROR) : [8] : Address 5E046675
Direct3D9: (ERROR) : [9] : Address 5E03B74A
Direct3D9: (ERROR) : [10] : Address 5E048670
Direct3D9: (ERROR) : [11] : Address 5E0481D0
Direct3D9: (ERROR) : [12] : Address 5E0482BB
Direct3D9: (ERROR) : [13] : Address 5E04838D
Direct3D9: (ERROR) : [14] : Address 5E049A29
Direct3D9: (ERROR) : [15] : Address 5E03B152
Direct3D9: (ERROR) : D3DRTYPE_SURFACE
Direct3D9: (ERROR) : Memory Address: 0e3ac6e0 lAllocID=651
dwSize=00000050, (pid=00000ba0)
Direct3D9: (ERROR) : Stack Back Trace
Direct3D9: (ERROR) : [0] : Address 0DC76C86
Direct3D9: (ERROR) : [1] : Address 0DD4AB63
Direct3D9: (ERROR) : [2] : Address 0DCAF99D
Direct3D9: (ERROR) : [3] : Address 0DCBE3A2
Direct3D9: (ERROR) : [4] : Address 748B9C98
Direct3D9: (ERROR) : [5] : Address 748BC70D
Direct3D9: (ERROR) : [6] : Address 748BCE2A
Direct3D9: (ERROR) : [7] : Address 748BED18
Direct3D9: (ERROR) : [8] : Address 5E046675
Direct3D9: (ERROR) : [9] : Address 5E03B74A
Direct3D9: (ERROR) : [10] : Address 5E048670
Direct3D9: (ERROR) : [11] : Address 5E0481D0
Direct3D9: (ERROR) : [12] : Address 5E0482BB
Direct3D9: (ERROR) : [13] : Address 5E04838D
Direct3D9: (ERROR) : [14] : Address 5E049A29
Direct3D9: (ERROR) : [15] : Address 5E03B152
Direct3D9: (ERROR) : D3DRTYPE_SURFACE
Direct3D9: (ERROR) : Memory Address: 0e3ac520 lAllocID=649
dwSize=00000050, (pid=00000ba0)
Direct3D9: (ERROR) : Stack Back Trace
Direct3D9: (ERROR) : [0] : Address 0DC76C86
Direct3D9: (ERROR) : [1] : Address 0DD4AB63
Direct3D9: (ERROR) : [2] : Address 0DCAF99D
Direct3D9: (ERROR) : [3] : Address 0DCBE3A2
Direct3D9: (ERROR) : [4] : Address 748B9C64
Direct3D9: (ERROR) : [5] : Address 748BC70D
Direct3D9: (ERROR) : [6] : Address 748BCE2A
Direct3D9: (ERROR) : [7] : Address 748BED18
Direct3D9: (ERROR) : [8] : Address 5E046675
Direct3D9: (ERROR) : [9] : Address 5E03B74A
Direct3D9: (ERROR) : [10] : Address 5E048670
Direct3D9: (ERROR) : [11] : Address 5E0481D0
Direct3D9: (ERROR) : [12] : Address 5E0482BB
Direct3D9: (ERROR) : [13] : Address 5E04838D
Direct3D9: (ERROR) : [14] : Address 5E049A29
Direct3D9: (ERROR) : [15] : Address 5E03B152
Direct3D9: (ERROR) :All user created D3DPOOL_DEFAULT surfaces must be freed
before Reset can succeed. Reset Fails.
Direct3D9: (ERROR) :Reset failed and Reset/TestCooperativeLevel/Release are
the only legal APIs to be called subsequently
device reset.
I make surfaces with AllocateSurfaceHelper and a private texture as a render
target.
I set up the VMR9 to MixerPref9_RenderTargetYUV hoping that VMR9 will not
change the render target.
(See http://www.gamedev.net/community/forums/topic.asp?topic_id=380264)
When PresentImage is called, I StretchRect the image from the source to
my private texture. The private texture is then used in my own render loop
in a separate thread to render the final image.
This works fine.
BUT. When I make a lost device event with Ctrl-Alt-Del something goes wrong.
I release all the textures, vertex buffers, state buffers I have allocated.
(As control I write all the addresses each time I make a new buffer
and when it is released, and check the returned reference count is 0)
I wait for TestCooperativeLevel to return D3DERR_DEVICENOTRESET
and call Reset.
Then I get the debug print shown below.
I really don't think I have directly allocated any of the surfaces mentioned.
None of the surfaces I allocate have that size
and none of the addresses is the same as the addresses of any of the
surfaces I allocate.
Q1: Where is these surfaces allocated?
Q2: How do I release these surfaces?
Q3: Is there any way I can use the information in the debug prints to get
closer?
Q4: Can I configure VMR9 to avoid the problem?
--
Jens
BK Medical
Debug print:
Direct3D9: (ERROR) :The following D3DPOOL_DEFAULT surfaces/buffers/textures
still exist
Direct3D9: (ERROR) : D3DRTYPE_SURFACE
Direct3D9: (ERROR) : Memory Address: 0e3ad500 lAllocID=682
dwSize=00000050, (pid=00000ba0)
Direct3D9: (ERROR) : Stack Back Trace
Direct3D9: (ERROR) : [0] : Address 0DC76C86
Direct3D9: (ERROR) : [1] : Address 0DD4AB63
Direct3D9: (ERROR) : [2] : Address 0DCAF99D
Direct3D9: (ERROR) : [3] : Address 0DCBE3A2
Direct3D9: (ERROR) : [4] : Address 748C5683
Direct3D9: (ERROR) : [5] : Address 748C5BBA
Direct3D9: (ERROR) : [6] : Address 748C659D
Direct3D9: (ERROR) : [7] : Address 748BCEB0
Direct3D9: (ERROR) : [8] : Address 748BED18
Direct3D9: (ERROR) : [9] : Address 5E046675
Direct3D9: (ERROR) : [10] : Address 5E03B74A
Direct3D9: (ERROR) : [11] : Address 5E048670
Direct3D9: (ERROR) : [12] : Address 5E0481D0
Direct3D9: (ERROR) : [13] : Address 5E0482BB
Direct3D9: (ERROR) : [14] : Address 5E04838D
Direct3D9: (ERROR) : [15] : Address 5E049A29
Direct3D9: (ERROR) : D3DRTYPE_SURFACE
Direct3D9: (ERROR) : Memory Address: 0e3ad140 lAllocID=672
dwSize=00000050, (pid=00000ba0)
Direct3D9: (ERROR) : Stack Back Trace
Direct3D9: (ERROR) : [0] : Address 0DC76C86
Direct3D9: (ERROR) : [1] : Address 0DD4AB63
Direct3D9: (ERROR) : [2] : Address 0DCAF99D
Direct3D9: (ERROR) : [3] : Address 0DCBE3A2
Direct3D9: (ERROR) : [4] : Address 748C369E
Direct3D9: (ERROR) : [5] : Address 748C5B17
Direct3D9: (ERROR) : [6] : Address 748C659D
Direct3D9: (ERROR) : [7] : Address 748BCEB0
Direct3D9: (ERROR) : [8] : Address 748BED18
Direct3D9: (ERROR) : [9] : Address 5E046675
Direct3D9: (ERROR) : [10] : Address 5E03B74A
Direct3D9: (ERROR) : [11] : Address 5E048670
Direct3D9: (ERROR) : [12] : Address 5E0481D0
Direct3D9: (ERROR) : [13] : Address 5E0482BB
Direct3D9: (ERROR) : [14] : Address 5E04838D
Direct3D9: (ERROR) : [15] : Address 5E049A29
Direct3D9: (ERROR) : D3DRTYPE_SURFACE
Direct3D9: (ERROR) : Memory Address: 0e3acc20 lAllocID=657
dwSize=00000050, (pid=00000ba0)
Direct3D9: (ERROR) : Stack Back Trace
Direct3D9: (ERROR) : [0] : Address 0DC76C86
Direct3D9: (ERROR) : [1] : Address 0DD4AB63
Direct3D9: (ERROR) : [2] : Address 0DCAF99D
Direct3D9: (ERROR) : [3] : Address 0DCBE3A2
Direct3D9: (ERROR) : [4] : Address 748B9C98
Direct3D9: (ERROR) : [5] : Address 748BC70D
Direct3D9: (ERROR) : [6] : Address 748BCE2A
Direct3D9: (ERROR) : [7] : Address 748BED18
Direct3D9: (ERROR) : [8] : Address 5E046675
Direct3D9: (ERROR) : [9] : Address 5E03B74A
Direct3D9: (ERROR) : [10] : Address 5E048670
Direct3D9: (ERROR) : [11] : Address 5E0481D0
Direct3D9: (ERROR) : [12] : Address 5E0482BB
Direct3D9: (ERROR) : [13] : Address 5E04838D
Direct3D9: (ERROR) : [14] : Address 5E049A29
Direct3D9: (ERROR) : [15] : Address 5E03B152
Direct3D9: (ERROR) : D3DRTYPE_SURFACE
Direct3D9: (ERROR) : Memory Address: 0e3aca60 lAllocID=655
dwSize=00000050, (pid=00000ba0)
Direct3D9: (ERROR) : Stack Back Trace
Direct3D9: (ERROR) : [0] : Address 0DC76C86
Direct3D9: (ERROR) : [1] : Address 0DD4AB63
Direct3D9: (ERROR) : [2] : Address 0DCAF99D
Direct3D9: (ERROR) : [3] : Address 0DCBE3A2
Direct3D9: (ERROR) : [4] : Address 748B9C98
Direct3D9: (ERROR) : [5] : Address 748BC70D
Direct3D9: (ERROR) : [6] : Address 748BCE2A
Direct3D9: (ERROR) : [7] : Address 748BED18
Direct3D9: (ERROR) : [8] : Address 5E046675
Direct3D9: (ERROR) : [9] : Address 5E03B74A
Direct3D9: (ERROR) : [10] : Address 5E048670
Direct3D9: (ERROR) : [11] : Address 5E0481D0
Direct3D9: (ERROR) : [12] : Address 5E0482BB
Direct3D9: (ERROR) : [13] : Address 5E04838D
Direct3D9: (ERROR) : [14] : Address 5E049A29
Direct3D9: (ERROR) : [15] : Address 5E03B152
Direct3D9: (ERROR) : D3DRTYPE_SURFACE
Direct3D9: (ERROR) : Memory Address: 0e3ac8a0 lAllocID=653
dwSize=00000050, (pid=00000ba0)
Direct3D9: (ERROR) : Stack Back Trace
Direct3D9: (ERROR) : [0] : Address 0DC76C86
Direct3D9: (ERROR) : [1] : Address 0DD4AB63
Direct3D9: (ERROR) : [2] : Address 0DCAF99D
Direct3D9: (ERROR) : [3] : Address 0DCBE3A2
Direct3D9: (ERROR) : [4] : Address 748B9C98
Direct3D9: (ERROR) : [5] : Address 748BC70D
Direct3D9: (ERROR) : [6] : Address 748BCE2A
Direct3D9: (ERROR) : [7] : Address 748BED18
Direct3D9: (ERROR) : [8] : Address 5E046675
Direct3D9: (ERROR) : [9] : Address 5E03B74A
Direct3D9: (ERROR) : [10] : Address 5E048670
Direct3D9: (ERROR) : [11] : Address 5E0481D0
Direct3D9: (ERROR) : [12] : Address 5E0482BB
Direct3D9: (ERROR) : [13] : Address 5E04838D
Direct3D9: (ERROR) : [14] : Address 5E049A29
Direct3D9: (ERROR) : [15] : Address 5E03B152
Direct3D9: (ERROR) : D3DRTYPE_SURFACE
Direct3D9: (ERROR) : Memory Address: 0e3ac6e0 lAllocID=651
dwSize=00000050, (pid=00000ba0)
Direct3D9: (ERROR) : Stack Back Trace
Direct3D9: (ERROR) : [0] : Address 0DC76C86
Direct3D9: (ERROR) : [1] : Address 0DD4AB63
Direct3D9: (ERROR) : [2] : Address 0DCAF99D
Direct3D9: (ERROR) : [3] : Address 0DCBE3A2
Direct3D9: (ERROR) : [4] : Address 748B9C98
Direct3D9: (ERROR) : [5] : Address 748BC70D
Direct3D9: (ERROR) : [6] : Address 748BCE2A
Direct3D9: (ERROR) : [7] : Address 748BED18
Direct3D9: (ERROR) : [8] : Address 5E046675
Direct3D9: (ERROR) : [9] : Address 5E03B74A
Direct3D9: (ERROR) : [10] : Address 5E048670
Direct3D9: (ERROR) : [11] : Address 5E0481D0
Direct3D9: (ERROR) : [12] : Address 5E0482BB
Direct3D9: (ERROR) : [13] : Address 5E04838D
Direct3D9: (ERROR) : [14] : Address 5E049A29
Direct3D9: (ERROR) : [15] : Address 5E03B152
Direct3D9: (ERROR) : D3DRTYPE_SURFACE
Direct3D9: (ERROR) : Memory Address: 0e3ac520 lAllocID=649
dwSize=00000050, (pid=00000ba0)
Direct3D9: (ERROR) : Stack Back Trace
Direct3D9: (ERROR) : [0] : Address 0DC76C86
Direct3D9: (ERROR) : [1] : Address 0DD4AB63
Direct3D9: (ERROR) : [2] : Address 0DCAF99D
Direct3D9: (ERROR) : [3] : Address 0DCBE3A2
Direct3D9: (ERROR) : [4] : Address 748B9C64
Direct3D9: (ERROR) : [5] : Address 748BC70D
Direct3D9: (ERROR) : [6] : Address 748BCE2A
Direct3D9: (ERROR) : [7] : Address 748BED18
Direct3D9: (ERROR) : [8] : Address 5E046675
Direct3D9: (ERROR) : [9] : Address 5E03B74A
Direct3D9: (ERROR) : [10] : Address 5E048670
Direct3D9: (ERROR) : [11] : Address 5E0481D0
Direct3D9: (ERROR) : [12] : Address 5E0482BB
Direct3D9: (ERROR) : [13] : Address 5E04838D
Direct3D9: (ERROR) : [14] : Address 5E049A29
Direct3D9: (ERROR) : [15] : Address 5E03B152
Direct3D9: (ERROR) :All user created D3DPOOL_DEFAULT surfaces must be freed
before Reset can succeed. Reset Fails.
Direct3D9: (ERROR) :Reset failed and Reset/TestCooperativeLevel/Release are
the only legal APIs to be called subsequently