Commit Graph

5511 Commits

Author SHA1 Message Date
Chris Robinson
1d1acc0c34 Ensure BUFFERSIZE is a power of 2 2018-09-30 12:12:27 -07:00
Chris Robinson
1860b2ec8a Make the Compressor struct opaque 2018-09-30 12:08:01 -07:00
Chris Robinson
7ad4f753a4 Fix some length ranges 2018-09-29 19:39:49 -07:00
Chris Robinson
d5a78f0843 Improve a couple loops
Avoid masking the index with each iteration, and instead do up to when the mask
would apply. This allows for better optimizations, in particular fewer
instructions and better chances for vectorization.
2018-09-29 18:48:28 -07:00
Chris Robinson
32494e72a5 Don't use a ringbuffer design for the limiter's side chain
Rather than continuously wrapping when used, each update uses it from the front
and copies the tail to the front at the end. This allows for more effficient
accesses in loops.
2018-09-29 11:54:45 -07:00
Chris Robinson
0396c0ecd2 Add some assumes for the limiter 2018-09-29 09:47:05 -07:00
Chris Robinson
51a447852f Simplify a lower-bound clamp 2018-09-28 18:34:21 -07:00
Chris Robinson
1684b2cc5f Constify a couple more variables 2018-09-28 16:42:22 -07:00
Chris Robinson
1dee902a5f Update changelog 2018-09-26 08:23:48 -07:00
Chris Robinson
79314c4461 Include the limiter's lookAhead delay in the device latency 2018-09-25 23:05:27 -07:00
Chris Robinson
2d6309d6fc Don't hardcode the limiter threshold
It's now calculated from the output sample type and dither depth.
2018-09-25 10:33:20 -07:00
Chris Robinson
c69338bc0d Update the output limiter/compressor
This provides better characteristics for an amplitude limiter. In particular,
it utilizes the peak amplitude instead of the RMS, and the used parameters
basically guarantee no output samples exceed the given threshold... almost, due
to floating-point errors as the threshold is converted from dB to log-e for the
envelope, then is negated and converted to linear amplitude to apply to the
signal. It's quite possible for some rounding errors to creep in and not
perfectly saturate the result.
2018-09-25 10:04:14 -07:00
Chris Robinson
39c3314d00 Only compare the reverb params that induce a need for fading
The offsets and coefficients are controlled by a relatively small set of input
parameters, just with different base constants or different calculations. This
lead to numerous redundant checks since if one value didn't change, others that
use the same inputs wouldn't have either.
2018-09-23 22:59:16 -07:00
Chris Robinson
db6905bf57 Clear reverb gain coefficients when doing a device update 2018-09-23 02:22:23 -07:00
Chris Robinson
800326d37a Rename ALreverbState to ReverbState 2018-09-23 01:11:58 -07:00
Chris Robinson
c708f871ec Update changelog 2018-09-22 20:13:31 -07:00
Chris Robinson
77a53594ba Improve the gain stepping difference check
Given the more stable stepping now in use, check that the total difference is
enough for perceptible transition, instead of the step itself.
2018-09-22 08:26:52 -07:00
Chris Robinson
36a6b9d42a Adjust comment spacing 2018-09-21 06:06:29 -07:00
Chris Robinson
b6d0ff02c2 Use an internal event to more timely release old effect states 2018-09-21 04:14:15 -07:00
Chris Robinson
f21e2df4cf Remove an unnecessary mutex 2018-09-20 22:53:16 -07:00
Chris Robinson
84a90b7cc3 Stop the event thread when releasing the context
To ensure no user callback gets called after alcDestroyContext.
2018-09-20 22:44:58 -07:00
Chris Robinson
ebbbeb0d66 Put user events in a union structure 2018-09-20 21:59:38 -07:00
Chris Robinson
cb8545346d Always start the event thread with the context 2018-09-20 19:58:01 -07:00
Chris Robinson
5c6b8eda4f Remove another duplicate function 2018-09-19 22:18:46 -07:00
Chris Robinson
ea95a8adef Combine nearly-duplicate structures 2018-09-19 21:31:46 -07:00
Chris Robinson
6eb980d1b2 Remove a couple duplicate functions 2018-09-19 21:09:19 -07:00
Chris Robinson
48b7745a49 Add macros for commonly used square roots 2018-09-19 19:53:25 -07:00
Chris Robinson
9ef4dd4247 Use ALsizei for the source resample position 2018-09-18 19:08:13 -07:00
Chris Robinson
952ff84b99 Properly queue buffers for OpenSL capture 2018-09-17 23:43:23 -07:00
Chris Robinson
b77e6096b8 Fix some potential race conditions with OpenSL
For playback, increment the ring buffer's write pointer before queueing audio,
to handle cases where the callback is invoked, advancing the read pointer,
before the write pointer is advanced.

For capture, limit the number of re-queued chunks to the number of fully read
chunks.
2018-09-17 22:49:52 -07:00
Chris Robinson
7f4441ffbe Handle the bsinc C resampler like the others 2018-09-17 04:07:56 -07:00
Chris Robinson
8bacb5dfb8 Fix buffer queue mixing logic
In particular, the source sample position was reduced by the size of the
next buffer list item when one is completed, rather than the size of the
one it just completed.
2018-09-16 17:38:55 -07:00
Chris Robinson
a6734c7a91 Check the effect slot list size only when there's no free entries
The list can contain (reuable) NULL entries, so the max - current_size doesn't
indicate how many can be allocated.
2018-09-14 14:53:35 -07:00
Chris Robinson
db452a19da The last reverb loop update doesn't need an aligned count. 2018-09-11 19:05:49 -07:00
Chris Robinson
99737469e2 Ensure the max reverb update size is a multiple of 4
It's not an issue for the final mix, but if one loop has an unaligned count,
the next loop will have unaligned input and output buffer targets which can
crash the SSE mixers.
2018-09-11 18:39:50 -07:00
Chris Robinson
b13396cce2 Separate the delay line feeding from reading
Since it feeds a different line than it reads, the feeding could overwrite
what's subsequently read.
2018-09-10 13:30:20 -07:00
Chris Robinson
d1f8b78dd4 Avoid a couple line count assumptions 2018-09-10 03:19:41 -07:00
Chris Robinson
4bdab0051f Combine identical loops into a separate function 2018-09-10 03:17:14 -07:00
Chris Robinson
634b13a630 Handle the early reflection delay separate from late refeed 2018-09-10 02:10:35 -07:00
Chris Robinson
275658b6db Some suggested changes for iOS 2018-09-07 23:01:17 -07:00
Chris Robinson
9054f41434 PATH_MAX not MAX_PATH 2018-09-07 22:52:34 -07:00
Chris Robinson
fa7993fe3e Load .alsoftrc from the app bundle root on macOS
Not sure what priority this should have. Currently it loads after system-level
configs, and before user-level configs.
2018-09-07 22:32:48 -07:00
Chris Robinson
46cfedb117 Pass the device name list to the backend probe method 2018-09-07 22:02:37 -07:00
Chris Robinson
212cb8e298 Implement capture support for SoundIO 2018-09-07 20:08:24 -07:00
Chris Robinson
7394dd512d Rename ALCsndioBackend 2018-09-07 18:45:24 -07:00
Chris Robinson
96aacac10c Release 1.19.0 2018-09-06 14:35:18 -07:00
Chris Robinson
4c32a0aba7 Update changelog about 32-bit using SSE2 by default 2018-09-03 21:09:31 -07:00
Chris Robinson
0f243b927c Slightly restructure some loops 2018-09-03 17:07:43 -07:00
Chris Robinson
fce86815f4 Extract SIMD values right before using them 2018-09-03 12:42:31 -07:00
Chris Robinson
3b4f28d173 Avoid double-resizing when appending a char to a string 2018-09-02 21:15:21 -07:00