1004 Commits

Author SHA1 Message Date
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
Chris Robinson
24b030d6bd Check that CoCreateInstance succeeds 2021-03-16 16:56:11 -07:00
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
727503acdb Avoid making BSincPointsMax public 2021-03-01 17:48:07 -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
9665171ea3 Clean up some formatting 2021-02-16 05:48:42 -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
dfe627133c Use spans instead of references to arrays 2021-02-06 14:39:30 -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
bedb89eb09 Avoid copying buffers for aligning overlapped windows 2021-01-30 15:11:47 -08:00
Chris Robinson
0cd5c37c20 Allow the sample type to get changed on Solaris 2021-01-29 07:37:13 -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
71e6bcbd62 Use an AL-specific buffer queue item struct for sources 2021-01-25 09:08:49 -08:00
Chris Robinson
f7acc30c22 Store the callback in the buffer list item 2021-01-24 09:29:56 -08:00
Chris Robinson
13c1d7efb7 Store buffer info in the queue entry 2021-01-24 02:07:39 -08:00
Chris Robinson
6f87cc92fb Set the correct default buffer bits/format 2021-01-22 11:55:37 -08:00
Chris Robinson
b5f1601c7f Remove an unnecessary semicolon 2021-01-22 06:05:50 -08:00
Chris Robinson
cff3693387 Use if constexpr when possible 2021-01-22 05:50:27 -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