1004 Commits

Author SHA1 Message Date
Chris Robinson
247a149115 MSVC doesn't like the decltype 2021-06-23 13:30:17 -07:00
Chris Robinson
9a7bca1116 Add wrapper methods for getting device config values 2021-06-23 10:45:24 -07:00
Chris Robinson
5b2489c3e8 Convert AmbDecConf to DecoderConfig for loading
This keeps AmbDecConf uses confined to multi-channel panning initialization,
and avoids spreading conversions and maps all over.
2021-06-23 09:44:58 -07:00
Chris Robinson
2b7c446363 Support built-in 3D ambisonic decoders 2021-06-23 03:22:54 -07:00
Chris Robinson
d28cf80b6f Allow querying ALC_ALL_DEVICES_SPECIFIER from loopback devices
They only return the default/driver name, since loopback devices don't have a
canonical name.
2021-06-22 03:25:31 -07:00
Chris Robinson
1c5a6ad92b Use a unique_ptr to hold raw byte memory 2021-06-21 03:54:49 -07:00
alexey.lysiuk
375838c473 Fix getting of device channel count in CoreAudio backend
AudioBufferList contains a variable length array of mNumberBuffers elements, so it should not be created with the default constructor like usual class instances.
Unfortunately, Apple developer site documentation is literally empty for this API. There is a bunch of comments in framework's header files.
Here is the correct usage of AudioBufferList pointer from Chromium: 008a1abc57/audio/mac/audio_manager_mac.cc (266)
There were occasional crashes because of memory corruption which was confirmed by address sanitizer
2021-06-21 13:24:45 +03:00
Chris Robinson
04a6e418d7 Fix some size types 2021-06-18 21:03:31 -07:00
Chris Robinson
a7d2e2974f Initial attempt at CoreAudio playback enumeration 2021-06-18 20:55:00 -07:00
Chris Robinson
76a9fdae75 Use a unique_ptr to auto-free the jack ports list 2021-06-12 14:19:55 -07:00
Chris Robinson
7e32478327 Set the JACK output ports as terminal
Since there are no input ports associated with the output.
2021-06-12 12:54:31 -07:00
Chris Robinson
241107faeb Give a name to a lambda 2021-06-11 13:43:01 -07:00
Chris Robinson
f5bcd12be1 Improve name duplication handling with JACK
If a custom device pattern matches an existing one, its name will be replaced.
A separate loop is used to check and handle duplicate display names.
2021-06-10 16:15:00 -07:00
Chris Robinson
debb932573 Add an option to mix directly in the JACK callback 2021-06-08 10:52:37 -07:00
Chris Robinson
58a9549a58 Handle the listener position separate from the rotation matrix
It's too unstable with larger vectors. Even when the source and listener
positions are the same, floating point precision can cause noticeable rounding
errors.
2021-05-25 14:08:16 -07:00
Chris Robinson
8d868ff33f Fix setting the channel distance compensation buffers 2021-05-20 23:48:43 -07:00
HALX99
2516fdee66
Handle tvOS case 2021-05-13 19:05:47 +08:00
Chris Robinson
1195bba833 Add back a missing include 2021-04-27 19:46:33 -07:00
Chris Robinson
e3c0b60cc6 Rename alcontext.h and move some functions to context.cpp 2021-04-27 19:04:45 -07:00
Chris Robinson
3d8e705107 Move some functions to a more appropriate place 2021-04-27 17:01:27 -07:00
Chris Robinson
06dcfc3fcf Rename alcmain.h to device.h 2021-04-27 16:40:22 -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
2571d9bbc4 Update some license notices
Permission to relicense was granted via email.
2021-04-27 11:56:29 -07:00
Chris Robinson
d06209ef5a Update includes 2021-04-27 08:39:17 -07:00
Chris Robinson
ff380298e4 Move BufferStorage and Voice to core 2021-04-27 08:26:42 -07:00
Chris Robinson
99157f149f Move ContextBase and VoiceChange to core 2021-04-27 08:04:09 -07:00
Chris Robinson
26c8c50c26 Partially implement an extension to hold sources on disconnect
Rather than stopping voices/sources when the device becomes disconnected, the
context can be set to leave them alone. As a consequence, their state will
remain as playing and they'll keep their last known sample offset indefinately.
For applications mindful of this behavior, it will allow resetting or reopening
the device to reconnect and automatically resume where it left off.
2021-04-26 20:25:24 -07:00
Chris Robinson
22a8ebff80 Move GetChannelIdxByName and clean up some more includes 2021-04-26 08:04:50 -07:00
Chris Robinson
2479483645 Move bformatdec to core 2021-04-25 18:08:08 -07:00
Chris Robinson
8d09d03ed3 Move async_event.h to core 2021-04-25 14:29:21 -07:00
Chris Robinson
0fe38c053d Move some functions to core
And clean up more includes
2021-04-25 11:36:37 -07:00
Chris Robinson
9b65ca4556 More include cleanup 2021-04-24 15:52:53 -07:00
Chris Robinson
440ce71dce Move GetHFOrderScales to a more appropriate place 2021-04-24 13:46:52 -07:00
Chris Robinson
fc7d55be4b Don't bother with al string types 2021-04-24 11:50:49 -07:00
Chris Robinson
e0e4a8c35d Update some includes 2021-04-24 11:45:50 -07:00
Chris Robinson
6d5dfbd09b Move the DeviceBase declaraction to core 2021-04-24 10:46:32 -07:00
Chris Robinson
581174ef98 Use the DeviceBase for the backend 2021-04-24 09:03:14 -07:00
Chris Robinson
b54bb388a3 Create a base the ALCdevice and ALCcontext structs
A base that contains the API-agnostic data, with ALCdevice and ALCcontext being
for AL-specific data.
2021-04-24 08:28:13 -07:00
Chris Robinson
519672c8e5 Move some more sources to core 2021-04-24 03:47:23 -07:00
Chris Robinson
7387148006 Use the root mean square for the HRTF B-Format HF scale
For the second-order decoder. Since the delays are adjusted to avoid most high
frequency phase cancelation, the energy-based scaling with the number of
channels used creates a significant HF increase. Using the RMS-based scaling
seems to create a more level response, though it's not perfect either. More
testing and measurements may be needed.
2021-04-24 03:12:05 -07:00
Chris Robinson
65b85f7cb9 Move hrtf.cpp/h to core 2021-04-22 10:26:20 -07:00
Chris Robinson
d6d6fd7378 Avoid using config methods in hrtf.cpp 2021-04-22 10:13:49 -07:00
Chris Robinson
d2f587ee23 Move helpers.cpp to core 2021-04-22 03:15:26 -07:00
Chris Robinson
f0154c4366 Move declarations to a more appropriate header 2021-04-22 03:00:05 -07:00
Chris Robinson
8f8e9aa913 Print an error when starting the backend fails 2021-04-20 22:03:56 -07:00
Chris Robinson
37730927ef Lower RLIMIT_RTTIME to allow RTKit to give RT priority 2021-04-20 07:35:42 -07:00
Chris Robinson
ccb1355cc8 Fill the PulseAudio buffer before uncorking playback 2021-04-19 04:42:28 -07:00
Chris Robinson
5165b29b19 Optionally use RTKit/D-Bus to set elevated priority
If pthread_setschedparam fails or is unavailable.
2021-04-18 00:43:01 -07:00
Chris Robinson
29cf7ebb75 Make an inverted atomic flag type and use it
The inverted atomic flag replaces test_and_set+clear with test_and_clear+set,
essentially inverting the flag status. This makes more logical sense for
flagging dirty state, which is less confusing than flagging clean state. The
one caveat is ATOMIC_FLAG_INIT (or default construction in C++20) initializes
the state to true rather than false.
2021-04-15 15:17:04 -07:00
Chris Robinson
4af6cfac7d Use per-HRIR delay alignment for B-Format-to-HRTF
For HOA signals, the number of responses used with slightly varying delays
causes noticeable attenuation in the higher frequencies because of destructive
phase interference. This is not a result of minimum phase alignment (attempts
to compensate for minimum phase had negligible results), nor does it affect
first-order signals (which only has 4 unique responses on each side).

This alternate alignment is only used when doing second-order rendering for
HRTF output, which is not the default with HRTF. It's likely not very ideal,
but it's necessary to prevent second-order rendering with HRTF from sounding
muffled.
2021-04-09 11:36:58 -07:00