-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Add optional support for WMA via FFmpeg #32
Comments
For anyone doing this with XACT as their motivation, I sat down and figured out how to get the seek table data from the WaveBanks: These tables can get sent to SubmitSourceBuffer via the BUFFER_WMA parameter, and should be the equivalent of the |
I've been looking into this a bit. I started from Andrew's work and finished integrating it with FAudio. ATM it's successfully playing a xWMA file (tested with 1 and 2 channels). It's in the ffmpeg branch of my repo. It needs more polish and definitely more testing :-) Right now I've only tested with a small utility program I wrote myself ... I'll rebase against the current master later tonight and try to run some more tests (maybe together with the COM wrapper). |
Neat! Another possible test is The one catch is that I haven't quite finished the WMA submit part yet... right now the walls are here: https://github.com/FNA-XNA/FAudio/blob/master/src/FACT.c#L1443 |
@JohanSmet just out of curiosity I tried to compile your branch to test some games that I know have wma issues and got this error:
used the following method: git clone git://github.com/JohanSmet/FACT.git also worth noting @flibitijibibo for Arch users MINGWROOT=sys-root/mingw is not needed in the paths in the cross_compile_scripts as the bin folder resides directly in the MINGW=x86_64-w64-mingw32 path (when using mingw-w64-sdl2 from the aur). As this is probably specific to Arch, it probably doesn't need to be changed. just making a note in case anyone else is attempting this. "btw I use Arch." |
I think you need to set EDIT: Also something else that needs to be looked at is |
Ah, I forgot an #ifdef test in FAudio.c, that's fixed now. Thanks for the heads-up, @GloriousEggroll ! Yes, @flibitijibibo is right. You'll need to Please note that playing partial buffers (PlayBegin/PlayLength != 0) is probably broken at the moment. Games that use this feature might sound a bit weird for now :-) |
Something that is not entirely apparent in the most recent documentation is that there are a couple rules for xWMA that should make life easier for us. The huge thing is that subregion looping is not supported at all, so for that format we can |
The docs for Right now I save the I tested Murder Miners and Skulls of the Shogun a bit and these seem to work fine. For these tests I only replaced the xaudio2 dll's not xactengine. |
Cool, if the XAudio2 side works then the XACT side shouldn't be too hard after that. I'm thinking the alignment relates to the packet sizes but if the block sizes can be arbitrary then maybe I'm overthinking this... The one thing I would trace is Shogun's SubmitSourceBuffer calls, as the music WaveBank in particular should be streaming the data instead of loading it all at once; how they submit it should give us an idea of how FACT should be doing it, and that'll keep us from accidentally coming up with a new use case. A couple more WMA samples if you want them: Shenmue I & II, Dead Rising 2, Castle Crashers, and of course, Skyrim... please let this work for Skyrim... |
A fun test that might be good for FAudio testing/compatibility is Warframe, as it requires the following patches from wine-staging: xaudio2_7-CreateFX-FXEcho -EDIT- https://gitlab.com/GloriousEggroll/warframe-linux/tree/no-directx the custom launcher is needed due to a bootloop issue with the official launcher. |
Just so everyone's aware, Wine does have a small xaudio2 test suite. As you start to understand the behavior of real games, you can start to write tests there and verify the behavior of Microsoft's xaudio2. We also have a testbot infrastructure you can use to run tests on Windows. The test loop will go faster if you have a Windows VM, but if you don't, you can use the testbot. https://testbot.winehq.org/ |
Ok, I tested Skyrim (not SE) on Windows 8.1. There was an issue with submix voices but other than that it sounds fine to me. But I did only play for about a minute (and still managed to die, don't seem to remember how to play ...) Skyrim uses processing stage 0xFFFFFFFF (-1) when creating submix voices. This caused Tomorrow I'll clean up the rough edges (I think I broke the non-ffmpeg build again) and add some documentation. I'll try to look at testing FACT a bit as well. |
Sounds good! For clarity's sake, we should probably start thinking about how the patchset should be organized. I'm thinking this, but if it could be broken down further that'd be fine too:
XACT in particular is a little bit fussy, so these can be sent out whenever they work, doesn't have to be all at once. For example, I'd be up for patches 1+2 right away, so we can test that with the existing decoders and trim the diff size down for 3 in case anyone that wants to look at WMA specifically, then I can look at 4 separately if needed since pretty much nobody except for me and Johan ever sees XACT WMA data these days... |
Yes, splitting these up is a good idea. I'll make PRs for the first two shortly. |
This just got fixed by #46. |
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:
aeikum@2a90621
aeikum@dd19029
The text was updated successfully, but these errors were encountered: