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

Build with OpenAL Soft and release Win32/64 binaries with versions #52

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

ThreeDeeJay
Copy link

@ThreeDeeJay ThreeDeeJay commented Jun 3, 2022

What this does:

firefox_fU8qTu4nCQ

This should hopefully make things easier for everyone and I know there's still lots of room for improvement so I'm open to suggestions.

@mirh
Copy link

mirh commented Jun 3, 2022

Compile DSOAL together with OpenAL Soft binaries for Windows 32 and 64 bits.

Disappointed that wasn't my wet dream, even though I guess it's the second best thing then.

@mirh mirh mentioned this pull request Jun 3, 2022
@ThreeDeeJay
Copy link
Author

ThreeDeeJay commented Jun 3, 2022

Disappointed that wasn't my wet dream, even though I guess it's the second best thing then.

I've always wondered why DSOAL didn't just kept using OpenAL32.dll or at least soft_oal.dll like EAXEFX, and I'm not familiar with global states but I guess kcat's response explains it.

Meanwhile, every release note could underline this step | #34 (comment)

The GitHub action I used for automatic releases doesn't have a release note preset/template but I could look for another action or it could just be added manually or into Readme which I can include in the zip.

every release zip should probably include the batch file. | #34 (comment)

I was actually considering that. same for the other script I made for logging but I'm not sure what's @kcat's stance on including batch scripts but I could submit PRs for each.
Either way, I'm planning to include them in the next version of my DSOAL (and others) installer.

@kcat
Copy link
Owner

kcat commented Jun 3, 2022

Not a fan of submodules, they're a maintenance headache and regularly run into issues with not updating properly.

I don't think the version.rc version should be updated like that, I think that's related to the version specified in Microsoft's DLL that some apps may depend on.

I also don't think it's yet time to jump to 1.0, since there's some issues to address with EAX.

@ThreeDeeJay
Copy link
Author

Not a fan of submodules, they're a maintenance headache and regularly run into issues with not updating properly.

I see. So far, it seems to checkout the current submodule seamlessly but I'd need to wait for a commit on openal-soft to make sure it updates properly as well.
What maintenance issues should we be on the lookout for? I could try other methods in case they can be mitigated with extra git commands/flags.

I don't think the version.rc version should be updated like that, I think that's related to the version specified in Microsoft's DLL that some apps may depend on.
I also don't think it's yet time to jump to 1.0, since there's some issues to address with EAX.

Fair enough. I'll just go ahead and revert that commit then. 👌

@kcat
Copy link
Owner

kcat commented Jun 3, 2022

What maintenance issues should we be on the lookout for? I could try other methods in case they can be mitigated with extra git commands/flags.

They don't automatically checkout with the repo, they don't automatically update when updating the repo, bisecting or switching between commits or branches that use different versions need extra steps to keep consistent, and the commands to use can get confusing, which when done wrong, can make it look like everything's fine and correct when it's not.

As an optional thing that only GitHub Actions need to worry about for the binary packages, it may not be a big deal, but having it there for users to see and think they need when building themselves could cause unnecessary problems.

@mirh
Copy link

mirh commented Jun 4, 2022

I don't think users that want to build the thing themselves are so clueless to mix up buttons.

Anyway, putting aside git hooks, I believe you can specify some option in the .gitmodules file? (fetchRecurseSubmodules maybe?)

@ThreeDeeJay
Copy link
Author

GitHubDesktop_2BKXHu7SHa
@mirh Thanks. I think that did the trick but I'm a bit confused.
I recall the submodule not being checked out automatically by the desktop app at one point, and now they do as shown above but I'm not completely sure it's because of that flag or some other option I tried. (which I've now disabled by the way).
Like, I added the flag in a new branch, but you can see it checked out the submodule in my fork's master branch, too.
I expected the change to only apply to the new branch but perhaps it applies to the repo globally?
You guys could try cloning https://github.com/ThreeDeeJay/dsoal.git and see if you get the same behavior.

That said, I'm willing to look into the other issues, but I also don't wanna impose a burden on the devs/users with further complications of submodules. So if this isn't the appropriate solution to #13, I don't mind just building the binaries on my fork and figure out how to make it fetch upstream automatically or something 🤔

@mirh
Copy link

mirh commented Jun 4, 2022

If you are confused, maybe it's something with the nuance between fetch, pull, checkout and update (I mean, that's the case for me at least)

But if any, the actually big conundrum for subdmodules seem: regardless of what we can do with git, should we always point to the HEAD of openal-soft, or just to some fixed commit that we bump every time as we deem fit?
Because at least for the moment the first option seems preferable, given how many awful quirks come up every odd week, but at the same tame that sounds pretty bad for reproducibility.

@ThreeDeeJay
Copy link
Author

should we always point to the HEAD of openal-soft, or just to some fixed commit that we bump every time as we deem fit?

yeah, I'd suggest a bit of both. I think DSOAL development builds should just use a recent/latest OpenAL Soft at the time (but we should probably also include the OALS commit hash to help with reproducibility) to keep up with debugging and hotfixes like this.
as for DSOAL stable builds, perhaps they should be triggered by either stable OALS releases or at least tested milestone-ish updates.

@mirh
Copy link

mirh commented Jun 4, 2022

I guess it makes sense for actions to point to the tip, and the release section to just have "hand-picked" versions (whenever circumstances will be rosy enough to have an official release).

But you can't have both ideas implemented in .gitmodules.
Ok seems like actions can do more or less whatever they want, regardless. So idk really.

@mirh
Copy link

mirh commented Jun 5, 2022

In fact, we should already have a release IMHO, pointing to e7a82d4 (i.e. the last version before the big EAX switch).
As can be seen in #53 (and plenty of other bugs I can't be bothered to search) it's a huge breaking point for every bisection.

@ThreeDeeJay
Copy link
Author

@mirh Oh, that's right. I've encountered a handful of bugs myself after the EAX switch, tho kcat/openal-soft@7518a8a fixed the last 2 I tested.

@kcat Would e7a82d4 and kcat/openal-soft@c1c63a2 be a good combination for a tentative "stable" build like, say, 0.9.1+1.22.0?
At least while I figure out the shortcomings of this PR. I've been reading some documentation and been testing a handful of improvements like automatically checkout submodules when cloning, use the last stable build of OALS for stable DSOAL, update OALS to the latest upstream commit before compiling Development build, add OALS commit hashes (Development) or tag/version (Stable), etc.

Also, would it make sense to build development binaries using the Debug build type instead of Release?
If so, does it enable logging by default or something?

@kcat
Copy link
Owner

kcat commented Jun 8, 2022

I wouldn't consider those two particularly stable. While the switch to the EAX API has caused some issues, there were issues with using the EFX API that got fixed or improved. And OpenAL Soft 1.22.0 has a known issue with air absorption being way too strong.

@ThreeDeeJay
Copy link
Author

ThreeDeeJay commented Jun 8, 2022

I see. Is there any DSOAL/ALSOFT combination that you'd consider stable/recommended for most games currently?
perhaps an older one, the latest or should we just wait for the next major release to consider it stable?

EDIT: apparently there's OpenAL Soft v1.22.1 according to the changelog, but there are no tags or releases anywhere. I take it that should be the actual latest stable OALS build.

By the way, just noticed Debug build type doesn't seem to be used for anything in particular.
Perhaps it would be useful if it forced logging somewhere (like %APPDATA%/OpenAL/) by default to simplify bug reporting in the development build.

@mirh
Copy link

mirh commented Jun 8, 2022

Not really, people can even just use the dev builds to play (indeed they are now).
Aside of what I suggested in #25, if any it would be great if there were simpler means than setting env vars to enable logging.

@Kappa971
Copy link

Kappa971 commented Jun 8, 2022

I see. Is there any DSOAL/ALSOFT combination that you'd consider stable/recommended for most games currently? perhaps an older one, the latest or should we just wait for the next major release to consider it stable?

There are these known problems to be solved:
kcat/openal-soft#706 (comment)
kcat/openal-soft#714

and this
#39
but if I remember correctly @kcat said that in this case it took some time to implement the missing function that causes this crash

After that, DSOAL/OpenAL Soft should be good enough. I'm not playing EAX games right now but if I notice any other issues I will report them 👌

@mirh
Copy link

mirh commented Jun 8, 2022

#39 isn't a regression
And I guess we could as well just link dsoal-XP as an "old odd release" to test just for peace of mind.

So, premised that perfectionism is the same thing that had pcsx2 took 3-4 years between official stable versions (somehow letting "best" to ruin "better"), and that the EAX switch isn't as big of a change as I thought (indeed #53 seems to be caused for other reasons) maybe we should just wait for a fix of the other two problems and the next official openal-soft release.

@kcat
Copy link
Owner

kcat commented Jun 9, 2022

I see. Is there any DSOAL/ALSOFT combination that you'd consider stable/recommended for most games currently?

Not really, if there was one I thought was stable enough for a release, there would've been a release (or at least an indication of stability). My recommendation is to try the latest version and report bugs so I can try to fix them. If there's an issue with a particular game you want to play, and an earlier version doesn't have the issue, use that earlier version until it can be fixed, but that'll depend on the game/issue, I can't give a general recommendation.

EDIT: apparently there's OpenAL Soft v1.22.1 according to the changelog, but there are no tags or releases anywhere. I take it that should be the actual latest stable OALS build.

1.22.1 isn't released yet, but is expected soon. The changelog shows what has been done in preparation of the release.

By the way, just noticed Debug build type doesn't seem to be used for anything in particular. Perhaps it would be useful if it forced logging somewhere (like %APPDATA%/OpenAL/) by default to simplify bug reporting in the development build.

Logging on Windows is something I've never got a grasp on. Simply dumping a random file to a place on disk without the user expecting it doesn't seem like a good idea.

and this
#39
but if I remember correctly @kcat said that in this case it took some time to implement the missing function that causes this crash

That it will take some time. Or I may not be able to implement it at all. DSound's native effect API is quite different from EAX and EFX, and it was never widely used, so it will take some time to understand how it's supposed to work and try to emulate it alongside EAX.

I'm honestly not too worried about that specific issue, though. As I said, DSound's effect API wasn't widely used, and that particular case has a workaround of turning off the radio EQ option. There may also be a way of working around it without implementing it by handling effect errors properly, if there's some incorrect behavior there. But that's something to worry about after the EAX issues are fixed.

@Kappa971
Copy link

Kappa971 commented Jun 9, 2022

That it will take some time. Or I may not be able to implement it at all. DSound's native effect API is quite different from EAX and EFX, and it was never widely used, so it will take some time to understand how it's supposed to work and try to emulate it alongside EAX.

I'm honestly not too worried about that specific issue, though. As I said, DSound's effect API wasn't widely used, and that particular case has a workaround of turning off the radio EQ option. There may also be a way of working around it without implementing it by handling effect errors properly, if there's some incorrect behavior there. But that's something to worry about after the EAX issues are fixed.

Absolutely, the other two problems are more serious, fortunately this is easily avoidable.

- Appends tag/version/git describe of both DSOAL and OpenAL Soft to Stable builds, and commit hashes to Development builds.
- Update OpenAL Soft submodule to the latest commit for Development builds, and set to 1.22.1 for Stable builds.
- Include Documentation (licenses, readmes, changelog, etc)
- Set Debug build type for Development builds
- Removed "-latest" from 32+64-bit bundle artifact which became misleading on new builds
- General cleanup
@ThreeDeeJay
Copy link
Author

ThreeDeeJay commented Jun 21, 2022

Pushed the update addressing some issues mentioned and builds succeeded and were released. 🎉
There's still a few things left to do though, but wanted to push this update to go with 1.22.1.
@kcat Speaking of, it seems latest openal soft commit needs a 1.22.1 tag so it reflects on the Stable builds/artifacts/releases.
I use cd openal-soft then git describe --tags to get the stable version of the OpenAL Soft submodule to label stable builds, but right now it's returning 1.22.0-79-g05f5faf2.
Then again, I know there's still no stable stable release of DSOAL, but this is just for testing purposes while we get there. 🤞
Also, I should point out that the submodule should probably be updated manually upon new OALS release with cd openal-soft then git checkout <NEW RELEASE COMMIT HASH> then push. At least unless there's a way to update to the latest tag via Github actions. 🤔

On a side note, I should also point out that currently, Development builds' releases overwrite the previous one because it re-uses the latest tag on the new commit. This allows a static direct download link that always points to the build of the latest commit via, e.g., https://github.com/ThreeDeeJay/dsoal/releases/download/latest/DSOAL.zip, but I'm not sure if it's worth using a different method so old development builds are permanently archived in Github Releases. 🤔

@mirh
Copy link

mirh commented Oct 24, 2023

True, though I woudn't recommend someone new at this to start messing with system DLLs.

You don't have to mess with anything.. just drop soft_oal.dll in place.

They may end up replacing dsound.dll which I think some apps/system rely on

I don't think it's even possible without going through the painstaking process of stealing TrustedInstaller's ownership

and have higher priority while keeping compatibility with them for other apps that require it.

This is how openal was ever supposed to be used tbh..
Putting aside that UE2 titles would also still have you fiddle in-game with the system driver option:

if( !UseDefaultDriver )
	DLLHandle = appGetDllHandle( "OpenAL32.dll" );
if( !DLLHandle )
	DLLHandle = appGetDllHandle( "DefOpenAL32.dll" );

But yeah, for someone who knows what they're doing and tests a bunch of apps, a system installation might be more practical.

At the moment this still isn't the case anyway

I just tested the latest DSOAL with RightMark3D and renamed the following libraries to dsoal-aldrv.dll:

Dsoal uses (even though I don't think they are actually too much of a hard requirement?) oal-soft specific extensions.

So Vista/7 don't require the registry patch then?

IF my theory is right, the theory that I spent weeks banging my head against, the theory that somehow got everybody else to stop to care once I detailed it, yes they do require the registry patch too.
As I had said from the get go, there's not even anything that we know that microsoft changed since Vista.

It's a much more robust but simple installer for renderers and wrappers

I mean.. simplicity and letting you switch even between different A3D wrappers and the godawful 3dsoundback, don't seem exactly to go hand-in-hand.

@iAskel
Copy link

iAskel commented Oct 24, 2023

As for (native) OpenAL games, the process is a bit different. You won't need DSOAL, but instead you'll just need the OpenAL Soft DLL, but in this case, named OpenAL32.dll (or something similar for some games that use a different filename)

I know about this what directsound wrapper doesnt need for openal games like UT2004. But you dont know how to replaced Openal in Minecraft 1.16.5? I know what in this game doesnt have good sound like unreal, dungeoon siege 1, warcraft 3 or another but i trying increase sound quality in this game and maybe add some spatial. In new versions (if im right correct) like 1.20 or 1.19 game officially using openal soft, but in old not. Only one way i can find its replace two dlls (who would have thought)) in folder C:\Users\Myname\AppData\Roaming\com.modrinth.theseus\meta\natives\1.16.5-1.16.5-36.2.39 if using Modrinth launcher if curseforge i afraid its very hard because curselauncher launch the game through official launcher that replacing your dlls before launching.

@kcat
Copy link
Owner

kcat commented Oct 24, 2023

Dsoal used to be like this before d25b657
(can't really say I like both this duplication of code and also the extra complexity.. even though when testing it may be a blessing)

It's necessary for apps that use both OpenAL and DirectSound (even if indirectly; e.g. a game that uses DirectShow for music playback, which can use DSound, while game audio uses OpenAL). An issue like this popped up in the game Legendary, which used Unreal Engine 3. The menus and/or videos would use DSound, while the game audio used OpenAL; this caused problems as the DSound calls were changing the OpenAL context that the engine was using (or maybe it was the engine changing the context that DSOAL was using, I forget exactly), resulting in calls being made on the wrong OpenAL context.

The original attempted fix was to constantly set and reset the context in DSound calls, but aside from increased overhead, this could still fail if it was being done multi-threaded; DSound can't prevent the engine from making its own OpenAL calls on other threads. A better fix was to utilize the ALC_EXT_thread_local_context extension, which would only change the context for the calling thread, so the engine's own OpenAL calls on other threads wouldn't be affected. But this still results in the context needing to be constantly set and reset for apps that make OpenAL calls on the same thread as DSound calls.

Having DSOAL use a differently-named DLL was the only guaranteed solution that could avoid most of the overhead from constantly resetting contexts on every DSound call and ensure the app is safe with any OpenAL calls it makes.

FWIW, the in-progress AL[C]_EXT_direct_context extension will avoid the need for the DLL rename, as it allows the caller to specify the context to AL calls without needing to make a context current, so it doesn't need to track or constantly reset the current context. But like ALC_EXT_thread_local_context, I don't expect it to be supported much outside of OpenAL Soft. Maybe MojoAL, or Rapture3D if we're lucky, but Creative seems to have abandoned OpenAL development so I don't expect them to support anything they don't already support.

Dsoal uses (even though I don't think they are actually too much of a hard requirement?) oal-soft specific extensions.

I don't think current master has any hard requirements, but you'll certainly be open to issues if certain extensions aren't available. Without ALC_EXT_thread_local_context there will be extra overhead with locks and context resets, and potential race conditions with multi-threaded use, and without AL_SOFTX_map_buffer most DSound buffers will need to be streamed with a buffer queue (that increases overhead, can cause glitches if the stream thread gets delayed, and apps that try to stream with low latency/tight read timing can miss updates).

The c++-rewrite branch, however, does require ALC_EXT_thread_local_context (though will likely be switching to AL[C]_EXT_direct_context) and AL_EXT_STATIC_BUFFER. The latter isn't OpenAL Soft specific (it existed well before I implemented support for it, though I don't know if anyone but Apple did for macOS), and hopefully the former won't be either (though I can't say how wide adoption is or will be).

Most importantly in either case, the implementation has to be able to accept stringified GUIDs for device names, which is completely non-standard and has no extension to specify the capability. It also can't work through the router since none of the drivers enumerate them (the router has no idea which driver to pass the call on to).

@ThreeDeeJay
Copy link
Author

ThreeDeeJay commented Oct 25, 2023

You don't have to mess with anything.. just drop soft_oal.dll in place.

@mirh But how would we make sure it actually uses soft_oal.dll instead of a different library?
I know sometimes we can specify the library in a config file/UI, but that's rare and even if we can, it's an extra step that could be avoided by just forcing OpenAL Soft locally.

I don't think it's even possible without going through the painstaking process of stealing TrustedInstaller's ownership

@mirh Oh that's right. I used a reg key that adds Take Ownership to the right-click menu so it's easy but yeah, otherwise I doubt a new user would figure out the manual method on their own lol

This is how openal was ever supposed to be used tbh...

@mirh Yeah I know, but if we're installing OpenAL Soft, chances are we want to use OpenAL Soft, not have it be overridden by a different library. but then again, I'm not really up to speed on how much priority it has over other libraries or how to give it more if needed.

At the moment this still isn't the case anyway

@mirh How so? If I wanted to test the latest (or multiple) OpenAL Soft DLL in several apps without having to install it locally for each .exe, I'd just replace OpenAL32.dll in the system folder (and delete the local DLL, if it exists) but as a general rule I prefer to install DLLs locally so that updating a system/global one wouldn't break apps in case of a regression. Plus, I think replacing the generic/router DLL can make startup faster, which I remember happening in EFXShow

Dsoal uses (even though I don't think they are actually too much of a hard requirement?) oal-soft specific extensions.

@mirh Interesting. makes sense 👌

IF my theory is right, the theory that I spent weeks banging my head against, the theory that somehow got everybody else to stop to care once I detailed it, yes they do require the registry patch too.
As I had said from the get go, there's not even anything that we know that microsoft changed since Vista.

You're completely right. Here's a recording on Windows 7 showing the registry patch being required like the one I made for Windows 11 that I posted here a while ago.

I mean.. simplicity and letting you switch even between different A3D wrappers and the godawful 3dsoundback, don't seem exactly to go hand-in-hand.

@mirh To be fair, other wrappers/renderers are there for people wanting to use/test them.
But if you just wanted something simpler/unattended, you can drop the exe into the script and it'll figure out which one to use on its own and install it automatically. It is quite slow (a lot more going on backstage but also lack of optimization) and there are some minor bugs to sort out, but for DSOAL it gets the job done https://youtu.be/erdZyx7zz1w

you dont know how to replaced Openal in Minecraft 1.16.5?

@iAskel I don't have the game so I can't test myself, but that game's been discussed a couple times in our server. I recall it loading OpenAL in a strange way, like the dll being extracted into a folder before the game starts, which makes it difficult to replace. But I was told that if you use the Prism Launcher you can make it use the system's OpenAL instead, like this.
Also you could try replacing the main source file that contains the OpenAL Soft DLL that gets copied over to the path used at runtime but I'm not sure where/how to find it.

i trying increase sound quality in this game and maybe add some spatial

@iAskel Apparently Minecraft comes with OpenAL Soft, but it might be an older version and the sound quality issues might be caused by poor sound code.

@mirh
Copy link

mirh commented Oct 25, 2023

The menus and/or videos would use DSound, while the game audio used OpenAL;

Tbh I'm surprised this doesn't/didn't happen more often then? Bink videos using directsound and the 3D scene using openal isn't exactly a rarity (even though conversely, it wouldn't really make sense to use dsoal)

FWIW, the in-progress AL[C]_EXT_direct_context extension will avoid the need for the DLL rename

Meaning.. you don't need to place two dlls every time?

Most importantly in either case, the implementation has to be able to accept stringified GUIDs for device names

Why so?

But how would we make sure it actually uses soft_oal.dll instead of a different library?

If you know how openal works, and you read and understood kcat/openal-soft#757 it should be clear..

it's an extra step that could be avoided by just forcing OpenAL Soft locally.

I guess (I could only see this not working if the game did integrity checks on its libs?), but that's an extra step.. like on every game.

but as a general rule I prefer to install DLLs locally so that updating a system/global one wouldn't break apps in case of a regression.

A perverse mind could argue that in turn that would make way easier to spot said hypothetical regression.

@kcat
Copy link
Owner

kcat commented Oct 25, 2023

Tbh I'm surprised this doesn't/didn't happen more often then?

The issue was fixed well enough when I first noticed it, so it's probably not apparent how often it happens. I also doubt many people would bother using DSOAL for games that use OpenAL natively.

Meaning.. you don't need to place two dlls every time?

Well, you'd still need OpenAL Soft, which most systems won't have installed system-wide, so you'll still need to provide an OpenAL Soft DLL with dsound.dll. And newer versions of DSOAL may want newer versions of OpenAL Soft that the user may not have. But if you already have a sufficiently recent OpenAL Soft DLL, then no, you wouldn't need to update both DLLs.

Why so?

Because OpenAL offers no way to identify its enumerated devices by GUID, and Windows uses the same GUID consistently for the same device across APIs. OpenAL can also dress its device names differently than the rest of the system (e.g. prepend OpenAL Soft on ..., append ... #2, etc). DSOAL ultimately uses WASAPI to enumerate and identify devices, so apps get the same names and GUIDs that they normally would from DSound, which match the rest of the system. And given a GUID from the app, DSOAL has to know which device to use, which there's currently no way to query so it has to rely on the stringified GUID being recognized (which OpenAL Soft already does for other reasons, for instance VR APIs provide the GUID of the VR headset's audio device for playback and capture, which otherwise can't be reliably mapped to OpenAL devices).

This is something else I've wanted to fix. I really don't like how standard enumeration works with OpenAL, how you only get a null-separated list of user-readable device names. Aside from a null-separated string being wonky to deal with, there's no concession for if two devices have the same display name, and there's no way to match them to system devices. I'd instead prefer an API where you first query the number of playback or capture devices (which does the actual system probing), then use an alcGetStringi type function to query the ith playback or capture device name (with two queries, one for the display name like you get now, and another for the unique system name, which on Windows would be the stringified GUID, PipeWire and PulseAudio would be something like "alsa_output.pci-0000_08_00.4.analog-stereo", etc). alc[Capture]OpenDevice would then recognize both the display and system names for devices.

@iAskel
Copy link

iAskel commented Oct 25, 2023

I don't have the game so I can't test myself, but that game's been discussed a couple times in our server. I recall it loading OpenAL in a strange way, like the dll being extracted into a folder before the game starts, which makes it difficult to replace. But I was told that if you use the Prism Launcher you can make it use the system's OpenAL instead, like this. Also you could try replacing the main source file that contains the OpenAL Soft DLL that gets copied over to the path used at runtime but I'm not sure where/how to find it.

In your manual said: Extract and rename soft_oal.dll to OpenAL32.dll (or a variant if the game uses it) and copy it to the "prismlauncher-windows-msvc-portable-6.0" folder

Prisma launcher doesn't have this folder, and why are you testing it on the portable version? It feels like you are using linux. Maybe you can just install the game and prisma launcher and just test it? Otherwise how do you know if a particular game is working correctly, is it by guessing? In other words, only in theory, without testing anything. If im right... I'm afraid the table you are referring above to won't help nobody.

ThreeDeeJay added a commit to ThreeDeeJay/dsoal that referenced this pull request Nov 16, 2023
Basically ported PR kcat#52 into the rewrite branch
ThreeDeeJay added a commit to ThreeDeeJay/dsoal that referenced this pull request Nov 16, 2023
Basically ported PR kcat#52 into the rewrite branch
@Svyatpro
Copy link

Is it possible to use Creative's OpenAL library to bring back hardware accelerated DirectSound for newer Windows versions?

@kcat
Copy link
Owner

kcat commented Jan 13, 2024

Is it possible to use Creative's OpenAL library to bring back hardware accelerated DirectSound for newer Windows versions?

ALchemy, which requires and comes with either a Creative sound card, or one of their paid software "sound card" solutions. I'm not aware of anything that works with the free Generic Software driver, though.

@Svyatpro
Copy link

Svyatpro commented Jan 14, 2024

Is it possible to use Creative's OpenAL library to bring back hardware accelerated DirectSound for newer Windows versions?

ALchemy, which requires and comes with either a Creative sound card, or one of their paid software "sound card" solutions. I'm not aware of anything that works with the free Generic Software driver, though.

Alchemy only has 32-bit binaries. I want to offload my CPU in Counter-Strike 2 which can use DirectSound using -directsound launch parameter. I tried renaming OpenAL32.dll to dsoal-aldrv.dll and got no sound with DSOAL's dsound.dll also tried renaming wrap_oal.dll to dsoal-aldrv.dll and got glitchy sound. Maybe someone could bugfix this?

I have Creative X-Fi Titanium 64MB X-RAM

@ThreeDeeJay
Copy link
Author

ThreeDeeJay commented Jan 14, 2024

Prisma launcher doesn't have this folder, and why are you testing it on the portable version? It feels like you are using linux. Maybe you can just install the game and prisma launcher and just test it? Otherwise how do you know if a particular game is working correctly, is it by guessing? In other words, only in theory, without testing anything. If im right... I'm afraid the table you are referring above to won't help nobody.

@iAskel Sorry I missed this message, and I can't test myself but I was told the latest version does use OpenAL Soft 1.23.0 (and even has an HRTF toggle in-game) which is relatively recent but remind me, but I still don't know how to force replace the OpenAL library in older Minecraft versions. If you ever figure it out, let me know.

Alchemy only has 32-bit binaries. I want to offload my CPU in Counter-Strike 2 which can use DirectSound using -directsound launch parameter. I tried renaming OpenAL32.dll to dsoal-aldrv.dll and got no sound with DSOAL's dsound.dll also tried renaming wrap_oal.dll to dsoal-aldrv.dll and got glitchy sound. Maybe someone could bugfix this?

I have Creative X-Fi Titanium 64MB X-RAM

@Svyatpro AFAIK Source games (old CSGO, HL2, etc.) use Miles Sound System for mixing(?) and DirectSound (or DirectSound3D with snd_legacy_surround 1 but only to spatialize surround channels, not true 3D audio) for output, which works with wrappers like ALchemy and DSOAL, but Source 2 (CS2) uses Steam Audio for mixing and HRTF and even if it uses DirectSound for output and wrappers can be loaded, I'm almost certain it won't be true hardware acceleration, at least not in a practical/useful way like reducing CPU load, though maybe there's a way to turn disable intensive Steam Audio features like dynamic and HRTF?

IIRC for hardware acceleration with an X-Fi on modern Windows, the game needs to use DirectSound3D (mostly mid-late 2000's and older) wrapped by Creative ALchemy using ct_oal.dll (Native OpenAL driver) or interfacing directly with OpenAL hardware like Battlefield 2.

On a side note, I'd be extremely careful with loading third-party DLLs in CS2. I think even CSGO required parameters like -allow_third_party_software to load stuff MSI Afterburner, so I think DSOAL would also need it, but it might be risky with Valve AntiCheat, unless you can force playing on unsecured servers which is also not a great idea.

@Svyatpro
Copy link

Svyatpro commented Jan 14, 2024

Prisma launcher doesn't have this folder, and why are you testing it on the portable version? It feels like you are using linux. Maybe you can just install the game and prisma launcher and just test it? Otherwise how do you know if a particular game is working correctly, is it by guessing? In other words, only in theory, without testing anything. If im right... I'm afraid the table you are referring above to won't help nobody.

@iAskel Sorry I missed this message, and I can't test myself but I was told the latest version does use OpenAL Soft 1.23.0 (and even has an HRTF toggle in-game) which is relatively recent but remind me, but I still don't know how to force replace the OpenAL library in older Minecraft versions. If you ever figure it out, let me know.

Alchemy only has 32-bit binaries. I want to offload my CPU in Counter-Strike 2 which can use DirectSound using -directsound launch parameter. I tried renaming OpenAL32.dll to dsoal-aldrv.dll and got no sound with DSOAL's dsound.dll also tried renaming wrap_oal.dll to dsoal-aldrv.dll and got glitchy sound. Maybe someone could bugfix this?
I have Creative X-Fi Titanium 64MB X-RAM

@Svyatpro AFAIK Source games (old CSGO, HL2, etc.) use Miles Sound System for mixing(?) and DirectSound (or DirectSound3D with snd_legacy_surround 1 but only to spatialize surround channels, not true 3D audio) for output, which works with wrappers like ALchemy and DSOAL, but Source 2 (CS2) uses Steam Audio for mixing and HRTF and even if it uses DirectSound for output and wrappers can be loaded, I'm almost certain it won't be true hardware acceleration, at least not in a practical/useful way like reducing CPU load, though maybe there's a way to turn disable intensive Steam Audio features like dynamic and HRTF?

IIRC for hardware acceleration with an X-Fi on modern Windows, the game needs to use DirectSound3D (mostly mid-late 2000's and older) wrapped by Creative ALchemy using ct_oal.dll (Native OpenAL driver) or interfacing directly with OpenAL hardware like Battlefield 2.

On a side note, I'd be extremely careful with loading third-party DLLs in CS2. I think even CSGO required parameters like -allow_third_party_software to load stuff MSI Afterburner, so I think DSOAL would also need it, but it might be risky with Valve AntiCheat, unless you can force playing on unsecured servers which is also not a great idea.

I found a vulnerability how to make it work without "-allow_third_party_software" parameter. Actually Alchemy was able to offload CPU and noticibly reduce the latency on Source and GldSrc engines. Source 2 is now using 64-bit architecture and Alchemy cannot be used. I also tried cl_oal.dll but nothing works. It seems new DSOAL uses EAXGet and EAXSet functions that are not present in OpeanAL32.dll and ct_oal.dll.

Maybe it is possible to make altrenative OpenAL driver loading method? For example delay-load openal32.dll or dsoal-aldrv.dll and check the device features and presence?

@ThreeDeeJay
Copy link
Author

I found a vulnerability how to make it work without "-allow_third_party_software" parameter.

Interesting, how did you manage to do it? copying dsound.dll into the system32 folder? 🤔
I had to do that to get DSOAL working in MTA:SA, but it's not recommended because it might cause issues

Actually Alchemy was able to offload CPU and noticibly reduce the latency on Source and GldSrc engines.

Source 2 is now using 64-bit architecture and Alchemy cannot be used. I also tried cl_oal.dll but nothing works. It seems new DSOAL uses EAXGet and EAXSet functions that are not present in OpeanAL32.dll and ct_oal.dll.

Maybe it is possible to make altrenative OpenAL driver loading method? For example delay-load openal32.dll or dsoal-aldrv.dll and check the device features and presence?

Apparently GoldSrc had proper DirectSound3D support with EAX so it could probably use hardware acceleration, though it was removed in games like Half-Life.
But I don't think Source ever got EAX support, and even its DirectSound3D "support" acts more like a wrapper around Miles Sound System so even if you could use hardware acceleration, I doubt it would be nearly as effective as in GoldSrc, though do you have any sources on ALchemy reducing CPU load and latency in Source? 👀
I think dependency on hardware (especially discontinued) seems to go against DSOAL/OpenAL Soft's hardware agnosticism but if there really is a significant performance/latency improvement, it would be nice to have so you could open a feature request, cuz we're also way offtopic here lol 😅

@Svyatpro
Copy link

I found a vulnerability how to make it work without "-allow_third_party_software" parameter.

Interesting, how did you manage to do it? copying dsound.dll into the system32 folder? 🤔 I had to do that to get DSOAL working in MTA:SA, but it's not recommended because it might cause issues

Actually Alchemy was able to offload CPU and noticibly reduce the latency on Source and GldSrc engines.

Source 2 is now using 64-bit architecture and Alchemy cannot be used. I also tried cl_oal.dll but nothing works. It seems new DSOAL uses EAXGet and EAXSet functions that are not present in OpeanAL32.dll and ct_oal.dll.

Maybe it is possible to make altrenative OpenAL driver loading method? For example delay-load openal32.dll or dsoal-aldrv.dll and check the device features and presence?

Apparently GoldSrc had proper DirectSound3D support with EAX so it could probably use hardware acceleration, though it was removed in games like Half-Life. But I don't think Source ever got EAX support, and even its DirectSound3D "support" acts more like a wrapper around Miles Sound System so even if you could use hardware acceleration, I doubt it would be nearly as effective as in GoldSrc, though do you have any sources on ALchemy reducing CPU load and latency in Source? 👀 I think dependency on hardware (especially discontinued) seems to go against DSOAL/OpenAL Soft's hardware agnosticism but if there really is a significant performance/latency improvement, it would be nice to have so you could open a feature request, cuz we're also way offtopic here lol 😅

Yes, I'm pretty sure the sound in CS GO with Alchemy was serveral tens of milliseconds faster but the performance difference I did not measure. BTW DSOAL with SoftOpenAL has a huge sound delay in CS2 and 1.6. I will open feature request though. Thanks!

- Separate release build (DSOAL+HRTF.zip) with a alsoft.ini that has the minimal configuration for HRTF, and the template moved to the Documentation folder (DSOAL.zip will still include the template next to the DLL files)
- Included Version.txt files including repo, branch, version, commit short hash, count and push time
- Versioned files now only found in the workflow artifacts for a cleaner release and to prevent confusion
- Untagged release now includes branch (e.g. latest-master) so that the rewrite branch can get its own releases (didn't use just the branch name in the tag because that makes the GitHub client confuse it with the actual branch when trying to push)
- Updated actions to fix workflow warnings
- General cleanup
.github/workflows/Tagged.yaml Outdated Show resolved Hide resolved
.github/workflows/Tagged.yaml Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants