Commit Graph

2096 Commits

Author SHA1 Message Date
Chris Robinson
f2875d5d13 Read in chunks of the fragment size, not expected buffer size 2008-02-12 21:19:09 -08:00
Chris Robinson
b0720333cc UpdateSize is not used for capture devices 2008-02-12 19:50:49 -08:00
Chris Robinson
c3446a10fa Rename UpdateFreq device field to UpdateSize 2008-02-12 19:38:27 -08:00
Chris Robinson
fbc869eed7 Pretend DSound buffer fragment size is 1/4th the total buffer size 2008-02-12 19:24:08 -08:00
Chris Robinson
e3e4dbbccf Make the backend list static 2008-02-11 17:24:04 -08:00
Chris Robinson
7fda645b16 Call InitAL at the start of some more ALC functions 2008-02-11 17:23:31 -08:00
Chris Robinson
ec7f20644d Fast float-to-int function is no longer needed 2008-02-08 21:03:48 -08:00
Chris Robinson
3d5fa91703 Remove unnecessary casting 2008-02-08 21:01:05 -08:00
Chris Robinson
e8acfb069c Remove explicit dependancy on ole32 and unused dxguid 2008-02-08 20:56:45 -08:00
Chris Robinson
4c38ed272d Enumerate DirectSound devices 2008-02-08 20:46:34 -08:00
Chris Robinson
acbb4f8e6c Include alext.h instead of redefining some enums 2008-02-08 19:55:51 -08:00
Chris Robinson
13a3fe8a7a Remove unneeded device struct member 2008-02-08 19:41:47 -08:00
Chris Robinson
3dd3cd4ceb Prevent overflow of the device lists 2008-02-08 15:33:26 -08:00
Chris Robinson
80fcbc8adc Use all capture devices listed by ALSA, not just the first on each card 2008-02-08 15:22:17 -08:00
Chris Robinson
33680accea Don't remove the devices from the device list on unexpected shutdown
The close functions will remove it for us
2008-02-08 14:44:05 -08:00
Chris Robinson
081e593e2b Set the done flag immediately when entering the initialization
To prevent two threads from initializing at the same time (not that it's
likely to happen at this point).
2008-02-06 22:22:29 -08:00
Chris Robinson
b4ffdfab81 Add an option for duplicating stereo sources on the back speakers 2008-02-06 22:18:50 -08:00
Chris Robinson
1ea4aac799 Add an alext.h header 2008-02-06 20:53:00 -08:00
Chris Robinson
4d6c292757 Fix race condition when starting winmm message poll thread 2008-02-03 00:28:00 -08:00
Chris Robinson
655a83c5c5 Use WAVEFORMATEXTENSIBLE for multichannel dsound output, and don't create a primary buffer 2008-02-01 08:17:57 -08:00
Chris Robinson
e8b576bc25 Use the correct channel ordering for Windows 2008-01-27 07:04:13 -08:00
Chris Robinson
01404ed7af Fix output channel order for 6.1 and 7.1 2008-01-27 06:49:48 -08:00
Chris Robinson
ad6237f6f7 Fix availibility amount calculation 2008-01-26 21:10:55 -08:00
Chris Robinson
d06c64e1c4 aluBytesFromFormat returns bytes, not bits 2008-01-26 21:09:08 -08:00
Chris Robinson
b4ad3186dd Update frame size after detecting the directsound output format 2008-01-25 17:05:14 -08:00
Chris Robinson
5f1c0450b3 Remove unnecessary Channels field 2008-01-25 16:38:37 -08:00
Chris Robinson
04b62f77e3 Set the output format according to the speaker setup reported by directsound 2008-01-25 05:02:00 -08:00
Chris Robinson
029dff3f40 Use both write pointers from the directsound buffer lock 2008-01-25 04:42:44 -08:00
Chris Robinson
342f639771 Release 1.2.218 2008-01-21 18:43:14 -08:00
Chris Robinson
b5a2baafe5 Remove effect slot thunk entry when deallocated forcefully 2008-01-21 15:34:38 -08:00
Chris Robinson
781e4e5be4 Remove an unneceesary pointer check and decrease indentation 2008-01-21 14:54:15 -08:00
Chris Robinson
f3dddb5e99 Remove unnecessary duplicate thunk lookups 2008-01-21 14:33:42 -08:00
Chris Robinson
9a5e892cad Small formatting updates 2008-01-20 22:16:28 -08:00
Chris Robinson
0317362662 Remove duplicate function 2008-01-20 19:22:39 -08:00
Chris Robinson
6b403a76e8 Don't access ALSource for every sample mix 2008-01-20 19:20:24 -08:00
Chris Robinson
6bf6c6fb7b More overflow protection 2008-01-20 13:27:54 -08:00
Chris Robinson
29618bee10 Prevent float samples from overflowing when converting to 16-bit 2008-01-20 00:43:02 -08:00
Chris Robinson
db80f682c9 Clean a couple debug messages 2008-01-19 21:41:09 -08:00
Chris Robinson
e1cdbac5a0 Close ALC first when exiting since devices might've been running when deleting stuff 2008-01-19 20:58:50 -08:00
Chris Robinson
543eb9d217 Don't use a multiple lists for extensions 2008-01-19 20:02:40 -08:00
Chris Robinson
bc963463f3 Add an option for setting the max number of sources 2008-01-19 19:38:06 -08:00
Chris Robinson
86b7b3d54b Remove duplication of setting the max source count 2008-01-19 19:28:34 -08:00
Chris Robinson
799ba1f954 Use less ambiguous config file names 2008-01-19 18:18:14 -08:00
Chris Robinson
1a3e39e452 Remove some unnecessary duplicate math, which was making long lines 2008-01-19 00:49:05 -08:00
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
73e386dc6f Release effect slots when deleting sources 2008-01-17 21:17:08 -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