1004 Commits

Author SHA1 Message Date
Chris Robinson
af6584b8fc Reduce the maximum number of source sends to 6 2020-02-25 04:52:39 -08:00
Chris Robinson
52d86ad51f Ignore VoiceChange objects while disconnected
And try to improve ALvoice/VoiceChange handling when attempting to recover a
lost device.
2020-02-24 11:01:45 -08:00
Chris Robinson
90d45984dc Simplify replaying a source 2020-02-23 21:40:54 -08:00
Chris Robinson
6044e0d7ca Remove a couple unnecessary type aliases 2020-02-22 00:08:55 -08:00
Chris Robinson
4660819f6a Avoid a single function call in a loop 2020-02-21 22:17:29 -08:00
Chris Robinson
a8162a77c2 Use an array of ALvoice pointers for the active voices
This allows growing the array atomically with the mixer since the ALvoice
objects themselves don't move, and a new larger array of them can be swapped in
without blocking the mixer.
2020-02-21 20:14:28 -08:00
Chris Robinson
0694df9014 Handle playing and pausing with VoiceChanges 2020-02-21 04:29:32 -08:00
Chris Robinson
9b43327f56 Asynchronously stop and rewind voices 2020-02-20 23:53:56 -08:00
Chris Robinson
bdb8ef22b0 Asynchronously stop voices if its source is being deleted 2020-02-20 22:50:37 -08:00
Chris Robinson
acf7f6f74e Add a voice flag to indicate a voice has a pending stop
Pending/asynchronous stops to be implemented soon.
2020-02-20 19:18:07 -08:00
Chris Robinson
3aad01d3ba Add AL_SOFTX_callback_buffer to the extension list 2020-02-19 17:32:32 -08:00
Chris Robinson
4277c05b0c Workaround a 32-bit GCC/MinGW TLS bug 2020-02-18 18:14:59 -08:00
Chris Robinson
3122c3b4a1 Handle running the buffer callback in the voice 2020-02-17 17:13:25 -08:00
Chris Robinson
c8dfd24818 Add a callback flag for voices 2020-02-17 04:50:00 -08:00
Chris Robinson
3156b17057 Stub out an interface for a callback-driven buffer 2020-02-16 23:49:29 -08:00
Chris Robinson
1d91e282c8 Update the MHR format
This update removes the 16/24-bit sample type enum, now always being 24-bit
(other than a very small size saving, there's no practical benefit to storing
16-bit samples). This also reverses the field storage, so no on-load fixup is
needed, and stores the IR delays with 2 bits of sub-sample precision, allowing
for slightly better timing (after resampling, blending, etc).
2020-02-11 00:37:21 -08:00
Chris Robinson
6ebdf3ab62 Use a triplet struct array instead of separate arrays 2020-02-09 14:25:20 -08:00
Chris Robinson
f2bc24f761 Consistently use distant wavefronts for 0 distance 2020-02-08 22:39:32 -08:00
Chris Robinson
85395b23a4 Clear voice target gains earlier 2020-02-08 18:10:59 -08:00
Chris Robinson
3ee0906c81 Use std::array and span for the HRTF delays 2020-02-08 15:00:58 -08:00
Aleš Gajdacz
7e319ad99b
Fix unreachable code warning 2020-02-08 23:34:09 +01:00
Chris Robinson
ebb1aaa06d Make sure stereo angles are kept in-range. 2020-01-31 11:11:06 -08:00
Chris Robinson
e960276a47 Try harder to find the closest HRIR for the B-Format decoder 2020-01-26 01:23:39 -08:00
Chris Robinson
43780913cd Fix the output channel count for the B-Format decoder 2020-01-19 13:40:39 -08:00
Chris Robinson
3904289af7 Only sort active effect slots as needed 2020-01-18 18:53:58 -08:00
Chris Robinson
32c9dbd7ff Avoid an extraneous index map 2020-01-15 10:45:08 -08:00
Chris Robinson
6a8c6eae6f Make a couple helper methods to create BFormatDec 2020-01-15 10:33:56 -08:00
Chris Robinson
fcfcb88b28 Repack B-Format decoder fields
This should better provide sequential access.
2020-01-15 10:09:41 -08:00
Chris Robinson
c112acadaf Transpose BFormatDec's matrices
This allows the band-split and output mix to happen together, rather than
splitting all input channels first and then mixing them to output.
2020-01-14 23:08:04 -08:00
Chris Robinson
030d428aec Clean up some formating 2020-01-14 13:10:01 -08:00
Chris Robinson
75a58ae333 Simplify appending delayed samples 2020-01-14 12:13:00 -08:00
Chris Robinson
5324bdb908 Signal the event handler only once per update 2020-01-14 10:39:41 -08:00
Chris Robinson
400c768e2f Inline a couple ring buffer methods 2020-01-14 10:17:57 -08:00
Chris Robinson
e889282131 Get rid of an unnecessary struct 2020-01-13 19:45:13 -08:00
Chris Robinson
a1a107f576 Return immediately on error when loading HRTFs 2020-01-13 18:13:05 -08:00
Chris Robinson
a56a6116c0 Make a separate function for duplicate code 2020-01-13 15:55:31 -08:00
Chris Robinson
174e48fe8f Use the Field and Elevation structs directly when loading 2020-01-13 14:23:11 -08:00
Chris Robinson
bc946b004e Don't assume the total length of certain arrays 2020-01-13 10:59:15 -08:00
Chris Robinson
7551242143 Use a span for a fixed-size array reference 2020-01-13 08:55:10 -08:00
Chris Robinson
a866aece46 Add missing include 2020-01-12 19:28:12 -08:00
Chris Robinson
2f1a2ce242 Scale the resampled HRTF delays if they exceed the max 2020-01-12 14:49:11 -08:00
Chris Robinson
00d80497d8 Warn when resampled HRIR delays get clamped 2020-01-12 11:24:30 -08:00
Chris Robinson
c182a3376a Blend the whole IR for the interpolated HRIR
The SIMD mixers may use a few more elements beyond the irSize, so not limiting
the blend to that size can slightly improve the quality for resampled HRIRs.
2020-01-12 11:08:05 -08:00
Chris Robinson
af08f68448 Fix JACK process callback handling
The callback apparently can't be set after activation, but we can't allocate
the ring buffer until after activation when the callback is already getting
called. An ugly flag it is, then, I guess.
2020-01-12 07:48:11 -08:00
Chris Robinson
6f1c853397 Don't allocate the ring buffer for JACK before activation
It seems the JACK server can send buffer size change events during device reset
and wait on it, which causes a failure since the change event can't be
processed during a reset. It's otherwise impossible to safely disable the
change event callback during a reset since the lock is already held and the
callback can be waiting to acquire it. The only guarantee we seem to have is
the event callback won't be invoked after jack_activate succeeds.

So instead, the buffer size can be queried after jack_activate and the ring
buffer allocated then, instead of using an event callback. This does mean the
buffer size can change with a start() call, but it's better than a failure to
start.
2020-01-11 15:10:54 -08:00
Chris Robinson
e6e2f509f8 Make CreateRingBuffer a static RingBuffer method 2020-01-10 07:56:43 -08:00
Chris Robinson
b31886ad73 Fix blending for the right IR delay 2020-01-08 17:00:48 -08:00
Chris Robinson
6608e5dd9f Make sure unassociated voices give back their update structs 2020-01-08 07:31:01 -08:00
Chris Robinson
45e82379a4 Make sure an unmixable source is properly stopped 2020-01-08 06:40:58 -08:00
Chris Robinson
84f65c1883 Avoid auto-releasing containers for the global device list
If any are left open at process shutdown, it may try to clean them up, and
subsequently close the device. This is dangerous to do at process exit, so
don't. The app should have closed the device(s) prior to exiting anyway
2020-01-07 03:12:49 -08:00