Game Development Community

[B5] DirectSound reduces FPS from 320 to 70

by Eric den Boer · in Torque 3D Professional · 09/22/2009 (3:25 pm) · 34 replies

I'm sorry if this has already been posted, however I ran T3D and saw that it was running unusually slow for my workstation. So I decided to fiddle around some, and I then got it: changing the audio driver fixes this.

This is what I mean:
i34.tinypic.com/2u9jr74.jpgi35.tinypic.com/10wpf92.jpg
When selecting OpenAL I get the best performance (325 fps).

When selecting NULL, I get a heap corruption.

What's up? :)

My hardware: Q6600, 8800GT, 4GB RAM, AC'97 Onboard Audio, latest DirectX update, not sure which version video drivers.
Page «Previous 1 2
#1
09/22/2009 (4:43 pm)

I'll be looking into this but my bet is this has more to do with drivers on Vista than with Torque's code. Vista has a new audio architecture that does not allow DirectSound a direct path to the drivers anymore. DirectSound instead runs in software emulation mode.

Also, some manufacturers (Realtek among them) of 3d sound cards supply their own DSound stubs that chain on to their own implementations.

So, in short, DirectSound is sort of being phased out with XAudio2 destined to take its place. Unfortunately, Torque's XAudio2 driver at this point is not as mature as the DSound driver.

I recommend using OpenAL or FMOD with Torque, especially in light of future additions to the SFX engine.
#2
09/22/2009 (4:51 pm)
Thanks for the reply. I'll test it on XP sometimes this week, see how that works :)
#3
09/22/2009 (4:52 pm)

That'd be great.

Ah, and the heap corruption with Null, I think that's fixed.
#4
09/22/2009 (5:13 pm)
Good to hear :)

Tomorrow I have access to an XP machine, I'll post the results here.
#5
09/22/2009 (10:36 pm)
My specs on this machine are near the same as Eric's.
q6600, 4GB ram, gts250, Realtek HD, //edit: XP sp3

//just decided to write-out every combination given to me for others to use as a reference of sorts.

DirectSound with primary sound driver @800x600:
avg. 80 fps

DirectSound with Realtek HD @800x600:
avg. 80 fps

Xaudio with Realtek HD @800x600:
avg. 500+ fps

Null with SFX Baseline Device @800x600:
avg. 78 fps

OpenAL with Generic Hardware @800x600:
Quite steady near 80 fps

OpenAL with Generic Software @800x600:
approx. 500 fps

..clearly there are winners.
#6
09/23/2009 (4:12 am)

Thanks for the detailed testing, eb. Great work.

DS and OpenAL hardware are probably using the same codepath from Realtek. DS probably goes through their SoundBack thing. On Vista, Creative is redirecting DS stuff to OpenAL; don't know if Realtek is doing the same.

Again, DirectSound should be considered legacy at this point. For your games, use XAudio2 or preferably OpenAL or even more preferably FMOD.

The results with the Null device puzzle me, though. That device triggers absolutely no mixing work and all its functionality is just stubs. It's probably not going to make it in time for the next release but I'll be looking into this in a future release.
#7
09/23/2009 (7:54 am)
Just tested this on an XP machine, that was unable to select XAudio as a device (for some reason), and his machine ran at 800 fps in the menu when DirectSound was selected.
#8
09/23/2009 (8:24 am)

Jup, that's what I thought. Vista = avoid DirectSound.

Thanks for testing.
#9
09/23/2009 (8:59 am)
Vista also avoid OpenAL unless you provide the most current installer. make a large way round the one provided in the torque install or vista64 users with a Core i7 will come around to bite of your head off (its not GG only. About any OpenCrap driven game on Steam suffers the very same problem and often even come with outdated drivers like the 2 week ago release Osmos)

Generally: use fmod
for freeware its free, for non freeware its $100, which is more than affordable actually.
#10
09/23/2009 (9:04 am)

Sidenote: Torque does not ship with OpenAL DLLs anymore. If you want to use OpenAL, you need to download it from Creative.
#11
09/23/2009 (10:22 am)
This might explain some of the sound issues in 1.8.1 as well since its basically the same SFX system. Will the 1.8.1 sound system merge with the t3d changes? Has anyone even looked at that at GG. And will SFX work with OpenALL DLLs considering 500 vs 50-80fps is a huge jump... Ill go with the 500fps.

"Again, DirectSound should be considered legacy at this point. For your games, use XAudio2 or preferably OpenAL or even more preferably FMOD."

umm a sidenote? Torque doesnt ship with OpenDLL when clearly its a better performing sound system with Vista and im going to guess Windows 7 (or Vista 2.0 as many are calling it)
Why dont we just include a basic form of FMOD into T3d, it seems to be the fix answer for alot of the problems by this new SFX sound system.
#12
09/23/2009 (10:30 am)

Torque does not ship with the DLLs as that is just another source of incompatibilities and problems. Downloading and installing the proper DLLs takes all of a minute.

I'll make 1.1 default to XAudio2 on Vista upwards. XAudio2 has no performance issues.

Torque is a commercial package so we cannot redistribute FMOD with it.
#13
09/23/2009 (10:35 am)

Ah, and BTW, I'm pretty sure those results above are in large part dependent on the configuration used. Both Eric and eb run Realtek hardware on Vista. I'm almost 100% sure the huge slowdown is to blame on Realtek's DirectSound hooks. There is really no reason, DirectSound's software mixing should be that slow on Vista.

Notice how the FPS equally dropped when switching to the Realtek device with OpenAL. That pretty much makes it obvious.
#14
09/23/2009 (10:40 am)
yes i understand that. But considering nearly every single bug or issue with SFX, the default answer has been FMOD, perhaps someone should give FMOD a call. At 100 bucks for the full FMOD EX package. I can see a basic version with a DLL being put in, ie no source or tools. But at least it would be a stable option.

Though i noticed that FMOD is in fact a OpenAL or DirectX system.. Which leads me to wonder why we changed the Sound System in the first place. The number of issues, bugs, and suggested fixs by yourself and others should speak for itself.

www.garagegames.com/products/fmod
check under the requirement tab.
#15
09/23/2009 (10:50 am)

There seems to be some misconception here what FMOD really is and how it is licensed. The $100 license here is a dedicated indie license only available through GG. It's an exclusive deal.

Look at fmod.org to get info on the licensing. A commercial single-platform license starts at $3000 and a casual one at $1500.

There is no "basic" package of FMOD and you never get the source.

Quote:Though i noticed that FMOD is in fact a OpenAL or DirectX system

FMOD will use lower-level sound APIs for raw sound output, but that is just 10% of what SFX is about. The remaining 90% are what makes FMOD special.

Quote:But considering nearly every single bug or issue with SFX, the default answer has been FMOD

Really? News to me.
#16
09/23/2009 (10:51 am)

Correction: By "you never get the license" I meant with our license. You'll get it with the commercial license.
#17
09/23/2009 (11:24 am)
Isn't there an FMOD extension available for Torque? Does that not fall under the Torque license?
#18
09/23/2009 (11:30 am)
These are just a few where folks refer to FMOD as a possible solution
http://www.garagegames.com/community/forums/viewthread/74616
http://www.garagegames.com/community/forums/viewthread/75657
http://www.garagegames.com/community/forums/viewthread/80984
http://www.garagegames.com/community/forums/viewthread/95435

And no i didnt include the links where surprisingly, there was a lot of sfx bug fixes by yourself. But i dont need to remind you about the dozen or so other posts specifically about SFX and documentation ect.

This is just one of mine
http://www.garagegames.com/community/forums/viewthread/81910

I think that SFX could have been dealt with a lot better from day one. And its still not really dealt with for TGEA owners who dont have T3D access to get alot of the bug fixes that you have posted.
#19
09/23/2009 (11:30 am)

Yep, there is an SFXDevice implementation for FMOD. Put the FMOD DLL into your game folder and it will automatically be made available from the sound provider options menu.

The device implementation is our code. However, for it to do something, it needs the FMOD library and that isn't ours. The FMOD library isn't a freely redistributable thing.

However, even if it was, I'd opt to rather not put it in the SDK. For all binary-only third-party libraries, people should get recent installs appropriate for their platform from the original suppliers. It's the same thing as with DX and PhysX.
#20
09/23/2009 (2:16 pm)
I've always had issues with OpenAL. Even when forcing it to work completely in software mode I found incompatibilities in some systems. Seems like the best route other than dropping some $$$ on FMOD is defaulting to DSound in XP and XAudio on Vista/7.
Page «Previous 1 2