57 Commits

Author SHA1 Message Date
Chris Robinson
014936ceff Be more robust with PulseAudio capture
Particularly, handle "holes" in the record stream and premature end-of-buffer.
Also don't bail out when capturing while disconnected (the extension says it
should provide anything it previously reported available, going to silence for
anything no longer readable).
2019-04-27 21:25:42 -07:00
Chris Robinson
0577028b65 Add missing function pointers 2019-04-27 18:01:26 -07:00
Chris Robinson
c135629eae Remove some ancient PulseAudio KDE/Phonon/Qt hacks
Unfortuantely, the relevant KDE bug still seems to exist (streams are forced to
KDE's default device after opening, even when they're created with a specific
device at user request). I do not know why KDE thinks this is in any way good
behavior (the user doesn't get their desired device, nor does the stream get
the appropriate format for the device its ultimately put on), but making
streams non-movable as a workaround has been a thorn in the side of non-KDE
users for too long. C'mon KDE, it's been nearly (if not more than) 7 years now.
2019-04-27 14:13:07 -07:00
Chris Robinson
150dc92f68 Remove unused pa_threaded* functions 2019-04-27 13:06:39 -07:00
Chris Robinson
f9f34def82 Use a custom PulseAudio mainloop
This allows using RT priority again with the mixer. It also consolidates all
mainloop instances into one.
2019-04-27 12:25:49 -07:00
Chris Robinson
9e4ee500b6 Scale the update size with sample rate changes 2019-04-26 18:04:22 -07:00
Chris Robinson
f23ff0394d Specify the buffer size as itself instead of the period count
Certain backends don't need a buffer size to be a strict multiple of the period
count, which allows a little more flexibility. The period/update size simply
acts as the minimum request, which helps control CPU load by determining how
often parameter and other pre-mixing updates are processed.
2019-04-26 15:58:25 -07:00
Chris Robinson
87e279082f Don't round the PulseAudio write size to the period multiple 2019-04-17 05:51:40 -07:00
Chris Robinson
09dbc4c2da Fix PulseAudio backend initialization 2019-04-16 17:23:28 -07:00
Chris Robinson
61f7e7716c Remove the backend factory deinit method
It was never actually called anywhere, and there's no safe place where it can
be called. It's probably better to let the individual backends worry about
cleaning themselves up anyway.
2019-04-14 04:05:07 -07:00
Chris Robinson
095a0b9beb Set the EARLY_REQUESTS flag for PulseAudio when possible 2019-03-26 17:03:31 -07:00
Chris Robinson
9695952c8d Rename DevProbe enum names 2019-03-19 00:24:54 -07:00
Filip Gawin
6ddb2c36fc Remove redundant void argument list in function def 2019-01-09 19:43:54 +01:00
Filip Gawin
4169c6f37d Use c++ headers 2019-01-09 19:42:40 +01:00
Filip Gawin
0d3a0635d9 Avoid using old style casts
To think about:
examples/alffplay.cpp:600
OpenAL32/Include/alMain.h:295
2019-01-08 19:42:44 +01:00
Chris Robinson
3df1d185f8 Don't make the backend's lock/unlock methods noexcept 2018-12-29 17:29:52 -08:00
Chris Robinson
71a4d6db6f Return a unique_ptr for the backend 2018-12-29 02:16:16 -08:00
Chris Robinson
3c637d5fd7 Make the backend type an enum class 2018-12-29 01:38:26 -08:00
Chris Robinson
3d92e8c4df Convert the backends to use proper inheritence 2018-12-28 22:56:20 -08:00
Chris Robinson
67b874328d Use static_cast instead of reinterpret_cast where possible 2018-12-28 16:13:28 -08:00
Chris Robinson
200e267b81 Turn some more methods into member functions 2018-12-28 12:58:01 -08:00
Chris Robinson
aff58265cb Make more methods into member functions 2018-12-27 23:37:24 -08:00
Chris Robinson
e48b8c4cda Rename some more struct members for consistency 2018-12-27 17:09:14 -08:00
Chris Robinson
f2c2b7c538 Get rid of the unnecessary STATIC_(UP)CAST macros 2018-12-27 14:27:35 -08:00
Chris Robinson
4782d6107d Use a proper constructor/destructor for the ALCbackend base 2018-12-27 13:40:43 -08:00
Chris Robinson
6a8c791e3c Rework the pulseaudio backend to avoid an explicit mixer thread 2018-12-25 16:31:31 -08:00
Chris Robinson
0314370eb5 Cache the process binary path and name 2018-12-25 11:27:22 -08:00
Chris Robinson
fbae41020d Remove extraneous typedef, struct, and enum keywords 2018-12-24 19:29:01 -08:00
Chris Robinson
0214a11024 Use inline methods for the device format sizes 2018-12-19 05:57:36 -08:00
Chris Robinson
c3c0a5022a Don't bother with (really) old pulseaudio headers 2018-11-28 15:09:19 -08:00
Chris Robinson
461ef4196e Avoid using ATOMIC_LOAD on ALCdevice::Connected 2018-11-26 18:07:52 -08:00
Chris Robinson
04c2802a82 Rename some struct members 2018-11-26 17:31:04 -08:00
Chris Robinson
9e10f632c7 Replace remaining uses of std::vector with al::vector
Which uses a custom allocator that uses our allocation functions.
2018-11-24 16:58:49 -08:00
Chris Robinson
d26b5d9467 Use proper time types for the device clock time and latency 2018-11-22 14:32:48 -08:00
Chris Robinson
bafcba7194 Use a std::string for the device name 2018-11-18 18:45:45 -08:00
Chris Robinson
8b8f01e25d Avoid more cases of an enum variable and type name clash 2018-11-18 08:01:50 -08:00
Chris Robinson
7b537c795b Don't pass the current thread to althrd_setname 2018-11-17 06:07:04 -08:00
Chris Robinson
e716c7b988 Convert the PulseAudio backend factory 2018-11-15 19:57:21 -08:00
Chris Robinson
7b3a2085aa Use a regular char* for the device's name 2018-11-15 06:23:01 -08:00
Chris Robinson
9d9d626d99 Avoid some more uses of al_string 2018-11-15 05:33:02 -08:00
Chris Robinson
1971d0f5c6 Use std::string instead of al_string for enumerating 2018-11-15 04:24:33 -08:00
Chris Robinson
6ae217d005 Fix some comment indentation 2018-11-13 23:26:42 -08:00
Chris Robinson
4793e5c4ae Use C++ for GetProcBinary 2018-11-11 16:09:24 -08:00
Chris Robinson
a7dcc1c6d1 Expand the anonymous namespaces 2018-11-02 14:56:10 -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
434582b8e3 Use an anonymous namespace instead of static for some things 2018-11-01 20:18:51 -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