http://forum.egosoft.com/viewtopic.php?t=113628
This is not an optimization thread. It's to address core system file issues and to provide a way to isolate any codec issues but it's a bit technical so it's not for everyone. If your not comfortable with the following don't pursue it, or do so at your risk. The fact is, no amount of optimizing or game patches will help those people with these issues that cause crashes, and that is who this topic is for. There is really no simple way to package this information at this stage, so it's a bit quick and dirty and even possibly confusing at times , but I wanted to just post what I can now to help folks having these issues.
Edit 11-19-05 - It is imperative that you rule out all other possible issues before proceeding to assume codecs to be your only issue. At times,there may be several causes for issues, and codecs, may be just one of them. First before proceeding, do insure you have latest drivers for your audio, video (see Driver Cleaner below), as well as latest motherboard drivers. Reinstalling DirectX9 from the game CD/DVD and Media Player from Microsoft can also fix some file issues.
The following may not help you if you don't have the latest drivers for your audio and graphics and DirectX files, or if windows doesn't have them properly installed(more on that later).
The following is a work in progress that will be updated periodically:/Edit
As a background, I started a thread on benchmarking here and realized my system was hurting from poor performance so then I got committed to finding out what was going on when others weren't seeing the same issues. I won't go over the details of how I found these results and came to conclusions, it's what I do for a living and it's really too much to summarize of many, many hours of tracking every IO and registry call and trying many different file versions and codec types and how I broke it down. So here is the pertinent stuff:
A summary of my system specs are:
P4 3.06
1 GIG RAM
Audigy soundcard
XP SP2 (Fresh install for X3 testing)
Windows Media 9
DX9 version from CD installed.
1280x960 AA and AF on and AQC=off, driver image quality=high quality, vsync on.
From TEST2, detailed in that link above, here are my current results:
Before fixing my codecs and DX9 and media filters:
Max 30
Avg 22.26
NOW I GET:
Max 50
Avg 36.364
(Hud Off)
Max 70
Avg 54.650
And Argon Prime doubled as well. And I didn't have CTD issues, just poor performance and several files effected it. It wasn't drivers or any optimization but the following codec and file issues.
Note: If you have an older graphics card don't expect miracles as it's too large a bottleneck at certain times in the game to get the real high fps. At other times the CPU is the bottleneck and proper codecs can help you there with performance.
I'm using a fresh XP SP2 install as an example of what file versions should be like on an unhampered, base XP system.
PART 1 - codecs:
As you've probably heard, X series has had issues with the way some of the codec are utilized in windows. It's not so much a fault of X, except maybe it's too trusting that the OS will have it's act together, and at times it doesn't. This can cause anywhere from poor performance to CTD's. I will break these down into isolating music(mpeg 3) and mpeg 1 decoding issues. Sound effects and speech for another time hopefully.
If you have performance concerns you can use FRAPS to test your FPS for issues. If you want to test performance I suggest a systematic benchmark routine like I linked above, only then can you get repeatable comparable results until the actual rolling demo comes out.
---Isolate your issue:
Music - (This strictly relates to background music)
To find out if your music subsystem is having issues a quick way to check is to rename the folder under X3 called soundtrack. You can rename it to soundtrack.rename or anything you prefer. This keeps X3 from loading or utilizing any MP3 codecs and many Windows audio subsystem files associated with it. If you had crashes before and don't after renaming that folder then you found a core cause of your issues. If performance drastically increases, then this also should be focused on. This doesn't impact sound effects, just music.
The default windows codec in use for this is:
l3codecx.ax MPEG Layer-3 Audio Decoder 1.5.0.50
(It comes as part of the DX9 package, other windows media files also play a part here as well)
This is the reason people are seeing a benefit from reconverting MP3's which is due to a deeper cause, but if that's a quick fix that works, so be it.
MPEG decoding - (this effects movies and overall performance)
To find out if you are having movie subsystem issues (these issues can effect performance overall, not just when movies are playing) then you can rename the MOV folder. As a note, when starting the game you will see a black screen just hit escape and wait for the menu to load. The X in the menu will be black like this picture
because movies and all there corresponding drivers and codecs won't be running(don't be suprised by 82 fps in the pic, many things were being tested there). This is where my performance problem was mainly due to recently installing PowerDVD, and X3 utilizing a MPEG splitter called clm1splter.ax. As a side note, renaming these codecs doesn't insure that X3 won't get another bad one, infact in my case it did just that and grabbed an NVIDIA audio codec(part of a DVD decoder) when all along it was supposed to use quartz.dll. Quartz.dll is a multifunctional codec that does many different things for video and audio and is used through the game for many different things but X3 decided not to use it for this this one specific aspect and used another splitter instead. Not really X3's fault it expects too much from windows and media player working properly.
Some of the main files used for movies:
amstream.dll DirectShow Runtime 6.5.2600.2180
quartz.dll DirectShow Runtime 6.5.2600.2180
wmspdmod.dll WM speech decoder 9.00.00.3250
qasf.dll DirectShow file 9.0.0.3250
Rememeber these issues, along with dx file mismatching can cause CTD's.
For performance testing:
If you would like to you can see the actual performance overhead of both those subsystems of music and movies by renaming both folders and benchmarking with a good benchmarking system like I mentioned above. Don't use your save games here, use the benchmark system above or the rolling demo if it exists, as long as you don't doc with a station it won't overwrite your last automatic saves. On a properly working system with proper file versions, suprisingly you will find the impact is not really that high and the overhead isn't that large. On the otherhand, if you see a huge difference, something isn't right with certain files being used or your sound card performance is an issue(test your sound card with Rightmark below). I can assure you X3 is not utilizing the codec or those aspects of the sound subsystems nor is it looking for missing files causing undo IO, it just runs without any of it loaded n memory and being used. Sound effects are still in use during this time so some audio is being used but not many of the other associated files as mentioned.
If you realized your having issues after testing above here is the next step. (edit 11-26) Undo any renaming you did to folders above, back to the original(/edit). To further isolate exactly what codecs your having issue with this is the quickest way I have right now(quick and dirty) to find out which ones your particular system is using with X3. Download Filemon here. Prior to starting X3, start filemon, by default it starts capturing when you start it. Run X3. When you get to the main menu you can exit out of x3 (it captured enough data for our purposes). Stop Filemon from capturing with ctrl-E or click the little capture icon that looks like a magnifying glass. Now scroll to the top of filemon, press ctrl-F to do a find. Search for "soundtrack" a few lines below the first occurence of soundtrack you will find the MP3 codec being used by X3. You should see l3codecx.ax. If you see the right codec and you are still having soundtrack issues, and you know that because earlier you isolated by renaming the soundtrack folder, then you will have to wait for PART 2 of file version issues with media player and direct x. If reconverting your MP3's works as a quick fix here, than so be it.
Now onto MPEG splitter. Scroll up on filemon again. Do a search for ".ax". If you find any other .ax files being opened other than the the l3codec.ax then that is probably not a good thing. This is what you do not want to see or anything like it!
You can also search for other codecs if you're a techie, if you want to see some of the filenames you can look here for file names and descriptions:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc
Edit 12-1 For a technically deeper search for codecs:
You can get all the file names for the windows video and audio codecs nicely displayed by going to Start\Run and type "Msinfo32" and hit Enter. Under 'Components';'Multimedia' you will see more actual filenames and versions as they correlate to the Windows friendly names. This does not include all codecs just main Windows codecs, there are more that can be found by doing a file search for ".ax" ".acm" on your drive and not only in system32./Edit
For those that want to test things and dig deeper on there own and try to isolate there issues further here are some of the tools I used that may be helpful:
See your video/audio codecs with Sherlock the codec detective.
Test your audio cards cpu useage with RightMark 3D sound.
Make sure your drivers are properly installed with Driver Cleaner.
Observe all I/O with X3 with Sysinternals Filemon
Solutions:
If you identify a codec issue the easiest way to fix it now, after identifying the actual one with filemon, is uninstall the offending app or rename the file. This doesn't mean windows won't provide another one that's not best, just rinse and repeat here. There are other registry hacks but this is already complicated enough. I wanted to get something out because maybe others can benefit from this info, I'm starting to tire from the fight. If I can make an app that can force X3 to use the right ones, I will, but these aren't the only issues.Edit 11-26-05 See Part 2 and Direct Show Filter Manager to adjust codec merits for another solution. /edit
Observations:
After entering a system it can take up to about 30 seconds to load assets until the engine and fps finally levels out. The engine also does alot of searching for objects that no longer exist in the 'objects' subdirectory! That additional file IO to 'invisible' assets will hopefully be on someones optimization list after the show stopper bugs get fixed. This can be clearly seen with Filemon if it needs to be reproduced. Additionally the x3.exe calls to the crypto files seems like alot of excessive I/O, but is probably out of Egosofts hands.
Closing:
Lastly, I tiltled this section as PART 1 and I really didn't touch on the other files that handle sound effects and voice and the version issues that inevitably come up for some people. There needs to be a PART 2 if I can get around to it because there are file version issues of mixing and matching that people will have at times due to Windows File Protection and other reasons. I don't just want to report problems without some feasible solutions. As an example, take the file qasf.dll(direct show file). Media Player 9, XP SP2 and DirectX 9 all have different versions of that same file, as well as other such media files! Which one do you have???(rhetorical question). Installers "shouldn't" overwrite newer files. Also, installers should take into account files in 'File Protection' but they don't always manage it properly. I found my dllcache was holding files that should have been updated with wmfdist or DX9 but file protection wasn't allowing it by overwriting older files. This is one of the reasons why programs like Driver Cleaner came on the scene because your system32\dllcache is sometimes is holding older files that rewrite the newer ones being installed. It's sad isn't it. And it doesn't help that when you try and reinstall directx 9, the installer doesn't copy new files down after scanning your system. You can't uninstall DX9 and then reinstall it either, with SP2 it's very difficult. Also, trying to roll back from media player 10 to media player 9 will leave you with a mish mosh of version 10 and 9 files(that's why Microsoft doesn't really support it). So the rabbit hole runs deep. That's one of the other issues i've seen and hopefully I can muster the energy to do a PART2 and clarify some solutions. I have reproduced alot of the issues I have read about here like CTD's after going through gates, black screen to crash "sorry for the inconvenience", etc. by file mismatching and playing with codecs. For now here are some pertinent files that X3 uses and there file versions on a base clean install, it's by no means a complete list of pertinent files but some main ones:
(your versions can be found in dxdiag, although not all these are listed there)
MOVIES
amstream.dll DirectShow Runtime 6.5.2600.2180
quartz.dll DirectShow Runtime 6.5.2600.2180
wmspdmod.dll WM speech decoder 9.00.00.3250
qasf.dll
MUSIC
msdmo.dll DMO Runtime 6.5.2600.2180
l3codecx.ax MPEG Layer-3 Audio Decoder 1.5.0.50
SOUND
MSACM32.drv Microsoft Sound Mapper 5.1.2600.0
wdmaud.drv WDM Audio driver mapper 5.1.2600.2180
midimap.dll Microsoft MIDI Mapper 5.1.2600.2180
(Your audio driver)
d3d9.dll 5.03.2600.2180
d3d8.dll 5.03.2600.2180
ddraw.dll 5.03.2600.2180
Any files with 2600.2180 are part of SP2, so if you don't have SP2, don't be suprised to see different versions. If you find wmspdmod.dll, which does speech decoding, at version 10.xxx it's because you have media Player 10 installed and hopefully you don't have any older files in your dllcache that are older versions rewriting the new. Mismatched versions of core files of Direct X, MediaPlayer and direct show cause issues which won't be fixed by codecs alone, so hopefully we'll address an easier process in Part 2.
Added 11-20-05
PART 2 - The Finaly!
Firstly, thanks to those that sent me there filemon logs and DXdiag logs, I didn't make the request public otherwise I would have too many to manage probably. I previously mentioned in the above Part 1, that codecs are only half the battle, the other big issue that causes bad performance and CTD's is the mis-matched DirectX and Media Player file versions. I know this because I took the 30 hours to dig into this game and discovered these things along the way, further I recreated alot of the CTD issues I read about here along the way. The sad thing is this thread will probably get buried and people will continue to start new topics saying "why is my performance horrible?", "why am I getting crashes?", "why, when every other game works fine?" X3 uses some aspects of direct show files that other games obviously don't. I'm usually careful with my machine, and the things I discovered happen overtime from normal use, afterall installing something basic like PowerDVD shouldn't effect X3, but it does.
I started working on a tool to change merit of codecs as well as a tool to verify and correct mis-versioned files for both DX9 and Media Player 9 and 10. But the project is really far too time consuming for me to undertake, and I asked myself why am I the one making this tool? Developers probably don't want to do it because they think Microsoft should keep it's house clean and govern their OS, and making workaround tools just put off the inevitable of Microsoft doing it. Take Norton, long before the Symantec bloat of these days, they used to make good tools that complimented Windows, like when there wasn't a defrag, they made one. So the point is, third parties have always made workarounds and if I could, I would make one. So, not wanting to recreate the wheel myself and make a "one stop tool" that does this strictly around this game alone, I figured many others have had to discover these mismatching issues as well as I did. And I was right!
I want to make this very clear: If your performance is horrible for your hardware, your a hard core gamer and you have done all that you can think of, when you can run other games like Doom 3, F.E,A.R, HL2: Lost Coast then it's most likely a file versioning problem and additionally codec merit (priority). In my case it was both. It affects overall performance, video and audio synching, CTD's, etc.
Waiting on patches or others to rectify these issues is not going to work, the quickest way to rectify your own issues is to setup a seperate partition and take the two hours to do a fresh install of XP SP2. I say that after spending thirty to forty hours digging into this and knowing what it requires to dig out of it. I just can't spend the time to build the one size fits all tool, it would take me weeks to do it properly for an OS that will be replaced in the next year. For those that don't want to take that route of reinstalling an OS on seperate partition, there is another solution. As I mentioned others have recognized this problem of codec priorities and mis-matched files caused primarily by file protection and older files that are kept in your system32\dllcache directory and other causes. Here are some tools that can help you fix mis-matching files, direct show filters, as well as codec priorities by changing there merit.
The problem is you really won't know your version issues unless you inspect each file like I did against the original binaries in Windows Media and DX 9c. That's why I mentioned a reinstall on seperate partition is easier than just running them all. Nevertheless, here are some tools to start you in the right direction and have some magic buttons that supposedly restore things the way they are supposed to be which what I was trying to do anyway with an all in one tool.
As you check these sites you'll see what I was saying has been confirmed and that's the reason for these other tools.
Be aware, these are extreme measures because that's what it takes to rectify issues for many:
I suggest you read up about these tools before jumping right in, use at your own risk.
First repair mismatched drivers by using driver cleaner, mentioned in part 1.
For DX9 issues:
Re-running setup for DirectX doesn't aleways work and an uninstall/reinstall is necessary to fix mis-matched files, others know this too, so tools were made to do just that.
There are others but this one seems popular:
Directx Happy uninstall
http://www.superfoxs.com/
For Direct show filters and codec priorities:
You can use the method I showed above to see which codecs, if infact codecs are in issue for you and change there priority. Quartz.dll for Mpeg video and audio decompression and l3codecx.ax for MPEG3. Others may even provide better performance but just didn't have the time.
Here are some tools and a short description, none of them require installers, just double click the exe:
http://www.free-codecs.com/download/Filmerit.htm
Direct Show Filter Manager, which color coordinates and shows you the priorities instantly by color and allows you to change them:FileMerit 2.1:
Filmerit is a freeware application for cleaning and managing the DirectShow filters. Directshow is a very nice concept that Microsoft introduced in DirectX. With directshow, the multimedia applications become a great construction play, where elementary bricks, called filters, are connected together, each one producing an elementary treatment on the streams of video or audio.
Many useful filters are delivered originally with DirectX , but each application may install its proper filters, eventually replacing some original ones, and finally this process may create conflicts, and in some extreme cases block all multimedia applications. Some packs of codecs install dozens of filters with insufficient precautions, bringing some trouble in your system. With Filmerit you may control exactly what they do, and correct what is not adequate.
Filmerit is in fact the Rolls-Royce of directshow filter management, with powerful functions:
- display the list of all directshow filters registered in your system, with all their properties, and the version information of the associated server file. Filters are displayed in alphabetical order, grouped by filter categories. The program tests the integrity of the filters and colors in red the lines with errors.
- modify the Merits of one or several filters. Merits are numeric values attached to filters, which define their priority level in multimedia applications. Modify them if you want to fine tune your applications. Often some new added filters have a too high Merit, hiding better filters which can no more operate. Decrease their Merit with Filmerit is sometimes a good solution, better then to snipe them.
- finally, Filmerit has a "magic button" . If you click on it, all erroneous records of filters are deleted from the registry, and the corresponding server files are reinstalled. It is the simplest way to maintain a clean and healthy system!
Also has a magic button to restore standard directx codecs.
http://www.free-codecs.com/download/Dir ... anager.htm
Lastly, Radlight Filter Manager:
http://www.free-codecs.com/download/Rad ... anager.htm
Edit 11-21-05This little tool allows you to change merit of DirectShow filters and it can also be used to list all registered codecs and to register or unregister codecs. We thought some people may find it useful. Should help fix some filter incompatibilty problems.
In Direct Show Filter Manager you can double click on the following:
[MPEG Audio Decoder] quartz.dll
[MPEG Layer-3 Decoder] l3codecx.ax
[MPEG Video Decoder] quartz.dll
[MPEG-I Stream Splitter] quartz.dll (this was my issue)
Raise the above in merit to preferred(00800000) or above.
/Edit
Lastly, I really haven't found something to verify mismatched file versions of windows media files(even though dx9 duplicates some with different versions as well XPSP2). But for MP 9 users, if you download WMFDIST.exe or the full MP9 installer, extract it to a temp directory and check your sys32 directory, you may find some mismatched due to older versions in your dllcache. Maybe someone else knows of a tool. I'll be around the forum but I don't have much more to contribute to this process unless folks have specific questions, I want to get some game time in too;). But to those wondering why, when every other game works and you tried everything you know and you know your system is up to snuff? This is many times why!