8063 Commits

Author SHA1 Message Date
Chris Robinson
964a11ef62 Set the proper reverb effect defaults for EAX 2022-03-23 17:38:45 -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
8ca3186bac Ensure the EAX functions are suitably aligned on 32-bit 2022-03-16 20:32:09 -07:00
Chris Robinson
f903c1ea11 Make sure FX slots that aren't made active are disabled 2022-03-13 10:38:36 -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
a2d34e4c2a Update comments about where to put config files 2022-03-10 20:53:16 -08:00
Chris Robinson
8e0164df96 Fix for some missing macros 2022-03-10 18:05:07 -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
cfae2cc254 Use proper macros instead of magic numbers 2022-03-09 16:11:47 -08:00
Chris Robinson
90db129d60 Avoid a divide-by-zero in UhjDecoder::decodeStereo 2022-03-07 17:32:13 -08:00
Chris Robinson
1369a081a0 Fix X-RAM tracking 2022-03-06 01:19:41 -08:00
Chris Robinson
be3b37b7c9 Avoid a stateful unique_ptr deleter 2022-03-05 18:49:46 -08:00
Chris Robinson
776d62c1d1 Fix EAXSOURCE_ROLLOFFFACTOR
It should be added to AL_ROLLOFF_FACTOR.
2022-03-05 17:39:18 -08:00
Chris Robinson
cc3cae87b2 Set the MacroFXFactor default 2022-03-05 01:32:20 -08:00
Chris Robinson
2dc9cf170c Simplify committing EAX properties
Based on DirectSound's EAX behavior, committing any EAX property commits *all*
deferred property changes, not just the object being changed. So applying EAX
changes can be handled in one place.
2022-03-05 01:14:26 -08:00
Chris Robinson
7bec22abb6 Handle deferring for EAX 1 reverb
I don't know if EAX 1 actually handles deferring updates, but it will simplify
future changes.
2022-03-04 18:24:29 -08:00
Chris Robinson
2492d76896 Ensure deferred EAX effect properties are committed 2022-03-04 13:19:00 -08:00
Chris Robinson
240171a53d Fix the UHJ decoder parameters in uhjdecoder 2022-03-02 21:19:53 -08:00
Chris Robinson
63ac9c0b5d Fix applying the EAX context AirAbsorptionHF property 2022-03-02 21:18:13 -08:00
Chris Robinson
a98d6b2417 Fix applying air absorption 2022-03-02 16:58:26 -08:00
Chris Robinson
eea679eada Move some temp variables closer to where they're used 2022-03-02 15:34:09 -08:00
Chris Robinson
43682a8c3e Rework source send distance attenuation handling
Specifically, AL_[EAX]REVERB_ROOM_ROLLOFF_FACTOR always applies to an inverse
distance rolloff model, where the source's AL_ROOM_ROLLOFF_FACTOR applies to
the selected distance model. Consequently, the normal distance and cone
attenuation only needs to be calculated once for all sends, with the effect's
room rolloff calculated and applied separately.
2022-03-02 11:14:59 -08:00
Chris Robinson
fbac67a6a0 Rework the initial reverb decay
The idea here is that the initial reverb decay can't become less than the dry
path distance attenuation, as the dry attenuation represents the audio that has
not yet had a chance to start reflecting in the environment. As well, the
reference distance indicates where there is no distance attenuation, with any
initial attenuation set by the environment itself.

So what we do is use the dry path attenuation as the baseline for what's mixed
to the reverb, with the decay rate indicating how much of the remaining room
(non-direct) energy attenuates with distance.

This may be over-complicating it. Other sources hint at a more typical XdB per
doubling of distance, with X varying depending on environment properties (room
size, absorbancy, etc). This could be handled by applying a normal inverse
distance attenuation model, with a rolloff factor generated from the reverb
properties (density, decay rate, etc). Will need more testing and research.
2022-03-01 15:38:04 -08:00
Chris Robinson
d86f1ab476 Remove AL_SOFTX_filter_gain_ex
It was only added to try to help DSOAL, and it's not clear if it's even
necessary. But with native EAX API support, it certainly isn't necessary
anymore.
2022-02-28 12:57:18 -08:00
Chris Robinson
410f08c4e4 Forward the DriverIface constructor's name 2022-02-26 12:06:12 -08:00
Chris Robinson
c2d2ef2c0e Don't handle EFX functions in the router
Creative's wrapper driver doesn't handle them through alcGetProcAddress, at
least with a null device. For this to work properly, they'd have to be loaded
per-context instead of per-driver.
2022-02-26 10:41:06 -08:00
Chris Robinson
ab8b828c57 Use a more C99-compliant function cast 2022-02-26 07:42:28 -08:00
Chris Robinson
f9c45eac1a Use a more compatible method to check for EFX effects
Creative's wrapper driver doesn't seem to handle EFX enums for alGetEnumValue,
let alone return values only for what's supported. The only way to check which
filter and effect types it supports is try to set them and check for errors.
2022-02-26 07:38:36 -08:00
Chris Robinson
843a5aac6b Forward the (un)likely expression being cast to bool 2022-02-24 06:43:14 -08:00
Chris Robinson
b1559227b0 Make some structs nested 2022-02-23 10:37:09 -08:00
Chris Robinson
2564a3750f Remove unused atomic_invflag 2022-02-23 06:42:09 -08:00
Chris Robinson
625b0d380a Use function overloading to handle pthread_setname_np differences 2022-02-23 05:56:29 -08:00
Chris Robinson
598c1aa224 Default initialize a union
To silence an errant GCC warning
2022-02-23 03:03:20 -08:00
Chris Robinson
42bacc399b Fix an unused parameter warning
... when either pthread_setschedparam or RTKit aren't available.
2022-02-23 02:39:17 -08:00
Chris Robinson
357fb467fe Define the CoreAudio default name only when needed 2022-02-23 02:26:25 -08:00
Chris Robinson
cadf0d1de5 Make some local constexpr variables static 2022-02-23 01:29:28 -08:00
Chris Robinson
7176247529 Avoid an implicit char-to-bool conversion 2022-02-23 00:04:29 -08:00
Chris Robinson
234e55cc3c Explicitly define AmbDecConf's destructor
GCC complains it can't inline the destructor because it's "unlikely" to be
called and would bloat code size, despite being implicitly defined. Technically
accurate, but rather annoying since it's not explicitly called or defined.
2022-02-22 21:23:53 -08:00
Chris Robinson
d22699d9bd Add a OpenAL::OpenAL cmake target alias
For when built as a sub-project, to clarify it's a target instead of a library.
2022-02-22 08:25:40 -08:00
Chris Robinson
d3d9f8ca3d Clean up some cmake output formatting 2022-02-22 08:06:39 -08:00
Chris Robinson
d06ed618d3 Avoid using an if_constexpr macro
It doesn't actually use if constexpr, and compilers are smart enough to
optimize. Some functions can use templates instead.
2022-02-22 03:03:44 -08:00
Chris Robinson
72ddb6351e Rename some variables to show the relevant bit pattern 2022-02-22 00:53:58 -08:00
Chris Robinson
9f44d99642 Revert "Use std::exchange instead of two swaps"
This reverts commit aa19223c65d8693dbaa8d8c9fa0c129d77eed4de.
2022-02-22 00:20:16 -08:00
Chris Robinson
1f9390f6f6 Use a simpler loop to enumerate sources 2022-02-21 21:46:38 -08:00
Chris Robinson
af6ce8e0d9 Remove unused dirty flags 2022-02-21 20:09:11 -08:00
Chris Robinson
7ca4fe6110 Remove a couple extraneous externs 2022-02-21 19:49:15 -08:00
Boris I. Bendovsky
4ffba10d51
Implement EAX v1.0 (#664) 2022-02-21 19:39:06 -08:00
Chris Robinson
6c643e59e9 Make a couple more operator bools explicit 2022-02-20 22:04:19 -08:00
Chris Robinson
023ad6320b Inline a couple more equality operators 2022-02-20 04:13:03 -08:00