Commit Graph

3351 Commits

Author SHA1 Message Date
Chris Robinson
4f279557a6 Attempt to use BS2B when using headphones without HRTF 2014-11-22 22:28:36 -08:00
Chris Robinson
ccbb3f069f Update some config descriptions 2014-11-22 22:00:44 -08:00
Chris Robinson
d77c6153e7 Document the stereo-mode config option 2014-11-22 21:02:25 -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
f7d7afb7c1 Remove an unused macro 2014-11-22 16:39:08 -08:00
Chris Robinson
a217be1539 Rename Voice's NumChannels to OutChannels 2014-11-22 16:23:08 -08:00
Chris Robinson
637993a793 Only update the necessary channels 2014-11-22 13:16:24 -08:00
Chris Robinson
4ebf0ad717 Mix DirectChannel sources to the non-virtual channel buffers 2014-11-22 13:10:32 -08:00
Chris Robinson
dece86f61f Store the number of output channels in the voice 2014-11-22 13:08:19 -08:00
Chris Robinson
fb511351df Remove an unnecessary union container 2014-11-22 12:58:54 -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
38383671d7 Balance the left and right channels for quad output 2014-11-21 14:41:02 -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
d608f0e9f0 Only warn when no data file could be opened 2014-11-19 13:07:37 -08:00
Chris Robinson
6e198b3476 Align UpdateSize for Neon, too 2014-11-17 21:33:09 -08:00
Chris Robinson
1dcc54c986 Don't force UpdateSize to a multiple of 4 after buffer metrics were set 2014-11-17 21:23:29 -08:00
Chris Robinson
40a08bed4f Always get the pulseaudio sink info on device reset 2014-11-17 17:57:52 -08:00
Chris Robinson
d4e52b64d8 Mark a function as const 2014-11-15 23:20:38 -08:00
Chris Robinson
308e6b697a Remove the unused angle and elevation from the device channel config 2014-11-15 04:26:11 -08:00
Chris Robinson
b10085cc63 Slightly increase the ambient gain volume 2014-11-15 04:11:22 -08:00
Chris Robinson
9681c5a2bb Interpolate directional reverb gains with ambient based on vector length 2014-11-15 00:21:26 -08:00
Chris Robinson
55a13456d4 Add a method to convert channel enums to a label string 2014-11-15 00:19:56 -08:00
Chris Robinson
a095645970 Don't bother with LFE in the channel setup, set the values explicitly 2014-11-12 19:26:53 -08:00
Chris Robinson
283c2b20d4 Add a toolchain for Android cross-compiling 2014-11-10 17:56:48 -08:00
Chris Robinson
e036cca1c9 Add the ability to use custom output channel coefficients
I'm not sure exactly how I want to do this yet, but this is a good starting
point.
2014-11-10 17:53:42 -08:00
Chris Robinson
1c4055419e Don't use the device lock/unlock wrappers needlessly 2014-11-08 18:04:01 -08:00
Chris Robinson
3eab44001d Remove the unused layout config options 2014-11-08 15:44:07 -08:00
Chris Robinson
a50ba603ab Remove the unused wide-stereo option 2014-11-08 06:36:45 -08:00
Chris Robinson
c053617066 Reorder some options in the config sample 2014-11-08 05:59:08 -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
907cd3dd01 Add a workaround for compilers without __COUNTER__
This can make GCC pretty noisey, complaining "declaration does not declare
anything" for each static_assert, but it should still function on such older
compilers.
2014-11-07 19:43:14 -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
1a326c758b Rename a couple parameters 2014-11-07 16:00:07 -08:00
Chris Robinson
57387505d8 Move a declaration 2014-11-07 15:47:41 -08:00
Chris Robinson
01a1e6f102 Fallback to 16-bit samples in alffmpeg if a float32 format isn't supported 2014-11-07 04:50:16 -08:00
Chris Robinson
3f7cb8392e Pas the output device channel count to ALeffectState::process 2014-11-07 03:43:33 -08:00
Chris Robinson
713e9dd4cc Rename speakers to channels, and remove an old incorrect comment 2014-11-07 03:12:32 -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
6c954e71db Use shorter display names for the surround sound config options 2014-11-07 01:13:20 -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
7a98e92117 Update cross-compiler toolchain to work better with Qt 2014-11-06 23:18:42 -08:00
Chris Robinson
ad247fe5cd Initialize a couple variables mingw complains about 2014-11-06 23:05:21 -08:00
Chris Robinson
4126ccf744 Use SZFMT for printing size_t 2014-11-06 23:02:39 -08:00
Chris Robinson
61a56ce120 Play zero-distance/zero-radius sources from the front 2014-11-05 04:48:48 -08:00
Chris Robinson
6aed34cfb5 Don't use FrontLeft and FrontRight to reference the dry buffer 2014-11-05 04:11:18 -08:00