This Guide is now depreciated a new Guide based on the DirectX March 2008 redistributable has been posted. Please don't use this Guide! The only reason it's still here is for reference
The New updated Guide is here: DirectX 9.0c March 2008 redistributable on Linux with Wine.
About DirectX
Microsoft DirectX is a collection of application programming interfaces for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. Originally, the names of these APIs all began with Direct, such as Direct3D, DirectDraw, DirectMusic, DirectPlay, DirectSound, and so forth. DirectX, then, was the generic term for all of these Direct-something APIs, and that term became the name of the collection. Over the intervening years, some of these APIs have been deprecated and replaced, so that this naming convention is no longer absolute. In fact, the X has caught on to the point that it has replaced Direct as the common part in the names of new DirectX technologies, including XAct, XInput, and so forth.
Direct3D (the 3D graphics API within DirectX) is widely used in the development of computer games for Microsoft Windows, Microsoft Xbox, and Microsoft Xbox 360. Direct3D is also used by other software applications for visualization and graphics tasks, most notably among the engineering sector for CAD/CAM, because of its ability to quickly render high-quality 3D graphics using DirectX-compatible graphics hardware. As Direct3D is the most widely recognized API in DirectX, it is not uncommon to see the name DirectX used in place of Direct3D.
Wine configuration
This is with a clean configuration directory and running in a 1024x768 virtual desktop.
$ winecfg
Once the .wine directory is built the configuration tool will start and you can set a virtual desktop in the graphics tab if you wish. This is a good time to also set your Audio driver in the Audio tab.
next up is to install a native mscoree.dll and streamci.dll into /system32 from a windows install and set them to native Windows.
You will need to set a large number of dlls to native for the install to work properly. Here is the full list of dlls that needs to be set.
[Software\\Wine\\DllOverrides] 1195992268
"d3d8"="builtin"
"d3d9"="builtin"
"d3dim"="native"
"d3drm"="native"
"d3dx8"="native"
"d3dxof"="native"
"dciman32"="native"
"ddrawex"="native"
"devenum"="native"
"dinput"="builtin"
"dinput8"="builtin"
"dmband"="native"
"dmcompos"="native"
"dmime"="native"
"dmloader"="native"
"dmscript"="native"
"dmstyle"="native"
"dmsynth"="native"
"dmusic"="native"
"dmusic32"="native"
"dnsapi"="native"
"dplay"="native"
"dplayx"="native"
"dpnaddr"="native"
"dpnet"="native"
"dpnhpast"="native"
"dpnlobby"="native"
"dsound"="builtin"
"dswave"="native"
"dxdiagn"="native"
"mscoree"="native"
"msdmo"="native"
"qcap"="native"
"quartz"="native"
"streamci"="native"
You can set all the dlls in winecfg under the "Libraries" tab or just set the first dll "d3d8"="builtin" and then go to .wine/user.reg and find the DLL override section [Software\\Wine\\DllOverrides] and copy the above list under it.
Installing Directx
Download DirectX 9.0c November release from here.
The directx_nov2007_redist.exe executable will extract the installer files to a directory of your choice.
tom@tuxonfire ~ $ wine directx_nov2007_redist.exe
fixme:advapi:DecryptFileA "z:\\home\\tom\\directx-9\\" 00000000
fixme:midi:OSS_MidiInit Synthesizer supports MIDI in. Not yet supported.
tom@tuxonfire ~ $ 

Now cd to the directory where you choose to extract the DirectX installer and run DXSETUP.EXE
tom@tuxonfire ~ $ cd /home/tom/directx-9
tom@tuxonfire ~/directx-9 $ wine DXSETUP.EXE
fixme:midi:OSS_MidiInit Synthesizer supports MIDI in. Not yet supported.


You will now want to run the setup a second time.... If you don't you will receive a network error and dplay wont function correctly.
Now lets run dxdiag.exe
tom@tuxonfire ~/directx-9 $ cd /home/tom/.wine/drive_c/windows/system32
tom@tuxonfire ~/.wine/drive_c/windows/system32 $ wine dxdiag.exe
fixme:ole:CoInitializeSecurity ((nil),-1,(nil),(nil),1,3,(nil),0,(nil)) - stub!


We can now test ddraw, ddraw 3D, D3D8, and D3D9







Direct Sound test:

Now we need to install gm.dls to test Direct Music, this driver file goes into ~/.wine/drive_c/windows/system32/drivers

Direct Play test:

You will notice in system32 d3dx9_24.dll up to d3dx9_36.dll is now installed, this really helps when you run into a game that needs these additional DirectX dlls.
Now you have the option to run most DirectX dlls in native or builtin mode, for example if you have a game that's crashing on the builtin Wine quartz.dll you can test the game with the native Windows dll to see if this will improve the situation.
Keep in mind d3d8, d3d9, ddraw will only work as builtin, and in most cases you should try to use builtin dsound and dinput. I have had limited success with (dsound and dinput) in native Windows mode btw... The reason why these dlls have to be used in builtin mode is there need for direct access to your hardware. direct music and direct play can be used in native windows mode in most circumstances.
Feel free to comment about this post at the wine-forum.












45 comments:
Very nice - dxdiag is working...
But could you give some examples what real game will work better (or work at all) with native Microsoft DirectX dlls? Crysis/BioShock/Gears Of War/The Witcher maybe? :)
"next up is to install a native mscoree.dll and streamci.dll into /system32 from a windows install and set then to native Windows."
"You will need to set a large number of dlls to native for the install to work properly."
And how are we supposed to know how to do these things? I have no idea where to even start..
What kinds of programs have you tested in wine with dx9c installed? Have there been any performance issues with running these APIs through the wine interface? I ask as I'm not familiar with how wine works compared with other types of virtualization like dosbox or vmware.
I have a problem with this procedure. It install dx without problem but without dxdiag.exe, so i can't do the test.
Anyway thanks for the tutorial!
Its what really needs to be done. Windows games and apps easily on linux then more people to linux.
Hello Anonymous,
Sorry, you do it in winecfg under "Libraries"
Hello HellBoyz77,
dxdiag.exe is installed in /system32
Hello Danniello,
Ive only tested this with 3DMark 06 thus far... but any game that needs a DX 9 update dll from d3dx9_24.dll up to d3dx9_36.dll can run those dlls as native windows.
Direct Music, Direct Play work as native.. I have used native Quartz.dll in the past (direct show)
Also I just got this box up and going a week ago and have just started installing games on it. I have "Steam" and "Need for Speed Prostreet" howtos done now, and plan many more howtos in the future.
bill: Wine Is Not an Emulator. Hence the name "Wine". www.winehq.org
You may find this post interesting....
3DMark 05 Score in Wine
Working directPlay is a great news for me but do you get any compatibility/performance improvements ?
Some benchmarks between wine and wine+directX will be a nice addition to your post !
Question:
"...rename...dsound...dsound.vxd...dlls to *.bak"
How are we supposed to rename dsound.dll and dsound.vxd (both) to .bak files?
Or, should we rename dsound.vxd -> dsound.vxd.bak?
(Sorry...I'ma bit of a n00b to Linux)
Hello David,
dsound.vxd.bak
Excellent guide but to ease the setup one can use
the following information:
Simply define DLL overrides using a text editor instead of winecfg
and the file .wine/user.reg at section
[Software\\Wine\\DllOverrides] 1195996825
"d3d8"="native"
"d3d9"="native"
..etc
and after directx installation changing the
necessary ones to "builtin"
[Software\\Wine\\DllOverrides] 1195996825
"d3d8"="builtin"
"d3d9"="builtin"
..
etc.
gm.dls is to be found on native windows\system32\drivers folder
which should be copied to .~/.wine/drive_c/windows/system32/drivers
folder manually
Thanks for the guide,
- Adil
Yea.....
I will update the guide in a couple minutes, I think Ive found a easier way for people to do the install.
If you were having trouble with the old guide... please read the guide again and see if the changes Ive made to it remedy the problems.
Hi, I've tested my favourite game "Rome: Total War" with this howto... and it worked! This was my last link with Windows.
Thank you very much!
you are a very good man. thank you very very much.
I had this installed, but don't expect any gain on world of warcraft. it's better on OpenGL with NVIDIA drivers
OK, if your having problems see this post in the forum......
DX in Wine
Hey nice post, the tests worked fine, but a 3D game didn't work... do you know if it's possible to run managerzone.com 3D game in Linux? since now, thank you very much!
"next up is to install a native mscoree.dll and streamci.dll into /system32 from a windows install and set then to native Windows."
I also do not understand this line. How to install those two? What I did is just googl-ing them instead and copy them to $/.wine/drive_c/windows/system32. I saw the mscoree in the list but not streamci in the libraries tab. What did I miss here?
streamci isnt in the list because Wine doesnt have its own streamci dll... So just put the dlls in system32 and set them to native. streamci is going to be native anyway as there isnt a builtin to fall back to ....
does halo work by doing this?
Halo should work if you install DX 9 or if you dont, The demo works, do a search on wine-review at the top of the page for Halo and you can find the post.
If you have trouble installing DX there is more info on the wine-forum... please go there and read the follow up on this.
I installed DirectX9.0c, but I do not have dxdiag.exe in system32 folder. What's going on?
nevermind, setting windows to 2000 version solved the problem.
I got DX9 installed properly and i have dxdiag.exe in system32 folder, but when i try to launch it, it says that dxdiagn.dll in not actual. I tried downloading another one from internet, but it didnt work. What's the problem?
I really appreciate your 3rd-person reports on Wine, and this is especially useful. Thank you!
PS People, when he talks about "installing" dlls/drivers/etc, he means to copy them from the WINDOWS/system32 directory of a windows installation into your equivalent Wine directory.
Also, you have to run dxdiag from within the directory it is installed in.
Excelent guide but i had have some differences.
Some dlls where not on my WindowsXp:
d3dx8.dll
any d3dx8* or d3dx9*, also not in wines system32 before installing dx9c
mscoree.dll
dmusic32.dll
I have an Spanish Windows Xp installed on VirtualBox, from i have copied the files.
Also i want to note, i have not tested dxdiag before on wine, but dx7 and 8 cube test runs very very quickly (i cant distinguish the dx logo, way too fast) and dx9 cube test runs slower than 8 or 7, not like in your video.
GeForce 7025 onboard
a question, can i also install dx10?
cheers
Hello diego,
No, you cant install DX 10...
Cheers,
Tom
Note: It is important that wine be in W2k mode for the installer to work properly.
I found that out the hard way on my second system...
For some reason, everything works fine except testing D3D. That locks the dxdiag with a white screen on my newer system. I sure hope I can get it working.
im not sure if im doing something something wrong first of all i got a patched version of wine with 3dmark patch.
on installation of dx im getting an error that msccores.dll could not loaded but installation looks run correct.also on dxdialog im getting ddrawex.dll missing.. i just copied to system32 folder. Directdraw works great but direct3d dont window goes white and im getting
1 0x7c012398 (0x6b0d1dc0)
2 0x6af0d731 ActivateContext+0x421() in wined3d (0x6b0d1f80)
3 0x6af3e1dd drawPrimitive+0x15d() in wined3d (0x6b0d2270)
4 0x6af196f4 in wined3d (+0x296f4) (0x6b0d22c0)
5 0x6a9b420c in ddraw (+0x2420c) (0x6b0d2310)
and some more of thouse... any clue ??
and some more of thouse... any clue ??
put a native msccores.dll in /system32
ddraw, d3d8/9 HAS to be set to builtin Wine..
Hello. Nice guide, but i have some problems. I've installed that DirectX like you said, bet when i test DirectDraw and Direct3D, it doesn't look like yours. Direct3D is spining faster, and it's impossible to see that logo. Did i do something wrong? Please, help me.
Nope, seems as if you did it right.. the cude spins here at about 10k FPS it seems.. just a blur :D
"landry said...
Note: It is important that wine be in W2k mode for the installer to work properly."
THANK YOU BUDDY !!!!
YES, THAT IS IMPORTANT. I wasn't getting dxdiag.exe either, until I did that.
Cheers.
i did everything nice, the dxdiag runs, no files missing, nativities set etc.,
But i get 2 error codes:
"Problems were found in the system registry. Details are available in the saved text file.
You should reinstall DirectX to get the latest version.
DirectDraw test results: Failure at step 3 (DirectDrawCreate): HRESULT = 0x887600de (No DirectDraw support)
Direct3D functionality not available. You should verify that the driver is a final version from the hardware manufacturer."
And
"0x80004005" (generic failure)
Anyone find out a solution to the white screen on Direct3d test? I've got it on two machiens, I've put the native mscorees.dll into system32 (there's a posts talking about msccores.dll but I believe this is a typo? can't find that DLL)
look people, it's not that hard. you can take any native or builtin .dll from the list, go to the library tab, add the .dll. (you'll be changing this later so pick whatever. native, builtin, both, cheeseburger, whatever) click apply or click ok to close winecfg. now you vi/nano/pico/whatever .wine/drive_c/user.reg. find the .dll you added. replace the single .dll with the long list of dll's on this page from d3d8 to streamci. save the file. pat yourself on the back.
Would there be ANY way at all to get AGP to work? I'm trying to get the infamous Lineage II working. Need it for it to run, as far as I know.
Incase You Don't Have gm.dls (And I Spent 3 Days Googling To Find This) Heres A Download Link:
http://www.kirupa.templarian.com/gm.dls
Enjoy!!!
(0) JOKesTER (0)
Before running direct3d tests check this:
$ glxinfo | grep rendering
direct rendering: Yes
(If it says "No", you don't have 3D acceleration.)
Okey my problem is this: I did all like you say but when i try to run dxdiag.exe wine just say "dxdiagn.dll" is out of date. And then nothing happened. Can you say what is wrong?
Post a Comment