262 Commits

Author SHA1 Message Date
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
Chris Robinson
e3168c9112 Add an extension to request stereo UHJ output 2021-11-08 16:56:05 -08:00
Chris Robinson
49a36334bd Use a tri-state optional for the stereo output mode 2021-10-24 11:51:39 -07:00
Chris Robinson
096bed35fa Pass a parameter to aluInitRenderer to specify UHJ output 2021-10-23 11:37:46 -07:00
Chris Robinson
d0e5e138e2 Use a flag to indicate headphone-like output 2021-10-23 07:51:06 -07:00
Chris Robinson
3154684f97 Reduce the JACK and ALSA backend priority
With the increased use of PipeWire, which offers JACK compatibility, the JACK
backend has a higher potential to be auto-selected for users. However, due to
the backend's inability to auto-configure output to the device format, this
creates a less optimal out-of-the-box experience.

Unfortunately this also means the JACK backend won't be used automatically when
a real JACK server is running along with PulseAudio. While not ideal, this is
probably the better of the two options, to have the user explicitly configure
the library to use JACK when they really want to use it, instead of unwantingly
selecting JACK because of PipeWire.
2021-08-14 20:14:12 -07:00
Chris Robinson
dc9b39f419 Implement PipeWire playback
Not yet an auto-selected backend. This doesn't yet support enumeration, or
matching the AL device format to the output.
2021-08-06 21:38:23 -07:00
Chris Robinson
4cc820bb5c Start a PipeWire backend
It's just a copy of the Null backend to start with
2021-08-02 21:03:18 -07:00
Chris Robinson
0a0849db99 Use an optional bool instead of two tri-state enums 2021-07-31 14:24:49 -07:00
Chris Robinson
29fba79cd5 Avoid 5.1Rear as its own channel configuration
It messes with 5.1 sources using direct channels, and the surround channels are
supposed to map to the side labels. Individual backends can deal with the
channel order/label differences, as they already do to a degree.
2021-07-30 07:38:26 -07:00
Chris Robinson
9a7bca1116 Add wrapper methods for getting device config values 2021-06-23 10:45:24 -07:00
Chris Robinson
d28cf80b6f Allow querying ALC_ALL_DEVICES_SPECIFIER from loopback devices
They only return the default/driver name, since loopback devices don't have a
canonical name.
2021-06-22 03:25:31 -07:00
Chris Robinson
e3c0b60cc6 Rename alcontext.h and move some functions to context.cpp 2021-04-27 19:04:45 -07:00