873 Commits

Author SHA1 Message Date
Chris Robinson
0a0849db99 Use an optional bool instead of two tri-state enums 2021-07-31 14:24:49 -07:00
Chris Robinson
29fba79cd5 Avoid 5.1Rear as its own channel configuration
It messes with 5.1 sources using direct channels, and the surround channels are
supposed to map to the side labels. Individual backends can deal with the
channel order/label differences, as they already do to a degree.
2021-07-30 07:38:26 -07:00
Chris Robinson
486eca8ce6 Remove an unused variable 2021-07-30 06:26:53 -07:00
Chris Robinson
3b3df06195 Be more robust with unexpected channel counts 2021-07-30 06:13:54 -07:00
Chris Robinson
1fd4c865fc Use non-block mode for sndio capture 2021-07-30 04:15:00 -07:00
Chris Robinson
620836f173 Simplify channel handling in the sndio backend 2021-07-29 23:23:03 -07:00
Chris Robinson
d766c59d4d Simplify connecting JACK ports 2021-07-25 00:10:15 -07:00
Chris Robinson
02a985e70a Set the CoreAudio stream according to the device channel format 2021-07-24 22:01:53 -07:00
Chris Robinson
510e5fc197 Remove a redundant buffer clear 2021-07-24 19:02:49 -07:00
Chris Robinson
d662cd8761 Don't assume more than stereo for unrequested ALSA channels
If setting the requested format channel count fails, getting anything with 2 or
more channels assumes the first two channels are stereo, leaving the rest
silent.
2021-07-24 18:58:48 -07:00
Chris Robinson
df71e42877 Fix the device sample type in the SDL2 backend 2021-07-24 18:57:18 -07:00
Chris Robinson
fb1ad483d3 Ensure unused output channels are cleared when rendering 2021-07-24 18:15:02 -07:00
Chris Robinson
d998c03a27 Add a UHJ-specific coefficient scaling array 2021-07-13 06:31:13 -07:00
Chris Robinson
fb2cb2bd06 Attempt to support capture enumeration with CoreAudio 2021-07-10 00:34:00 -07:00
Chris Robinson
10d782502a Use variables and types when they're defined 2021-07-09 21:25:13 -07:00
Chris Robinson
c8cfdf6ddf Don't define enumeration functions when they're not used 2021-07-09 18:54:23 -07:00
Chris Robinson
d38c8419c7 Update the 5.1+center decoder and use it by default
The itu5.1-nocenter preset is the same as the previous default, so it can still
be used for people that prefer it. But this new one purportedly has better
panning and positioning responses in listening tests, which initial impressions
concur with.
2021-06-30 15:53:15 -07:00
Chris Robinson
c09c94de25 Allow decoders to specify the coefficient scaling 2021-06-25 08:10:41 -07:00
Chris Robinson
41add63728 Don't attenuate spatialized multichannel sources
It's inconsistent behavior with spatialized B-Format sources, and causes a very
apparent gain disparity between such a source on the listener compared to just
barely off-origin. It's also not something an app can easy correct for if it
doesn't want that behavior, since the source gain clamps to 1 by default. In
contrast, an app can attenuate sources as they want with little issue.
2021-06-24 08:21:25 -07:00
Chris Robinson
247a149115 MSVC doesn't like the decltype 2021-06-23 13:30:17 -07:00
Chris Robinson
9a7bca1116 Add wrapper methods for getting device config values 2021-06-23 10:45:24 -07:00
Chris Robinson
5b2489c3e8 Convert AmbDecConf to DecoderConfig for loading
This keeps AmbDecConf uses confined to multi-channel panning initialization,
and avoids spreading conversions and maps all over.
2021-06-23 09:44:58 -07:00
Chris Robinson
2b7c446363 Support built-in 3D ambisonic decoders 2021-06-23 03:22:54 -07:00
Chris Robinson
d28cf80b6f Allow querying ALC_ALL_DEVICES_SPECIFIER from loopback devices
They only return the default/driver name, since loopback devices don't have a
canonical name.
2021-06-22 03:25:31 -07:00
Chris Robinson
1c5a6ad92b Use a unique_ptr to hold raw byte memory 2021-06-21 03:54:49 -07:00
alexey.lysiuk
375838c473 Fix getting of device channel count in CoreAudio backend
AudioBufferList contains a variable length array of mNumberBuffers elements, so it should not be created with the default constructor like usual class instances.
Unfortunately, Apple developer site documentation is literally empty for this API. There is a bunch of comments in framework's header files.
Here is the correct usage of AudioBufferList pointer from Chromium: 008a1abc57/audio/mac/audio_manager_mac.cc (266)
There were occasional crashes because of memory corruption which was confirmed by address sanitizer
2021-06-21 13:24:45 +03:00
Chris Robinson
04a6e418d7 Fix some size types 2021-06-18 21:03:31 -07:00
Chris Robinson
a7d2e2974f Initial attempt at CoreAudio playback enumeration 2021-06-18 20:55:00 -07:00
Chris Robinson
76a9fdae75 Use a unique_ptr to auto-free the jack ports list 2021-06-12 14:19:55 -07:00
Chris Robinson
7e32478327 Set the JACK output ports as terminal
Since there are no input ports associated with the output.
2021-06-12 12:54:31 -07:00
Chris Robinson
241107faeb Give a name to a lambda 2021-06-11 13:43:01 -07:00
Chris Robinson
f5bcd12be1 Improve name duplication handling with JACK
If a custom device pattern matches an existing one, its name will be replaced.
A separate loop is used to check and handle duplicate display names.
2021-06-10 16:15:00 -07:00
Chris Robinson
debb932573 Add an option to mix directly in the JACK callback 2021-06-08 10:52:37 -07:00
Chris Robinson
58a9549a58 Handle the listener position separate from the rotation matrix
It's too unstable with larger vectors. Even when the source and listener
positions are the same, floating point precision can cause noticeable rounding
errors.
2021-05-25 14:08:16 -07:00
Chris Robinson
8d868ff33f Fix setting the channel distance compensation buffers 2021-05-20 23:48:43 -07:00
HALX99
2516fdee66
Handle tvOS case 2021-05-13 19:05:47 +08:00
Chris Robinson
1195bba833 Add back a missing include 2021-04-27 19:46:33 -07:00
Chris Robinson
e3c0b60cc6 Rename alcontext.h and move some functions to context.cpp 2021-04-27 19:04:45 -07:00
Chris Robinson
3d8e705107 Move some functions to a more appropriate place 2021-04-27 17:01:27 -07:00
Chris Robinson
06dcfc3fcf Rename alcmain.h to device.h 2021-04-27 16:40:22 -07:00
Chris Robinson
061148072f Update include headers
Don't add alc/ to the include paths.
2021-04-27 16:04:54 -07:00
Chris Robinson
2571d9bbc4 Update some license notices
Permission to relicense was granted via email.
2021-04-27 11:56:29 -07:00
Chris Robinson
d06209ef5a Update includes 2021-04-27 08:39:17 -07:00
Chris Robinson
ff380298e4 Move BufferStorage and Voice to core 2021-04-27 08:26:42 -07:00
Chris Robinson
99157f149f Move ContextBase and VoiceChange to core 2021-04-27 08:04:09 -07:00
Chris Robinson
26c8c50c26 Partially implement an extension to hold sources on disconnect
Rather than stopping voices/sources when the device becomes disconnected, the
context can be set to leave them alone. As a consequence, their state will
remain as playing and they'll keep their last known sample offset indefinately.
For applications mindful of this behavior, it will allow resetting or reopening
the device to reconnect and automatically resume where it left off.
2021-04-26 20:25:24 -07:00
Chris Robinson
22a8ebff80 Move GetChannelIdxByName and clean up some more includes 2021-04-26 08:04:50 -07:00
Chris Robinson
2479483645 Move bformatdec to core 2021-04-25 18:08:08 -07:00
Chris Robinson
8d09d03ed3 Move async_event.h to core 2021-04-25 14:29:21 -07:00
Chris Robinson
0fe38c053d Move some functions to core
And clean up more includes
2021-04-25 11:36:37 -07:00