49 Commits

Author SHA1 Message Date
Chris Robinson
28a9f0826c Use a macro for the record thread name 2014-12-21 10:38:40 -08:00
Chris Robinson
bdbf6613ef Support B-Format output with the wave file writer 2014-11-25 22:20:00 -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
9dacd89a02 Convert the winmm backend to the new backend API 2014-09-08 06:46:20 -07:00
François Cami
3c13e1e333 Update COPYING to the latest https://www.gnu.org/licenses/old-licenses/lgpl-2.0.txt to fix the FSF' address Fix the FSF' address in the source 2014-08-18 11:34:29 -07:00
Chris Robinson
d0a64fe191 Don't require pre-declaring vector types 2014-07-06 03:27:39 -07:00
Chris Robinson
1d2504d12e Make RefCount a non-integer type
It should only be accessed through the appropriate functions to ensure proper
atomicity.
2014-05-14 02:47:07 -07:00
Chris Robinson
f150676873 Add a helper VECTOR_FOR_EACH macro 2014-04-30 12:30:02 -07:00
Chris Robinson
a4cf378af8 Use a helper method to clear winmm device lists 2014-04-24 01:25:26 -07:00
Chris Robinson
9af8e10c20 Avoid using superfluous LP* types 2014-04-23 10:08:33 -07:00
Chris Robinson
0b527621a5 Use a RefCount for counting committed winmm buffers 2014-04-23 05:08:17 -07:00
Chris Robinson
ca1008571e Use the althrd methods in winmm 2014-04-21 09:35:17 -07:00
Chris Robinson
dbe0897c7f Use the stored format block align instead of calculating it 2014-04-20 22:29:54 -07:00
Chris Robinson
36df67f546 Rename SetThreadName to althrd_setname 2014-04-17 20:41:32 -07:00
Chris Robinson
1290f37750 Silence an MSVC warning about -1u 2014-04-07 13:55:22 -07:00
Chris Robinson
4f1104125b Use an al_string vector for winmm device names
Also now gets wchar device names, to properly convert to UTF-8
2014-04-07 12:43:19 -07:00
Chris Robinson
7b93e10f7a Use an al_string for the device name 2014-03-28 22:11:34 -07:00
Chris Robinson
80ea801204 Add a macro for GCC to ensure stack alignment 2013-11-25 17:29:39 -08:00
Chris Robinson
10dbb1bc9b Remove the Lock and Unlock methods from BackendFuncs
All backends that still use the old interface use the default locking methods,
which is also used by the ALCbackend base.
2013-11-04 23:34:18 -08:00
Chris Robinson
8ceb800def Rework threading functions 2013-10-27 08:14:13 -07:00
Chris Robinson
f93bfab824 Set a name for the mixer and recording threads 2013-10-27 07:00:44 -07:00
Chris Robinson
32e85d469b Use the UNUSED macro in the backends 2013-10-07 08:00:18 -07:00
Chris Robinson
0f3a575a09 Don't include alu.h in alMain.h 2012-09-14 02:14:29 -07:00
Chris Robinson
37924887e8 Use a default method to provide a dummy latency 2012-08-19 12:31:59 -07:00
Chris Robinson
0865db564f Move the device lock into the backend function table
For backend-specific implementations: this should hold the audio mixer loop for
playback devices, and provide recursive mutex behavior.
2012-08-18 15:58:04 -07:00
Chris Robinson
ac4fc4026c Add a device method to retrieve the active latency
This is effectively the time until the next update will be heard by the user,
or the closest approximation thereof, in nanoseconds.
2012-08-17 13:38:52 -07:00
Chris Robinson
259e4f5b38 Rename AllDevice -> AllDevices 2012-05-09 16:28:16 -07:00
Chris Robinson
cff0f938e5 Remove hungarian notation from the winmm backend 2012-04-19 23:22:11 -07:00
Chris Robinson
5418519637 Remove some more hungarian notation 2012-04-19 23:00:58 -07:00
Chris Robinson
b023dbe7b8 Remove hungarian notation from the device and context structs 2012-04-19 22:50:11 -07:00
Chris Robinson
f2b64fd111 Update the ALCdevice in winmm's reset method instead of open 2012-03-06 10:14:05 -08:00
Chris Robinson
fe6e532c87 Use a separate backend callback to start playback of the device
This allows us to properly update the ALCdevice and its resources with the new
parameters before starting playback, instead of expecting the mixer to block
and wait after it has begun.

This also lets us avoid holding the device lock while resetting and starting
the device, which helps prevent lock inversion on some backends (ie, one thread
locking A then B, and another thread locking B then A), ultimately allowing
certain backends to asynchronously update the ALCdevice without risk of lockup.
Capture still has issues here, however.
2012-03-05 07:11:09 -08:00
Chris Robinson
14912229b1 Avoid default names for winmm and dsound 2012-02-20 22:03:08 -08:00
Chris Robinson
e2ccc6f98e Always use "OpenAL Soft" for the short device enumeration list 2012-02-20 20:45:22 -08:00
Chris Robinson
7e9af6f406 Use a switch to check the device format with winmm 2012-02-15 21:13:13 -08:00
Chris Robinson
1140b3ae83 Support signed and unsigned 32-bit int output 2012-02-14 11:44:57 -08:00
Chris Robinson
0ef3a30b84 Fix WaveIn shutdown for real
The processing thread must be messaged when shutting down, and depending on the
state of the device, waveInReset may not do it. Additionally, all buffers must
be removed from the device before they can be unprepared and the device closed.
2012-01-20 12:36:23 -08:00
Chris Robinson
2b2ce8bf3b Always message the WinMM processing thread when a buffer is done
So the processing thread can keep track of completed buffers when shutting
down, too.
2012-01-20 12:06:31 -08:00
Chris Robinson
47c8c15878 Fix a possible race condition when shutting down WinMM devices
If the processing threads are interrupted between the shutdown check and re-
adding the buffer back to the device, the device can be left with a buffer that
will get unprepared and freed while in use.
2012-01-20 03:02:21 -08:00
Chris Robinson
ae7b61b040 Avoid printing messages about device parameter changes in the backends 2012-01-17 16:38:58 -08:00
Chris Robinson
a7266442c2 Retry opening the WinMM device with 16-bit short if 32-bit float output fails 2012-01-17 12:21:52 -08:00
Chris Robinson
cf34b9c04e Support 32-bit float in the WinMM backend 2012-01-17 12:17:41 -08:00
Chris Robinson
390d94ec97 Define _WIN32_WINNT on the command line with _WIN32 2011-09-20 14:59:01 -07:00
Chris Robinson
cc3dd648ac Check the number of available samples before calling the capture method 2011-09-18 20:27:34 -07:00
Chris Robinson
97024151e4 Return an error from the CaptureSamples method instead of setting it 2011-09-14 02:01:35 -07:00
Chris Robinson
ccc2644e6b Free the WaveIn buffers' data after unpreparing them all 2011-08-25 11:33:13 -07:00
Chris Robinson
7e2155d937 Return an ALC error enum from the OpenCapture backend method 2011-08-24 14:44:15 -07:00
Chris Robinson
c696d4dbb2 Return an ALC error enum from the OpenPlayback backend method 2011-08-24 14:24:48 -07:00
Chris Robinson
9989f33fc2 Move backend sources to a separate sub-directory 2011-08-20 00:41:47 -07:00