VirtualBox

Ticket #5640 (closed defect: fixed)

Opened 10 years ago

Last modified 4 years ago

Hang during Direct3D access from Windows XP

Reported by: wl2776 Owned by:
Component: 3D support Version: VirtualBox 3.1.0
Keywords: Cc:
Guest type: Windows Host type: Linux

Description (last modified by frank) (diff)

The following C++ code hangs.

HRESULT hr = S_OK;

m_d3dobj = Direct3DCreate9(D3D_SDK_VERSION);

RECT rc;
GetWindowRect(m_hwnd, &rc);
int wnd_width = rc.right - rc.left;
int wnd_height = rc.bottom - rc.top;
if (wnd_width || wnd_height)	{
  m_wnd_width = wnd_width;
  m_wnd_height = wnd_height;
}

wnd_width += wnd_width % 2;

D3DDISPLAYMODE d3ddm;
hr = IDirect3D9_GetAdapterDisplayMode(m_d3dobj, D3DADAPTER_DEFAULT, &d3ddm);
if (FAILED(hr)) return false;
m_texture_format = d3ddm.Format;

D3DPRESENT_PARAMETERS d3dpp;
memset(&d3dpp, 0, sizeof(D3DPRESENT_PARAMETERS));
d3dpp.Flags                  = D3DPRESENTFLAG_VIDEO;
d3dpp.Windowed               = TRUE;
d3dpp.hDeviceWindow          = m_hwnd;
d3dpp.BackBufferWidth        = m_wnd_width;
d3dpp.BackBufferHeight       = m_wnd_height;
d3dpp.SwapEffect             = D3DSWAPEFFECT_COPY;
d3dpp.MultiSampleType        = D3DMULTISAMPLE_NONE;
d3dpp.PresentationInterval   = D3DPRESENT_INTERVAL_DEFAULT;
d3dpp.BackBufferFormat       = m_texture_format;
d3dpp.BackBufferCount        = 1;
d3dpp.EnableAutoDepthStencil = FALSE;

hr = IDirect3D9_CreateDevice(m_d3dobj, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, m_hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &m_d3ddev);

I am using DirectX SDK 9. of March 2008, Visual Studio 2008 SP1.

The call to IDirect3D9_GetAdapterDisplayMode has returned d3ddm.Format = D3DFMT_X8R8G8B8

Guest OS is Windows XP SP3, russian.

Host OS is Ubuntu 9.10, 32-bit, with all updates.

The output of uname -a:

$ uname -a
Linux veremeev 2.6.31-15-generic #50-Ubuntu SMP Tue Nov 10 14:54:29 UTC 2009 i686 GNU/Linux

Host video adapter is NVidia GeForce 8400 GS, driver version is 190.42

Attachments

VBox.log Download (50.2 KB) - added by wl2776 10 years ago.
VBox.log
crlog.txt Download (4.5 KB) - added by wl2776 10 years ago.
output_debug Download (8.5 KB) - added by wl2776 10 years ago.
crlog.txt.1 Download (8.1 KB) - added by wl2776 10 years ago.

Change History

Changed 10 years ago by wl2776

VBox.log

comment:1 Changed 10 years ago by frank

  • Host type changed from other to Linux
  • Component changed from other to 3D support

comment:2 Changed 10 years ago by leonid

Rather strange...because if this isn't working, then d3d9 apps wouldn't work at all, which isn't the case.

Try running VirtualBox with CR_DEBUG=1. And inside your guest, set CR_DEBUG_FILE=crlog.txt and run your app. Please attach those logs.

comment:3 Changed 10 years ago by leonid

Another reason might be that host part created opengl 3.2 context with compatibility profile which might mess the things up. Anyway, it's strange.

Changed 10 years ago by wl2776

Changed 10 years ago by wl2776

comment:4 Changed 10 years ago by wl2776

I also think this is strange, because dxdiag runs well and successfully shows the rotating cube.

My application also runs well on windows host. Basically, it is an ActiveX component, playing a video, inserted in the simple C# form.

I am attaching two files. The first one is the requested crlog.txt, and the second one is the log of messages, emitted in the Visual Studio's Debug window. There are a couple of warnings, related to the OpenGL.

Changed 10 years ago by wl2776

comment:5 Changed 10 years ago by frank

  • Guest type changed from other to Windows
  • Summary changed from Poor support of Direct3D on windows XP to Hang during Direct3D access from Windows XP

comment:6 Changed 10 years ago by wl2776

I am attaching another crlog.txt. This one was produced during dxdiag run.

One more interesting thing - when I run dxdiag first time, Direct3D 8 tests failed. The second and 3rd runs - Direct3D 8 tests were OK. The attached file is from successful runs of Direct3D 8 and 9 tests.

comment:7 Changed 10 years ago by wl2776

After several software upgrades, I've tried the code once more. This doesn't hang now, but still doesn't draw anything.

I am developing an ActiveX video player and testing it in the C# form. I am using VisualStudio 2008 SP1. After launching my form, I've seen the following messages in the debug window. There are several OpenGL warnings among them.

'PlayerTestContainer.exe': Loaded 'C:\WINDOWS\system32\mswsock.dll'
'PlayerTestContainer.exe': Loaded 'C:\WINDOWS\system32\hnetcfg.dll', Symbols loaded (source information stripped).
'PlayerTestContainer.exe': Loaded 'C:\WINDOWS\system32\wshtcpip.dll', Symbols loaded (source information stripped).
'PlayerTestContainer.exe': Loaded 'C:\WINDOWS\system32\dnsapi.dll'
'PlayerTestContainer.exe': Loaded 'C:\WINDOWS\system32\winrnr.dll', Symbols loaded (source information stripped).
'PlayerTestContainer.exe': Loaded 'C:\WINDOWS\system32\wldap32.dll', Symbols loaded (source information stripped).
'PlayerTestContainer.exe': Loaded 'C:\WINDOWS\system32\rasadhlp.dll', Symbols loaded (source information stripped).
The thread 'Win32 Thread' (0xf20) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xf24) has exited with code 0 (0x0).
'PlayerTestContainer.exe': Loaded 'C:\WINDOWS\system32\VBoxOGL.dll'
'PlayerTestContainer.exe': Loaded 'C:\WINDOWS\system32\VBoxOGLcrutil.dll'
'PlayerTestContainer.exe': Loaded 'C:\WINDOWS\system32\VBoxOGLpackspu.dll'
'PlayerTestContainer.exe': Loaded 'C:\WINDOWS\system32\VBoxOGLerrorspu.dll'
'PlayerTestContainer.exe': Loaded 'C:\WINDOWS\system32\VBoxOGLfeedbackspu.dll'
'PlayerTestContainer.exe': Loaded 'C:\WINDOWS\system32\VBoxOGLpassthroughspu.dll'
'PlayerTestContainer.exe': Loaded 'C:\WINDOWS\system32\opengl32.dll', Symbols loaded (source information stripped).
'PlayerTestContainer.exe': Loaded 'C:\WINDOWS\system32\glu32.dll', Symbols loaded (source information stripped).
'PlayerTestContainer.exe': Unloaded 'C:\WINDOWS\system32\VBoxOGL.dll'
'PlayerTestContainer.exe': Loaded 'C:\WINDOWS\system32\VBoxD3D9.dll'
OpenGL Warning: State tracker is being re-initialized..

OpenGL Warning: State tracker is being re-initialized..

'PlayerTestContainer.exe': Loaded 'C:\WINDOWS\system32\libWine.dll'
'PlayerTestContainer.exe': Loaded 'C:\WINDOWS\system32\wined3d.dll'
'PlayerTestContainer.exe': Loaded 'C:\WINDOWS\system32\VBoxOGL.dll'
'PlayerTestContainer.exe': Loaded 'C:\WINDOWS\system32\mcd32.dll', Symbols loaded (source information stripped).
'PlayerTestContainer.exe': Unloaded 'C:\WINDOWS\system32\mcd32.dll'
OpenGL Warning: No pincher, please call crStateSetCurrentPointers() in your SPU
'PlayerTestContainer.exe': Loaded 'C:\WINDOWS\system32\usp10.dll', Symbols loaded (source information stripped).

comment:8 Changed 9 years ago by wl2776

Just noticed, that this bug is gone now. VirtualBox is now 3.2.8-64453~Ubuntu~lucid. Newer DirectX SDK, other updates.

comment:9 Changed 4 years ago by frank

  • Status changed from new to closed
  • Resolution set to fixed
  • Description modified (diff)
Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use