274 Commits

Author SHA1 Message Date
Chris Robinson
63a82feae6 Rename the UHJ filter config option 2022-08-09 04:01:31 -07:00
Chris Robinson
7e5dd41968 Add an option for higher quality UHJ filters 2022-08-08 03:44:25 -07:00
Chris Robinson
250f162496 Parameterize the UHJ filter length 2022-08-07 13:09:12 -07:00
Chris Robinson
af5d4fb77d Don't store and manage wet buffers separately 2022-07-15 06:58:15 -07:00
Chris Robinson
0f4679981b Allocate EffectSlots in clusters 2022-07-15 06:14:25 -07:00
Chris Robinson
0b9fc03545 Dynamically allocate EffectSlot objects 2022-07-15 04:28:13 -07:00
Chris Robinson
1ad553b5a9 Add a config compat option for NFC distance scaling
Currently there's no way for an application to specify the "real world" scale
for in-game units. If the game doesn't use one unit to represent what should be
perceived as one meter to the user, the NFC filter's effect will be too near or
too far sounding. This allows adjusting the unit scale as applied to the NFC
filters only, correcting the misalignment.

This also removes the influence of EFX's MetersPerUnit from the NFC filters,
since many games don't use it, and those that do won't know it also influences
the perceived wave curvature along with the air absorption strength.
2022-07-07 22:11:38 -07:00
Chris Robinson
11d148502d Use an inline function instead of a function-like macro 2022-06-12 23:20:53 -07:00
Chris Robinson
2a81f32abd Disable EAX if the Chorus effect is disabled 2022-06-10 23:15:13 -07:00
Chris Robinson
862628966d Increase the priority of the ALSA backend
So that it's tried before sndio. Many Linux systems seem to have libsndio
installed as a hard dependency from SDL2, but not the server component to
actually make it work. And because there's no way to test if it's usable
without opening a device, the backend would get selected over ALSA and
subsequently fail to work. As a result, Linux users that don't use PipeWire or
PulseAudio would have to explicitly configure for ALSA.
2022-06-04 13:00:58 -07:00
Chris Robinson
7518a8a503 Ensure enough default sends for EAX with the config option set 2022-05-27 15:58:03 -07:00
Chris Robinson
65e4c20c27 Move EAX files to their own sub-directory 2022-05-16 02:08:18 -07:00
Chris Robinson
593966c8db Handle 3D7.1 as a separate channel configuration
It's treated as 5.1 + 2 aux channels. This allows AL_DIRECT_CHANNELS_SOFT to
behave better, not forwarding rear left/right channel inputs to lower front and
upper rear, and allows reporting a more appropriate output mode to the app
instead of 7.1.
2022-04-26 23:32:15 -07:00
Chris Robinson
9ac49e2ce1 Finalize ALC_SOFT_output_mode 2022-04-17 13:56:01 -07:00
Chris Robinson
adccf0aec9 Use a bool type for boolean parameters 2022-04-16 03:53:54 -07:00
Chris Robinson
4bfaf860bf Include ALC_OUTPUT_MODE_SOFT with ALC_ALL_ATTRIBUTES 2022-04-16 03:49:22 -07:00
Chris Robinson
144e30a949 Update the ALC_SOFT_output_mode surround enums
The values are identical to the matching loopback channel configuration enums,
so for example ALC_5POINT1_SOFT is interchangable with ALC_SURROUND_5_1_SOFT,
this is simply providing a cleaner styling for potential future modes.
2022-04-15 01:45:24 -07:00
Chris Robinson
33109e86c9 Fix ALC_SOFT_reopen_device for the null device extension list 2022-04-01 19:26:41 -07:00
Chris Robinson
872c206deb Finalize ALC_SOFT_reopen_device 2022-04-01 16:37:26 -07:00
Chris Robinson
f15106e77f Remove the reversed all-pass trick in MixDirectHrtfBase
Given the minimum phase HRTF, it's not going to stay linear phase anyway.
2022-03-30 04:06:00 -07:00
Chris Robinson
6bc1787a3b Make and use a Default enum for StereoEncoding 2022-03-29 11:48:57 -07:00
Chris Robinson
4ca8992fbd Rename ALC_STEREO_PLAIN_SOFT and don't duplicate ALC_HRTF_SOFT 2022-03-29 11:48:57 -07:00
Chris Robinson
3b09b7761f Handle more modes with the ALC_OUTPUT_MODE_SOFT attribute 2022-03-23 19:13:21 -07:00
Chris Robinson
8239e4c845 Better ensure attributes are properly traced 2022-03-17 13:26:49 -07:00
Chris Robinson
3d0500f823 Fix tracing the ALC_OUTPUT_MODE_SOFT attribute 2022-03-17 12:21:31 -07:00
Chris Robinson
e28937d1f6 Add options to reverse local X and Y coordinates
To go along with reverse-z on the other axii. This is only for games that have
position/orientation errors causing top-bottom (or left-right) inversion.
2022-03-10 22:37:02 -08:00
Chris Robinson
609ee74211 Add a config option for reverse-z
The same as the __ALSOFT_REVERSE_Z env var, but in the config file. Should only
be used for per-game config files (either along side the executable, or setting
the ALSOFT_CONF env var when launching the app).
2022-03-10 17:47:42 -08:00
Chris Robinson
cadf0d1de5 Make some local constexpr variables static 2022-02-23 01:29:28 -08:00
Chris Robinson
3e6d210767 Avoid more unnecessary atomics 2022-02-13 21:00:57 -08:00
Chris Robinson
ea7c6f3e4e Don't make mPropsDirty atomic
It's only ever used under the ALCcontext::mPropLock mutex.
2022-02-13 19:37:45 -08:00
Chris Robinson
ac42ac336e Don't hide EAX functions behind a context
The standard says a function being returned doesn't necessarily mean it's
usable, and calling them will return failure if called when not usable. The
config option still prevents it from being returned, to better hide it when
disabled globally.
2022-02-10 17:54:27 -08:00
Chris Robinson
256ea81dbe Combine listener and context updates 2022-02-08 20:43:05 -08:00
Chris Robinson
843cff0537 Hold mPropLock when deferring updates 2022-02-08 09:39:02 -08:00
Chris Robinson
be80e49f1b DisabledEffects won't change so EAX can just check it once 2022-02-08 08:21:06 -08:00
Chris Robinson
b09aab8426 Don't pass an ALeffect to ALeffectslot::initEffect 2022-02-07 08:47:55 -08:00
Chris Robinson
816bd8ab30 Move ALSOFT_EAX definition to config.h
And disable it by default for non-Windows targets
2022-01-30 05:42:44 -08:00
Boris I. Bendovsky
19ed994dc3
Add EAX extensions (EAX 2.0-5.0, X-RAM) (#632)
* Add EAX extensions (EAX 2.0-5.0, X-RAM)

* Comment out C++17 leftovers

* Remove everything related to patching

* Update alsoftrc.sample

* Rewrite integration

* Fix GCC compilation under Linux

* Always reset EAX effect properties when loading it into FX slot
2022-01-30 04:47:32 -08:00
Chris Robinson
481b115b96 Add an ambi-format option for ACN ordering and FuMa scaling 2022-01-12 03:25:59 -08:00
Chris Robinson
f1a970e680 Trace the device format after starting playback
Some devices can change it when starting, so it's useful to know what the
device configuration is when that happens.
2021-12-27 14:23:31 -08:00
Chris Robinson
bcd40861f7 Increase the priority of the PipeWire backend 2021-12-25 19:47:09 -08:00
Chris Robinson
0af1b5f721 Don't do direct channels with UHJ output
Directly mixing a non-UHJ stereo signal into a UHJ stereo signal results in a
non-UHJ stereo signal. Such a mix can't be properly decoded anymore.

An option can probably be added for users that intend to listen to UHJ output
undecoded and let a stereo sound come through as-is on their speakers, but it
probably shouldn't be the default for cases where the output may be decoded
back.
2021-12-21 08:18:07 -08:00
Chris Robinson
633c332dee Work around a MinGW thread_local bug
MinGW-w64 generates bad code when accessing extern thread_local objects.
Wrapper functions are used to ensure it only accesses them from the same place
they're defined. This unfortunately adds a bit of overhead for what should be a
relatively simple thing.

These functions are inlined for non-MinGW targets, avoiding the overhead on
non-affected targets.
2021-12-20 10:27:39 -08:00
Chris Robinson
d16b61dffb Move the effects base and effectslot to core 2021-12-17 17:13:59 -08:00
Chris Robinson
c9537abfb1 Allocate voice properties in clusters 2021-12-17 04:07:00 -08:00
Chris Robinson
54c4bea487 Add source properties for Super Stereo
When playing a stereo format, enabling Super Stereo causes the source to behave
as a B-Format source, with a variable width control.
2021-12-15 02:01:22 -08:00
Chris Robinson
5e3fcb3a93 Avoid initializing the NFC filter for every voice channel
It can be initialized once with the device's speaker distance since it won't
change in between resets, then copied into the voice where it can be adjusted
as needed.
2021-12-11 21:42:34 -08:00
Chris Robinson
08a4e8a6b2 Return true from alcReopenDeviceSOFT if the new device opened 2021-11-21 23:22:04 -08:00
Chris Robinson
0c99a6b316 Make the backend pointer part of ALCdevice instead of DeviceBase 2021-11-19 20:04:10 -08:00
Chris Robinson
6e2c1b8431 Consolidate some variable state 2021-11-17 19:08:22 -08:00
Chris Robinson
b43fd6dca7 Always lock the device state when querying device attributes 2021-11-16 16:44:58 -08:00