Sign in to follow this  

handling lost devices + The Pipe State is invalid

This topic is 3869 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm handling lost devices in our Direct3D game. I put a breakpoint just before I call device->reset and when I use call reset, I see this error : "The Pipe State is Invalid" in the watch window. (Just to clarify, if you enter the text: "$err, hr" in the watch window, you will see the last returned error code, and a formatted string for it: That's what I did) Anyways, I'm wondering what this error message could mean, and if it has anything to do with the fact that I can't see anything on the screen afterwards, or maybe its just a red-herring attributed to the fact that I was debugging. A couple of google searches haven't returned any relevant results. I'm using a Nvidia GeForce 7300 LE, and I have 2 monitors plugged in. One by a DVI cable, the other by a VGA cable. The application is running in the monitor with the VGA cable. Both my desktops are running at 1280x1024x32, but the game itself is running at 800x600x32. here's my code <code> // Release our ressources list ReleaseRessources(); _pD3DDevice->Reset(&mPresentParameters); //sort the list so that the surface resources are at the end,so they'll be restored AFTER the textures are re-initialized RestoreRessources(_pD3DDevice); gameAltTabbed = false; ASSERT( (_pD3DDevice->TestCooperativeLevel() == D3D_OK) && "The device was not reset sucessfully"); </code> here's a log of my messages. (I got these by: running the game, alt-tabbing, coming back in, then alt-tabbing again to exit the app) <code> FontManager: Warning, failed to find font 0x45650a46 Direct3D9: :WM_SYSKEYUP: wParam=00000009 lParam=a00f0001 Direct3D9: :Hot key pressed, switching away from app Direct3D9: :WM_ACTIVATEAPP: BEGIN Deactivating app pid=000019d0, tid=000019d4 Direct3D9: :DoneExclusiveMode Direct3D9: :INACTIVE: 000019d0: Restoring original mode (1280x1024x22x60) at adapter index 0 Direct3D9: :WM_DISPLAYCHANGE: 1280x1024x32 Direct3D9: :*** Active state changing Direct3D9: :WM_ACTIVATEAPP: DONE Deactivating app pid=000019d0, tid=000019d4 Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: :WM_SYSKEYUP: wParam=00000012 lParam=c0380001 Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: :WM_ACTIVATEAPP: BEGIN Deactivating app pid=000019d0, tid=000019d4 Direct3D9: :*** Already deactivated Direct3D9: :WM_ACTIVATEAPP: DONE Deactivating app pid=000019d0, tid=000019d4 Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: :WM_ACTIVATEAPP: Ignoring while minimized Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: :WM_SIZE hWnd=50085E wp=0000, lp=0224031A dwFlags=00000001 Direct3D9: :WM_SIZE: Window restored, sending WM_ACTIVATEAPP Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: :WM_ACTIVATEAPP: BEGIN Activating app pid=000019d0, tid=000019d4 Direct3D9: :*** Active state changing Direct3D9: :WM_ACTIVATEAPP: DONE Activating app pid=000019d0, tid=000019d4 Direct3D9: :StartExclusiveMode Direct3D9: :WM_DISPLAYCHANGE: 800x600x32 D3D9 Helper: Warning: Default value for D3DRS_POINTSIZE_MAX is 2.19902e+012f, not 1.58456e+029f. This is ok. Direct3D9: (WARN) :Vertexbuffer created with POOL_DEFAULT but WRITEONLY not set. Performance penalty could be severe. Direct3D9: (WARN) :Ignoring redundant SetRenderState - 15 Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 13 Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 14 Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 25 Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 15 Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 16 Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 17 Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 18 Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 19 Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 20 Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 21 Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 29 Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 30 Direct3D9: (WARN) :Ignoring redundant SetRenderState - 19 Direct3D9: (WARN) :Ignoring redundant SetRenderState - 20 Direct3D9: :WM_SYSKEYUP: wParam=00000012 lParam=c0380001 Direct3D9: :WM_SYSKEYUP: wParam=00000012 lParam=c0380001 Direct3D9: :Window 0155009e is on top of us!! Direct3D9: :Window 0155009e is on top of us!! Direct3D9: :Window 0155009e is on top of us!! Direct3D9: :WM_ACTIVATEAPP: BEGIN Deactivating app pid=000019d0, tid=000019d4 Direct3D9: :DoneExclusiveMode Direct3D9: :INACTIVE: 000019d0: Restoring original mode (1280x1024x22x60) at adapter index 0 Direct3D9: :WM_DISPLAYCHANGE: 1280x1024x32 Direct3D9: :*** Active state changing Direct3D9: :WM_ACTIVATEAPP: DONE Deactivating app pid=000019d0, tid=000019d4 Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails Direct3D9: (WARN) :Window does not have focus. TestCooperativeLevel fails The program '[6608] debug.exe: Native' has exited with code 0 (0x0). </code> Thanks in advance to anyone who might have an idea about this. [Edited by - EGD Eric on May 9, 2007 4:31:29 PM]

Share this post


Link to post
Share on other sites
The "err, hr" method only handles the error from GetLastError() as far as I know, and formatting it as an HRESULT (the ", hr" bit) most likely won't work for D3D. There's no errors in the debug output there, but you really need to check the return values of D3D functions in code.

In short, there's nothing there that seems to be failing. If anything is returning a failed HRESULT, what is the value of the HRESULT (in hex, please)?

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
...but you really need to check the return values of D3D functions in code.


Agreed, but IMO it's worth differentiating between Debug and Release builds. I like to think of it like the difference between asserts and [expected] error handling.

1. Most DirectX calls should never fail unless you've passed bad parameters to them (i.e. a bug in your code). You only need to check these in debug builds. I'd make a simple macro that checks the return code and then wrap every DX call with that macro. The macro could perhaps use DXTRACE_ERR() from the DirectX Error Handling Library to display a friendly message. In release builds the macro would dissolve away to not check return codes (since you're only doing it to catch programmer errors).

2. Other calls you can reasonably expect to fail in a perfectly written application. For example all the Create* calls can fail due to things like out of memory conditions; IDirect3DDevice9::Reset() if the device was lost [again] in between freeing defauly pool resources and the call to Reset(). These kinds of things you should ALWAYS check, and always handle in all builds.


NOTE: Lazy evaluation is used inside D3D - many things don't actually do anything (or fail) until a few major API entry points like Draw*Primitive().

Share this post


Link to post
Share on other sites

This topic is 3869 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this