Chris Robinson
7dc73815ae
Remove some branches
2008-01-18 21:39:09 -08:00
Chris Robinson
4caf2c7edd
Implement AL_EFFECT_REVERB
...
Here is a quick description of how the reverb effect works:
+--->---+*(4)
| V new sample
+-----+---+---+ |
|extra|ltr|ref| <- +*(1)
+-----+---+---+
(3,5)*| |*(2)
+-->|
V
out sample
1) Apply master reverb gain to incoming sample and place it at the head of the
buffer. The master reverb gainhf was already applied when the source was
initially mixed.
2) Copy the delayed reflection sample to an output sample and apply the
reflection gain.
3) Apply the late reverb gain to the late reverb sample
4) Copy the end of the buffer, applying a decay gain and the decay hf ratio,
and add to the late reverb.
5) Copy the late reverb sample, adding to the output sample.
Then the head and sampling points are shifted forward, and done again for each
new sample. The extra buffer length is determined by the Reverb Density
property. A value of 0 gives a length of 0.1 seconds (long, with fairly
distinct echos) , and 1 gives 0.075 seconds (short, indistinct echos).
The decay gain is calculated such that after a number of loops to satisfy the
Decay Time, a sample will be 1/32768th as powerful (virtually insignificant to
the resulting output, and only getting further reduced). It is calculated as:
DecayGain = pow(1.0f/32768.0f, 1.0/(DecayTime/ExtraLength));
Things to note: Reverb Diffusion is not currently handled, nor is Decay HF
Limit. Decay HF Ratios above 1 probably give incorrect results. Also, this
method likely sucks, but it's the best I can come up with before release. :)
2008-01-18 21:25:40 -08:00
Chris Robinson
1b9d740244
Remove duplicated source freeing code
2008-01-18 00:56:01 -08:00
Chris Robinson
497ada9c77
Buffer size fixes. Partially reverts the ALSA buffer size "fix"
2008-01-18 00:28:25 -08:00
Chris Robinson
43cfc097de
Don't dereference ALContext if there's no context yet
...
Patch by Evgeny A. Marchenko
2008-01-17 12:57:22 -08:00
Chris Robinson
6735fc7911
Add missing config.h includes
2008-01-16 14:09:04 -08:00
Chris Robinson
be34dbe608
Don't include alAuxEffectSlot.h in alSource.h
2008-01-16 14:01:24 -08:00
Chris Robinson
8ad16145f6
Make sure sources are deleted with the context
2008-01-16 13:27:15 -08:00
Chris Robinson
4742dedb45
Don't clamp wet gain if there's no send slot, and move slot gain calculation
...
To remove an extra if check
2008-01-16 13:00:35 -08:00
Chris Robinson
10a9bc62bf
Store a reference to the effect slot in a source's send, not a copy
2008-01-16 12:43:25 -08:00
Chris Robinson
24f433b938
Remove unneeded variables
2008-01-15 21:57:50 -08:00
Chris Robinson
abc69dd3d0
Use acosf when available
2008-01-15 21:23:14 -08:00
Chris Robinson
03ca50fa70
Use the previous low-pass filter again, as it seems to match the intended output better
2008-01-15 18:29:21 -08:00
Chris Robinson
b95fcf5da1
Store effect slots in the context
2008-01-15 16:22:39 -08:00
Chris Robinson
df07e8a65b
Add support for AL_LOKI_quadriphonic
2008-01-14 16:11:15 -08:00
Chris Robinson
729f076c3b
Reduce indentation
2008-01-14 15:38:15 -08:00
Chris Robinson
dfc0118b8b
Add an option for disabling ALSA mmap
2008-01-14 15:30:52 -08:00
Chris Robinson
d9ef062caf
Avoid busy waiting when waiting for suspend to clear
2008-01-14 13:23:49 -08:00
Chris Robinson
2b8ce3b4cf
Let the mmap thread start the pcm stream when it's full
...
Instead of filling it with silence and starting it before the thread is active
2008-01-14 13:07:41 -08:00
Chris Robinson
a27b855a39
Make sure the stream is playing when it's full
2008-01-14 12:59:44 -08:00
Chris Robinson
1634b69faf
Don't restart the stream right after preparing it
...
It needs to be filled, first
2008-01-14 12:51:36 -08:00
Chris Robinson
59fa1f90d5
Don't attempt to recover the ALSA stream when filling silence
...
Since it was just prepared, any error would likely mean bigger problems
2008-01-14 12:49:21 -08:00
Chris Robinson
7a4870bd97
Close dangling devices when exiting
2008-01-14 10:54:33 -08:00
Chris Robinson
a552e32a9a
Destroy context if closing a device with one
2008-01-14 10:42:11 -08:00
Chris Robinson
29c6238b52
Keep track of open devices
2008-01-14 10:39:54 -08:00
Chris Robinson
38db8eb64b
Reorder setting of some variables
2008-01-12 07:36:22 -08:00
Chris Robinson
3bbbf8a025
Merge branch 'master' into efx-experiment
2008-01-11 17:19:08 -08:00
Chris Robinson
978764cb6b
Don't limit output wave filename size
2008-01-11 15:27:56 -08:00
Chris Robinson
893ecf1af2
Fix the Wave Writer's reliance on ftell
...
So output can work on FIFOs
2008-01-11 15:18:26 -08:00
Chris Robinson
aa453b4e9e
Use Sleep instead of usleep
2008-01-11 14:55:35 -08:00
Chris Robinson
f8089d2026
Don't double-close a handle on error
2008-01-11 13:23:37 -08:00
Chris Robinson
40241b4e97
Don't attempt to open ALSA playback/capture if it didn't load
2008-01-11 13:00:30 -08:00
Chris Robinson
f10408739e
Add a wave file writing backend
2008-01-11 09:32:22 -08:00
Chris Robinson
bc56c00a9a
Allow querying of ALC_MONO_SOURCES and ALC_STEREO_SOURCES
...
Based on a patch by Xavier Bouchoux
2008-01-10 08:24:23 -08:00
Chris Robinson
1e3ad2f9ce
Use a more reliable thread loop for DSound, instead of a Win32 timer
...
Also use a simpler method for calculating the read/write location
2008-01-08 07:09:25 -08:00
Chris Robinson
9c97f07ec9
Remove unneeded silence field
2008-01-07 00:26:10 -08:00
Chris Robinson
90d825e7f8
Fix lone ALC_REFRESH query case
2008-01-06 03:36:01 -08:00
Chris Robinson
1178e900eb
Don't allow 0 periods
2008-01-06 01:27:26 -08:00
Chris Robinson
8553fb9e30
ALC_REFRESH is the number of updates per second
2008-01-06 01:14:09 -08:00
Chris Robinson
da3b270488
Make OSS's update size dynamic
2008-01-06 00:19:28 -08:00
Chris Robinson
dd60366aec
Fix the buffer size so ALSA doesn't multiply by the number of periods
2008-01-06 00:18:06 -08:00
Chris Robinson
017fc93307
Some non-mmap ALSA fixes
2008-01-05 05:33:54 -08:00
Chris Robinson
042ec206e7
Disable fast float-to-int hack.
...
Even with precautions, it's giving problems. Not worth it since I don't quite
understand how it works, or know if there's even a benefit.
2008-01-05 05:03:31 -08:00
Chris Robinson
312108a0d3
Try a different low-pass filter
...
Seems to be more correct, although it's not as powerful as the previous (which
may be a good thing)
2008-01-05 03:51:24 -08:00
Chris Robinson
5e48be27b8
Merge branch 'master' into efx-experiment
2008-01-04 14:40:38 -08:00
Chris Robinson
b3badbf97d
Use 6 point spatialization for 6.1 and 7.1 output
2008-01-04 14:15:55 -08:00
Chris Robinson
4d5885e27b
Implement a crossfeed config option
2008-01-03 06:02:06 -08:00
Chris Robinson
8fe39042da
Add the Bauer stereophonic-to-binaural DSP (bs2b) code and hooks
2008-01-03 05:36:51 -08:00
Chris Robinson
9ed574b399
Merge branch 'master' into efx-experiment
2008-01-01 06:29:11 -08:00
Chris Robinson
7ef623c71d
Fail if OSS can't set the requested bit depth and channel count
2008-01-01 06:25:00 -08:00