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

Audio System Improvements #596

Merged
merged 14 commits into from
May 21, 2020
Merged

Audio System Improvements #596

merged 14 commits into from
May 21, 2020

Conversation

Hoikas
Copy link
Member

@Hoikas Hoikas commented Sep 15, 2019

This adds flexibility to the audio system by allowing any endpoint available to OpenAL for both playback and capture. This should fix several assumptions that prevented OpenAL Soft from working properly as well. Additionally, the broken "My Voice" slider in the audio options dialog has been fixed by rewriting the plWinMicLevel class to target Windows Core Audio.

In my testing, MOULa ships with an oddball OpenAL32.dll that does not support the ALC_ENUMERATE_ALL_EXT, so only the default playback endpoint is available. Also, there appears to be a bug in the Creative OpenAL implementation that causes an access violation when accessing the ITaskbarList3 pointer after changing the playback device. OpenAL Soft does not display this bug. Finally, OpenAL Soft 1.19.1 appears to have an issue in its WASAPI backend that causes audio capturing at any sampling rate other than 44.1kHz to have discernible distortion. This issue is not present in OpenAL Soft master and can be worked around in 1.19.1 by disabling the WASAPI backend in favor of the DirectSound or WinMM backend. Since Windows Vista, DirectSound and WinMM are just layers on top of Windows Core Audio WASAPI, so this is effectively bypassing an AL Soft issue.

This depends on H-uru/moul-scripts#111.

@Hoikas Hoikas force-pushed the asys branch 6 times, most recently from 89a377d to f217c30 Compare September 23, 2019 20:29
@Hoikas Hoikas marked this pull request as ready for review September 23, 2019 20:37
@Hoikas
Copy link
Member Author

Hoikas commented Sep 23, 2019

This is ready for playtime!

@Hoikas
Copy link
Member Author

Hoikas commented Oct 25, 2019

This has been rebased to facilitate review.

@Hoikas
Copy link
Member Author

Hoikas commented Dec 31, 2019

Updated the PR text due to the release of OpenAL Soft 1.20.

@Hoikas
Copy link
Member Author

Hoikas commented Jan 17, 2020

Rebased after merge of #612.

@zrax
Copy link
Member

zrax commented Jan 21, 2020

Looks like the rebased version needs a #include <set>

@Hoikas
Copy link
Member Author

Hoikas commented Jan 28, 2020

I seem to have messed up the rebase and gained an extra definition for plAudioSystem. That should be fixed now.

@Hoikas
Copy link
Member Author

Hoikas commented Apr 23, 2020

rebased to fix chaos from astyling and variadic plStatusLog

@Hoikas
Copy link
Member Author

Hoikas commented May 3, 2020

Looks like the linux CI failure is a github bug, not a necessarily a problem with this PR?

@Hoikas
Copy link
Member Author

Hoikas commented May 11, 2020

Rebased to fix the linux-ci issue and bring in the scripts portion.

@Deledrius
Copy link
Member

I'm in favor of using it (and therefore dropping support for legacy OpenAL), making openal-soft a hard requirement.

That's acceptable to me.

Hoikas added 2 commits May 20, 2020 14:42
This effectively rewrites the audio system init process to utilize the
ALC_ENUMERATE_ALL_EXT such that all available audio endpoints can be
selected as playback devices. Furthermore, this strips out support for
hardware audio devices, which went the way of the dodo as of Windows
Vista.
None of that crap is virtual, fool.
@Hoikas Hoikas force-pushed the asys branch 7 times, most recently from 08a8df1 to 9133f4d Compare May 21, 2020 18:18
vcpkg.txt Outdated Show resolved Hide resolved
Sources/Plasma/PubUtilLib/plAudio/plEAXEffects.cpp Outdated Show resolved Hide resolved
Hoikas added 12 commits May 21, 2020 17:40
This is needed due to ALSoft changing the delcaration of ALCdevice and
ALCcontext to no longer match the Creative OpenAL SDK. It is also
helpful in that plAudioSystem.h is now much lighter weight so changes to
the ASYS are less likely to induce rebuilds of many units.
Previously, the "My Voice" control in the options GUI did nothing. The
old plWinMicLevel code was originally for the WinMM library from 1991
(!!!). This rewrites all that junk to use the Windows Core Audio library
upon which WinMM sits as of Windows Vista. When using OpenAL Soft, the
primary backend is WASAPI, a Core Audio component. Further, when
adjusting the level in Uru, you can observe the level changing in the
Windows mixer as well.
Due to limited space in the options GUI, I was already needing to do
this in the Python code. Now that we need it in C++ for CoreAudio, it's
best to rely only on a single implementation.
This fixes the issue in which trying to build a debug client would fail
with compile errors on MSVC due to mismatched iterator debug levels.
@Hoikas
Copy link
Member Author

Hoikas commented May 21, 2020

Removed unused file and fixed a few would-be compile errors in ifdef'd code as pointed out in review.

@Hoikas
Copy link
Member Author

Hoikas commented May 21, 2020

💥

@Hoikas Hoikas merged commit d3dad7a into H-uru:master May 21, 2020
@Hoikas Hoikas deleted the asys branch May 21, 2020 23:05
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.

3 participants