Commit Graph

1151 Commits

Author SHA1 Message Date
Chris Robinson
c8d385c998 Use a helper to tell if an effect type is reverb 2011-07-05 04:36:41 -07:00
Chris Robinson
4c35bfbc10 Read the source's RoomRolloffFactor once 2011-07-05 03:55:16 -07:00
Chris Robinson
83e322c5f3 Force front-centered for mono sounds that comes from the listener under HRTF 2011-07-05 03:36:14 -07:00
Chris Robinson
6020b964c7 Fix some formatting 2011-07-04 22:36:51 -07:00
Chris Robinson
b2d5367830 Fix rolloff calculations for auxiliary sends 2011-07-04 07:32:23 -07:00
Chris Robinson
d307ee8c2f Implement a lerped lookup of the HRTF coefficients/delays
Code supplied by Christopher Fitzgerald
2011-07-04 07:20:38 -07:00
Chris Robinson
202f57552a Use a proper enum for the distance model 2011-07-03 19:39:19 -07:00
Chris Robinson
5ba864b6da Calculate the wet gain decay time attenuation with linear values 2011-07-03 19:22:14 -07:00
Chris Robinson
30e97d5223 Read the RoomRolloffFactor property with the other properties 2011-07-03 03:34:40 -07:00
Chris Robinson
69be02c0fd Set the default auxiliary sends to MAX_SENDS
Since the property is ALC_MAX_AUXILIARY_SENDS, it makes more sense to default
it to the maximum and let the app lower it on request.
2011-07-03 03:18:18 -07:00
Chris Robinson
eefda551de Properly handle input samples for changes with the FIR coefficients
This makes sure previously processed samples are not changed due to changes in
the FIR filter. It also applies the coefficients in ascending order with the
values, to improve caching.
2011-07-03 02:14:33 -07:00
Chris Robinson
ac7ca07221 Get rid of a couple typedefs 2011-07-02 21:33:53 -07:00
Chris Robinson
b043390ec2 Update a trace 2011-07-02 19:02:45 -07:00
Chris Robinson
4c94ba6d8a Properly save the original FPU state when using _controlfp 2011-07-02 02:56:06 -07:00
Chris Robinson
7b87519c15 Move functions to where they're used 2011-07-02 02:54:05 -07:00
Chris Robinson
14bfe0293a Use separate functions to find valid ALC loopback device formats 2011-07-02 02:51:33 -07:00
Chris Robinson
931d422443 Use separate ALC enums for loopback device formats 2011-07-02 02:25:34 -07:00
Chris Robinson
895150eebe Update HRTF coefficients 2011-07-01 05:08:57 -07:00
Chris Robinson
a5ccae5779 Do air absorption with linear gain values
This copies the way the calculation is done with the wet path
2011-07-01 02:30:15 -07:00
Chris Robinson
1635132fd5 Use a template function to handle processing ring modulator types 2011-07-01 01:48:04 -07:00
Chris Robinson
048aee66cf Avoid accessing source properties more than once when updating parameters 2011-07-01 01:46:56 -07:00
Chris Robinson
723755788d Rename Suspend/ProcessContext since they are locking a mutex 2011-06-30 18:10:04 -07:00
Chris Robinson
032d0836a7 Declare some variables closer to where they're used 2011-06-29 23:32:48 -07:00
Chris Robinson
5736bbc3e4 Add a source property to skip channel virtualization for multi-channel buffers
With virtualization disabled, channels are mapped directly from input to output
and any input channel that is missing an output is dropped. Any virtualization
effects (such as HRTF filters) for positional cues are also skipped.

The idea is to allow applications a way to play pre-filtered audio that channel
vitualization effects could interfere with.
2011-06-29 23:18:49 -07:00
Chris Robinson
1b773a8585 Select the correct resampler 2011-06-28 00:30:00 -07:00
Chris Robinson
3f0214ed6b Implement capture support for the CoreAudio backend 2011-06-27 23:49:17 -07:00
Chris Robinson
ea83608ee4 Avoid a junk sample at the start of the ring buffer, and allocate the buffer
memory at the end of the ring buffer itself.
2011-06-27 14:30:45 -07:00
Chris Robinson
8cae1aee80 Clamp PortAudio output to stereo 2011-06-27 01:00:34 -07:00
Chris Robinson
3db061e670 Combine the two pa_load definitions into one 2011-06-26 15:40:15 -07:00
Chris Robinson
efaaf9b5f9 Don't bother with a per-context lock for disconnecting devices 2011-06-26 01:26:50 -07:00
Chris Robinson
c451bf370d Remove an incorrect ProcessContext call 2011-06-26 01:22:29 -07:00
Chris Robinson
212b187447 Add a function to check if a device is compatible with the Hrtf filter 2011-06-25 21:39:36 -07:00
Chris Robinson
1fc44d5788 Select the mixer during a source update 2011-06-25 00:13:56 -07:00
Chris Robinson
913c70557d Fix formatter for size_t 2011-06-24 15:03:29 -07:00
Chris Robinson
f6d1e0f299 Avoid setting a thread priority for OpenBSD
It apparently causes a negative performance impact regardless of which values
are set.
2011-06-23 15:42:35 -07:00
Chris Robinson
e42bdc2022 Fix device Update parameters for sndio 2011-06-23 15:42:16 -07:00
Chris Robinson
cf44f499b8 Be silent about failing to load shared libs 2011-06-22 20:48:45 -07:00
Chris Robinson
39c984fda8 Actually load libsndio.so 2011-06-22 20:45:45 -07:00
Chris Robinson
96b6cd46e6 Add a FreeBSD sndio backend 2011-06-22 19:29:13 -07:00
Chris Robinson
bc6e3879d4 Properly handle the PortAudio lib in OpenBSD 2011-06-22 16:43:37 -07:00
Chris Robinson
3dcfd0dc98 Use 'Distance' for the unclamped distance value, since the clamped value is
only used for distance attenuation
2011-06-21 12:55:21 -07:00
Chris Robinson
40b8934487 Calculate wet gain when needed 2011-06-18 16:45:26 -07:00
Chris Robinson
157e1394d6 Open the log file with config initialization 2011-06-17 18:54:05 -07:00
Chris Robinson
edf78b077e Use separate lines for HRTF history and values 2011-06-17 16:22:39 -07:00
Chris Robinson
753e64c76c Do stereo duplication in two passes
First using the rear channels, then using the normal stereo channels
2011-06-17 16:20:18 -07:00
Chris Robinson
3a072a294d Avoid resetting a flag that isn't on 2011-06-17 14:59:10 -07:00
Chris Robinson
c429a5be25 The DirectSound DLL is always loaded by the Win32 API 2011-06-16 06:17:57 -07:00
Chris Robinson
fba58fb1f0 Make sure user configuration is always initialized for Windows 2011-06-16 05:36:16 -07:00
Chris Robinson
dad7f1cf0f Prefer DllMain when in Windows 2011-06-16 05:34:13 -07:00
Chris Robinson
8bee7a2b7f Don't suspend individual contexts when updating 2011-06-16 05:29:38 -07:00
Chris Robinson
632b4e6332 Avoid some channel order duplication 2011-06-16 00:00:40 -07:00
Chris Robinson
f26798bd19 Remove some unnecessary casts 2011-06-15 23:52:21 -07:00
Chris Robinson
7f4dcefc80 Remove the databuffer functions and structs
It's been disabled for a while now, and not likely to be re-enabled.
2011-06-15 23:46:35 -07:00
Chris Robinson
d702cb9b49 Avoid an unnecessary lock when retrieving the current context 2011-06-15 23:22:34 -07:00
Chris Robinson
2081228055 Declare some variables where they're used 2011-06-15 06:45:51 -07:00
Chris Robinson
f85283c036 Don't prematurely set the HRTF flag 2011-06-15 02:00:41 -07:00
Chris Robinson
14d6ab384d Use a flag to specify when a device is running 2011-06-15 01:59:07 -07:00
Chris Robinson
62036745f3 Separate config init from library init
OSX has a bug where the file descriptor resource limit can't be increased once
certain functions (such as fopen) are used. Since lib initialization happens in
a global constructor and includes opening and parsing config files, it prevents
apps from being able to increase the rlimit once the lib is loaded, which is
usually before main().

By delaying config init, it allows apps the opportunity to change the rlimit
before calling certain OpenAL functions.
2011-06-14 09:43:33 -07:00
Chris Robinson
264274685a Throw an error when no global initialization is available 2011-06-14 08:47:53 -07:00
Chris Robinson
1babf28491 Unset the local context if it's being destroyed 2011-06-14 08:27:09 -07:00
Chris Robinson
5a15dc4ddf Avoid multiple list searches when destroying devices and contexts 2011-06-14 07:04:08 -07:00
Chris Robinson
0f782b385b Create TLS for contexts earlier 2011-06-14 06:57:51 -07:00
Chris Robinson
1534fcfafd Remove some unneeded includes 2011-06-14 05:06:39 -07:00
Chris Robinson
1c7ed6e693 Avoid using function pointers directly in the ALSA backend
Also make it use the lib wrappers
2011-06-14 05:00:59 -07:00
Chris Robinson
0c5c56cf88 Avoid using function pointers directly in the PulseAudio backend
Also, switch to the lib wrapper functions
2011-06-14 04:45:52 -07:00
Chris Robinson
53c5275aa4 Use a proper enum for the probe type 2011-06-14 04:02:58 -07:00
Chris Robinson
c93d7a1721 Open the logfile in append/text mode 2011-06-14 03:04:00 -07:00
Chris Robinson
9c7dad1bdf Combine multiple probe functions into one 2011-06-14 02:28:15 -07:00
Chris Robinson
bfe09b933e Trace errors in the opensl callback 2011-06-14 01:51:44 -07:00
Chris Robinson
823f5779e1 Set format_pcm according to the device format 2011-06-14 01:48:13 -07:00
Chris Robinson
96a18ba1d5 Make fewer assumptions on the OpenSL buffer count 2011-06-12 19:36:28 -07:00
Chris Robinson
b8bb41107c Don't be silent when an OpenSL error occurs 2011-06-12 18:10:01 -07:00
Chris Robinson
ccffb7e380 Add missing semicolon 2011-06-12 16:30:51 -07:00
Chris Robinson
39088b2035 Uninline the timeGetTime wrapper 2011-06-12 05:04:36 -07:00
Chris Robinson
ba069ded40 Add an OpenSL backend
Currently for Android's OpenSL ES implementation
2011-06-12 04:41:42 -07:00
Chris Robinson
6b8209fdc9 Cleanup dynamic loading in the PortAudio backend 2011-06-12 04:37:32 -07:00
Chris Robinson
ccf62fc525 Add wrappers to handle dyanmically loading libs 2011-06-12 04:36:24 -07:00
Chris Robinson
6bfab6427a Avoid calling some function pointers directly 2011-06-12 03:55:02 -07:00
Chris Robinson
aab4f85383 Change HRTF table user input format 2011-06-03 03:15:13 -07:00
Chris Robinson
99b9208896 Improve default HRTF filter delays
They're now rounded from the source's float delays
2011-06-03 03:09:13 -07:00
Chris Robinson
7402e3743d Readd the default HRTF filter (based on the diffuse set) 2011-06-03 01:47:33 -07:00
Chris Robinson
7ddfacb58f Use a minimum phase HRTF data set
This reduces the coefficient size from 128 down to 32, with a set of delays
2011-06-03 01:06:00 -07:00
Chris Robinson
c7a80418d9 Separate device-type parameter checks for alcGetIntegerv 2011-05-29 23:20:33 -07:00
Chris Robinson
e98104dac8 Avoid holding locks once the context is removed from the lists 2011-05-29 23:03:59 -07:00
Chris Robinson
884f668855 Uninline a couple more functions 2011-05-29 03:28:34 -07:00
Chris Robinson
2bbe9d1b1f Uninline a couple mutex wrapper functions 2011-05-29 03:08:26 -07:00
Chris Robinson
91c3cffe41 Protect the mixer while the device's context array is being updated 2011-05-29 03:04:32 -07:00
Chris Robinson
60a55aa897 Hold the global lock while the device is being updated 2011-05-29 02:56:00 -07:00
Chris Robinson
9325a78043 Use a separate lock for device and context list accesses 2011-05-29 02:26:46 -07:00
Chris Robinson
cd0e80126c Require a lock for IsDevice calls 2011-05-28 22:21:11 -07:00
Chris Robinson
1778c0d7d8 Get the device format directly from the string 2011-05-28 21:37:33 -07:00
Chris Robinson
b07901f1a0 Set the subformat type when an unknown one is encountered 2011-05-28 21:21:37 -07:00
Chris Robinson
a15a1abb21 Trace the format that is set when reporting HRTF disabled 2011-05-28 20:40:46 -07:00
Chris Robinson
7da2eea8f0 Add a 5.1 device format that uses side channels instead of back 2011-05-28 19:35:32 -07:00
Chris Robinson
596a1af7d9 Switch to the diffuse HRTF data set 2011-05-26 15:43:26 -07:00
Chris Robinson
6b6a7757ce Clear HRTF coefficients for the LFE channel 2011-05-25 19:04:19 -07:00
Chris Robinson
8a6266239c Rename Quad to Quadraphonic 2011-05-24 14:34:53 -07:00
Chris Robinson
d83af679bd Fix handling of GUID definitions 2011-05-22 13:29:32 -07:00
Chris Robinson
af005668da Avoid using an unnecessary temp variable 2011-05-21 23:14:55 -07:00
Chris Robinson
d07e94056d Use libuuid when it has MMDevApi's UIDs 2011-05-21 21:57:44 -07:00
Chris Robinson
4d7aab1df4 Make some declarations static or static const 2011-05-21 21:28:27 -07:00
Chris Robinson
c3cbfecbae Remove duplicate macros 2011-05-21 21:16:30 -07:00
Chris Robinson
a9d9553fff Use a multi-dimensional array for the panning LUT 2011-05-21 17:45:54 -07:00
Chris Robinson
5cdf774ea7 Use the stored sample and channel count 2011-05-21 17:36:54 -07:00
Chris Robinson
b75d4beb1a Dedicated dialog should go in front 2011-05-20 09:50:31 -07:00
Chris Robinson
35a0430c81 Store the separate effect parameters in a union 2011-05-20 09:36:36 -07:00
Chris Robinson
cbbb04eb40 Always fully normalize the position when using HRTF 2011-05-20 07:58:05 -07:00
Chris Robinson
7396aaf2c2 Fix HRTF elevation calculation 2011-05-19 17:57:14 -07:00
Chris Robinson
555ccce4ee Update the device update fields after initializing the MMDevApi device 2011-05-19 15:55:27 -07:00
Chris Robinson
b838d123f8 Multiply the history offset in the filtering funcitons 2011-05-18 18:52:47 -07:00
Chris Robinson
1d3926e187 Remove some more duplication 2011-05-18 18:49:41 -07:00
Chris Robinson
c316766144 Use lerp() in a couple more places 2011-05-18 18:09:04 -07:00
Chris Robinson
c00b2f9254 Avoid looking in the buffer queue to find the frame size 2011-05-18 17:02:18 -07:00
Chris Robinson
06f5f0b7c8 Make mixers channel-count agnostic
As a result, this combines/removes a bunch of mixers
2011-05-17 13:25:15 -07:00
Chris Robinson
9f91ff4734 Move the channel loop to the outside of the sample mixing loop 2011-05-17 12:49:26 -07:00
Chris Robinson
f7936b4709 Avoid multiple getenv calls to the same var 2011-05-17 10:15:53 -07:00
Chris Robinson
2abeed069b Improve handling of format support for MMDevApi 2011-05-17 04:54:09 -07:00
Chris Robinson
569106acd3 Fix COM initialization with MMDevApi 2011-05-16 10:31:38 -07:00
Chris Robinson
507d2f8afb Properly set the channel order for WinMM playback 2011-05-16 10:28:17 -07:00
Chris Robinson
54769a823e Implement playback using MMDevApi 2011-05-16 04:13:37 -07:00
Chris Robinson
cf3287f8ec Fix closing of waveOut devices 2011-05-16 03:16:47 -07:00
Chris Robinson
c5fbc9f05c Define GUIDs in ALc.c instead of the individual backend source files 2011-05-15 21:47:50 -07:00
Chris Robinson
2940b0f390 Add a skeleton backend for MMDevApi 2011-05-15 20:26:25 -07:00
Chris Robinson
e95b718cf4 Improve handling of device channels with DSound 2011-05-15 05:24:27 -07:00
Chris Robinson
143c08bfcb Use channel config strings in log output 2011-05-15 04:49:18 -07:00
Chris Robinson
b3902c8950 Add functions to get strings from the device format 2011-05-15 04:03:15 -07:00
Chris Robinson
7210796cb8 Combine multiple loops 2011-05-15 02:12:42 -07:00
Chris Robinson
949cfe2ceb Re-enable duplication for stereo sounds 2011-05-15 00:18:28 -07:00
Chris Robinson
c39f27d5f8 Set the duplicate-stereo flag properly after the device format is reset 2011-05-13 21:27:46 -07:00
Chris Robinson
c9ac4f06ff Remove an unused macro and rename another 2011-05-07 04:35:49 -07:00
Chris Robinson
674b14faa3 Make a couple more pointers restricted 2011-05-07 04:32:53 -07:00
Chris Robinson
a8fdcd30a5 Some minor cleanups 2011-05-07 04:31:43 -07:00
Chris Robinson
db3cb23c1d Add an option to reverse Z panning of mono sources
Applications that are not built around OpenAL's orientation system need to
convert their given vectors to it. Depending on how this is done, it can lead
to proper stereo (left-right) panning with improper surround sound (front-back)
panning, which thusly sounds correct with stereo output and incorrect with 4+
channel output.

This option is intended to help fix playback of such applications on surround
sound systems, without having to resort to forcing stereo output.
2011-05-07 03:54:46 -07:00
Chris Robinson
7972f7a2da Combine duplicate arrays 2011-05-06 23:25:15 -07:00
Chris Robinson
8c3d50be28 Skip LFE with HRTF output 2011-05-06 04:46:21 -07:00
Chris Robinson
4198f3062c Remove the device channel matrix 2011-05-06 04:42:54 -07:00
Chris Robinson
c2a6efc77a Use the panning algorithms to build the multi-channel source matrix
This prevents the stereo-duplication option from working. It should hopefully
be restored soon.
2011-05-06 04:37:10 -07:00
Chris Robinson
6928487aa1 Remove some redundancy 2011-05-06 02:53:22 -07:00
Chris Robinson
64b5d7a519 Check the correct flag in the dsound backend 2011-05-06 01:53:13 -07:00
Chris Robinson
eef41e76d7 Don't clear the request flag if a new context doesn't specify a frequency 2011-05-06 01:50:19 -07:00
Chris Robinson
d583f7f307 Update sources automatically when device parameters change 2011-05-06 01:06:01 -07:00
Chris Robinson
f97eca34df Minor source update fixes 2011-05-06 00:51:12 -07:00
Chris Robinson
1363e044ac Remove the head_dampen option
Now that HRTF is properly supported, it's not needed
2011-05-06 00:38:10 -07:00
Chris Robinson
9967d4eadd Mark a couple more pointers as restricted 2011-05-06 00:33:58 -07:00
Chris Robinson
2972de1047 Use function pointers to call the source mixer 2011-05-06 00:20:40 -07:00
Chris Robinson
0e824914b2 Use signed samples for 8-bit storage 2011-05-05 18:54:10 -07:00
Chris Robinson
7832a6d1d8 Add a warning when HRTF is disabled 2011-05-03 20:23:35 -07:00
Chris Robinson
0cce93a1f8 Fix WinMM backend compilation 2011-05-03 17:12:05 -07:00
Chris Robinson
679f2480c9 Add a device flag for channel config requests 2011-05-03 17:11:07 -07:00
Chris Robinson
db7ca2c7ca Combine the mono and multi-channel mixer templates 2011-05-03 16:34:28 -07:00