494 Commits

Author SHA1 Message Date
Chris Robinson
e9d17c5191 Move wstr_to_utf8 to compat.h 2018-11-03 12:55:02 -07:00
Chris Robinson
a7dcc1c6d1 Expand the anonymous namespaces 2018-11-02 14:56:10 -07:00
Chris Robinson
b54c4b02c7 Add a wrapper to manage PROPVARIANT objects 2018-11-02 13:32:42 -07:00
Chris Robinson
aaa31d987f Check the correct propvariant object 2018-11-02 00:42:50 -07:00
Chris Robinson
d66664122a Try another fix to declare GUIDs in C++ 2018-11-02 00:13:07 -07:00
Chris Robinson
66df771d96 Make the polymorphism macros less hacky in C++
In particular, it relies on derived structs using C++-style inheritence. Any
implementation's source that's converted to C++ will consequently need to make
that change.
2018-11-01 23:52:53 -07:00
Chris Robinson
7307c2d5aa Workaround some issue with DEFINE_GUID in C++ 2018-11-01 21:42:26 -07:00
Chris Robinson
a90b17113a Use more C++ types where possible 2018-11-01 21:39:34 -07:00
Chris Robinson
434582b8e3 Use an anonymous namespace instead of static for some things 2018-11-01 20:18:51 -07:00
Chris Robinson
1ca4e268f6 Preliminary conversion of the WASAPI backend to C++
A very sparse conversion. Will clean up more later after seeing what MSVC does.
2018-11-01 16:26:42 -07:00
Chris Robinson
11967dc2da Use a wrapper function to simplify a check 2018-11-01 16:00:16 -07:00
Chris Robinson
69162cf9c6 Use perfect forwarding to initialize DevMap entries 2018-11-01 13:12:42 -07:00
Chris Robinson
cd68530ab4 Simplify a couple loops 2018-11-01 11:44:11 -07:00
Chris Robinson
5d092a1c58 Use the appropriate enums for standard atomics 2018-11-01 08:43:31 -07:00
Chris Robinson
d28c0eb556 Avoid uniform initialization with references
Also doesn't work with GCC 4.x
2018-11-01 08:41:23 -07:00
Chris Robinson
48f877e859 Remove unused header 2018-11-01 08:19:51 -07:00
Chris Robinson
ccf356a03d Include a missing header for atomic 2018-11-01 08:17:23 -07:00
Chris Robinson
95966c4d92 Fix another use of auto uniform initialization 2018-11-01 08:15:47 -07:00
Chris Robinson
759c3a996c Avoid all uniform initialization with auto
Because of early C++11 (GCC 4.x) deficiencies, it's not interpreted correctly.
Either declare the type name explicitly with uniform initization, or use auto
with = initialization. It'll be fine when updating to GCC 5 or Clang 3.6.
2018-11-01 08:04:21 -07:00
Chris Robinson
353bb1ed17 Avoid uniform initialization on auto for integer types
To work around a deficiency with early C++11 compilers (GCC 4.x).
2018-10-31 22:10:26 -07:00
Chris Robinson
d41fbd5c2d Convert the PulseAudio backend to C++ 2018-10-31 20:09:14 -07:00
Chris Robinson
903d878460 Replace restrict with RESTRICT 2018-10-29 11:32:50 -07:00
Chris Robinson
c39eeb9638 Don't try to get the JNIEnv on Android
It's currently not used. More stuff is needed anyway which may need a different
approach.
2018-10-02 12:40:26 -07:00
Chris Robinson
79314c4461 Include the limiter's lookAhead delay in the device latency 2018-09-25 23:05:27 -07:00
Chris Robinson
952ff84b99 Properly queue buffers for OpenSL capture 2018-09-17 23:43:23 -07:00
Chris Robinson
b77e6096b8 Fix some potential race conditions with OpenSL
For playback, increment the ring buffer's write pointer before queueing audio,
to handle cases where the callback is invoked, advancing the read pointer,
before the write pointer is advanced.

For capture, limit the number of re-queued chunks to the number of fully read
chunks.
2018-09-17 22:49:52 -07:00
Chris Robinson
275658b6db Some suggested changes for iOS 2018-09-07 23:01:17 -07:00
Chris Robinson
46cfedb117 Pass the device name list to the backend probe method 2018-09-07 22:02:37 -07:00
Chris Robinson
212cb8e298 Implement capture support for SoundIO 2018-09-07 20:08:24 -07:00
Chris Robinson
7394dd512d Rename ALCsndioBackend 2018-09-07 18:45:24 -07:00
Chris Robinson
24b646dec0 Append the OpenSL capture device to the appropriate list 2018-08-23 18:20:09 -07:00
Chris Robinson
fd1458ce1b Always prepare the ALSA PCM handle before starting capture
Draining the ALSA device via stopping puts it into a setup state, which
requires re-preparing before playback can start again. Preparing it prior to
the first start seems to cause no harm, so just always do it before starting.
2018-06-08 05:02:47 -07:00
Chris Robinson
525b6fe168 Clear ALSA's PCM handle after closing it 2018-04-19 12:22:39 -07:00
Chris Robinson
414b56edec Initialize COM using the multithreaded apartment
I honestly have no idea which is the correct (or better) mode to use given the
confusing mess COM is, but CoInitialize uses single-threaded apartments which
seems to be a problem for with at least a couple games in the STALKER series
(the call fails, which causes us to drop back to the DSound backend).
2018-04-01 16:39:20 -07:00
Chris Robinson
e5e3b05015 Fix capture device closing in the CoreAudio backend 2018-03-24 09:25:49 -07:00
Chris Robinson
e37634e908 Remove an unused struct and move some functions to where they're used 2018-03-23 11:58:11 -07:00
Chris Robinson
63c9d95b84 Combine multiple allocations into one 2018-03-23 11:39:07 -07:00
Chris Robinson
603e3e23ac Remove an outdated comment 2018-03-14 23:51:13 -07:00
Chris Robinson
2011421e18 Release the PulseAudio mainloop lock sooner 2018-03-14 23:48:46 -07:00
Chris Robinson
f65e83c349 Avoid using pa_stream_begin_write with PulseAudio
It seems to actually have a negative performance impact when the system is
under load. Without having actual measurements for any potential benefits,
simply go with the recommended (and previous fallback) method of allocating
space for the write and passing the free method.

Ideally some kind of ring buffer could be used, so rather than constantly
allocating and freeing blocks of memory, it uses the same memory over again
with the callback marking each one as reusable. Unfortunately the callback
isn't given much information to work with, and the update size (minreq) can
potentially change during playback, which complicates things.
2018-03-14 03:21:26 -07:00
Chris Robinson
a6ddeaf5f1 Rename the mmdevapi backend to wasapi 2018-03-09 18:56:24 -08:00
Chris Robinson
30821e978b Add extern "C" to some headers 2018-03-09 17:24:03 -08:00
Chris Robinson
c0e7a5b8b0 Prefix SDL2 device names on Windows 2018-03-09 11:41:28 -08:00
Chris Robinson
8b24255557 Request the device's sample type for SDL2 2018-03-09 10:53:03 -08:00
Chris Robinson
46e7e96eb3 Store the frame size for the SDL2 backend 2018-03-08 22:23:36 -08:00
Chris Robinson
41cc82e84b Print the unsupported values from SDL2 2018-03-08 22:09:30 -08:00
Chris Robinson
2866c6cf28 Init and quit the SDL2 audio subsystem with the factory 2018-03-08 18:59:22 -08:00
Chris Robinson
aa7df8183f Also save the update size with SDL2 2018-03-08 18:22:03 -08:00
Chris Robinson
58760e6184 Use the audio device lock for the SDL2 backend 2018-03-08 18:16:10 -08:00
Chris Robinson
52ca70d98e Properly close the SDL2 audio device 2018-03-08 18:12:14 -08:00