694 Commits

Author SHA1 Message Date
Chris Robinson
3b8f54d572 Use aluVector in some more places 2014-12-16 07:20:27 -08:00
Chris Robinson
97f6d302fe Add explicit matrix and vector types to operate with 2014-12-16 06:29:31 -08:00
Chris Robinson
a606bbc7f1 Use a lookup table to do cubic resampling 2014-12-15 12:23:28 -08:00
Chris Robinson
bdbf6613ef Support B-Format output with the wave file writer 2014-11-25 22:20:00 -08:00
Chris Robinson
391ab19b02 Avoid using ALCdevice_Lock and ALCdevice_Unlock unnecessarily 2014-11-23 21:05:42 -08:00
Chris Robinson
65620e0ae5 Update a comment 2014-11-23 20:43:17 -08:00
Chris Robinson
033cf3dca9 Add a boolean to specify if a device is headphones 2014-11-23 18:23:24 -08:00
Chris Robinson
fc3608b381 Handle loopback devices when deciding to use HRTF 2014-11-23 08:38:33 -08:00
Chris Robinson
7e716bfc4a Remove a couple unnecessary traces 2014-11-22 22:33:19 -08:00
Chris Robinson
4f279557a6 Attempt to use BS2B when using headphones without HRTF 2014-11-22 22:28:36 -08:00
Chris Robinson
312330dbaa Rework HRTF decision logic
This way takes into account a new stereo-mode config option, which when set to
"headphones" will default to using HRTF. Eventually the device will also be
able to specify if headphones are being used.
2014-11-22 20:52:08 -08:00
Chris Robinson
e41cfeca84 Move a warning check earlier 2014-11-22 04:51:34 -08:00
Chris Robinson
a27e5e1652 Use a different method for HRTF mixing
This new method mixes sources normally into a 14-channel buffer with the
channels placed all around the listener. HRTF is then applied to the channels
given their positions and written to a 2-channel buffer, which gets written out
to the device.

This method has the benefit that HRTF processing becomes more scalable. The
costly HRTF filters are applied to the 14-channel buffer after the mix is done,
turning it into a post-process with a fixed overhead. Mixing sources is done
with normal non-HRTF methods, so increasing the number of playing sources only
incurs normal mixing costs.

Another benefit is that it improves B-Format playback since the soundfield gets
mixed into speakers covering all three dimensions, which then get filtered
based on their locations.

The main downside to this is that the spatial resolution of the HRTF dataset
does not play a big role anymore. However, the hope is that with ambisonics-
based panning, the perceptual position of panned sounds will still be good. It
is also an option to increase the number of virtual channels for systems that
can handle it, or maybe even decrease it for weaker systems.
2014-11-22 04:20:17 -08:00
Chris Robinson
c8d82712da Reformat a couple lines 2014-11-21 14:40:10 -08:00
Chris Robinson
ccba33169b Initialize panning after setting up HRTF 2014-11-21 14:35:19 -08:00
Chris Robinson
4ad6905c13 Allocate the DryBuffer dynamically 2014-11-21 13:45:57 -08:00
Chris Robinson
6e198b3476 Align UpdateSize for Neon, too 2014-11-17 21:33:09 -08:00
Chris Robinson
1c4055419e Don't use the device lock/unlock wrappers needlessly 2014-11-08 18:04:01 -08:00
Chris Robinson
a50ba603ab Remove the unused wide-stereo option 2014-11-08 06:36:45 -08:00
Chris Robinson
3904a3f033 Allow selecting the 5.1-rear channel config from the config file 2014-11-08 05:53:17 -08:00
Chris Robinson
74994e9d11 Remove the long-deprecated 'format' config option 2014-11-08 05:41:55 -08:00
Chris Robinson
b34a374fa7 Only enable the BS2B filter with stereo output 2014-11-07 16:11:47 -08:00
Chris Robinson
35eacf058e Go to the next voice when a source is stopped 2014-11-07 16:05:06 -08:00
Chris Robinson
4c3f27193f Use a separate macro for the max output channel count 2014-11-07 02:18:24 -08:00
Chris Robinson
0051a96376 Fix 5.1 surround sound
Apparently, 5.1 surround sound is supposed to use the "side" channels, not the
back channels, and we've been wrong this whole time. That means the "5.1 Side"
is actually the correct 5.1 setup, and using the back channels is anomalous.

Additionally, this means the 5.1 buffer format should also use the the side
channels instead of the back channels.

A final note: the 5.1 mixing coefficients are changed so both use the original
5.1 surround sound set (with the surround channels at +/-110 degrees). So the
only difference now between 5.1 "side" and 5.1 "back" is the channel labels.
2014-11-07 00:54:16 -08:00
Chris Robinson
28c1ec830e Support AL_EXT_MULAW_BFORMAT 2014-10-31 22:52:30 -07:00
Chris Robinson
ac51c9cce6 Add preliminary AL_EXT_BFORMAT support
Currently missing the AL_ORIENTATION source property. Gain stepping also does
not work.
2014-10-31 17:18:45 -07:00
Chris Robinson
4320a1483b Make alcSuspendContext and alcProcessContext batch updates
This behavior better matches Creative's hardware drivers and Rapture3D's OpenAL
driver. A compatibility environment variable is provided to restore the old
no-op behavior for any app that behaves badly from this change (set
__ALSOFT_SUSPEND_CONTEXT to "ignore").

If too many apps have a problem with this, the default behavior may need to be
changed to ignore, with the env var providing an option to defer/batch instead.
2014-10-12 09:17:13 -07:00
Chris Robinson
70b23ab77f Add a helper to search for a channel index by name 2014-10-02 21:19:34 -07:00
Chris Robinson
af7330de88 Copy the null terminator from the string instead of appending it 2014-09-30 21:49:29 -07:00
Chris Robinson
01adfde199 Invert the ChannelOffsets array 2014-09-10 16:52:54 -07:00
Chris Robinson
a234fc11e5 Remove the GetLatency method from the old BackendFuncs 2014-09-08 06:59:58 -07:00
Chris Robinson
9dacd89a02 Convert the winmm backend to the new backend API 2014-09-08 06:46:20 -07:00
Chris Robinson
705c60d924 Use al_calloc/al_free to allocate contexts and voices 2014-08-30 20:59:46 -07:00
Chris Robinson
f04b15692e Setup the HRTF format before tracing the pre-reset format 2014-08-29 19:34:20 -07:00
Chris Robinson
2b87ffece5 Return the correct default capture device name 2014-08-26 14:52:36 -07:00
Chris Robinson
a3bba200c0 Convert the wave writer backend to the new API 2014-08-24 22:20:02 -07:00
Chris Robinson
259e265920 Rename activesource to voice 2014-08-21 03:41:13 -07:00
Chris Robinson
65d2e0eb8d Use an array of objects for active sources instead of pointers 2014-08-21 02:27:56 -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
François Cami
3c13e1e333 Update COPYING to the latest https://www.gnu.org/licenses/old-licenses/lgpl-2.0.txt to fix the FSF' address Fix the FSF' address in the source 2014-08-18 11:34:29 -07:00
Chris Robinson
8364aa5f6f ALC_SOFT_pause_device is finished 2014-08-12 08:45:11 -07:00
Chris Robinson
e64d0f83cd Disable the autowah effect
There's apparently some issues with it causing noise or killing the output. It
might be due to the per-sample changes being too harsh for the filter to keep
up with, but it's not something I can take care of in time for release.

This commit should be reverted after release when work on fixing it can resume.
2014-08-06 23:38:05 -07:00
Chris Robinson
f5194a9d8e Use an ATOMIC_INIT macro instead of ATOMIC_LOAD_UNSAFE 2014-08-03 00:26:21 -07:00
Chris Robinson
87423f046e Use atomics for the device and context list heads 2014-08-01 02:04:40 -07:00
Chris Robinson
ce046d2f03 Rename ATOMIC_COMPARE_EXCHANGE to ATOMIC_COMPARE_EXCHANGE_STRONG 2014-07-31 04:34:46 -07:00
Chris Robinson
531c0d8e6b Explicitly pass the address of atomics and parameters that can be modified 2014-07-26 03:00:49 -07:00
Chris Robinson
a3dbe08c8b Support C11 atomics 2014-07-23 06:36:34 -07:00
Chris Robinson
e4b779c492 Use generic atomics in more places 2014-07-22 18:57:51 -07:00
Chris Robinson
5a339a2a5b Add macros for generic atomic functionality 2014-07-22 00:20:28 -07:00