-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[XAudio2] FAudio support #2
Comments
Spent some time on this today, the COM wrapper should work out of the box again (some recent 2.8+ compat and SIMD optimizations screwed it up) if anyone wants to play with this right now. |
Uh? For real, no more MMDevAPI?
I mean, isn't that what windows itself requires? |
FAudio is a plain-as-peaches C implementation of XAudio2 and is already shipping in other work, so I'm pretty sure this won't end up like other scenarios where implementations were done with high-level wrappers or were unfinished and abandoned. Windows does require the DX redist but we don't have to be like that! In other news, I just threw together the XACT COM wrapper source, but not the project files themselves... I think it'll work but the COM stuff isn't something I'm terribly familiar with myself: |
Just so no one goes too far down this road, I already have the Wine integration work for xaudio2, xapofx, and x3daudio done in my tree. It's currently at the point where I'm testing games that worked in Wine's "old" xaudio2 and ensuring they work in the new FAudio-based xaudio2. I just got busy with other stuff ;) |
So.. How's the final picture going to look like?
Mhh.. Newer windows maybe not either - but I'm not sure how much wine would be happy to differ otherwise. |
Same as it is now, we're just going to use FAudio to do the audio mixing instead of OpenAL, since it's a much better fit. All the audio still goes through the normal Wine audio paths. |
Oh, "reimplementing" was with respect to windows, not a previous wine architecture.
|
Just finished making the XACT DLLs! XACT 3.0 to 3.7 should work with FAudio now. EDIT: Demo vid, because why not https://www.youtube.com/watch?v=_gFpDfN60S4 |
@flibitijibibo would it be possible to have the dlls in a precompiled form ready to download somewhere so the guys from winetricks could add a verb for it to ease testing? |
At the moment FAudio is moving really fast so precompiled wouldn't be of much use - I may do this for stable releases though (expected to be every month on the 1st, alongside FNA releases). This may be a good time to test out Johan's README: |
FWIW I put my WIP patches at https://github.com/aeikum/FAudio/commits/wip-totally-broken . It is in no way usable in its current state, but has some needs-more-research fixes to get more games to work. |
I also put the matching wine.git commit here, again, totally broken. https://github.com/aeikum/wine/commits/wip-faudio |
On the subject of broken things, the XACT wrapper is now at the point where Resident Evil 4 should run (though it's probably very fragile since it depends on a slightly unimplemented function). If you self-build, set this to 1: FNA-XNA/FAudio@38471d2#diff-396a3a789a898fb29cce92cb6fc31014R2328 |
By far the most requested feature since Proton has gone out is WMA support - here's the issue where we're now tracking this: There's some existing code but none of it is meant to work (it doesn't even compile yet), so if you're familiar with FFmpeg and want to fix this problem, that's the place to start. |
Work on this has been sparse since FAudio now works with FNA and I'm still in the process of seeing if I can work on this in a more official capacity, but in the meantime I've been given a couple games and I made some more samples. Sonic Mania: https://www.youtube.com/watch?v=FV_GPY8O9ww A Hat in Time (64-bit!): https://www.youtube.com/watch?v=I9NEkqfhWDw |
Had a bit of free time today, so I cleaned up the existing work for the COM wrapper and now it's MUCH easier to build and run yourself. All you need is MinGW-w64, MinGW-SDL2 (2.0.8 or greater), and Git, all of which are most likely in your repositories. To build:
Then you can use https://github.com/FNA-XNA/FAudio/blob/master/cpp/README.md As of now my recommendation is to install the XAudio2 DLL, but NOT X3DAudio. So you would be removing these 5 lines, for example: https://github.com/FNA-XNA/FAudio/blob/master/cpp/scripts/wine_setup_native#L62 XACTEngine may or may not work, but honestly so few games use this that I'd be surprised if you ran into it at all. |
There's a typo in the |
If you can, do a pass through the files and for anything you find that's off send a PR, I can merge it right away if it's all docs plus the return code. |
Tested on Witcher 3, which fixes audio cracks followed by volume drops I got with wine internal xaudio2_7, nice! |
Tested Skyrim Special Edition but without success. The following errors were logged: So, it's not looking too promising. |
Thanks! |
Isn't this expired already? |
Assuming it is that patent which is in question for this case, it would appear that while not expired it should be covered under the OIN? |
I have FFmpeg 4.1.0 with all codecs enabled (including WMA), i've built FAudio and replaced it in Proton 3.16 Beta and now Skyrim: SE runs, but there is something wrong with sound. It is buzzing or cracking every few minutes. Also Skyrim crashes on exit (same way it did with xact native dll). |
@BeerZ0rg I'm no longer having the crackling sound issue in my build. Could you try https://github.com/kakra/wine-proton, it is rebased to a newer wine version including several patches and experimental improvements. Maybe we can isolate the required patches... SkyrimSE works fine here. But currently you'd have to compile from source (should be easy) and extract the resulting dist.tar.xz to the proton beta folder. |
@kakra Thanks, i'll try this when im back home in couple of hours. The ammount of work done here is so impressive im feeling like Christmas already. |
@BeerZ0rg Nah, there's a few days left until then. ;-) I'm planing to push a refined branch this evening (CEST). |
Skyrim has a crash-on-exit bug caused by one of the DLC. (Dawnguard, I think, but I'm not sure of that.) You might want to try again with DLC disabled. |
@foresto It can crash or freeze. Usually, with built-in xaudio2_7, it freezes. It may crash otherwise with native xaudio2_7, I'm not sure, but from Proton it looks like a clean exit so that's okay. |
@BeerZ0rg My branch is updated now. |
As explain in https://github.com/FNA-XNA/FAudio/wiki/FAudio-for-Proton SDL 2.0.9 is needed... Ubuntu 16.04 (or even 18.04) => SDL 2.0.4 (2.0.8)... Can't compile... Arfff, in one or two year Fallout 4 or Skyrim SE should be played out of the box with Proton. But for now stuck with Xaudio. |
It compiles fine here on Gentoo with SDL 2.0.8, tho it's throwing a warning during compile to upgrade ASAP. In my Ubuntu (cosmic) container, it also compiles fine, cosmic seems to have SDL 2.0.9. |
@kakra Debian sid and Ubuntu cosmic/disco still are at 2.0.8 version. Once Debian upgrades to 2.0.9 it'll to be pulled by next Ubuntu release before freeze (it's too late for anything <19.04 aka Disco). |
This might impact The Darkness II. Using "winetricks xact xact_july2010"(though xact_july2010 is probably redundant) solves all audio issues in the game with the most recent version of wine (wine-4.0). It is also worth noting that the game runs with wine out of the box though fails to start with "Steam Play". The game might make it to platinum rating if the audio problems were solved without winetrick and the following patch(that fixes and old "missing textures" bug) made it to wine: |
Hello @LinuxUser404, please use the Proton issue tracker for game-specific discussion, in your case ValveSoftware/Proton#563 (and issues with upstream wine should be reported to the winehq issue tracker). |
Wine 4.3 includes the FAudio rewrite: https://www.winehq.org/announce/4.3 Proton 3.16-5+ also includes the XACT DLLs, but some work will need to go into that before it goes into upstream: https://github.com/flibitijibibo/wine/pull/2 The FAudio-specific stuff is tracked over here: https://github.com/FNA-XNA/FAudio/issues Developers can use the above issue tracker, and all other users are encouraged to use the Proton issue tracker for any issues found in specific titles: |
# This is the 1st commit message: winebus.sys: Pass HID_XFER_PACKET and IO_STATUS_BLOCK to callbacks. # The commit message ValveSoftware#2 will be skipped: # fixup winebus.sys: Pass HID_XFER_PACKET and IO_STATUS_BLOCK to callbacks.
Signed-off-by: Jon Doron <[email protected]>
Signed-off-by: Jon Doron <[email protected]>
Signed-off-by: Jon Doron <[email protected]>
Signed-off-by: Jon Doron <[email protected]>
Signed-off-by: Jon Doron <[email protected]>
So now that this is out in the wild...
FAudio is a new, accuracy-focused reimplementation of XAudio2 and its relative libraries (such as X3DAudio, XACT, and XAPO). Part of this work includes a COM wrapper that mimics the Windows XAudio2 DLLs, allowing Windows games to use FAudio for audio support instead. This is known to work on both Windows and Wine for 32- and 64-bit, and both @JohanSmet and @aeikum have been putting in work to make it more compatible with the whole range of XAudio2 versions.
At the moment Wine is reimplementing XAudio2 with OpenAL Soft, and the other libraries (including X3DAudio) are currently stubbed. In addition to the feature gaps, there are also various accuracy issues that come from wrapping a low-level audio API around a high-level API (as we found ourselves while making FNA, hence the creation of FAudio).
The idea is that FAudio would both fill in large gaps left by the current Wine implementation as well as make the existing implementation much more accurate, and in a perfect world, remove the need for the DX redist for audio support.
Andrew has been leading the charge with Wine compatibility lately so I'll let him drive this thread, but the main things that Wine cares about:
The text was updated successfully, but these errors were encountered: