Project

General

Profile

Actions

Emulator Issues #2617

closed

XAudio2 support

Added by cascardian over 14 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
DSP
% Done:

0%

Operating system:
Windows
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
Yes
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

I have searched in both the forums and here, and neither mention anybody
ever suggesting implementing XAudio2. If this is redundant and has already
been discussed by the devs on IRC or the like, I apologize.

Since installing the newest DirectX redistributables is already required,
all users of Dolphin will have XAudio2 support on their machines. Its
benefits should be obvious, although Wikipedia also nicely summarizes them
for those needing to look it up. Its API is clean and nonblocking, its very
multithreading-safe (though that, I know, does not exactly matter in
Dolphin's case), its CPU usage is extremely minimal, and its latency is far
below that of DirectSound in Vista and upwards, as Vista introduced a new
UAA-based audio stack which emulates DirectSound through a WASAPI Session
on the software mixer. DirectSound can still be an option as a sort of
fallback, but once implemented XAudio2 should be the default for Windows users.
Directly using WASAPI is not an option, as this would tie Dolphin
exclusively to the sound device during its runtime, which is at the very
least bad default behaviour and overall not necessary other than for things
such as Reclock.

For a working implementation which is very much ahead compared to
DirectSound (less stuttering mainly), look at SPU2-X on PCSX2 or at VBA-M.
In general, SPU2-X's timestretching code deserves a look all on its own
(DeSmuME, for instance, has also implemented it in its "P" synchronization
method), as Dolphin's DSP's current audio throttling implementation does
not seem to intelligently stretch the sound whatsoever, but that's
something for another issue report.

XAudio2 certainly seems to be easy to use, although Microsoft's official
documentation is not the best. I still wouldn't know how to implement it,
since I'm a C++ noob and its buffering system alone (using an unsigned char
byte array?) confuses the heck out of me. Consequently, I'm useless :)

For the devs this is surely unnecessary, but here are the docs anyway for
those wanting to get a feel for the API and its features:
http://msdn.microsoft.com/en-us/library/ee415737%28v=VS.85%29.aspx
http://en.wikipedia.org/wiki/DirectSound#XAudio_2

Thank you.

Actions

Also available in: Atom PDF