72 Commits

Author SHA1 Message Date
Chris Robinson
080e2cd16f Match exactly 5.1 Rear in WASAPI
So 7.1 and other configurations like it aren't detected as 5.1 Rear despite
having side channels.
2022-06-16 18:32:59 -07:00
Chris Robinson
9bf630c9d6 Handle a blank channel mask from WASAPI
Without a channel mask, the channels are treated as "raw" or unknown. Auto-
detection will only go up to stereo (assuming the first two channels are front-
left and front-right), while explicit requests will work as long as there are
enough channels (the user is responsible for ensuring a correct setup).
2022-06-14 03:24:23 -07:00
Chris Robinson
14e6d3836a Check and handle 5.1 Rear with WASAPI capture 2022-06-07 23:53:03 -07:00
Chris Robinson
d923f2d0a6 Trace the WASAPI device mix format 2022-06-07 18:58:44 -07:00
Chris Robinson
4750e553f1 Track 5.1 Rear with WASAPI playback 2022-06-07 18:50:28 -07:00
Chris Robinson
54d72d17ad Use the mix format if IsFormatSupported fails for WASAPI capture 2022-05-17 13:02:00 -07:00
Chris Robinson
593966c8db Handle 3D7.1 as a separate channel configuration
It's treated as 5.1 + 2 aux channels. This allows AL_DIRECT_CHANNELS_SOFT to
behave better, not forwarding rear left/right channel inputs to lower front and
upper rear, and allows reporting a more appropriate output mode to the app
instead of 7.1.
2022-04-26 23:32:15 -07:00
Chris Robinson
6c643e59e9 Make a couple more operator bools explicit 2022-02-20 22:04:19 -08:00
Chris Robinson
4de789ba68 Don't change the requested format when it's usable with WASAPI 2021-10-25 06:37:48 -07:00
Chris Robinson
d0e5e138e2 Use a flag to indicate headphone-like output 2021-10-23 07:51:06 -07:00
Chris Robinson
b841ce5e17 Properly check the channel count for WASAPI capture 2021-08-23 00:04:43 -07:00
Chris Robinson
643c1648fb Don't store "OpenAL Soft on " in WASAPI device names
It's still prepended for enumeration, just not part of the name in the DevMap.
2021-08-22 19:26:09 -07:00
Chris Robinson
29fba79cd5 Avoid 5.1Rear as its own channel configuration
It messes with 5.1 sources using direct channels, and the surround channels are
supposed to map to the side labels. Individual backends can deal with the
channel order/label differences, as they already do to a degree.
2021-07-30 07:38:26 -07:00
Chris Robinson
061148072f Update include headers
Don't add alc/ to the include paths.
2021-04-27 16:04:54 -07:00
Chris Robinson
581174ef98 Use the DeviceBase for the backend 2021-04-24 09:03:14 -07:00
Chris Robinson
519672c8e5 Move some more sources to core 2021-04-24 03:47:23 -07:00
Chris Robinson
d2f587ee23 Move helpers.cpp to core 2021-04-22 03:15:26 -07:00
Chris Robinson
743f0931c6 Don't activate the WASAPI device when initially opening it 2021-03-17 17:03:35 -07:00
Chris Robinson
f11fef9ee5 Avoid returning objects with a reference parameter 2021-03-16 22:40:23 -07:00
Chris Robinson
24b030d6bd Check that CoCreateInstance succeeds 2021-03-16 16:56:11 -07:00
Chris Robinson
1d57db6836 Move the ComPtr wrapper to a common header 2021-03-08 22:47:50 -08:00
Chris Robinson
730c964029 Allow calling BackendBase::open multiple times on playback devices
It will not be called while the device is running. If the first call succeeds,
a subsequent call that happens to fail must leave the existing device state as
it was so it can be resumed.

This is a rough first pass. It will fail when trying to re-open the same device
which can only be opened once (for instance, with direct hardware access, on
hardware that doesn't do its own mixing). Some backends won't guarantee the new
device is usable until the reset() or start() call.
2021-03-08 22:29:40 -08:00
Chris Robinson
da59ad5105 Make PopCount and CountTrailingZeros more standard-like 2021-01-22 04:58:42 -08:00
Chris Robinson
5ff5fd8ecc Use a standard bitset for bitfield flags 2021-01-22 00:00:10 -08:00
Chris Robinson
eedc42890f Move alexcpt to core 2020-12-24 22:49:55 -08:00
Chris Robinson
6ae0115bf7 Avoid AL/ALC types in the backends 2020-12-17 23:21:45 -08:00
Chris Robinson
5edd5a11fc Don't use ALC error enums for the backend error code 2020-12-17 21:07:53 -08:00
Chris Robinson
4d1ac95ae2 Don't return an enum from captureSamples
It's always no_error
2020-12-17 03:06:52 -08:00
Chris Robinson
d578bc6cb1 Move logging to core 2020-12-17 02:47:03 -08:00
Chris Robinson
303ca3af72 Use inline functions for popcnt and ctz instead of macros 2020-10-13 01:21:44 -07:00
Chris Robinson
7fb6d64ca8 Be more robust with to-mono channel conversions 2020-10-05 22:30:23 -07:00
Chris Robinson
7361e108a3 Fix a variable name 2020-10-05 00:17:13 -07:00
Chris Robinson
cf298075b5 Round (and clamp) the reftime instead of ceiling it 2020-09-12 00:47:04 -07:00
Chris Robinson
33d91ceeec Avoid repeating string literals 2020-09-11 01:40:36 -07:00
Chris Robinson
73f5331305 Use an RAII wrapper to manage COM object references 2020-09-05 12:32:41 -07:00
Chris Robinson
88f7617807 Avoid duplicate WASAPI devices by matching GUIDs 2020-09-04 18:32:06 -07:00
Chris Robinson
b12cd77d32 Use a wait predicate instead of a while loop 2020-08-12 10:00:43 -07:00
Chris Robinson
e8b3e82f96 Change a couple functions into member functions 2020-08-07 06:22:39 -07:00
Chris Robinson
bd0144065a Set channel labels from WFX channel masks 2020-06-15 20:21:54 -07:00
Chris Robinson
6ce9bf6c94 Move a couple related functions to the backend base 2020-06-12 12:53:47 -07:00
Chris Robinson
4094135ed7 Don't return a bool from the backend start method 2020-04-28 19:25:58 -07:00
Chris Robinson
02d7fbfa0c Use standard attribute declarations 2020-04-13 23:27:56 -07:00
Chris Robinson
d67cba99bd Clean up some more unnecessary uses of AL types 2020-04-08 10:15:43 -07:00
Chris Robinson
662d77159b Get rid of a redundant enum 2020-03-30 16:00:02 -07:00
Chris Robinson
f2ddf971df Return the enumerated device names from the backend
Rather than using an out parameter.
2020-03-30 15:37:41 -07:00
Chris Robinson
9b237790b2 Remove the mutex from the backend base 2020-03-29 23:57:37 -07:00
Chris Robinson
cc27bbb680 Clear the WASAPI device list when enumerating 2020-03-24 11:48:25 -07:00
Chris Robinson
62f17d8763 Don't send close messages for unopened WASAPI devices 2020-03-24 11:40:34 -07:00
Chris Robinson
9ce182228d Avoid some pre-C++14 workarounds 2020-03-22 08:51:06 -07:00
Chris Robinson
eb49290dab Remove unnecessary locks now that the mixer doesn't require one 2020-02-26 04:58:02 -08:00