VirtualBox

Opened 14 years ago

Closed 9 years ago

#5640 closed defect (fixed)

Hang during Direct3D access from Windows XP

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

Description (last modified by Frank Mehnert)

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 (4)

VBox.log (50.2 KB ) - added by Vladimir 14 years ago.
VBox.log
crlog.txt (4.5 KB ) - added by Vladimir 14 years ago.
output_debug (8.5 KB ) - added by Vladimir 14 years ago.
crlog.txt.1 (8.1 KB ) - added by Vladimir 14 years ago.

Download all attachments as: .zip

Change History (13)

by Vladimir, 14 years ago

Attachment: VBox.log added

VBox.log

comment:1 by Frank Mehnert, 14 years ago

Component: other3D support
Host type: otherLinux

comment:2 by Leonid Lobachev, 14 years ago

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 by Leonid Lobachev, 14 years ago

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.

by Vladimir, 14 years ago

Attachment: crlog.txt added

by Vladimir, 14 years ago

Attachment: output_debug added

comment:4 by Vladimir, 14 years ago

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.

by Vladimir, 14 years ago

Attachment: crlog.txt.1 added

comment:5 by Frank Mehnert, 14 years ago

Guest type: otherWindows
Summary: Poor support of Direct3D on windows XPHang during Direct3D access from Windows XP

comment:6 by Vladimir, 14 years ago

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 by Vladimir, 14 years ago

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 by Vladimir, 14 years ago

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

comment:9 by Frank Mehnert, 9 years ago

Description: modified (diff)
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use