2477 Commits

Author SHA1 Message Date
Chris Robinson
4efe0d8696 Update a couple comments 2015-07-04 10:12:57 -07:00
Chris Robinson
d90dfc8d1f Check for duplicate device names in the mmdevapi backend 2015-06-30 07:44:56 -07:00
Chris Robinson
c24f4f230f Use the lockless ringbuffer for mmdevapi capture
The backend's capture funcs are already called while under a lock, so multiple
threads shouldn't be able to read from it at once.
2015-06-30 07:42:09 -07:00
Chris Robinson
e5964d6dc4 Double check the mmdevapi capture format
This isn't a real solution, but it should get IAudioClient_IsFormatSupported to
stop failing.
2015-06-07 13:05:07 -07:00
Chris Robinson
9f49ac0fda Add a macro to simplify allocating and constructing an object 2015-05-18 16:39:44 -07:00
Chris Robinson
9479ea656b Convert the solaris backend to the new API 2015-05-17 04:18:38 -07:00
Chris Robinson
3058205963 Add a method to reset the device
This basically acts as if the app created a new context with the specified
attributes (causing the device to reset with new parameters), then immediately
delete it. Existing contexts remain undisturbed, except for a temporary pause
while the device output is reconfigured.
2015-05-16 02:18:09 -07:00
Chris Robinson
80f0b5e736 Add a few more HRTF status values
DISABLED - Generic disabled status
ENABLED - Generic enabled status
DENIED - Not allowed (user has configured HRTF to be off)
REQUIRED - Forced (user has forced HRTF to be used)
HEADPHONES_DETECTED - Enabled because headphones were detected
UNSUPPORTED_FORMAT - Device format is not compatible with available filters
2015-05-16 01:06:26 -07:00
Chris Robinson
0f51b6df4b Add an HRTF status query
This can report the status of HRTF, specifying if it's enabled or not and why
(currently only reports unsupported formats, but this may be extended).
2015-05-15 23:28:03 -07:00
alexxvk
8846ad967f Fix mingw64 build 2015-05-02 17:44:06 +06:00
Chris Robinson
6fcaccc964 Don't assert the increment value in the copy32 resampler 2015-02-15 13:15:49 -08:00
Chris Robinson
b4c9744d6a Fix the HRTF B-Format decoder's W coefficient
And limit it to first-order again, since there will likely need to be extra
scalings applied.
2015-02-14 12:11:50 -08:00
Chris Robinson
18fed4e79a Cheange some more unnecessarily small coefficients to 0 2015-02-11 22:23:33 -08:00
Chris Robinson
71b6e9bfe0 Add an option for "basic" HRTF rendering
This method is intended to help development by easily testing the quality of
the B-Format encode and B-Format-to-HRTF decode. When used with HRTF, all
sources are renderer using the virtual B-Format output, rather than just
B-Format sources.

Despite the CPU cost savings (only four channels need to be filtered with HRTF,
while sources all render normally), the spatial acuity offered by the B-Format
output is pretty poor since it's only first-order ambisonics, so "full" HRTF
rendering is definitely preferred.

It's /possible/ for some systems to be edge cases that prefer the CPU cost
savings provided by basic over the sharper localization provided by full, and
you do still get 3D positional cues, but this is unlikely to be an actual use-
case in practice.
2015-02-11 09:32:05 -08:00
Chris Robinson
a6e574ba9e Calculate HRTF coefficients for all B-Format channels at once
It's possible to calculate HRTF coefficients for full third-order ambisonics
now, but it's still not possible to use them here without upmixing first-order
content.
2015-02-10 11:22:28 -08:00
Chris Robinson
3ed79cc229 Use a single statement to declare the buffer format channel maps 2015-02-10 10:04:59 -08:00
Chris Robinson
b9e81794e4 Pass the (FuMa) channel number to GetBFormatHrtfCoeffs 2015-02-10 06:46:02 -08:00
Chris Robinson
cf5856ed48 Correct conversion from polar to cartesian coords for HRTF
A functional no-op (cos(a) == cos(-a), -sin(a) == sin(-a)), but Ambisonics
expects the azimuth angle to go counter-clockwise.
2015-02-10 05:38:16 -08:00
Chris Robinson
a1d4847d07 Use B-Format for HRTF's virtual output format
This adds the ability to directly decode B-Format with HRTF, though only first-
order (WXYZ) for now. Second- and third-order would be easilly doable, however
we'd need to be able to up-mix first-order content (from the BFORMAT2D and
BFORMAT3D buffer formats) since it would be inappropriate to decode lower-order
content with a higher-order decoder.
2015-02-09 15:59:29 -08:00
Chris Robinson
8933e21ef2 Properly handle a mono output buffer with the MIDI synths 2015-02-09 08:47:48 -08:00
Chris Robinson
1393af4f9f Add a comment detailing how the HRTF channel buffer is set up 2015-02-09 08:11:07 -08:00
Chris Robinson
a925fb8111 Make sure the BS2B filter is freed if HRTF is enabled 2015-02-09 05:56:37 -08:00
Chris Robinson
61755f35c1 Move HRTF params and state closer together 2015-02-09 05:54:14 -08:00
Chris Robinson
c297b51a6e Add a note to the JACK backend about a (minor) race condition 2015-02-07 10:09:01 -08:00
Chris Robinson
f5dd5c1330 Fix some ringbuffer function comments 2015-02-07 10:08:27 -08:00
Chris Robinson
4a5daa2e91 Clean up another vector iterator loop 2015-02-07 04:47:02 -08:00
Chris Robinson
50cdc0ac1e Avoid tracing wide-char strings
Because on Windows, traced strings are written to a char string, which causes
UTF-16 strings to be converted to a narrow (non-UTF-8) encoding, potentially
losing characters.
2015-02-07 04:19:50 -08:00
Chris Robinson
61743a3a00 Avoid unnecessary uses of ExchangeInt/Ptr 2015-02-04 23:39:51 -08:00
Chris Robinson
efb7b11d7f Avoid unnecessary ExchangeInt uses 2015-02-04 05:57:54 -08:00
Chris Robinson
33ced1a7c2 Try the JACK backend before PulseAudio
The backend will not spawn a server by default, so PulseAudio will still be
preferred as long as a JACK server isn't already running.
2015-02-03 05:11:46 -08:00
Chris Robinson
e6f4648924 Signal the mixer thread outside of the mutex lock 2015-02-03 02:40:22 -08:00
Chris Robinson
12e443d61d Don't try to spawn a JACK server by default
And don't print an error if one couldn't be started when not requested.
2015-02-03 01:23:19 -08:00
Chris Robinson
e53861bfb9 Always use the JACK server buffer size as the update size
The buffer-size config option now only specifies an additional mix ahead to
keep ready for audio requests, rather than a pretend period size.
2015-02-03 01:08:38 -08:00
Chris Robinson
290badea95 Ensure PulseAudio's mixing loop is signaled when stopping 2015-01-21 22:02:02 -08:00
Chris Robinson
5cbafaa014 Remove a couple unused variables 2015-01-20 16:44:47 -08:00
Chris Robinson
0b6bb76259 Fix variable check 2015-01-20 16:42:23 -08:00
Chris Robinson
199646ac2b Fix X7DOT1_NARROW name to X7DOT1_WIDE 2015-01-15 09:27:37 -08:00
Chris Robinson
c1607300bb Accept a "narrow" layout for 7.1 with mmdevapi 2015-01-15 01:56:04 -08:00
Chris Robinson
ed05c83ee7 Fix the flags type 2015-01-11 15:02:26 -08:00
Chris Robinson
4dc9956a12 Remove some IN_IDE_PARSER uses 2014-12-24 17:15:50 -08:00
Chris Robinson
ca28d81b36 Update some function comments (bytes -> elements) 2014-12-24 16:42:57 -08:00
Chris Robinson
c71d8c0fc5 Update a comment 2014-12-24 01:17:55 -08:00
Chris Robinson
ad11a90720 Don't update the channel format if all JACK ports were allocated 2014-12-23 22:02:56 -08:00
Chris Robinson
93b69583d3 Try the device-specified channel configuration first
This does basically no checking that the channel config is correct, but should
be good enough for when non-stereo modes are requested.
2014-12-23 21:06:10 -08:00
Chris Robinson
2f162f0fc3 Use the custom ringbuffer instead of JACK's 2014-12-23 20:24:10 -08:00
Chris Robinson
a9cce5de3e Add a lockless ringbuffer
Largely copied from JACK, it's extended to work with user-specified element
sizes instead of bytes. This is necessary to be able to work with 6- and 7-
channel output modes.
2014-12-23 20:17:34 -08:00
Chris Robinson
6ccf10bbde Don't set unused pointers to NULL, don't try to write 0 samples 2014-12-23 11:56:55 -08:00
Chris Robinson
e84b3f4707 At least measure the ringbuffer size for JACK's latency
We should also add the port latency, but there's currently no way to ensure
it's synchronized with the ringbuffer (the ringbuffer will update before the
port latency gets updated).
2014-12-23 11:42:57 -08:00
Chris Robinson
beb670a939 Add an option to prevent spawning a JACK server 2014-12-22 19:29:55 -08:00
Chris Robinson
b8d98dd6d0 Add an option for an increased ringbuffer size with JACK 2014-12-22 18:48:54 -08:00