fna-xna / faudio Goto Github PK
View Code? Open in Web Editor NEWFAudio - Accuracy-focused XAudio reimplementation for open platforms
Home Page: https://fna-xna.github.io/
License: Other
FAudio - Accuracy-focused XAudio reimplementation for open platforms
Home Page: https://fna-xna.github.io/
License: Other
Line 1010 in f7a0ce7
This line should look like this: if( skipCenter && curSpeakerIdx == centerChannelIdx )
Hi @flibitijibibo, thanks for all the efforts on FAudio.
I've landed here as I'm trying to get Wolfenstein: The New Order running with Proton and I'm encountering XAudio2 issues.
I've checked-out and attempted to build FAudio, I'm running into issues where cmake
can't find the SDL2 libs. Could I get a slight helping hand in this aspect?
The SDL2 libs have been downloaded from APT:
sudo apt install libsdl2-dev libsdl2-2.0-0
The library and include files land here respectively:
/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so: symbolic link to libSDL2-2.0.so.0.4.0
/usr/include/SDL2
When building I get the following CMake errors:
-- no TARGET SDL2::SDL2, or SDL2, using variables
-- Configuring done
CMake Error at CMakeLists.txt:51 (add_library):
Target "FAudio" links to item "-L/usr/lib/x86_64-linux-gnu -lSDL2 " which
has leading or trailing whitespace. This is now an error according to
policy CMP0004.
CMake Error at CMakeLists.txt:51 (add_library):
Target "FAudio" links to item "-L/usr/lib/x86_64-linux-gnu -lSDL2 " which
has leading or trailing whitespace. This is now an error according to
policy CMP0004.
CMake Error at CMakeLists.txt:51 (add_library):
Target "FAudio" links to item "-L/usr/lib/x86_64-linux-gnu -lSDL2 " which
has leading or trailing whitespace. This is now an error according to
policy CMP0004.
Predictably make
fails at the following line:
/home/kjoshi/temp/FAudio/src/FAudio_platform_sdl2.c:257:23: error: ‘SDL_AudioStream’ undeclared (first use in this function)
SDL_FreeAudioStream((SDL_AudioStream*) resampler);
Looking at the release notes for 19.02, I see the following env-vars which I've tried to set:
export SDL2_INCLUDE_DIRS=/usr/include/SDL2
export SDL2_LIBRARIES=/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so
But I run into the same errors as above. I'm unfamiliar with cmake
is there a way to get it to discover SDL2 in those installed locations?
Thanks again for your efforts.
This one's for @JohanSmet and @lamarqua.
While working on 3D, filters, and reverb you guys came up with a bunch of good tools to test these features. Let's try and get those into the FAudio repo.
I added a utils/ folder that now hosts testparse and facttool, but more importantly I split up the UI stuff I wrote for facttool and put it in a "uicommon" folder. This folder does all the boring stuff like rendering/input and ImGui interop, so you don't have to use the ImGui example code or other third-party bits, and it has a few declarations that tools can use:
https://github.com/flibitijibibo/FACT/blob/master/utils/uicommon/FAudioUI_main.c#L48
So you define those parts in your tool somewhere and then it should Just Work without any window/UI setup on your part; here's facttool as an example:
https://github.com/flibitijibibo/FACT/blob/master/utils/facttool/facttool.cpp
Pretty easy to use I hope! And of course if it's just a console-only program that just prints stuff, you can ignore this.
For now we're only going to add tools to the Makefile, since we're probably going to get into C/C++ features that VS2010 doesn't like, and right now I don't really care about that target for tests... MinGW works just fine for these. That's also pretty quick, since I'm just adding them as separate uberbuilds:
https://github.com/flibitijibibo/FACT/blob/master/Makefile#L68
We'll do VS2010 later on, since some of these tools do have the option to use XAudio2 alongside FAudio and that can be really useful. But that's busy work I can do later!
so I compiled and ran "make install" on FAudio.
I then added the patches mentioned in #105 to wine 3.21 source.
I was then trying to run configure for a 64bit wine build, I continually got errors
for "configure: libFAudio 64-bit development files not found, XAudio2 won't be supported."
in an attempt to fix this I copied the header files from /usr/local/include to /usr/include, and the include folder in the wine source.
I also copied the libFAudio.so to /usr/lib/x86_64-linux-gnu/
as you can see from the output below some parts are being found but some are not.
what can I do to fix this?
../wine-3.21/configure --enable-win64 | grep -i faudio checking FAudio.h usability... yes checking FAudio.h presence... yes checking for FAudio.h... yes checking for -lFAudio... not found configure: libFAudio 64-bit development files not found, XAudio2 won't be supported.
I'm building FAudio for android both 32 and 64 bits. The 32 bit version is failing because the neon implementation uses intrinsics that appear to be only present in ARM64 (eg. vuzp1q_f32).
As 32bit android is quite rare this days, I don't care much, but I just wanted to let you know.
The likelihood of us ever getting a permissively-licensed WMA/xWMA decoder is close to zero, but that should only affect commercial FNA projects that have access to the source data (and thus can choose a different compression method). For projects like the COM wrapper, Wine, and @0x0ade's XnaToFna, we can use something like FFmpeg to deal with this.
@aeikum has already gotten started on this; adding the decoder is simple enough but we'll also have to fuss with the decoders a little bit due to the various ways WMA sources get special treatment in the spec:
Hey, I built everything and ran the script for DLL overrides but now the audio isn't working at all, there are no error popups etc.
How about providing binary releases? That would widen the audience considerably!
What's easy, works and known is the winetricks verb facility, like dxvk is using.
Hellblade crashes at the beginning with Faudio.
Crash log:
0031:fixme:ntdll:EtwEventRegister ({5eec90ab-c022-44b2-a5dd-fd716a222a15}, 0x14000107c, 0x140016030, 0x140016050) stub. 0031:fixme:ntdll:EtwEventSetInformation (deadbeef, 2, 0x140013988, 43) stub 0033:err:module:import_dll Library libaom.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libgsm.dll.1.0.14 (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libiconv-2.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library liblzma-5.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libmp3lame-0.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libopencore-amrnb-0.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libopencore-amrwb-0.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libopenjp2-7.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libopus-0.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libspeex-1.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libtheoradec-1.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libtheoraenc-1.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libvorbis-0.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libvorbisenc-2.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libvpx.dll.5.0.0 (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libwebp-7.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libwebpmux-3.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libx264-148.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libx265.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library zlib1.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library xvidcore.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libsoxr.dll (which is needed by L"C:\\windows\\system32\\swresample-3.dll") not found 0033:err:module:import_dll Library swresample-3.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library avcodec-58.dll (which is needed by L"C:\\windows\\system32\\FAudio.dll") not found 0033:err:module:import_dll Library libssp-0.dll (which is needed by L"C:\\windows\\system32\\FAudio.dll") not found 0033:err:module:import_dll Library FAudio.dll (which is needed by L"C:\\windows\\system32\\X3DAudio1_7.dll") not found 0033:err:module:import_dll Library X3DAudio1_7.dll (which is needed by L"Z:\\mnt\\Games\\Hellblade Senuas Sacrifice\\HellbladeGame\\Binaries\\Win64\\HellbladeGame-Win64-Shipping.exe") not found 0033:err:module:import_dll Library libssp-0.dll (which is needed by L"C:\\windows\\system32\\XAPOFX1_5.dll") not found 0033:err:module:import_dll Library libaom.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libgsm.dll.1.0.14 (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libiconv-2.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library liblzma-5.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libmp3lame-0.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libopencore-amrnb-0.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libopencore-amrwb-0.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libopenjp2-7.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libopus-0.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libspeex-1.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libtheoradec-1.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libtheoraenc-1.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libvorbis-0.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libvorbisenc-2.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libvpx.dll.5.0.0 (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libwebp-7.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libwebpmux-3.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libx264-148.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libx265.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library zlib1.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library xvidcore.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library libsoxr.dll (which is needed by L"C:\\windows\\system32\\swresample-3.dll") not found 0033:err:module:import_dll Library swresample-3.dll (which is needed by L"C:\\windows\\system32\\avcodec-58.dll") not found 0033:err:module:import_dll Library avcodec-58.dll (which is needed by L"C:\\windows\\system32\\FAudio.dll") not found 0033:err:module:import_dll Library libssp-0.dll (which is needed by L"C:\\windows\\system32\\FAudio.dll") not found 0033:err:module:import_dll Library FAudio.dll (which is needed by L"C:\\windows\\system32\\XAPOFX1_5.dll") not found 0033:err:module:import_dll Library XAPOFX1_5.dll (which is needed by L"Z:\\mnt\\Games\\Hellblade Senuas Sacrifice\\HellbladeGame\\Binaries\\Win64\\HellbladeGame-Win64-Shipping.exe") not found 0033:err:module:LdrInitializeThunk Importing dlls for L"Z:\\mnt\\Games\\Hellblade Senuas Sacrifice\\HellbladeGame\\Binaries\\Win64\\HellbladeGame-Win64-Shipping.exe" failed, status c0000135 0031:fixme:kernelbase:AppPolicyGetProcessTerminationMethod 0xfffffffffffffffa, 0x5ffd00
I've built the tip of master (98d2bbd) and applied imported the build libraries into my wine (proton 3.7-7beta) context using the wine_setup_native script. When I run Skyrim: Special Edition I get the following error dialogues on launch:
Assertion failure at FAudio_CreateSourceVoice (src/FAudio.c:260), triggered 1 time: '0 && "Unsupported format tag!"'
Assertion failure at FAudioSourceVoice_SubmitSourceBuffer (src/FAudio.c:1274), triggered 1 time: 'pBufferWMA == ((void *)0)'
I can hit ignore on those errors and get to the main menu for the game. I hear the initial baseline for the title screen, but there is no menu music, or any other menu sounds.
I can start a new game, which results in the following errors on a loop:
Assertion failure at F3DAudioCheckCalculateParams (src/F3DAudio.c:379), triggered 1 time: 'pEmitter->InnerRadiusAngle <= 6.283185307f / 4.0f && "Value" "pEmitter->InnerRadiusAngle" "Is too big"'
Assertion failure at F3DAudioCalculate (src/F3DAudio.c:1491), triggered 1 time: '0 && "LPF_DIRECT not implemented!"
Assertion failure at F3DAudioCalculate (src/F3DAudio.c:1497), triggered 1 time: '0 && "LPF_REVERB not implemented!"
Assertion failure at F3DAudioCalculate (src/F3DAudio.c:1502), triggered 1 time: '0 && "REVERB not implemented!"
Assertion failure at FAudioVoice_SetOutputFilterParameters (src/FAudio.c:947), triggered 1 time: '0 && "Output filters are not supported!"'
If i hit "ignore permanently" I can continue playing the game without sound.
I would like to have this github issue to help track the progress of these features for myself and anyone else interested in using FAudio for skyrim. I have some C knowledge, and i would like to be pointed in the right direction for additional debugging info or paths forward for implementing these features.
In Skyrim SE (Special Edition) I have to use FAudio to get any voice to work properly. This, of course, was quite easy and not hard at all. The only issue is that Voice gets a little messed up. When facing the character dialog is easily heard however when looking away even if the character is close audio drops out. I believe this to be a problem caused by the lack of full 3d audio support/implementation. If you could confirm that that would be awesome. I also notice in some dialog during the sentence the character repeats a word and the sentence gets cut off and the end. This isn't a huge deal and perhaps isn't an FAudio issue rather a Windows issue. I also get weird Reverb in certain buildings within the game. Again not game breaking but something to note.
I'd like to add a way to dump the raw buffers fed to a SourceVoice object to files to make it easier to work on files, which trigger assertions or cause other errors
I think it would be possible if we create a unique filename in FAudio_CreateSourceVoice and store it in FAudioVoice. I think we can also write the header format for the wave-files in this step.
Then with each FAudioSourceVoice_SubmitSourceBuffer we open the file with append and byte mode, append the buffers to the dump file and close the file again
Hej!
This library is probably of interest to me for https://github.com/xoreos/xoreos (specifically, because of Jade Empire). I'd probably prefer to pull the code into xoreos, especially since the Windows version of Jade Empire uses an ASCII variant of the XACT formats (which as far as I understand is not usual?), so I'd probably have to fiddle with the code anyway in a way that's possibly not relevant to you.
Unfortunately, the Ms-PL doesn't seem to be compatible with the GPL. According to this StackExchange answer, the issue seems to be 3. (D).
Would it be possible to dual-license this library Ms-PL and GPL (well, xoreos is GPLv3+, so either GPLv2+ or GPLv3+ would be fine with me)?
Cheers
Sven
First, I am average Linux user, and I use Manjaro KDE latest stable version.
I installed the required Mingw 64 libraries
then tried to compile FAudio as described at Readme.md, and got this error about FAudio.dll not found
[ahmed@ahmed-pc FAudio-master]$ make clean all rm -f src/F3DAudio.o src/FAudio.o src/FAudio_internal.o src/FAudio_internal_simd.o src/FAudioFX_reverb.o src/FAudioFX_volumemeter.o src/FACT.o src/FACT3D.o src/FACT_internal.o src/FAPOBase.o src/FAPOFX.o src/FAPOFX_eq.o src/FAPOFX_masteringlimiter.o src/FAPOFX_reverb.o src/FAPOFX_echo.o src/FAudio_platform_sdl2.o src/XNA_Song.o ./libFAudio.so testparse facttool testreverb testvolumemeter testfilter cc -fpic -fPIC -g -Wall -pedantic -c -o src/F3DAudio.o src/F3DAudio.c
sdl2-config --cflagscc -fpic -fPIC -g -Wall -pedantic -c -o src/FAudio.o src/FAudio.c
sdl2-config --cflagscc -fpic -fPIC -g -Wall -pedantic -c -o src/FAudio_internal.o src/FAudio_internal.c
sdl2-config --cflagscc -fpic -fPIC -g -Wall -pedantic -c -o src/FAudio_internal_simd.o src/FAudio_internal_simd.c
sdl2-config --cflagscc -fpic -fPIC -g -Wall -pedantic -c -o src/FAudioFX_reverb.o src/FAudioFX_reverb.c
sdl2-config --cflagscc -fpic -fPIC -g -Wall -pedantic -c -o src/FAudioFX_volumemeter.o src/FAudioFX_volumemeter.c
sdl2-config --cflagscc -fpic -fPIC -g -Wall -pedantic -c -o src/FACT.o src/FACT.c
sdl2-config --cflagscc -fpic -fPIC -g -Wall -pedantic -c -o src/FACT3D.o src/FACT3D.c
sdl2-config --cflagscc -fpic -fPIC -g -Wall -pedantic -c -o src/FACT_internal.o src/FACT_internal.c
sdl2-config --cflagscc -fpic -fPIC -g -Wall -pedantic -c -o src/FAPOBase.o src/FAPOBase.c
sdl2-config --cflagscc -fpic -fPIC -g -Wall -pedantic -c -o src/FAPOFX.o src/FAPOFX.c
sdl2-config --cflagscc -fpic -fPIC -g -Wall -pedantic -c -o src/FAPOFX_eq.o src/FAPOFX_eq.c
sdl2-config --cflagscc -fpic -fPIC -g -Wall -pedantic -c -o src/FAPOFX_masteringlimiter.o src/FAPOFX_masteringlimiter.c
sdl2-config --cflagscc -fpic -fPIC -g -Wall -pedantic -c -o src/FAPOFX_reverb.o src/FAPOFX_reverb.c
sdl2-config --cflagscc -fpic -fPIC -g -Wall -pedantic -c -o src/FAPOFX_echo.o src/FAPOFX_echo.c
sdl2-config --cflagscc -fpic -fPIC -g -Wall -pedantic -c -o src/FAudio_platform_sdl2.o src/FAudio_platform_sdl2.c
sdl2-config --cflagscc -fpic -fPIC -g -Wall -pedantic -c -o src/XNA_Song.o src/XNA_Song.c
sdl2-config --cflagscc -fpic -fPIC -g -Wall -pedantic -shared -o ./libFAudio.so src/F3DAudio.o src/FAudio.o src/FAudio_internal.o src/FAudio_internal_simd.o src/FAudioFX_reverb.o src/FAudioFX_volumemeter.o src/FACT.o src/FACT3D.o src/FACT_internal.o src/FAPOBase.o src/FAPOFX.o src/FAPOFX_eq.o src/FAPOFX_masteringlimiter.o src/FAPOFX_reverb.o src/FAPOFX_echo.o src/FAudio_platform_sdl2.o src/XNA_Song.o
sdl2-config --libs[ahmed@ahmed-pc FAudio-master]$ source cpp/scripts/cross_compile_64 Please check your mingw32 SDL installation [ahmed@ahmed-pc FAudio-master]$ cd cpp [ahmed@ahmed-pc cpp]$ make mkdir -p build_win64 cp ../FAudio.dll build_win64 cp: cannot stat '../FAudio.dll': No such file or directory make: *** [Makefile:241: directories] Error 1
Here's a really strange bug... this one's for @aeikum, @JohanSmet, and possibly @GloriousEggroll.
We're having trouble diagnosing a crash in various games related to callbacks, and the more I dig into it the more confused I get! For today's example, we have a LEGO-themed Wolfenstein 3D fan remake, which among other things is simple enough to run through Valgrind:
http://drdanick.com/legowolf3d/
When using the COM wrapper everything should be okay, but when you build it as a Wine DLL, the program randomly crashes! This also happens with our Wine built-ins. I'm not 100% sure what the difference might be, other than the usual suspects (calling conventions, packing/alignment, etc).
The crash happens only when OnBufferStart/OnBufferEnd is referenced, so if you comment those bits out in the wrapper, the game should be okay (but also silent). Other samples may be affected by different callbacks, depending on what the application cares about. Andrew has a list of games crashing right now, but we don't know if it's all the same bug.
This one's for me... I'm running into issues with Windows games being very particular about their ReadFile callbacks, and the FAudioIOStream stuff that exists now doesn't handle it very well.
I need to fix FACT_INTERNAL_ParseWaveBank to not use the IOStream directly, but instead use the ReadFile callback which will default to a function that does reference the IOStream. In the case of Wine, it'll always override these callbacks due to calling convention differences and the expectation that the input file handle will be a HANDLE, not an FAudioIOStream.
On the bright side, this makes C# interop a little easier because the callback can be used with FileStream, MemoryStream, junk like that.
It is almost impossible to provide a compiled version of FAudio with FFmpeg support in Wine or Proton due to IP issues within FFmpeg. This is despite the fact that FFmpeg itself is easily available for almost every major Linux distro currently in use.
In the past software has (legitimately) gotten around this by runtime linking of the questionable software, e.g. using dlopen(3)
et alia instead of passing the library name to the compiler. This is more work upfront for the developer since previous conditional compile statements now need to be replaced by checks for null or 0 results, but it saves hundreds to thousands of hours spent recompiling the software each time it is released.
Hi,
Any chance a release could be tagged, ideally along with an upload of a tar-{xz,bz2,gz} of the files? Background is that GitHub makes the auto-generated packages on the fly and changes their formula without notice, so having an automated ports system like on OpenBSD that check SHA256 and file sizes before building breaks regularly and messes up the package build system with the auto-generated tarballs.
Similar to this question in the Theorafile repo:
Line 1127 in f7a0ce7
The ComputeEmitterChannelCoefficients function does not take into acount LFEDistanceCurve.
Maybe this line should look like:
pMatrixCoefficients[ curConfig->LFSpeakerIdx * numSrcChannels + currentChannel ] += LFEattenuation;
The comment in CalculateMatrix function seems to be true /* TODO: this could be skipped if the destination has no LFE */
👍 It really skipped for none multi-channel emitters..
Hi, Thanks a lot for your efforts!
Got here trying to make Skyrim Special Edition speak.. I'm on Proton 3.16 beta, built in the provided vagrant with the latest code from git, running under Neon User Edition (based on ubuntu 18.04)
So I encountered the "sound but no voices" issue in SSE (also, no music) and eventually wound up reading in this repo and compiling a replacement FAudio with ffmpeg support. After dropping my compiled .so in place, NPCs were still silent. I installed SDL 2.09 manually from source, then recompiled FAudio, to make sure that wasn't a problem, but it made no difference.
I put in some debug printfs to see what was going on, and I found the avcodec_find_decoder() call around L85 in FAudio_ffmpeg.c was returning NULL.
I checked my libavcodec install and headers, and all that seemed to be in order. Googling, I found a SO question https://stackoverflow.com/questions/4091340/ffmpeg-compilation-problem-avcodec-find-decoder-always-returns-null with a similar problem.
Applying the solution found there, I was able to get music and voices working with the following diff against FAudio_ffmpeg.c:
diff --git a/src/FAudio_ffmpeg.c b/src/FAudio_ffmpeg.c
index f4b05b5..d86d811 100644
--- a/src/FAudio_ffmpeg.c
+++ b/src/FAudio_ffmpeg.c
@@ -68,6 +68,12 @@ uint32_t FAudio_FFMPEG_init(FAudioSourceVoice *pSourceVoice, uint32_t type)
AVFrame *av_frame;
AVCodec *codec = NULL;
const char *typestring = "Unknown";
+ static int registered = 0;
+
+ if (!registered) {
+ avcodec_register_all();
+ registered = 1;
+ }
LOG_FUNC_ENTER(pSourceVoice->audio)
pSourceVoice->src.decode = FAudio_INTERNAL_DecodeFFMPEG;
After making this change NPC voices and music are both sounding good. I haven't tested beyond the start of the initial speech in the prisoners' wagon, so I can't vouch for anything beyond that point.
I'm not suggesting this is a good place to put this, since I don't really know how the code is layed out in FAudio. However it does seem for at least some current versions of libavcodec (specifically the one in ubuntu 18.04 repos) you really do need to call avcodec_register_all() to register the codecs you want to use. Hope it's of some use!
the variable i
is defined as uint16_t
and compared in a for loop for the break condition i>=0
which is always true. i
just wraps around and maybe can cause a segmentation fault
https://github.com/FNA-XNA/FAudio/blob/master/src/FACT_internal.c#L90
https://github.com/FNA-XNA/FAudio/blob/master/src/FACT_internal.c#L114
I just finished stubbing in the four effects provided by XAPOFX:
This will improve compatibility with games that depend on it, but note that I have NOT implemented the XAPOFX DLLs. I've found that the X3DAudio DLL has given us more than enough trouble to warrant putting that off deliberately until we have something that can actively go out for use in something like Proton, so for this we'll do that after everything else is written.
Here's the checklist:
testfx
program, similar to testreverbHere's the MSDN documentation for XAPOFX.
I am particularly talking about this page: https://github.com/FNA-XNA/FAudio/wiki/FAudio-for-Proton
Running tar --list --file proton_dist.tar.gz | grep libFAudio
on 4.2 gave me this list:
./lib/libFAudio.so
./lib/libFAudio.so.0
./lib/libFAudio.so.0.19.03
./lib64/libFAudio.so
./lib64/libFAudio.so.0
./lib64/libFAudio.so.0.19.03
Replacing just ./lib64/libFAudio.so
did not seem to make effect. I had to replace libFAudio.so.0.19.03
and libFAudio.so.0
on top of that for my FFmpeg libFAudio to work.
This could also be a bug on Valves end that might be fixed in the future.
Hello,
I followed the README
on compiling the native dlls with mingw
; most of the DLLs compile fine except the xactengine
ones, while compiling I get the following error:
x86_64-w64-mingw32-g++ -I../src -DFAUDIOCPP_EXPORTS -D_WIN32_WINNT=0x0600 `sdl2-config --cflags` -shared -o build_win64/xactengine3_0.dll build_win64/com_utils_xact_x30.o build_win64/xact3_x30.o build_win64/win_registry_x30.o build_win64/xactdll_x30.o -Wl,--enable-stdcall-fixup `sdl2-config --libs` -static-libgcc -static-libstdc++ -L.. -lFAudio
/usr/lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/ld: build_win64/xact3_x30.o:xact3.cpp:(.rdata$.refptr.wrap_io_close[.refptr.wrap_io_close]+0x0): undefined reference to `wrap_io_close'
/usr/lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/ld: build_win64/xact3_x30.o:xact3.cpp:(.rdata$.refptr.wrap_io_seek[.refptr.wrap_io_seek]+0x0): undefined reference to `wrap_io_seek'
/usr/lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/ld: build_win64/xact3_x30.o:xact3.cpp:(.rdata$.refptr.wrap_io_read[.refptr.wrap_io_read]+0x0): undefined reference to `wrap_io_read'
collect2: error: ld returned 1 exit status
make: *** [Makefile:204: build_win64/xactengine3_0.dll] Error 1
I read the commit history on xact3.cpp
and deemed it "normal" since it's untested code, so I tried copying the xaudio2
dlls into my Skyrim Special Edition prefix (no NPC voice sound problem) with the script provided in /scripts
anyway but there's no in-game sound at all.
Here's the Skyrim steamlog in case it's of any use:
steam-489830.log
I read the wiki entry for how to use with Proton, but what needs to be done to use/test FAudio with wine from Winehq?
What version of wine works?
Is there any patches that need to be applied to wine to use FAudio?
where would I put the libFAudio.so so wine will use it?
should all the xaudio dlls in winecfg be builtin? or any other configuration to wine?
how would one know that FAudio is being used?
When i run Skyrim Legendary Edition with FAudio dlls, i get such error:
00eb:err:ole:COMPOBJ_DllList_Add couldn't find function DllGetClassObject in L"C:\\windows\\system32\\xaudio2_6.dll"
And therefore, there is no sound in game.
Used commit: 13ef41c
Something broke between a756af4 and 126cd0e.
I'm working on the https://github.com/kakra/wine-proton project, compiling libFAudio
master as part of my proton branch.
With the current version of libFAudio I get crackling audio and several audio dropouts. It sounds like audio buffers play out of order or interleave with zero-filled buffers.
@flibitijibibo Do you need a recording sample? Should I try bisecting or do you suspect one commit which I could revert and try again?
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
Building the new FAudio_internal_simd.c
in 32-bit mode shows some warnings:
../../../wine/dlls/xaudio2_7/FAudio/FAudio_internal_simd.c:421:33: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
uint32_t tail, header = (16 - ((uint64_t) (*resampleCache)) % 16) / 4;
Similar warnings in FAudio_INTERNAL_ResampleStereo_SSE2 and FAudio_INTERNAL_Amplify_SSE2. Changing to uint32_t fixes the warning, though I'm not sure if that's correct.
This is mostly for Wine, but also has to do with our own COM wrapper.
@aeikum has already started work on this, though it depends specifically on Wine atm:
That said, the only dependency is wine/heap.h
, and I'm 99% sure that can be fixed by using CoTaskMemAlloc
for FAudio_malloc, which I'm pretty sure is what XAudio2/XACT are using:
Line 78 in 344dd55
Line 2328 in 38471d2
The game almost crashes instantly if trying to use the menu (pressing anything but play/continue). I got sound once, but it was clippy and did not work correctly. When speech was activated (as in a character spoke), the game would stutter a few seconds at a time before it eventually just froze. This is what I got from gdb.
Continuing.
[New Thread 0xc62fdb40 (LWP 6345)]
LogAppleARKit: Warning: Failed to bind to the listen port (76561198009613636:11111) for LiveLink face AR receiving with error ()
LogStreaming: Display: Took 0.000s to delete old logs.
LogStreaming: Display: Async Loading initialized: Event Driven Loader: true, Async Loading Thread: true
LogStreaming: Display: Took 0.205s to EndInitTextLocalization.
LogWindowsTextInputMethodSystem: Error: Initialization failed while advising the profile notification sink to the TSF source. (0x80004001)
LogWindows: Warning: Register touch input failed!
[Detaching after fork from child process 6396]
Installing breakpad exception handler for appid(gameoverlayui)/version(20181105235327)
Installing breakpad exception handler for appid(gameoverlayui)/version(1.0)
Installing breakpad exception handler for appid(gameoverlayui)/version(1.0)
[1106/111413.967231:INFO:crash_reporting.cc(239)] Crash reporting enabled for process: renderer
Installing breakpad exception handler for appid(gameoverlayui)/version(1.0)
JS method call WebChat.GetOverlayChatBrowserInfo with 1 arguments
LogInit: Display: Game Engine Initialized.
LogGameplayTags: Display: UGameplayTagsManager::DoneAddingNativeTags. DelegateIsBound: 0
LogInit: Display: Starting Game.
LogGameMode: Display: Match State Changed from EnteringMap to WaitingToStart
TOG2Log: Error: WARNING: No mission icon was set.
LogConsoleResponse: Display:
LogConsoleResponse: Display:
LogConsoleResponse: Display:
LogConsoleResponse: Display:
TOG2Log: Error: Autospawning instanced meshes pools, because level script actor is not TOG2BaseLevelScriptActor or a child.
LogStreaming: Display: Suspending async loading (1)
LogStreaming: Display: Resuming async loading (0)
LogHttp: Warning: 000000004DCD8980: request has been successfully processed. URL: http://www.mothergunship.com/image1.png, HTTP code: 500, content length: 148, actual payload size: 148
LogHttp: Warning: 000000004DCD8980 Response Header Server: Cowboy
LogHttp: Warning: 000000004DCD8980 Response Header Connection: keep-alive
LogHttp: Warning: 000000004DCD8980 Response Header X-Powered-By: Express
LogHttp: Warning: 000000004DCD8980 Response Header Vary: Origin
LogHttp: Warning: 000000004DCD8980 Response Header Content-Security-Policy: default-src 'self'
LogHttp: Warning: 000000004DCD8980 Response Header X-Content-Type-Options: nosniff
LogHttp: Warning: 000000004DCD8980 Response Header Content-Type: text/html; charset=utf-8
LogHttp: Warning: 000000004DCD8980 Response Header Content-Length: 148
LogHttp: Warning: 000000004DCD8980 Response Header Date: Tue, 06 Nov 2018 10:14:19 GMT
LogHttp: Warning: 000000004DCD8980 Response Header Via: 1.1 vegur
LogGameMode: Display: Match State Changed from WaitingToStart to LeavingMap
LogNet: Display: SteamNetDriver_0 bound to port 7777
LogStreaming: Display: ULevelStreaming::RequestLevel(/Game/Levels/HQ/Campaign01_Sublevels/Set_HQ_Campaign01_HoloAds01) is flushing async loading
LogOnline: Warning: STEAM: No game present to join for session (GameSession)
LogUObjectGlobals: Warning: Failed to find object 'Object None.None'
LogUObjectGlobals: Warning: Failed to find object 'Object None.None'
LogUObjectGlobals: Warning: Failed to find object 'Object None.None'
LogUObjectGlobals: Warning: Failed to find object 'Object None.None'
LogUObjectGlobals: Warning: Failed to find object 'Object None.None'
LogUObjectGlobals: Warning: Failed to find object 'Object None.None'
LogUObjectGlobals: Warning: Failed to find object 'Object None.None'
LogUObjectGlobals: Warning: Failed to find object 'Object None.None'
LogGameMode: Display: Match State Changed from EnteringMap to WaitingToStart
LogConsoleResponse: Display:
LogConsoleResponse: Display:
LogMediaUtils: Error: Cannot play file://../../../TowerOfGuns2/Content/Movies/Default_Startup.mp4, because none of the enabled media player plug-ins support it:
LogGameMode: Display: Match State Changed from WaitingToStart to InProgress
LogOnline: Warning: STEAM: Can't start an online game for session (GameSession) that hasn't been created
WARN:
Assertion failure at F3DAudioCheckCalculateParams (src/F3DAudio.c:342), triggered 1 time:
'pDSPSettings->DstChannelCount == ChannelCount && "Invalid channel count, DSP settings and speaker configuration must agree"'
LogAudio: Warning: Waited 70.125999ms for audio thread.
LogAudio: Warning: Waited 105.333099ms for audio thread.
LogAudio: Warning: Waited 140.496887ms for audio thread.
LogAudio: Warning: Waited 175.662201ms for audio thread.
LogAudio: Warning: Waited 210.797806ms for audio thread.
LogAudio: Warning: Waited 245.918701ms for audio thread.
LogAudio: Warning: Waited 281.033386ms for audio thread.
LogAudio: Warning: Waited 316.140411ms for audio thread.
LogAudio: Warning: Waited 351.254700ms for audio thread.
LogAudio: Warning: Waited 386.360809ms for audio thread.
LogAudio: Warning: Waited 421.465485ms for audio thread.
LogAudio: Warning: Waited 456.571411ms for audio thread.
LogAudio: Warning: Waited 491.679016ms for audio thread.
LogAudio: Warning: Waited 526.783875ms for audio thread.
The game mostly crashes when launching it with fna, but sometimes it work.
It works with xact, but audio is poor.
Hey all,
I was thinking of implementing FAudio into a game engine directly, and bypassing the XAudio COM interface. One of my other plans was to also implement https://github.com/resonance-audio/resonance-audio as an 'FAPO', the Unity integration looks like a decent reference to work from.
The official docs of XAudio2 suggest to subclass XAPOBase, but FAPO looks like a C-API, and looking at the implementations do I make one like this?
https://github.com/FNA-XNA/FAudio/blob/master/src/FAPOFX_masteringlimiter.c
With my hypothetical FAPOResonanceAudioRenderer I would have FAPOBase at the start of the struct with that funky #INITPARAMS macros to fill it up?
Cheers!
For the first release of FAudio we focused on what FNA and XACT needed, but now that this is looking to go into a whole lot more games we should look at the rest of the X3DAudio features.
The stubs are here:
https://github.com/FNA-XNA/FAudio/blob/master/src/F3DAudio.c#L1538
Don't expect a whole lot of information out there - the MSDN docs are completely useless and many months of looking for existing research on this turned up completely and entirely empty. If you're working on this, it's because you REALLY know what you're doing (I certainly don't).
Checklist:
Libraries typically have a soname version in the library and in their filename. FAudio does not have one.
Please set "libFAudio.so" to "libFAudio.so.0" or something similar.
This is for, uh, anyone who knows what on Earth is happening here:
This was found by James at Bit Kid when updating to FNA 19.01... here's our test sample!
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Input;
class Program : Game
{
static void Main(string[] args)
{
using (Program p = new Program())
{
p.Run();
}
}
Program() : base()
{
new GraphicsDeviceManager(this);
}
SoundEffect barf;
protected override void LoadContent()
{
barf = Content.Load<SoundEffect>("chirp");
}
protected override void UnloadContent()
{
barf.Dispose();
}
int argh = 0;
protected override void Update(GameTime gameTime)
{
if (Keyboard.GetState().IsKeyDown(Keys.P))
{
if (argh == 0)
{
barf.Play(0.3f, 0.1f, 0.0f);
}
}
argh = (argh + 1) % 3;
}
}
Here's chirp.xnb, and for those using FAudio directly, chirp as raw mono PCM16.
I'm thinking this has to do with our end-of-update padding, but why it truncates like that is... really odd. For all I know this happens with resampling in general (fun experiment: compare default sample rate to SDL_AUDIO_FREQUENCY=44100) but this seems to be the most obvious case we have.
Hi
Dragon quest heroes crash when enter in game and similar situation occurs in berserk and the hawk band
This is backtrace of crash in both games
Thanks
I finally figured out what's causing all that racket with WMA/XMA streams. This one's for @aeikum (wrote the original FFmpeg work), @0x0ade (XMA), @GloriousEggroll (Warframe), and @JohanSmet (wrote the most recent FAudio FFmpeg work).
A quick overview of how the decoding system works: When a buffer is submitted we receive not just the data itself, but the amount of data we can get (measured in samples). So when we decode, we ask for exactly the number of samples we need based on the quantum size until the end, where the number will be a little bit smaller. In either case, the decoder always provides the exact number of samples we request because we always know how many samples are available without the decoder's assistance.
FFmpeg isn't playing by the rules. In particular, we're hitting this line which should never ever happen:
https://github.com/FNA-XNA/FAudio/blob/master/src/FAudio_ffmpeg.c#L382
Here's the quick version:
available
is 0, breakstodo
is less than samples
, resulting in uninitialized memory at the endEggroll has it in Warframe, I have it in Skyrim SE. We need to figure out how to make FFmpeg cooperate and actually give us all the samples. We can't leave without the full size, because then you just get skipping, which is more pleasant-sounding but still very wrong.
Anyone have any ideas? I'm not terribly familiar with FFmpeg so I don't know if there's a trick to making decoding consistent. Sadly it's not 100% consistent, but it's very easy to reproduce with those two games.
From MSDN: https://docs.microsoft.com/en-us/windows/desktop/api/xaudio2/ns-xaudio2-xaudio2_debug_configuration
In addition to filling in one more XAudio2 feature, this is a legitimately useful for general FAudio debugging without having to step through a whole lot. It can be extremely verbose, however, so this should only be enabled for non-release builds (i.e. !_DEBUG && !DEBUG && (GCC && !OPTIMIZED)
). Additionally, I would like to add the ability to enable features with environment variables, not just SetDebugConfiguration. This is useful for projects like Wine that won't have access to these entry points without added hackery. Each flag/bool should get a variable in some way.
As for the implementation, this can be mapped to something like SDL_Log, though I don't know how complicated we'll need to get. I'm hoping we can make all these log types macros that are blanked in release builds, but that's totally speculation without having actually tried to write this at all.
It's a big ol checklist:
Hi,
When trying Owlboy with newest FNA 18.10 and locally compiled FAudio, the game gets this assertion failure when the main menu is about to be displayed:
Assertion failure at FAudio_memptr (src/FAudio_platform_sdl2.c:587), triggered 1 time:
'rwops->type == 4U'
This was preceded before the intro video by:
Assertion failure at FACT_INTERNAL_ParseWaveBank (src/FACT_internal.c:2709), triggered 1 time:
'wb->streaming == isStreaming'
However, this ParseWaveBank failure didn't stop the program and sound was played afterwards.
Any hints where I can start to troubleshoot this?
avcodec_find_decoder(AV_CODEC_ID_WMAV2) always returns NULL unless I call avcodec_register_all() first.
After I inserted a call to avcodec_register_all in FAudio_FFMPEG_init I heard npc voices in Skyrim SE.
Not sure whether FAudio_FFMPEG_init is the right place for this, though.
This one's easier than it sounds - we already have filters implemented, we just need to add filter states for each send that's currently attached to the voice.
Here are the relevant blocks:
And here's where our send data is right now. It'll mostly likely be an FAudioFilterParameters*
and FAudioFilterState**
allocated at SetOutputVoices (along with all the other per-send data) and will function pretty much exactly like the voice filter, which is a single function call.
For Far Cry 4, I get audio during the videos only. This is with a development 4.3
release, with FAudio added as system libraries. Wine compiles with xaudio2 support.
I compile wine with Pulseaudio support.
Trying to find out where the stream is going, I watched the game with the pulse
volume control. It is as below. <-vol+> when the videos are playing is clearly
normal. <-vol+> jumps up and down as you would expect for any stream. Then, when the
videos are finished and you are at the main menu in the game, audio stream #2
disappears. <-vol+> for the wine preloader app is dead. No audio is being sent
to pulse by SDL2.
FarCry4.exe: audio stream #2 on [HD-Audio Generic Analog Stereo]
<-vol+> <- this jumps up/down
wine64-preloader: Simple DirectMedia Layer on [HD-Audio Generic Analog Stereo]
<nothing>
To get audio working for this game, I would have to override xaudio 2.7.
Should I just wait this one out? Or is there some way to find out what
exactly SDL2 is sending pulse?
When I compile SDL2 I don't use any special configuration options. But, I did look
up debian.
--enable-sdl-dlopen --disable-nas --disable-esd --disable-arts --disable-alsa-shared --disable-pulseaudio-shared
I don't know how to debug this, but I thought I'd make an issue report. Not used to github, so please excuse me for the lack of information.
Using latest steam/steamplay on Arch (Fully updated).
Used commit 879.
Built FAudio with FFMPEG support and installed using install_fake_dlls to proper directories in the fallout directory (pfx).
Sound works, music works, voices works. Everything works. There's a bit of audio clipping while entering terminal, but that's another issue. I'm not a proffessional, but I can't hear the difference using FAudio and XAudio, so good work!
Anyway, when using fast travel or entering a sanctuary (in my case, the Castle) the game will freeze.
It's not reproducible with XAudio. This happens every time, no matter how I try to enter. It seems there's a specific line I cross from one region over to another (In this case, the castle), and the text should show up "Now entering The Castle". On the same spot, the same pixel evel, the game will crash.
Thunder, etc. works with FAudio though, did not with XAudio (sound would dissapear).
Shooting a missile at a group of raiders/mutants/etc will sometimes freeze the game using FAudio (when there's too many sounds on screen it seems. Same as XAudio, except that XAudio would just dissapear. Using FAudio and the game freezes). This happens frequently.
Fast traveling. Whenever I use fast travel, the loading screen comes up (I have just tested it on a few locations...sanctuaries. Might just be sanctuary related) and it completes the loading. Just when it's about to change from loading screen to game screen, the game freezes. This happens every time.
No output in terminal. Just game executable removed.
From the beginning, FNA has always supported Ogg Vorbis files exclusively, primarily due to patent/licensing concerns and the ability to share dependencies with the Theora-based VideoPlayer.
However, part of FAudio's new features is using stb_vorbis to stream Vorbis data, and since FNA's creation the mp3 patent(s) have expired. We now have at least one single-file mp3 decoder library available to us under a public domain license:
https://github.com/lieff/minimp3
There is another library based on minimp3 but with a lot more "stuff" in it:
https://github.com/mackron/dr_libs/blob/master/dr_mp3.h
With this in mind, I'm filing this issue as an offer to anyone who really wants mp3 support and doesn't want to use Ogg Vorbis files. All I ask is that it stays entirely within XNA_Song.c and is at least as clean as the stb_vorbis support. We'll have to detect the file format when passed a file name, then select the decoder and FAudioSourceVoice callback function. Everything else should stay the same, I think...
Note that I'm perfectly happy with Ogg Vorbis myself, so don't expect me to do this myself. This is specifically available for those who prefer mp3 and are willing to put in the work to support it.
I think enough cases have come up to consider replacing the Makefile... Typically I just write a handwritten Makefile because there's not much you're meant to do with the library, but FAudio has run into WAY more use cases than anything I've ever built before, so CMake is starting to make a little more sense now. There are many reasons for this, including easy Debug/Release configuration, a clear options list (FFmpeg, XNA_Song, etc), improving the utils/ builds, and if we can, integrating the cpp/ folder's builds.
Note that this is replacing ONLY the Makefiles. The VS/Xcode projects will stay as-is. (Maik, I'll still take the Android.mk if that's still useful)
I wrote up a basic file that covers the core sources, with a bunch of TODOs to fill in:
https://github.com/FNA-XNA/FAudio/tree/cmake
A bunch of people are involved, so here's a list so everyone has an idea of what's going on:
As far as mandatory requirements go, we're stuck supporting Debian's criminally old CMake version, 3.7. Yes, it really is that old. Aside from this limitation, there aren't really any hard rules I can think of.
I'm currently stuck on the code side of things, but I know a lot of people were getting frustrated with my crappy old build system so I thought I'd open this up for anyone who's ready to throw it in the dumpster.
Checklist:
This is primarily for ValveSoftware/wine#2 and is based on our existing COM wrapper support.
I just wrote up the code that should handle this, and thankfully XACT is a lot less complicated than XAudio...
... but I dunno how to actually wire all this up properly. If someone wants to rip off the XAudio2 work and get this going, XACT games should start booting right away. There are some TODOs for streaming WaveBanks and notification callbacks but everything else should be okay.
CC: @JohanSmet @aeikum
Edit: Silly mistake, I didn't have 32-bit ffmpeg installed. Please close.
Fails to compile source in 32-bit on 64-bit system.
$ git clone https://github.com/FNA-XNA/FAudio
$ cd FAudio/
$ CFLAGS="-m32" FAUDIO_FFMPEG=1 make
results in ...
...cc -m32 -fpic -fPIC -g -Wall -pedantic `pkg-config libavcodec --cflags` `pkg-config libavutil --cflags` -DHAVE_FFMPEG=1 -shared -o libFAudio.so src/F3DAudio.o src/FAudio.o src/FAudio_internal.o src/FAudio_internal_simd.o src/FAudioFX_reverb.o src/FAudioFX_volumemeter.o src/FACT.o src/FACT3D.o src/FACT_internal.o src/FAPOBase.o src/FAPOFX.o src/FAPOFX_eq.o src/FAPOFX_masteringlimiter.o src/FAPOFX_reverb.o src/FAPOFX_echo.o src/FAudio_platform_sdl2.o src/XNA_Song.o src/FAudio_ffmpeg.o `sdl2-config --libs` `pkg-config libavcodec --libs` `pkg-config libavutil --libs`
/usr/bin/ld: skipping incompatible /usr/lib/libSDL2.so when searching for -lSDL2
/usr/bin/ld: skipping incompatible /usr/lib/libavcodec.so when searching for -lavcodec
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/8.2.1/../../../libavcodec.so when searching for -lavcodec
/usr/bin/ld: skipping incompatible /usr/lib/libavcodec.so when searching for -lavcodec
/usr/bin/ld: cannot find -lavcodec
/usr/bin/ld: skipping incompatible /usr/lib/libavutil.so when searching for -lavutil
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/8.2.1/../../../libavutil.so when searching for -lavutil
/usr/bin/ld: skipping incompatible /usr/lib/libavutil.so when searching for -lavutil
/usr/bin/ld: cannot find -lavutil
/usr/bin/ld: skipping incompatible /usr/lib/libgcc_s.so.1 when searching for libgcc_s.so.1
collect2: error: ld returned 1 exit status
make: *** [Makefile:89: all] Error 1
Kernel/OS: 4.18.16-1-MANJARO
Compiling normally in 64-bit works.
The sound is so buggy when I play The Witcher 3 with Esync turned on, but when it is off everything is working fine. I think it is worth mentioning because it could help you bisecting the issue.
WaveBank.IsPrepared should be set during load without requiring a sound to be played or selected. I'm unsure as to the specifics of what is complete in order for this to be set. Tested in FNA and XNA:
FNA: IsPrepared seems to be set immediately after the creation of the WaveBank.
XNA: IsPrepared is not set immediately, but will be set after running the below loop.
FNA-FACT: IsPrepared is not set immediately and does not appear to be set after running the below loop. Playing a song from the sound bank will function but it will not set IsPrepared either.
while (!MusicWaveBank.IsPrepared) { Engine.Update(); }
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.