323 Commits

Author SHA1 Message Date
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
Chris Robinson
1a2438b09c Don't blend the B-Format decoder HRIRs
Though fine in theory, an issue arises with extra phase interference since the
frequency phases aren't aligned for each response. It would be better to do the
blending before minimum phase reconstruction, where it can blend just the
frequency magnitudes, essentially allowing makemhr to increase the resolution
of the dataset.
2020-01-07 00:40:38 -08:00
Chris Robinson
8338d9e197 Use a loop instead of a series of lambda calls 2020-01-05 18:25:50 -08:00
Chris Robinson
54b49594e6 Simplify post-mix HRTF gain storage 2020-01-05 17:12:48 -08:00
Chris Robinson
6ed8061cbf Finalize AL_SOFT_bformat_ex 2020-01-05 03:45:35 -08:00
Chris Robinson
0d0ea586b6 Use temporaries for repeated values 2020-01-05 03:38:19 -08:00
Chris Robinson
cc9fa266e7 Avoid more duplicate arrays 2020-01-04 16:50:35 -08:00
Chris Robinson
cdd24c7d01 Combine identical arrays 2020-01-04 00:59:49 -08:00
Chris Robinson
462bcd4ab7 Use a span instead of an array+size 2020-01-04 00:37:59 -08:00
Chris Robinson
a42a586f0f Avoid a duplicate array 2020-01-04 00:04:55 -08:00
Chris Robinson
8b3a1ed9e4 Use an array type for the HRIR delay pair 2019-12-30 21:04:10 -08:00
Chris Robinson
cfc8a82951 Load the HRIRs directly into HrirArrays 2019-12-30 20:49:19 -08:00
Chris Robinson
d9e3f0edf6 Avoid declaring a variable early 2019-12-30 19:17:33 -08:00
Chris Robinson
28d2294b07 Workaround for MSVC 2015 2019-12-29 21:49:29 -08:00
Chris Robinson
c1cf10f508 Handle downmixing for mono output 2019-12-29 20:35:47 -08:00
Chris Robinson
9ac8f25a05 Ignore direct channels for mono and B-Format buffers 2019-12-29 19:17:29 -08:00
Chris Robinson
137394c2cf Make the new direct channel remix extension public 2019-12-28 16:40:10 -08:00
Chris Robinson
701d43b41e Start a new extension for a new direct_channels state
So existing behavior remains consistent for anything that needs it, and new
behavior is opt-in.
2019-12-28 11:33:19 -08:00
Chris Robinson
3b3d3d3a03 Use a span for the band-splitter input 2019-12-25 21:48:58 -08:00
Chris Robinson
f153def941 Pass a span for the biquad filter input 2019-12-25 18:39:22 -08:00
Chris Robinson
36c745a514 Fix parameter order 2019-12-25 18:32:53 -08:00
Chris Robinson
0897927419 Make a couple more functions private 2019-12-25 17:09:14 -08:00
Chris Robinson
de2c64c06f Pass a span to the NFC filters 2019-12-24 23:41:26 -08:00
Chris Robinson
04b8f2a042 Reorganize some function parameters 2019-12-24 23:36:08 -08:00
Chris Robinson
28e68d03d3 Fix a shadowed parameter warning 2019-12-23 23:13:45 -08:00
Chris Robinson
bff6696814 Avoid reading a struct field twice 2019-12-23 23:00:59 -08:00
Chris Robinson
16220be86e Make a duration type to handle WASAPI reference times 2019-12-22 22:05:47 -08:00
Chris Robinson
8807d373b0 Print the unhandled subformat 2019-12-22 16:38:52 -08:00
Chris Robinson
a671c02b0b Try harder to find a matching WASAPI configuration
As long as the lowest channel bits match the enabled bits for a given
configuration, higher bits from any extra channels can be ignored since they
can be skipped.
2019-12-22 02:52:50 -08:00
Chris Robinson
2e6a55a87c Handle padding between device sample frames
The padding must be constant and sample type aligned (e.g. some fixed multiple
of two bytes between the start of two consecutive frames for 16-bit output).
The intent is to always have the ability for stereo output with WASAPI even if
the device has some other unsupported configuration, as long as front-left and
front-right exist.
2019-12-21 20:43:46 -08:00
Chris Robinson
c2ca617ed6 Use size_t for the compressor channel count
And general cleanup of the compressor
2019-12-21 03:21:13 -08:00
Chris Robinson
54e7f48df9 Use unique setters for biquad filter parameters
One for whether a slope parameter is used, and one for bandwidth.
2019-12-21 02:02:57 -08:00