39 Commits

Author SHA1 Message Date
Chris Robinson
9cd086a707 Filter unneeded thread messages with MMDevApi 2012-12-24 05:37:53 -08:00
Chris Robinson
1fb9311d82 Lock the device before calling aluHandleDisconnect
PulseAudio causes an assert if being relocked inside a callback on the worker
thread, where aluHandleDisconnect is called. We can assume it's already locked
there, so just make sure the device is locked before being calling it.
2012-12-02 11:30:23 -08:00
Chris Robinson
3da1b540fd Use the stored buffer metrics for the mmdevapi buffer size 2012-11-04 22:35:35 -08:00
Chris Robinson
92dde81296 Add rudimentary latency tracking for mmdevapi
This won't be as granular as it could be, since it only updates when the wakeup
event trips (which may or may not happen more often than OpenAL's mix updates).
A more correct method would be to query GetCurrentPadding directly, but that
would require sending a message to the processing thread and waiting for a
reply, since we can't guarantee COM on the calling thread.
2012-11-04 08:35:39 -08: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
46840ee787 Add DEVPKEY_Device_FriendlyName declaration for mingw-w64 compatibility 2012-06-14 18:10:10 -07:00
Chris Robinson
259e4f5b38 Rename AllDevice -> AllDevices 2012-05-09 16:28:16 -07:00
Chris Robinson
511b4790d0 Remove hungarian notation from dsound and mmdevapi 2012-04-19 23:42:02 -07:00
Chris Robinson
b023dbe7b8 Remove hungarian notation from the device and context structs 2012-04-19 22:50:11 -07:00
Chris Robinson
5c59e6e704 Try to ensure the full mmdevapi buffer is used 2012-03-13 01:39:57 -07:00
Chris Robinson
ef2f237276 Try to ensure at least 2 mmdevapi updates 2012-03-13 01:35:31 -07:00
Chris Robinson
0af14c7a11 Try to find a multiple of mmdevapi's period size nearest to the wanted update size 2012-03-13 01:32:15 -07:00
Chris Robinson
dddacc25a5 Store a duplicate of the mmdevapi device ID 2012-03-06 13:15:55 -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
8d24bd720f Don't use GUIDs to ID mmdevapi devices, and don't enumerate if not needed 2012-03-01 06:07:00 -08:00
Chris Robinson
ae1633497c Get and release the mmdevapi render client iface on the message thread 2012-02-29 05:54:58 -08:00
Chris Robinson
00b0e64bd2 Use local variables to determine how much to write to mmdevapi 2012-02-29 00:32:20 -08:00
Chris Robinson
da4408835d Print the mmdevapi device and GUID found 2012-02-26 21:59:27 -08:00
Chris Robinson
484e8f07a0 Watch for CLSIDFromString errors 2012-02-23 21:41:24 -08:00
Chris Robinson
2b64df05e6 Avoid using a default name with the MMDevApi backend 2012-02-20 21:46:01 -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
bbc679a5db Minor MMDevApi cleanups 2012-02-18 13:08:54 -08:00
Chris Robinson
eb8be88866 Use the correct type to store the count from IMMDeviceCollection_GetCount 2012-02-17 12:31:53 -08:00
Chris Robinson
e43e1bd7f5 Silence another MSVC warning 2012-02-17 01:32:35 -08:00
Chris Robinson
eb586b0ed7 Initialize a variable before use 2012-02-17 01:30:41 -08:00
Chris Robinson
10257f485a Support device enumeration with mmdevapi 2012-02-16 17:04:08 -08:00
Chris Robinson
deee6a73f0 Fix a device count leak and make sure COM is cleaned up if an mmdevice open fails 2012-02-16 10:08:50 -08:00
Chris Robinson
5d17cef55f Calculate the buffer time before modifying the frequency 2012-02-15 22:54:17 -08:00
Chris Robinson
70f1a7e3ca Get the mmdevapi device period after initialization 2012-02-15 22:40:01 -08:00
Chris Robinson
1140b3ae83 Support signed and unsigned 32-bit int output 2012-02-14 11:44:57 -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
319f40462f Initialize/Uninitialize COM as needed 2011-10-24 22:11:16 -07:00
Chris Robinson
044774ed72 Rename the MMDevAPI backend's MessageProc function 2011-09-24 13:55:44 -07:00
Chris Robinson
390d94ec97 Define _WIN32_WINNT on the command line with _WIN32 2011-09-20 14:59:01 -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