Skip to content
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

Migrate to .NET 4.7.1 and to SharpDX #55

Closed
ericpignet opened this issue Sep 26, 2020 · 8 comments
Closed

Migrate to .NET 4.7.1 and to SharpDX #55

ericpignet opened this issue Sep 26, 2020 · 8 comments
Assignees
Labels

Comments

@ericpignet
Copy link
Collaborator

The project is currently using very old Dot Net framework 3.5, SlimDX library which was abandoned years ago, and SoundDecoder which is also abandonned.

Other DTXMania forks have already upgraded to recent .NET versions and to SharpDX which is an active C# DirectX wrapper. Original DTXMania did the migration first, and DTXMania Ver.K did it in version 4.10, DTXMania AL did it too.
We need to do it too, in order to benefit from the optimisations brought by recent .NET framework, better quality libraries, especially for sound decoding.,
This is also a prerequisite for a future migration to 64 bit (already done by DTXMania, VerK 4.x and AL) which should optimize memory access for people with large simfile libraries.
Finally this will make it easier to backport features or fixes done in other forks.

@ericpignet ericpignet self-assigned this Sep 26, 2020
@ericpignet
Copy link
Collaborator Author

I've been working on that for a while, trying to manually backport from Ver.K 4.10, with adaptations when needed.
See my branch: https://github.com/ericpignet/DTXmaniaXG/tree/sharpdx

I had to reorganise the directory structure to make the build process work, and to align with DTXMania and latest Ver.K.
I think it's better/clearer now, my only concern is that most files look deleted/recreated.

@limyz
Copy link
Owner

limyz commented Sep 27, 2020

@fisyher and myself highly recommend this adaptation. As SharpDX is no longer in active development, do consider Vortice.Windows as an alternative.

@fisyher
Copy link
Collaborator

fisyher commented Sep 27, 2020

SharpDX is a good choice as it is very stable and used in many projects.

Which library should we use to replace SoundDecoder?

@limyz limyz added the core label Sep 27, 2020
@tanabotadtx
Copy link

Original dtxmania seems already removed SoundDecoder... (BASS.DLL is used instead of SoundDecoder)

There are mainly 2 commits to implement it;
https://osdn.net/projects/dtxmania/scm/git/dtxmania/commits/397438f86142fd5d0777977b67b4db3bd44c7a0a
https://osdn.net/projects/dtxmania/scm/git/dtxmania/commits/8cb598283e68b1b0fc3cc2e851b5637547842866

First one is to remove SoundDecider.dll, second one is to fix degrade (for keeping legacy support)

But it seems there are many commits about audio support.... it might be better to use whole source code of the latest original ones, instead of patching to our code.

@limyz
Copy link
Owner

limyz commented Sep 27, 2020

Our fork uses Un4seen for audio support. As mentioned by tanabotadtx, BASS.NET is responsible for all audio processing.

DirectSound has been superseded by XAudio2. According to Low Latency Audio in the Windows Hardware documentation, we can natively use Windows 10's AudioGraph or WASAPI. ASIO should come from Steinberg.

@ericpignet
Copy link
Collaborator Author

I'm really following what was done in other DTXMania versions, not more.
SoundDecoder is replaced by:

  • BASS (from Un4seen) for MP3 and Ogg. See https://github.com/ericpignet/DTXmaniaXG/blob/sharpdx/FDK/Code/03.Sound/Cmp3ogg.cs (this class is coming straight from Ver.K 4.10)
  • BJXA for XA format. Same as DTXMania and Ver.K 4.10. What's good with this library is that it's free software, we can include the source code in the project, do changes if needed, rebuild with more recent compilers etc. Not one old Dll found somewhere on the internet.

I didn't know of Vortice.Window. Indeed that would be the best choice going forward, but this will be much more work than what I did (backporting the migration to SharpDX done by other version).
Migration to SharpDX is already a first step forward and made it possible to use recent .NET framework. Also our version of FDK becomes very close to Ver.K 4.10 so we can easily integrate fixes from them. That made it easy to backport the WASAPI Exclusive/Shared separate modes.
Let's keep Vortice in mind for the future.

Same for migration from DSound to XAudio2. I agree we should do that, but it's much more work than what I did (which was already not so easy as the commits in Ver.K were in the middle of tens of unrelated changes).

We can open another wishlist item for Vortice, and one for XAudio2 :-)

@limyz
Copy link
Owner

limyz commented Sep 28, 2020

Awesome, just feel free to merge whenever the FDK is ready. Anything extra will be added on the wishlist.

@ericpignet
Copy link
Collaborator Author

OK, merged.
I recommend doing a fresh clone to get the new directory structure right.
Note that the folder renaming has not lost the history, you can see it with git log --follow or by clicking on blame in Github.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants