149 Commits

Author SHA1 Message Date
Chris Robinson
3148986184 Implement AL_EXT_STEREO_ANGLES support 2016-03-25 14:40:44 -07:00
Chris Robinson
25732d0895 Calculate channel gain stepping just before mixing 2016-02-14 01:22:01 -08:00
Chris Robinson
d69dd6dc7a Make the source's buffer queue a singly-linked list 2016-01-31 00:42:58 -08:00
Chris Robinson
b9e192b78a Implement a band-limited sinc resampler
This is essentially a 12-point sinc resampler, unless it's resampling to a rate
higher than the output, at which point it will vary between 12 and 24 points
and do anti-aliasing to avoid/reduce frequencies going over nyquist.

Code provided by Christopher Fitzgerald.
2015-11-05 09:42:08 -08:00
Chris Robinson
2ff3bf5ab0 Use a constant value for the post-position padding 2015-10-15 15:13:19 -07:00
Chris Robinson
97f53d941c Store the source's previous samples with the voice
This helps avoid different results when looping is toggled within a couple
samples of the loop point, or when a processed buffer is removed while the
source is only a couple samples into the next buffer.
2015-10-15 07:29:25 -07:00
Chris Robinson
07f80eb4e1 Move the resampler stuff to mixer.c where it's used 2015-10-01 00:34:13 -07:00
Chris Robinson
3e60b18989 Don't keep selecting the mixer to use 2015-09-27 20:55:39 -07:00
Chris Robinson
3b8f54d572 Use aluVector in some more places 2014-12-16 07:20:27 -08:00
Chris Robinson
3d2853274d Support B-Format source rotation with AL_ORIENTATION 2014-10-31 22:43:13 -07:00
Chris Robinson
336aba6f1f Rename the source's Orientation to Direction 2014-10-31 17:24:46 -07:00
Chris Robinson
259e265920 Rename activesource to voice 2014-08-21 03:41:13 -07:00
Chris Robinson
b92e643e97 Use a NULL source for inactive activesources
Also only access the activesource's source field once per update.
2014-08-21 00:29:42 -07:00
Chris Robinson
15a58eb383 Make the source's buffer queue head and current queue item atomic 2014-07-31 07:20:36 -07:00
Chris Robinson
5a339a2a5b Add macros for generic atomic functionality 2014-07-22 00:20:28 -07:00
Chris Robinson
f4cdecebcf Add a source radius property that determines the directionality of a sound
At 0 distance from the listener, the sound is omni-directional. As the source
and listener become 'radius' units apart, the sound becomes more directional.

With HRTF, an omni-directional sound is handled using 0-delay, pass-through
filter coefficients, which is blended with the real delay and coefficients as
needed to become more directional.
2014-07-11 00:03:13 -07:00
Chris Robinson
57c683f822 Get the mixer and resampler functions when needed 2014-06-13 16:07:25 -07:00
Chris Robinson
a8deaf12f4 Combine the direct and send mixers 2014-06-13 13:34:19 -07:00
Chris Robinson
c29eb63489 Combine some dry and wet path types 2014-06-13 11:42:04 -07:00
Chris Robinson
4ca561acd3 Move the active source's offset out of the direct params 2014-05-24 16:55:10 -07:00
Chris Robinson
5a1abf6918 Use different parameters for HRTF mixers 2014-05-18 09:31:08 -07:00
Chris Robinson
82dd2d875e Apply high-pass source filters as needed 2014-05-17 07:54:25 -07:00
Chris Robinson
343200d229 Store the filter reference frequency in the source 2014-05-11 10:07:17 -07:00
Chris Robinson
851a917b03 Use a struct to store the source's direct gain/gainhf properties 2014-05-11 01:40:44 -07:00
Chris Robinson
e9297d9744 Mark the buffer queue pointers volatile 2014-05-10 08:03:53 -07:00
Chris Robinson
a455704148 Use a RWLock to help protect the source's buffer queue
In some instances this allows to to remove the device/mixer lock, or reduce how
long it's held.
2014-05-10 05:07:13 -07:00
Chris Robinson
eebde08e65 Don't explicitly store the BuffersInQueue 2014-05-10 03:33:41 -07:00
Chris Robinson
c4383b65e2 Store the current buffer queue item, rather than played buffer count 2014-05-10 03:21:40 -07:00
Chris Robinson
b0d511a860 Store the HrtfState directly in the DirectParams 2014-03-23 02:45:50 -07:00
Chris Robinson
842aeb888b Move some HRTF and mixer structs to alu.h 2014-03-22 02:39:57 -07:00
Chris Robinson
0c5cbafcd8 Use a union to combine HRTF and non-HRTF mixer params 2014-03-19 17:55:09 -07:00
Chris Robinson
6ee54fb1f3 Store some source mixing parameters in the active source struct 2014-03-19 13:14:11 -07:00
Chris Robinson
d6f7aac1bb Use a separate struct for tracking active sources 2014-03-18 19:56:25 -07:00
Chris Robinson
c68ce288d0 Move HRTF macros and function declarations to a separate header 2014-02-23 21:11:01 -08:00
Chris Robinson
5874e387a8 Move some inline methods to their appropriate headers 2013-11-04 13:51:19 -08:00
Chris Robinson
8aa237ac23 Fix effect slot struct declarations so KDevelop doesn't barf on them 2013-10-07 05:41:41 -07:00
Chris Robinson
6425480d40 Don't store the effect slot in SendParams
This makes it much more like DirectParams.
2013-10-06 10:11:01 -07:00
Chris Robinson
8448b94c0b Rename Filter param member to LpFilter 2013-10-06 09:33:02 -07:00
Chris Robinson
94884ed04b Use a separate value for the maximum buffer channels
Unlike the device, input buffers are accessed based on channel numbers
instead of enums. This means the maximum number of channels they hold
depends on the number of channels any one format can have, rather than
the total number of recognized channels. Currently, this is 8 for 7.1.
2013-07-23 00:13:15 -07:00
Chris Robinson
feeec34333 Use ALfilterState for the source direct and send filters 2013-05-27 19:14:02 -07:00
Chris Robinson
e4186f4903 Use a properly-defined history for the FILTER struct 2013-05-21 07:10:24 -07:00
Chris Robinson
4f5aafe59f Put the HRTF DirectParams into an anonymous struct 2012-10-15 01:37:37 -07:00
Chris Robinson
a852669dce Store the output buffers in the DirectParams struct 2012-10-14 11:21:52 -07:00
Chris Robinson
0b679167c9 Store some more HRTF info in the DirectParams struct 2012-10-14 10:57:11 -07:00
Chris Robinson
7635afcb52 Use a source param for the resampler and move them to the mixer source 2012-09-14 04:13:18 -07:00
Chris Robinson
9f58edd7a8 Fix up some more header includes 2012-09-14 02:42:36 -07:00
Chris Robinson
2bf1979d4a Move the target effect slot to the SendParams struct 2012-09-08 22:32:30 -07:00
Chris Robinson
9737f68315 Place the alignment attribute before the variable declaration 2012-08-16 10:42:48 -07:00
Chris Robinson
2cbb565d09 Ensure some HRTF-related parameters are aligned 2012-08-15 04:10:41 -07:00
Chris Robinson
e32e2fd6b8 Fix an inadvertent change in the HRTF coefficient stepping value array size 2012-07-19 11:49:43 -07:00