FNA-XNA / FAudio

FAudio - Accuracy-focused XAudio reimplementation for open platforms
https://fna-xna.github.io/
Other
545 stars 73 forks source link

[F3DAudio] Bulletstorm: Full Clip Edition #26

Closed pingubot closed 5 years ago

pingubot commented 6 years ago

Hi,

first of all thank you very much for bringing in a replacement for xact. I wanted to give it a try with Bulletstomr Full Clip Edition, as this game is having bad sound issue with the current wine builtin dll's and also using the native ones with wine does not work.

Using the mingw compiled Faudio dlls, i can get into the menu of the game and the sound is fine, i can lower/raise the different sound levels (music, environement and voices) in the sound menu of the game.

Trying to get into a mission i get the following error message:

Assertion failure at F3DAudioCheckCalculateParams (src/F3DAudio.c:342), triggered 1 time: 'pDSPSettings->DstChannelCount == ChannelCount && "Invalid channel count, DSP settings and speaker configuration must agree"'

After being able to klick on ignore, the following error message shows up:

Assertion failure at F3DAudioCalculate (src/F3DAudio.c:1502), triggered 1 time: '0 && "REVERB not implemented!"'

I can also press ignore here, but the game finally crashes after ignoring both issues 2 times

Many thanks ! Christian

flibitijibibo commented 6 years ago

Compiling with -O3 instead of -g should suppress the assertions, but maybe look into the Src/Dst mismatch first. Because the data doesn’t match there’s more than likely too much or too little data being written. You can enable tracing in cpp/trace.h and get a verbose call stream dumped too, which should narrow down where it dies.

Unless you have a Visual Studio setup, get ready to do a lot of printf debugging. I don’t have a budget for any real Proton work since I’m not actively on their team, and I don’t own this game myself...

pingubot commented 6 years ago

Hi,

many thanks for the update. Sadly i have no c/c++ knowledge, so my debugging skills are basically non existent here :(.

Sad that you are not part of the proton team, having working sound is s important as having working graphics, and when it comes to xaudio, wine is not trouble free .

As you are working together with the wine guys, would it make sense to ask them for help cause this issue may show up when faudio eventually will be used in wine per default ? Suppressing will not stop the game from crashing i guess ? Is it possible that the error is relate to the amount of sound channels which the game tries to use ?

Many thanks ! Christian

flibitijibibo commented 6 years ago

Andrew Eikum is working to integrate this into upstream Wine but a lot of that work is just basic correctness fixes (input validation, version compatibility, things like that). Between Codeweavers' work on Wine and Valve's work on Proton I'm just a no-name loser that happens to be in the middle!

The crash will happen without the asserts, but the asserts told us a couple things that we and the game were doing badly, so if anyone can debug this they have a starting point to work with. Based on my experience with XAudio2 Source/Destination channel validation, they may just have 3D math hardcoded to specific values and certain wav files don't line up, but I feel like that'd introduce bugs even in native XAudio2... I'd have to see for myself.

pingubot commented 6 years ago

fwiw,i just retested with latest master and still get the same error messages show up. Pressing "Ignore all" let the game run,but without sound.

flibitijibibo commented 6 years ago

F3DAudio hasn’t been touched in a while, but hey, no more crashes I guess. This at least means the FAudio side should be valid, but maybe a temp solution would be to just ignore the math altogether and just force the output matrix values to be all 1.0f.

pingubot commented 6 years ago

Sadly i have no clue where to do that. If you have some patch to do that i will happily apply it here and build and test it and report back.

flibitijibibo commented 6 years ago

Might be a while before I can look at this, but if anyone else wants to try, it's this block here:

https://github.com/FNA-XNA/FAudio/blob/master/src/F3DAudio.c#L1433

Instead of attempting to calculate the matrix, just take pDSPSettings->pMatrixCoefficients (which should be SrcChannelCount * DstChannelCount number of floats) and set them all to 1.0f. Or maybe something less than that... who knows how loud that's going to be.

flibitijibibo commented 5 years ago

It's been a while since this last got updated, so I wanted to check something real quick:

Does this work okay if you only use the XAudio2_7 override and skip our fake X3DAudio DLLs altogether? In testing other UE3 games the combination of the fake XAudio2 DLL with the real X3DAudio (and XAPOFX) libraries seems to work just fine.

flibitijibibo commented 5 years ago

Based on other UE3 games I've tested, this probably fixes it for now:

https://github.com/FNA-XNA/FAudio/commit/ce60c41973913065d849aab8413e2003950b9425

pingubot commented 5 years ago

Hi,

would have tested that stuff at the weekend, will try it out now with your latest build. So what do i have to do, do i need to place all dlls in the game folder or just the Xaudio2_7 one ? And what do you mean with the "real x3daudio and xapofx" ? Are you talking about the original native ones or the wine built in ones ?

Many thanks ! Christian

flibitijibibo commented 5 years ago

The process is a little more streamlined now, with a fresh prefix these directions should work:

https://github.com/FNA-XNA/FAudio/blob/master/cpp/README.md#prerequisites

https://github.com/FNA-XNA/FAudio/blob/master/cpp/README.md#wine---native-dlls

pingubot commented 5 years ago

I don't have a fresh prefix and therefore used application specifc overrides in winecfg for the dlls (native, builtin).

I sadly still have no sound and still the following :+1:

Assertion failure at F3DAudioCheckCalculateParams (src/F3DAudio.c:342), triggered 5 times: 'pDSPSettings->DstChannelCount == ChannelCount && "Invalid channel count, DSP settings and speaker configuration must agree"'

WARN:

Assertion failure at F3DAudioCalculate (src/F3DAudio.c:1502), triggered 5 times: '0 && "REVERB not implemented!"'

Did i miss something?

In addition, i think the wine --native-dlls docu is a little bit misleading here, Afaik, the wine delivered dlls are called builtin, not native (if that is what you wanted to describe).

flibitijibibo commented 5 years ago

Delete your Bulletstorm Wine prefix and start over, you have outdated DLLs in there.

We don’t have builtins, that’s eventually going to be done in the Wine source tree.

pingubot commented 5 years ago

did that, new prefix, used :

build_win64> ../scripts/wine_setup_native 
xaudio2_0: done
xaudio2_1: done
xaudio2_2: done
xaudio2_3: done
xaudio2_4: done
xaudio2_5: done
xaudio2_6: done
xaudio2_7: done
xaudio2_8: done
xaudio2_9: done
Skipping link for x3daudio1_3
Skipping link for x3daudio1_4
Skipping link for x3daudio1_5
Skipping link for x3daudio1_6
Skipping link for x3daudio1_7
xactengine3_0: done
xactengine3_1: done
xactengine3_2: done
xactengine3_3: done
xactengine3_4: done
xactengine3_5: done
xactengine3_6: done
xactengine3_7: done
Skipping link for xapofx1_0
Skipping link for xapofx1_1
Skipping link for xapofx1_2
Skipping link for xapofx1_3
Skipping link for xapofx1_4
Skipping link for xapofx1_5

The error messages are gone, but i still have working sound in the menu, but none when resuming my campaign. If i start a new game, the sound seems to work.

In addition I don't fully understand why you create overrides for dlls which you don't link actually ?

flibitijibibo commented 5 years ago

The silence is more than likely a sound that either goes through something other than xaudio or is a WMA buffer, which we don’t support.

The overrides are for the DX redist versions, Steam installs them but does not set any overrides, meaning it uses the builtins which are still unimplemented.

pingubot commented 5 years ago

Mh, ok, I will try to install the direct x redist version in addition.

The strange thing is that only loading a saved campaign shows the no sound issue. Starting a new one works fine and also menu has fine sound.

And what makes it even more strange is that I have seen the same issue using the real native dlls via wineticks.

I only get sound when loading a campaign using the built in dlls, but sound is distorted that way. Therfore I guess it is using xaudio. Not sure if built in xaudio has wma support.

Ethan Lee notifications@github.com schrieb am Fr., 5. Okt. 2018, 21:50:

The silence is more than likely a sound that either goes through something other than xaudio or is a WMA buffer, which we don’t support.

The overrides are for the DX redist versions, Steam installs them but does not set any overrides, meaning it uses the builtins which are still unimplemented.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/FNA-XNA/FAudio/issues/26#issuecomment-427479845, or mute the thread https://github.com/notifications/unsubscribe-auth/Ah9ZczCzMud44mMJ7WdVyFg3MYB-Hbizks5uh7fvgaJpZM4WJCjM .

pingubot commented 5 years ago

Hi,

as an update, i tried to get it working with an faudio build which supports wma from here:

https://gitlab.com/GloriousEggroll/warframe-linux/tree/master/FAudio

But sound when loading the campaign is still a no go.

Many thanks! Christian