365 Commits

Author SHA1 Message Date
Chris Robinson
9a60184bf6 Set a JACK error message handler when initializing the backend
JACK2 will print error messages to stderr if it fails to connect to a server.
Users who don't normally use JACK but have the client lib installed will get
those messages even though OpenAL Soft will continue on to find a working
backend without trouble. So to avoid it, set an error message handler that'll
log them as warnings.

This isn't that great because there's no way to tell whether the error messages
are due to the server not running, or some other problem. And it resets the
callback to the default afterward even if it may have been set to something
else before. JACK2, which is what needs this workaround in the first place,
doesn't export the jack_error_callback pointer to properly save and restore it.
2016-08-11 20:43:54 -07:00
Chris Robinson
f775f25379 Modify NumUpdates for different sample rates instead of UpdateSize
Not that this really changes anything since the CoreAudio backend doesn't honor
the ALCdevice's buffer metrics, nor accurately report the device's actual
metrics. But it clears up warnings from a non-multiple-of-four update size if
the sample rate causes it to change.
2016-08-04 21:19:04 -07:00
Chris Robinson
48b954160e Look for the correct DLL for JACK on Windows 2016-08-03 19:07:35 -07:00
Chris Robinson
bff5268ed4 Remove DevFmtBFormat3D, which is covered by DevFmtAmbi1 2016-07-31 08:13:41 -07:00
Chris Robinson
b5b3ea95f8 Add a config to output first-, second-, or third-order ambisonics
Currently incomplete, as second- and third-order output will not correctly
handle B-Format input buffers. A standalone up-sampler will be needed, similar
to the high-quality decoder.

Also, output is ACN ordering with SN3D normalization. A config option will
eventually be provided to change this if desired.
2016-07-29 21:55:43 -07:00
Chris Robinson
5e11a738c6 Combine VECTOR_RESIZE and VECTOR_RESERVE 2016-07-26 12:02:03 -07:00
Chris Robinson
612b24fa91 Clean up a couple variable names and declarations 2016-05-30 02:10:06 -07:00
Chris Robinson
6d4380a48c Change the backend getLatency method to return the clock time too
This will also allow backends to better synchronize the tracked clock time with
the device output latency, without necessarily needing to lock if the backend
API can allow for it.
2016-05-28 00:43:14 -07:00
Chris Robinson
e8b274d349 Properly pluralize some messages 2016-05-22 21:03:16 -07:00
Chris Robinson
f4ff5fc106 Shorten VECTOR_ITER_ macros to VECTOR_ 2016-04-15 12:22:54 -07:00
Chris Robinson
e127072b41 Use al_malloc/al_free for allocations 2016-04-05 20:51:38 -07:00
Chris Robinson
071f8a7b18 Also disable ALSA's resampler when not requesting a sample rate 2016-04-05 19:35:03 -07:00
Chris Robinson
8145a26d07 Add a hack to workaround erroneous prebuf values from pulse 2016-03-31 16:21:49 -07:00
Chris Robinson
d6163fe570 Convert remaining ringbuffers to the lockless variant 2016-03-29 23:48:36 -07:00
Chris Robinson
2c6e59c4ca Fix when ESTRPIPE and EPIPE are the same 2016-02-22 08:12:09 -08:00
Chris Robinson
f4fa41487c Replace some CreateEvent calls with CreateEventW 2016-02-07 16:14:27 -08:00
Chris Robinson
79e0f3e747 Don't write one byte at a time for the wave writer on big endian 2016-01-25 01:49:28 -08:00
Chris Robinson
7de8db2960 Replace multiple fputc calls with one fwrite 2016-01-23 21:47:43 -08:00
Chris Robinson
9c05a16c9a Fix for systems that don't have strnlen 2016-01-21 02:09:32 -08:00
Chris Robinson
bbd2876afb Improve the OSS enumeration code 2016-01-21 01:05:29 -08:00
Keegan Drake H.P
5a73aa2502 Added a check for an empty path 2015-12-17 20:05:21 -06:00
Keegan Drake H.P
df2ee7ba87 Add device enumeration support for OSSv4 2015-12-17 19:20:08 -06:00
Chris Robinson
01e43e5d4d Add includes to work around broken GNU headers and POSIX-2001 2015-12-11 09:24:40 -08:00
Chris Robinson
e45ff47361 Reformat Windows device name dressing 2015-12-04 15:52:43 -08:00
Chris Robinson
63567526b0 Better handle inexact ALSA period counts 2015-11-23 16:50:31 -08:00
Chris Robinson
c8a3e51296 Fix the allow-resampler check for ALSA 2015-11-23 16:29:32 -08:00
Alex Szpakowski
21c84bcd96 Replace deprecated Carbon API calls with modern AudioComponent APIs in the CoreAudio backend.
This prevents a deprecation notice from being output to stdout when alcOpenDevice is called in Mac OS X 10.11.

The new API calls require Mac OS X 10.6 or newer.
2015-11-13 20:11:12 -04:00
Chris Robinson
9891d61206 Add options to disable Pulse's and ALSA's resamplers 2015-11-07 23:05:45 -08:00
Chris Robinson
d6f4e5139f Add another cast for MSVC 2015-11-06 02:23:42 -08:00
Chris Robinson
6fc8cd3b29 Convert the PortAudio backend to the new backend API 2015-10-22 10:46:36 -07:00
Chris Robinson
70fbc2b1ff Add a function to get a list of data files
The method takes a marked-up filename (e.g. may include %r for a sample rate,
%% for %, etc), and returns a vector of strings of found filenames that match.
It will search the CWD, the local, and global data directories, in that order.
2015-10-03 20:41:18 -07:00
Chris Robinson
30d88cf547 Use the macros to allocate the wrapper backends 2015-09-24 15:54:32 -07:00
Chris Robinson
46bbf95bae Disable mmdevapi capture and update changelog
Unfortunately mmdevapi does not do channel remixing or resampling, even for
capture, so the device can only be opened in the mode it's configured for.
For now, fallback to dsound or winmm to get the conversion until we can do it
ourselves.
2015-09-18 03:19:16 -07:00
Chris Robinson
87f3babe2c Append "on OpenAL Soft" to mmdevapi, dsound, and winmm device names
Would be nicer to have a more backend-agnostic method of doing this, Perhaps
even also only when the router is being used.
2015-09-10 22:15:40 -07:00
Chris Robinson
703f1fdec2 Specify the pa_channel_map directly instead of through a string 2015-09-04 23:59:24 -07:00
Chris Robinson
ce487d1e43 Use the correct device name for PulseAudio too
Like mmdevapi. duplicate device names will have a '#2' or such appended, so the
device's reported name may be incorrect.
2015-09-03 14:59:59 -07:00
Chris Robinson
23729c2083 Replace another vector loop with VECTOR_FIND_IF 2015-09-03 14:53:46 -07:00
Chris Robinson
87e4ec6620 Use the correct device name when opening a device by name
Duplicate device names will have a '#2' or such appended, so the device's
reported name may be incorrect.
2015-09-03 11:56:46 -07:00
Chris Robinson
e5fa4ee25d Allow for device-specific config values 2015-08-28 14:10:39 -07:00
Chris Robinson
53f6590b17 Set the WAVEFORMATEX cbSize field for mmdevapi capture 2015-08-18 00:19:22 -07:00
Chris Robinson
f6e52debb5 Fix handling of PulseAudio devices that have the same description 2015-08-14 19:05:16 -07:00
Chris Robinson
7d4e3688e1 Wait for the OpenSL buffer queue to empty when stopping 2015-08-13 16:01:31 -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
c297b51a6e Add a note to the JACK backend about a (minor) race condition 2015-02-07 10:09:01 -08:00
Chris Robinson
4a5daa2e91 Clean up another vector iterator loop 2015-02-07 04:47:02 -08:00
Chris Robinson
e6f4648924 Signal the mixer thread outside of the mutex lock 2015-02-03 02:40:22 -08:00