aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
Commit message (Collapse)AuthorAgeFilesLines
* Only update the necessary channelsChris Robinson2014-11-221-2/+2
|
* Mix DirectChannel sources to the non-virtual channel buffersChris Robinson2014-11-221-1/+18
|
* Store the number of output channels in the voiceChris Robinson2014-11-221-0/+2
|
* Remove an unnecessary union containerChris Robinson2014-11-221-6/+6
|
* Use a different method for HRTF mixingChris Robinson2014-11-221-111/+52
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Allocate the DryBuffer dynamicallyChris Robinson2014-11-211-1/+1
|
* Rename a couple parametersChris Robinson2014-11-071-3/+3
|
* Pas the output device channel count to ALeffectState::processChris Robinson2014-11-071-2/+2
|
* Rename speakers to channels, and remove an old incorrect commentChris Robinson2014-11-071-14/+14
|
* Use a separate macro for the max output channel countChris Robinson2014-11-071-11/+11
|
* Fix 5.1 surround soundChris Robinson2014-11-071-2/+2
| | | | | | | | | | | | | 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.
* Play zero-distance/zero-radius sources from the frontChris Robinson2014-11-051-4/+4
|
* Don't use FrontLeft and FrontRight to reference the dry bufferChris Robinson2014-11-051-4/+4
|
* Don't increment the output buffer in the Write_ methodsChris Robinson2014-11-051-13/+17
|
* Set gains using the device channel indexChris Robinson2014-11-051-16/+10
|
* Use a method to set omni-directional channel gainsChris Robinson2014-11-041-1/+4
|
* Add some missing breaksChris Robinson2014-11-021-0/+2
|
* Avoid the ALCdevice_Lock/Unlock wrapper in some placesChris Robinson2014-11-011-2/+3
|
* Support B-Format source rotation with AL_ORIENTATIONChris Robinson2014-10-311-1/+42
|
* Rename the source's Orientation to DirectionChris Robinson2014-10-311-3/+3
|
* Add preliminary AL_EXT_BFORMAT supportChris Robinson2014-10-311-1/+32
| | | | | Currently missing the AL_ORIENTATION source property. Gain stepping also does not work.
* Don't attempt to match a channel input to outputChris Robinson2014-10-121-24/+7
| | | | | | | | | I don't like this, but it's currently necessary. The problem is that the ambisonics-based panning does not maintain consistent energy output, which causes sounds mapped directly to an output channel to be louder compared to when being panned. The inconcistent energy output is partly by design, as it's trying to render a full 3D sound field and at least attempts to correct for imbalanced speaker layouts.
* Avoid taking the square-root of the ambient gainChris Robinson2014-10-111-21/+10
| | | | | | Although it is more correct for preserving the apparent volume, the ambisonics- based panning does not work on the same power scale, making it louder by comparison.
* Add a helper to search for a channel index by nameChris Robinson2014-10-021-10/+4
|
* Make ComputeAngleGains use ComputeDirectionalGainsChris Robinson2014-10-021-54/+65
|
* Use helpers to set the gain step valuesChris Robinson2014-10-021-142/+73
|
* Add a cast for MSVCChris Robinson2014-09-301-1/+1
|
* Use an ambisonics-based panning methodChris Robinson2014-09-301-15/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For mono sources, third-order ambisonics is utilized to generate panning gains. The general idea is that a panned mono sound can be encoded into b-format ambisonics as: w[i] = sample[i] * 0.7071; x[i] = sample[i] * dir[0]; y[i] = sample[i] * dir[1]; ... and subsequently rendered using: output[chan][i] = w[i] * w_coeffs[chan] + x[i] * x_coeffs[chan] + y[i] * y_coeffs[chan] + ...; By reordering the math, channel gains can be generated by doing: gain[chan] = 0.7071 * w_coeffs[chan] + dir[0] * x_coeffs[chan] + dir[1] * y_coeffs[chan] + ...; which then get applied as normal: output[chan][i] = sample[i] * gain[chan]; One of the reasons to use ambisonics for panning is that it provides arguably better reproduction for sounds emanating from between two speakers. As well, this makes it easier to pan in all 3 dimensions, with for instance a "3D7.1" or 8-channel cube speaker configuration by simply providing the necessary coefficients (this will need some work since some methods still use angle-based panpot, particularly multi-channel sources). Unfortunately, the math to reliably generate the coefficients for a given speaker configuration is too costly to do at run-time. They have to be pre- generated based on a pre-specified speaker arangement, which means the config options for tweaking speaker angles are no longer supportable. Eventually I hope to provide config options for custom coefficients, which can either be generated and written in manually, or via alsoft-config from user-specified speaker positions. The current default set of coefficients were generated using the MATLAB scripts (compatible with GNU Octave) from the excellent Ambisonic Decoder Toolbox, at https://bitbucket.org/ambidecodertoolbox/adt/
* Combine some fields into a structChris Robinson2014-09-101-6/+6
|
* Invert the ChannelOffsets arrayChris Robinson2014-09-101-4/+7
|
* Rename activesource to voiceChris Robinson2014-08-211-132/+132
|
* Use an array of objects for active sources instead of pointersChris Robinson2014-08-211-8/+8
|
* Use a NULL source for inactive activesourcesChris Robinson2014-08-211-12/+12
| | | | Also only access the activesource's source field once per update.
* Update COPYING to the latest ↵François Cami2014-08-181-2/+2
| | | | https://www.gnu.org/licenses/old-licenses/lgpl-2.0.txt to fix the FSF' address Fix the FSF' address in the source
* Use atomics for the device and context list headsChris Robinson2014-08-011-2/+2
|
* Make the source's buffer queue head and current queue item atomicChris Robinson2014-07-311-3/+3
|
* Explicitly pass the address of atomics and parameters that can be modifiedChris Robinson2014-07-261-4/+4
|
* Use generic atomics in more placesChris Robinson2014-07-221-2/+2
|
* Add macros for generic atomic functionalityChris Robinson2014-07-221-2/+2
|
* Add a source radius property that determines the directionality of a soundChris Robinson2014-07-111-9/+12
| | | | | | | | | 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.
* Remove unused variablesChris Robinson2014-06-131-4/+0
|
* Get the mixer and resampler functions when neededChris Robinson2014-06-131-65/+0
|
* Combine the direct and send mixersChris Robinson2014-06-131-28/+11
|
* Combine some dry and wet path typesChris Robinson2014-06-131-50/+45
|
* Add SSE2 and SSE4.1 linear resamplersTimothy Arceri2014-06-061-0/+8
| | | | | Currently the only way SSE 4.1 is detected is by using __get_cpuid, i.e. with GCC. Windows' IsProcessorFeaturePresent does not report SSE4.1 capabilities.
* Avoid a loop when updating the source position variablesChris Robinson2014-06-021-4/+8
|
* Don't clear the current and step gain values when updating a sourceChris Robinson2014-05-211-89/+66
|
* Put per-channel filter properties togetherChris Robinson2014-05-191-20/+20
|
* Don't pass the DirectParams to the dry-path mixerChris Robinson2014-05-181-51/+74
|
* Use different parameters for HRTF mixersChris Robinson2014-05-181-6/+11
|