7542 Commits

Author SHA1 Message Date
Chris Robinson
c1f0555fef Workaround mingw complaining about the %z formatter 2021-03-12 03:14:29 -08:00
Chris Robinson
ca0a6024a3 Avoid shadowing variable names 2021-03-11 04:59:58 -08:00
Chris Robinson
e43bbbd3b8 Declare the attribute counts closer to where they are 2021-03-10 02:46:01 -08:00
Chris Robinson
d750983a58 Prevent querying the capture device name from a playback device
And vice-versa.
2021-03-09 07:09:27 -08:00
Chris Robinson
5e481e7654 Don't verify and hold a device reference in alcRenderSamplesSOFT
NULL devices are still checked, but invalid non-NULL device handles will invoke
undefined behavior, as will attempting to close the device while the function
is being executed (modifying the device state while the function is being
called was inadvertently already UB, and will now remain so).

This change is solely so alcRenderSamplesSOFT can be used in a buffer callback,
and other places that need functions to be real-time safe. The verification
requires locking to access the device list, which isn't allowed in a real-time
callback.
2021-03-09 06:01:27 -08:00
Chris Robinson
e824c808a0 Add a function/extension to reopen a playback device 2021-03-09 05:52:40 -08:00
Chris Robinson
e6c7cdc1ba Initialize the new audio unit before disposing the old one 2021-03-09 02:55:01 -08: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
0f7ed495e1 Use a fast native type for the backup popcount 2021-03-02 22:58:36 -08:00
Chris Robinson
ffc3859a8d Use the correct lock when allocating filters 2021-03-02 19:59:33 -08:00
Chris Robinson
727503acdb Avoid making BSincPointsMax public 2021-03-01 17:48:07 -08:00
Chris Robinson
9f349c21e7 Avoid cutting off the last bsinc filter coefficient 2021-03-01 01:03:44 -08:00
Chris Robinson
6102cdae02 Avoid trying to get the app path when it fails on Windows too 2021-02-27 17:10:50 -08:00
Chris Robinson
4179633440 Avoid calling readlink on platforms that don't support it
Also don't keep trying to find the path+name if it fails the first time.
2021-02-27 13:09:43 -08:00
Chris Robinson
6e676b81d5 Avoiding cutting all bsinc resampler output at scale 0
This is mostly for the SampleConverter, used by some capture backends. When
recording at really low rates, like 5512hz, with a device capturing at a higher
rate like 44100hz or 48000hz, it hits the filter's downscaling limit and
produces pure silence.

In such cases, it's better to just accept some aliasing noise so that the app
will still get some recognizable audio. The alternative would be to scale the
desired rate by 2x, 3x, etc until it's above the bsinc limit, then take every
2nd, 3rd, etc sample of the result as if by an extra simpler resampler pass.
2021-02-24 22:21:18 -08:00
Chris Robinson
5511bffdeb Use a more appropriate epsilon for Sinc() 2021-02-24 20:17:27 -08:00
Chris Robinson
e1d62e2e77 Avoid an unnecessary loop iteration 2021-02-23 21:07:34 -08:00
Chris Robinson
5647aa4042 Adjust the bsinc filter table packing
Now each scale's filter and phase delta are interleaved for each phase index,
followed by the scale and scale+phase delta for each phase index. This ensures
no holes in the filter coefficients for the fast bsinc resampler for a given
run, while keeping the scale deltas in the same vicinity for the non-fast bsinc
resampler.
2021-02-23 18:48:02 -08:00
Chris Robinson
25d25f9a80 Remove unnecessary use of SSE2 intrinsics
The compiler is producing the same results either way, since the upper bit
results are never used.
2021-02-21 07:01:10 -08:00
Chris Robinson
28aaaab434 Store the all-pass FIR results more efficiently 2021-02-18 14:58:03 -08:00
Chris Robinson
89ddad8487 Use shifts instead of shuffles with SSE where possible 2021-02-18 14:05:50 -08:00
Chris Robinson
8fd83778b8 Add some optimization hints 2021-02-16 05:49:09 -08:00
Chris Robinson
9665171ea3 Clean up some formatting 2021-02-16 05:48:42 -08:00
Chris Robinson
302e88dbf0 Add missing include 2021-02-16 05:42:14 -08:00
Chris Robinson
698799da0e Add enumeration to the JACK backend
Port names seem to be structured as <device_name:channel_name> or
<app_name:channel_name>. I'm not sure if this is always the case, but it seems
some other apps expect something like this.

Also fix the port selection to exclude MIDI ports and allow non-physical ports.
2021-02-13 00:45:38 -08:00
Chris Robinson
76d9897bc3 Add the all-pass filter results to the output with NEON 2021-02-08 15:25:42 -08:00
Chris Robinson
dfe627133c Use spans instead of references to arrays 2021-02-06 14:39:30 -08:00
Chris Robinson
72c4dd4d10 Add a alSourceQueueBufferLayersSOFT stub
For compatiblity with apps that may have directly linked to it on accident.
2021-02-04 13:09:31 -08:00
Chris Robinson
ae4eacf147 Release 1.21.1 2021-02-04 11:09:06 -08:00
Chris Robinson
17cf1848fb Update changelog 2021-02-02 19:15:17 -08:00
Chris Robinson
b8a4ebd594 Stop the Oboe recording stream when recording is stopped
Hopefully Oboe will retain any unread samples and let them be read.
2021-02-02 19:12:56 -08:00
Chris Robinson
63f5240db2 Implement Oboe capture 2021-01-31 21:07:49 -08:00
Chris Robinson
27bcc55e81 Set the oboe stream buffer size 2021-01-31 19:57:11 -08:00
Chris Robinson
0c510416db Add a comment about using lld on Android 2021-01-31 13:24:58 -08:00
Chris Robinson
bedb89eb09 Avoid copying buffers for aligning overlapped windows 2021-01-30 15:11:47 -08:00
Chris Robinson
a96b91afd3 Update changelog 2021-01-29 22:36:10 -08:00
Chris Robinson
20057b848c Calculate the square root after checking the limit 2021-01-29 09:56:38 -08:00
Chris Robinson
0cd5c37c20 Allow the sample type to get changed on Solaris 2021-01-29 07:37:13 -08:00
kcat
a2452d8222
Merge pull request #524 from Cacodemon345/patch-1
Fix compilation on Solaris backend
2021-01-29 07:16:52 -08:00
Cacodemon345
e11cfb50f3
Fix compilation on Solaris backend 2021-01-29 20:47:52 +06:00
Chris Robinson
3702ee669b Add a panning "deadzone" for spatialized sources
It is now the greater of 'epsilon' (1 / 2**23) or ref_distance/1024.
2021-01-28 08:36:49 -08:00
Chris Robinson
27e8807a5b Export EFX functions from the router 2021-01-27 21:24:03 -08:00
Chris Robinson
8c2592b4d9 Ignore SI-style configuration strings for device names 2021-01-27 19:44:33 -08:00
Chris Robinson
f0f7bc036f Rework fading of stopped sounds
Voices that stop and have no more accessible samples now fade out over 64
samples max. The extra loaded samples are also prevented from moving away from
0 amplitude. Paused voices that still have samples will still fade out over the
whole mix.
2021-01-27 14:55:20 -08:00
Chris Robinson
3b89246733 Make sure InitVoice is given a valid buffer queue item 2021-01-26 10:40:16 -08:00
Chris Robinson
ac5d40e40a Move al::deque to a common header 2021-01-25 09:24:10 -08:00
Chris Robinson
71e6bcbd62 Use an AL-specific buffer queue item struct for sources 2021-01-25 09:08:49 -08:00
Chris Robinson
6151d11253 Use a deque for the source buffer queue
This mainly avoids having to allocate ~64-byte structures individually. The
mixing voice still holds the queue as a linked list so as to be container-
agnostic.
2021-01-25 05:07:02 -08:00
Chris Robinson
f7acc30c22 Store the callback in the buffer list item 2021-01-24 09:29:56 -08:00