839 Commits

Author SHA1 Message Date
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
Chris Robinson
f8299c60ec Log the reset exception error 2021-04-07 16:17:03 -07:00
Chris Robinson
a2c45f8928 Advertise the in-progress AL_SOFT_UHJ extension 2021-04-01 08:20:47 -07:00
Chris Robinson
c6dbc487b3 Rename Uhj2Encoder to UhjEncoder 2021-04-01 05:37:54 -07:00
Chris Robinson
e457018921 Avoid passing an array of pointers 2021-04-01 03:44:26 -07:00
Chris Robinson
f33edc3b30 Add support for 4-channel UHJ
Also add the SOFT moniker to the new macros
2021-03-31 21:02:30 -07:00
Chris Robinson
b5e36007f1 Handle 3-channel UHJ audio buffers 2021-03-31 10:03:31 -07:00
Chris Robinson
35a0f2665f Decode UHJ buffers to B-Format for mixing
This should also have an adjustment for the shelf filter. Although it's not
clear what the appropriate adjustments should be.
2021-03-31 09:37:30 -07:00
Chris Robinson
8793055e66 Start an interface for providing UHJ audio
Currently only 2-channel UHJ, which gets treated as stereo.
2021-03-31 05:37:56 -07:00
Chris Robinson
051d6fb243 Combine some duplicate code 2021-03-30 07:04:06 -07:00
Chris Robinson
8ab5e5dba2 Move the UHJ phase shifter to a common header 2021-03-28 06:09:11 -07:00
Chris Robinson
9a31dcf84f Don't add the resampler prepadding to the source size to load 2021-03-23 19:55:44 -07:00
Chris Robinson
063da94bd8 Load/convert samples from all channels at once for mixing
This uses a bit more memory (each voice needs to hold buffers for the
deinterleaved samples of each channel, instead of just one buffer for the
current channel being mixed on the device), but it will allow for handling
formats that need or prefer their channels decoded together.
2021-03-19 23:15:27 -07:00
Ilya Fedin
b7ff1de48e Don't force application name with pulseaudio 2021-03-18 04:34:57 +04: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