Author Topic: DirectSound or XAudio2  (Read 12502 times)

Offline Gab75

  • FBNeo Contributor
  • *****
  • Posts: 1481
  • Karma: +33/-0
  • All games deserve to be emulated, more or less! :P
DirectSound or XAudio2
« on: September 09, 2016, 01:39:08 AM »
Hi guys,
trying different settings I noticed that using XAudio2 instead of DirectSound (as audio plugin) the games' framerate is more stable (usually 60/60 fps instead of 57-60/60 fps)... moreover with XAudio2 is selectable an additional effect, the "reverb".
Is there a reason to favour a specific library or can they be used indifferently ? (logically, assuming that both plugins work properly on the system)

Thanks in advance for the answers! :)

Offline synnchan

  • Jr. Member
  • **
  • Posts: 69
  • Karma: +2/-0
  • aka: synnae
Re: DirectSound or XAudio2
« Reply #1 on: October 18, 2016, 04:06:33 PM »
I don't really have the answer for this question :( and sorry for digging this rather old thread, but I'd like to ask something related.

After doing some research, I read that "XAudio2 is the successor to DirectSound" and that DirectSound is considered deprecated now. Does that mean XAudio2 has better sound quality than DirectSound, or is it just something about DirectSound having less compatibility with newer systems?

Offline Gab75

  • FBNeo Contributor
  • *****
  • Posts: 1481
  • Karma: +33/-0
  • All games deserve to be emulated, more or less! :P
Re: DirectSound or XAudio2
« Reply #2 on: October 19, 2016, 12:51:37 AM »
After doing some research, I read that "XAudio2 is the successor to DirectSound" and that DirectSound is considered deprecated now. Does that mean XAudio2 has better sound quality than DirectSound, or is it just something about DirectSound having less compatibility with newer systems?

Obviously, I don't know much about it... but the XAudio2 library should have better performance than the DirectSound library, but ,as counterpart, it could have "compatibility issues" with the emulation of some audio sub-systems.


Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: DirectSound or XAudio2
« Reply #3 on: October 19, 2016, 06:31:28 AM »
The timing in FBA is largely controlled by the audio interface. On modern system xAudio2 gives much more consistent performance as you noticed.

On a modern system (Windows 7 and up) you should be using xAudio2. We should probably make it the default option now.
Account of Barry Harris; the traitor.
Send me an e-mail at barry@fbalpha.com letting me know how big of a piece of sh** I am.

Offline Gab75

  • FBNeo Contributor
  • *****
  • Posts: 1481
  • Karma: +33/-0
  • All games deserve to be emulated, more or less! :P
Re: DirectSound or XAudio2
« Reply #4 on: October 19, 2016, 07:14:44 AM »
Indeed using the XAudio2 plugin the framerate is more stable (60/60 fps in almost every condition)... thanks for the clarification! :)

Offline synnchan

  • Jr. Member
  • **
  • Posts: 69
  • Karma: +2/-0
  • aka: synnae
Re: DirectSound or XAudio2
« Reply #5 on: October 19, 2016, 07:20:14 AM »
Does DirectSound have any advantage over XAudio2?

Offline iq_132

  • Administrator
  • *****
  • Posts: 3728
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: DirectSound or XAudio2
« Reply #6 on: October 19, 2016, 07:28:40 AM »
Does DirectSound have any advantage over XAudio2?
The few things I've read suggest no.


Offline furiadeoso

  • Newbies
  • *
  • Posts: 46
  • Karma: +0/-0
    • EMUpartidas online
Re: DirectSound or XAudio2
« Reply #7 on: November 01, 2016, 12:17:24 PM »
Indeed using the XAudio2 plugin the framerate is more stable (60/60 fps in almost every condition)... thanks for the clarification! :)
Can be supposed that Xaudio2 is a better option to play online too (bearing in mind that stability)?

Offline Gab75

  • FBNeo Contributor
  • *****
  • Posts: 1481
  • Karma: +33/-0
  • All games deserve to be emulated, more or less! :P
Re: DirectSound or XAudio2
« Reply #8 on: November 01, 2016, 12:46:21 PM »
Can be supposed that Xaudio2 is a better option to play online too (bearing in mind that stability)?

I don't use the online functions, so I don't rightly know, but surely (as you wrote) a stable frame rate can help to prevent potential lags/desyncs!

Offline furiadeoso

  • Newbies
  • *
  • Posts: 46
  • Karma: +0/-0
    • EMUpartidas online
Re: DirectSound or XAudio2
« Reply #9 on: November 01, 2016, 01:35:48 PM »
I don't use the online functions, so I don't rightly know, but surely (as you wrote) a stable frame rate can help to prevent potential lags/desyncs!
I think the same. Thanks for your comments!

Offline synnchan

  • Jr. Member
  • **
  • Posts: 69
  • Karma: +2/-0
  • aka: synnae
Re: DirectSound or XAudio2
« Reply #10 on: November 05, 2016, 02:25:52 PM »
By the way, Gab75, can you name a few games that work better with XAudio2 than DirectSound? I'd like to test them out. :)

Offline furiadeoso

  • Newbies
  • *
  • Posts: 46
  • Karma: +0/-0
    • EMUpartidas online
Re: DirectSound or XAudio2
« Reply #11 on: November 05, 2016, 03:09:41 PM »
I've checked it too. 100% stable frame rate and a bit less  resources wasted.
DirectSound have tiny framedrops.
Tested with street fighter III strike.
Xaudio2 allow low pass filtering and reverb.

Offline Gab75

  • FBNeo Contributor
  • *****
  • Posts: 1481
  • Karma: +33/-0
  • All games deserve to be emulated, more or less! :P
Re: DirectSound or XAudio2
« Reply #12 on: November 05, 2016, 03:45:07 PM »
By the way, Gab75, can you name a few games that work better with XAudio2 than DirectSound? I'd like to test them out. :)

It's not a matter related to specific games, it's a "general trend"... using the DirectSound API there are small fluctuations in the frame rate with almost all games, often these fluctuations are imperceptible, but sometimes you can notice small indecisions in the animation.
In any case, with a quite modern computer all games emulated by FBA run at "full speed" (DirectSound small fluctuations permitting) in almost every condition! :)

Offline furiadeoso

  • Newbies
  • *
  • Posts: 46
  • Karma: +0/-0
    • EMUpartidas online
Re: DirectSound or XAudio2
« Reply #13 on: November 06, 2016, 12:34:04 AM »
I'm not sure but, may increase input lag using Xaudio2. Playing Dimahoo today I felt so.

Offline Gab75

  • FBNeo Contributor
  • *****
  • Posts: 1481
  • Karma: +33/-0
  • All games deserve to be emulated, more or less! :P
Re: DirectSound or XAudio2
« Reply #14 on: November 06, 2016, 01:24:18 AM »
I'm not sure but, may increase input lag using Xaudio2. Playing Dimahoo today I felt so.

Did you test the game using the same settings? Different settings may produce a modification in the results...