306 Commits

Author SHA1 Message Date
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
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
Chris Robinson
7e6d0d6b4f Fill out the JACK playback backend
A few notes about it:

The OpenAL device's requested buffer metrics are ignored, and instead the
device will keep one JACK-sized buffer's worth of audio prepared for JACK's
next process request.

Output is restricted to 32-bit float stereo. Part of this is because JACK
requires a buffer size that's a power of 2 (measured in samples), and the
ringbuffer requires a buffer size that's a power of 2 (measured in bytes). A
channel count of 6 (5.1) or 7 (6.1) will not work without causing a sample to
split over the edge of the ringbuffer. Additioanlly, JACK doesn't provide
information about what channel configuration a device or set of ports has, so
there's no way to know what ports 3 and up map to (even the first two ports are
unknown, but assuming stereo seems to work well enough).

There is no device latency measurement (for AL_SOFT_source_latency) due to the
non-atomicity between the ringbuffer's read size and port latency. A method is
needed to ensure the ringbuffer's read size and port latency can both be
measured between the end of a JACK update cycle (when the port latency has been
updated with the newly-retrieved audio) and the following ringbuffer read
update.
2014-12-22 13:30:35 -08:00
Chris Robinson
23197ddbc3 Add a skeleton backend for JACK 2014-12-21 15:51:16 -08:00
Chris Robinson
c2975b5f44 Trace lparam and wparam message values 2014-12-21 12:37:02 -08:00
Chris Robinson
a91bca64f8 Check the PROPVARIANT type before use 2014-12-21 12:20:31 -08:00
Chris Robinson
13092d94b7 Use VECTOR_FOR_EACH instead of a manual loop 2014-12-21 10:45:10 -08:00
Chris Robinson
28a9f0826c Use a macro for the record thread name 2014-12-21 10:38:40 -08:00
Chris Robinson
abf0bd13ca Support capture with mmdevapi 2014-12-19 15:49:37 -08:00
Chris Robinson
4b91d34d58 Set a couple pulse callbacks to NULL during reset, and minor cleanups 2014-12-17 10:10:28 -08:00
Chris Robinson
af193e9fb3 Don't kill pulseaudio's mixer thread if it's already killed 2014-12-17 09:47:58 -08:00
Chris Robinson
6883619b14 Check mmdevice endpoint for being headphones 2014-11-27 17:43:37 -08:00
Chris Robinson
8d6d2e9a2b Avoid unnecessary uses of ALCdevice_Lock and ALCdevice_Unlock 2014-11-27 15:27:43 -08:00
Chris Robinson
82780a703b Set headphones when dsound reports headphones 2014-11-27 02:30:52 -08:00
Chris Robinson
bdbf6613ef Support B-Format output with the wave file writer 2014-11-25 22:20:00 -08:00
Chris Robinson
cbe22763ee Require at least pulse client 0.9.16 2014-11-24 13:15:04 -08:00
Chris Robinson
fc00c1c009 Trace PulseAudio's active port 2014-11-24 12:45:51 -08:00
Chris Robinson
2c533fdc36 Set headphones when pulse reports using the headphones port 2014-11-23 20:41:29 -08:00
Chris Robinson
1dcc54c986 Don't force UpdateSize to a multiple of 4 after buffer metrics were set 2014-11-17 21:23:29 -08:00
Chris Robinson
40a08bed4f Always get the pulseaudio sink info on device reset 2014-11-17 17:57:52 -08:00
Chris Robinson
0051a96376 Fix 5.1 surround sound
Apparently, 5.1 surround sound is supposed to use the "side" channels, not the
back channels, and we've been wrong this whole time. That means the "5.1 Side"
is actually the correct 5.1 setup, and using the back channels is anomalous.

Additionally, this means the 5.1 buffer format should also use the the side
channels instead of the back channels.

A final note: the 5.1 mixing coefficients are changed so both use the original
5.1 surround sound set (with the surround channels at +/-110 degrees). So the
only difference now between 5.1 "side" and 5.1 "back" is the channel labels.
2014-11-07 00:54:16 -08:00
Chris Robinson
49cb2421c7 Use a wave file channel mask based on the actual format 2014-09-10 08:30:07 -07:00
Chris Robinson
4a712dc612 Remove some unnecessary config options 2014-09-08 15:29:07 -07:00
Chris Robinson
7a31847f7d Use a vector instead of a manual dynamic array 2014-09-08 15:24:27 -07:00
Chris Robinson
5ff1730e02 Don't modify a capture device's format
OpenAL's capture API guarantees the application gets the format requested, or
else the device will fail to open. The only valid change is that the capture
buffer can be larger than requested.
2014-09-08 14:29:59 -07:00
Chris Robinson
a234fc11e5 Remove the GetLatency method from the old BackendFuncs 2014-09-08 06:59:58 -07:00
Chris Robinson
9dacd89a02 Convert the winmm backend to the new backend API 2014-09-08 06:46:20 -07:00
Chris Robinson
2be33d8a77 Only pass nano seconds to al_nssleep 2014-09-08 04:37:52 -07:00
Chris Robinson
f18d2f2445 Check mmdevapi device ids to match the default device
Seems Windows can return different IMMDevice object pointers for the same
endpoint.
2014-08-28 18:22:17 -07:00
Chris Robinson
368bf037dd Check the given CoreAudio capture device name 2014-08-26 14:50:14 -07:00
Chris Robinson
a3bba200c0 Convert the wave writer backend to the new API 2014-08-24 22:20:02 -07:00
François Cami
3c13e1e333 Update COPYING to the latest https://www.gnu.org/licenses/old-licenses/lgpl-2.0.txt to fix the FSF' address Fix the FSF' address in the source 2014-08-18 11:34:29 -07:00
Chris Robinson
f173a67870 Use VECTOR_FIND_IF and VECTOR_FOR_EACH instead of manual loops 2014-08-09 06:15:11 -07:00
Chris Robinson
1692dda4b9 Use the default input device for portaudio's default capture device 2014-08-08 19:48:45 -07:00
Chris Robinson
6864053eee Use pulseaudio's write callback to signal a mixer proc wakeup 2014-07-26 22:04:26 -07:00
Chris Robinson
d0a64fe191 Don't require pre-declaring vector types 2014-07-06 03:27:39 -07:00
Chris Robinson
fd5e7f1466 Don't print an ERR if pulse fails to get latency info due to no data
It just means it was called too quickly after starting.
2014-05-26 03:41:33 -07:00
Chris Robinson
2729a1549b Add a needed header for the CoreAudio backend 2014-05-22 11:29:26 -07:00
Chris Robinson
fdcdda2ed3 Initialize a pointer to NULL instead of a string 2014-05-15 01:39:42 -07:00
Chris Robinson
ef1b34dcd2 Initialize some variables when declaring them 2014-05-15 01:14:31 -07:00
Chris Robinson
a6974a6c83 Don't try to read the internal capture buffer into itself 2014-05-14 21:20:28 -07:00
Chris Robinson
f311f74001 Avoid freeing an in-use capture buffer
When stopping, ALSA may capture into its own storage buffer. Do not free
the storage buffer if it first reads from it.
2014-05-14 03:22:42 -07:00
Chris Robinson
1d2504d12e Make RefCount a non-integer type
It should only be accessed through the appropriate functions to ensure proper
atomicity.
2014-05-14 02:47:07 -07:00
Chris Robinson
3bdb3f9db7 Iniitialize some mmdevapi backend fields in the constructor 2014-05-02 10:47:31 -07:00
Chris Robinson
f150676873 Add a helper VECTOR_FOR_EACH macro 2014-04-30 12:30:02 -07:00
Chris Robinson
149df6d4db Convert the mmdevapi backend to the new backend API 2014-04-25 09:26:53 -07:00