1071 Commits

Author SHA1 Message Date
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
1278d3b849 Handle 5.1 Rear with DSound playback 2022-06-08 02:21:37 -07:00
Chris Robinson
14e6d3836a Check and handle 5.1 Rear with WASAPI capture 2022-06-07 23:53:03 -07:00
Chris Robinson
d923f2d0a6 Trace the WASAPI device mix format 2022-06-07 18:58:44 -07:00
Chris Robinson
4750e553f1 Track 5.1 Rear with WASAPI playback 2022-06-07 18:50:28 -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
7f1d9725b2 Use a ringbuffer for Oboe capture 2022-05-28 07:00:45 -07:00
Chris Robinson
d7367aeee0 Fix requeueing logic for OpenSLCapture::captureSamples
The write vector represents the chunks queued for OpenSL, and the write pointer
only increments when OpenSL fills in more samples. So requeueing from the start
of the write vector is requeueing chunks that are already queued, which is
obviously wrong. It instead needs to queue chunks that become available as
they're read.

Because the ring buffer holds more elements than can be written to at a givem
time, the read vector does not represent the next writable chunks to queue.
Advancing the read pointer increases the number of writable elements, so
instead of queueing from the read vector or the start of the write vector,
queue from the end of the write vector given the number of chunks read.
2022-05-28 06:56:41 -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
233863cf29 Use a boolean check instead of a function pointer 2022-05-24 05:22:49 -07:00
Chris Robinson
6027ac4bc2 Avoid dividing by a constant 2022-05-24 02:20:33 -07:00
Boris I. Bendovsky
074dbef2e3
[EAX] Add separate effect state for each version (#705)
* [EAX] Add separate effect state for each version

* [EAX] Don't use EAX call as data member
2022-05-24 02:19:14 -07:00
Chris Robinson
54d72d17ad Use the mix format if IsFormatSupported fails for WASAPI capture 2022-05-17 13:02:00 -07:00
Chris Robinson
556c5d14d7 Avoid a virtual function call to set the decoder width 2022-05-17 02:32:10 -07:00
Chris Robinson
65e4c20c27 Move EAX files to their own sub-directory 2022-05-16 02:08:18 -07:00
Chris Robinson
83238973ed Use virtual functions for the decoder 2022-05-14 21:23:03 -07:00
Chris Robinson
0a57ebdd49 Mark the template base as inline
Apple LLVM doesn't like template specializatioms marked inline without the
(deleted) base also being inline.
2022-05-14 10:27:03 -07:00
Chris Robinson
82c8e87ec7 Keep some variables local to where they're needed 2022-05-13 15:40:15 -07:00
Chris Robinson
dbf5306828 Use pw_buffer::requested in newer PipeWire versions 2022-05-13 15:40:15 -07:00
Chris Robinson
d38d9b091e Remove a couple unnecessary casts 2022-05-13 15:40:15 -07:00
Chris Robinson
af8e756dcb Fix the CoreAudio output element value 2022-05-10 15:36:26 -07:00
Chris Robinson
5c55ec2f9b More agressively hide PipeWire and SDL header warnings 2022-05-09 07:47:43 -07:00
Chris Robinson
96756acc52 Reject older versions of PipeWire than built against
Newer versions of PipeWire may add things to public structures. For example,
pw_buffer::requested added in 0.3.49. Building against 0.3.49 or newer, but
then running with 0.3.48 could result in invalid accesses since the returned
pw_buffer objects are shorter than the definition says to expect, creating
undefined behavior. Even if explicit access to the additional fields is
protected by a runtime check, the language allows the compiler to assume a
pointer to a pw_buffer object contains a complete pw_buffer, allowing the
optimizer to access the field earlier than the check (with the check only
controlling if the value gets used).

Another example is pw_time, which had a few fields added in 0.3.50 along with a
function, pw_stream_get_time_n, that provides the size of the pw_time struct
the application is using (so the library knows what version of the struct it
has to fill in). If a later version adds a new field, running it with an older
version will either fail (due to the library getting a size larger than it
knows about) or silently leave the newer fields as garbage.
2022-05-07 08:49:02 -07:00
Chris Robinson
10e863d1b4 Avoid a deprecated PipeWire function
Building against 0.3.50 or newer will require that version or newer at runtime.
Building against a version before 0.3.50 will work with newer versions.
2022-05-06 12:46:36 -07:00
Chris Robinson
7e6ed2fa95 Use an array of pointers for the UHJ encoder input 2022-05-06 04:14:34 -07:00
Chris Robinson
de33f4968c Fix CoreAudio audio unit element values for capture 2022-05-02 05:17:22 -07:00
Chris Robinson
d9fe5a11cd Reset the ringbuffer when stopping OpenSL playback 2022-04-26 23:42:23 -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
2daed0d0b4 Fully protect disconnection with the mixer counter 2022-04-25 17:32:20 -07:00
Chris Robinson
31d7d62eea Use a type alias to simplify using a type 2022-04-25 17:32:20 -07:00
Chris Robinson
5038ba4d6b Clean up some case spaghetti 2022-04-25 17:32:20 -07:00
Chris Robinson
9ac49e2ce1 Finalize ALC_SOFT_output_mode 2022-04-17 13:56:01 -07:00
Chris Robinson
ac4d4fc731 Always report ALC_ANY_SOFT for output without contexts
Not required, but nicer to be consistent if it's not a meaningful value (e.g.
the actual device mode).
2022-04-17 05:27:40 -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
12dd7bee90 Finalize AL_SOFT_UHJ 2022-04-13 23:02:35 -07:00
Chris Robinson
2fb7538f68 Clear capture buffers before enqueueing them with OpenSL 2022-04-08 21:46:30 -07:00
Chris Robinson
a42fe862c5 Keep track of uncaptured samples with the Oboe backend
Stopping Oboe capture drops uncaptured samples, whereas OpenAL keeps them. Also
make sure the reported available count doesn't go backwards without reading.
2022-04-06 21:53:26 -07:00
Chris Robinson
6a9fe1e2c1 Rename lerp to avoid conflicts with C++20's std::lerp 2022-04-06 17:41:24 -07:00
Chris Robinson
707f4cca27 Limit the super stereo width factor to 0.7 2022-04-04 23:20:59 -07:00
Chris Robinson
8188bb9f01 Update a comment for abandoned extension functions 2022-04-03 20:52:54 -07:00
Chris Robinson
f2f83aaabb Finalize AL_SOFT_callback_buffer 2022-04-01 19:31:22 -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
a731e042cc Remove the unused flags parameter from alBufferCallbackSOFT 2022-04-01 19:15:16 -07:00
Chris Robinson
872c206deb Finalize ALC_SOFT_reopen_device 2022-04-01 16:37:26 -07:00
Chris Robinson
d91b68ef8e Avoid some explicit extern "C"s on function definitions 2022-03-31 05:20:16 -07:00
Chris Robinson
9537c77105 Avoid some redundant variable assignments 2022-03-30 04:32:40 -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