5034 Commits

Author SHA1 Message Date
Chris Robinson
fa9ab9af7c Minimize each response delay for the ambisonic HRTF decode 2018-02-18 23:56:51 -08:00
Chris Robinson
b5aa0c0759 Remove the unnecessary ComputeAmbientGains 2018-02-18 23:56:51 -08:00
Chris Robinson
79604c3c0e Preserve RMS for the high-frequency HRTF ambisonic coefficients 2018-02-18 23:56:51 -08:00
Chris Robinson
7a974b2460 Combine the vector reverse and partial scatter where they're together 2018-02-18 23:56:51 -08:00
Chris Robinson
7f3d69fdbc Remove an unnecessary comment about if meters_per_unit is > 0 2018-02-18 23:56:51 -08:00
Chris Robinson
7dafac0c34 Avoid duplicating some scale tables 2018-02-18 23:56:51 -08:00
kcat
c24aea712b
Merge pull request #170 from digitalist/patch-1
freebsd fix: typo
2018-02-18 23:56:02 -08:00
Alexey Elymanov
063ad490a2
freebsd fix: typo
Alc/helpers.c:738:30: error: use of undeclared identifier 'KERN_PROCARGS'
    int mib[4] = { CTL_KERN, KERN_PROCARGS, getpid() };

/usr/include/sys/sysctl.h:
`#define	KERN_PROC_ARGS		7	/* get/set arguments/proctitle */`
there's no KERN_PROCARGS
2018-02-18 20:55:31 +03:00
Chris Robinson
59768674f1 Use an alternate ambisonic HRTF decode layout
Similar to the previous, but includes the top and bottom HRTF responses. The
higher-order decode (for the "basic" HRTF output) also now uses 2H1P mixed-
order instead of 2H1V, which seems more stable.
2018-02-13 03:03:26 -08:00
Chris Robinson
2cb49e51a0 Fix NULL pointer dereference 2018-02-12 22:20:43 -08:00
Chris Robinson
6b76eddbe3 Supply HF coefficient scales with a single-band ambisonic matrix 2018-02-12 21:24:58 -08:00
Chris Robinson
59934b47de Avoid using an enum for array indices 2018-02-12 20:58:39 -08:00
Chris Robinson
4d417f3dd4 Make bformatdec_free and ambiup_free clear the freed pointer 2018-02-12 20:48:28 -08:00
Chris Robinson
dce497fbca Use a bitfield for enabled bformatdec channels 2018-02-12 20:33:31 -08:00
Chris Robinson
e63e0ee596 Combine multiple functions called sequentially 2018-02-11 22:23:03 -08:00
Chris Robinson
494e9fd61d Don't asynchronously modify the source on disconnect 2018-02-11 16:58:34 -08:00
Chris Robinson
b11e31fbfd Clear stale 'post's on the event semphaphore 2018-02-11 06:14:18 -08:00
Chris Robinson
1e93122470 Remove unused reverb modulation code
Still unsure how to handle reverb modulation without some kind of reference
output, so remove the related functions to not waste CPU time. It'll remain in
the Git history should it ever need to be resurrected.
2018-02-10 19:50:42 -08:00
Chris Robinson
5b11129eaa Use a function pointer for applying the dry mix post-process 2018-02-10 15:50:05 -08:00
Chris Robinson
ee3d53a673 Use an alternate virtual layout for Ambisonic HRTF decoding
This uses 16 channels, an 8-channel octagon + 8-channel cube, which should
improve horizontal resolution without affecting vertical too much.
2018-02-10 05:16:28 -08:00
Chris Robinson
c346baff5b Clarify some macro names using ambisonic mixed-mode notation 2018-02-09 18:43:34 -08:00
Chris Robinson
20bee69955 Attempt to improve the reverb panning vectors
This should now retain the original orientation of the soundfield and merely
focus on the panning vector direction, as intended.
2018-02-08 01:18:40 -08:00
Chris Robinson
4cd04f192d Alter tha curve of the density-related delay scale
The delay scale is roughly linear with respect to room size, however the
density is not linear with room size. The density is calculated by taking the
room size cubed, then normalized by some factor. Unnormalizing the density and
taking the cube root restores the original room size to use as a delay scale.

The patch also alters the delay and all-pass line lengths to be based on a 1
meter room size, so the the room size recovered from the density acts as a
direct multiple for the desired target length.

Note that the room scale range is unchanged (5m to 50m), so the minimum and
maximum delays are the same. It should also be noted that 50m may not be the
correct room size for a density value of 1. A density value of 1 corresponds to
an environment size of roughly 2.52m when converted from EAX (DENSITY_SCALE
should be 16 rather than 125000), but sizes that low result in undesirable
resonance in the feedback, indicating other changes are necessary for that to
work.
2018-02-08 00:05:29 -08:00
Chris Robinson
f5f996c14a Check for a cbrtf function 2018-02-06 02:35:08 -08:00
Chris Robinson
da1ee3baba Revert "Don't fade the all-pass delay changes"
This reverts commit 799dfb732b4f49198d72649e86955ea82f45f229.
2018-02-04 19:57:22 -08:00
Chris Robinson
1d7a5dbede Remove unsupported source queries 2018-02-04 15:01:04 -08:00
Chris Robinson
9b878c64f9 Make the Connected state atomic
Also don't send the Disconnected event more than once.
2018-02-04 00:01:12 -08:00
Chris Robinson
1f61472e77 Avoid potentially writing partial samples 2018-02-03 14:02:47 -08:00
Chris Robinson
b99e64a0e3 Provide more descriptive messages to disconnection events 2018-02-03 13:54:42 -08:00
Chris Robinson
e49607078e Handle disconnected events in alffplay 2018-02-03 11:27:03 -08:00
Chris Robinson
4ef60d7214 Add a couple missing lock calls 2018-02-03 01:26:04 -08:00
Chris Robinson
40bda4d93f Add a disconnected event type 2018-02-03 01:07:06 -08:00
Chris Robinson
8f4c078fb5 Add missing header for UINT_MAX 2018-02-02 23:08:29 -08:00
Chris Robinson
80cc32d77b Remove the unused thunk code 2018-02-02 22:59:06 -08:00
Chris Robinson
28fa82378b Remove the individual source queue and buffer locks
They're inherently protected by the mutex for their respective lists. Should
those mutexes be replaced by rwlocks the individual locks should also be
reinstated, but they're unlikely to be unless a lot of contention starts
happening in the read-only case.
2018-02-02 22:24:33 -08:00
Chris Robinson
6a4a88f8f5 Store an index to a given source's voice
For more efficient voice lookups when needed.
2018-02-01 23:56:35 -08:00
Chris Robinson
a114d6cbb5 Remove unused _timed methods
They're not reliably implemented anyway, as some systems will just flat out
fail when trying to use them.
2018-02-01 22:24:17 -08:00
Chris Robinson
3acd2a55ad Don't generate Buffer Completed events for static sources 2018-02-01 21:07:55 -08:00
Chris Robinson
3a90fd5751 Avoid an unnecessary temp variable 2018-02-01 19:11:23 -08:00
Chris Robinson
ec14c98f2d Use an atomic instead of volatile to tell a thread to quit 2018-02-01 18:59:32 -08:00
Chris Robinson
975c682ec3 Use semaphores to signal for more samples with JACK and OpenSL 2018-02-01 18:54:13 -08:00
Chris Robinson
e240351d81 Use a semaphore to signal the event handler
Semaphores allow for semi-persistent signals, compared to a condition variable
which requires a mutex for proper detection. A semaphore can be 'post'ed after
writing some data on one thread, and another thread will be able to recognize
it quickly even if the post occured in between checking for data and waiting.

This more correctly fixes a race condition with events since the mixer
shouldn't be using mutexes, and arbitrary wake-ups just to make sure an event
wasn't missed was quite inefficient.
2018-02-01 18:20:14 -08:00
Chris Robinson
4ec31291c0 Add semaphore functions to the thread API wrapper 2018-02-01 17:37:31 -08:00
Chris Robinson
7a538141c9 Signal a condition variable when a buffer completes in alffplay 2018-02-01 02:24:44 -08:00
Chris Robinson
bcdc399029 Send buffer completed events when enabled 2018-02-01 01:36:03 -08:00
Chris Robinson
8652ae046b Fix check for matching event type 2018-02-01 00:50:06 -08:00
Chris Robinson
833eface38 Don't print buffer completed events in alffplay 2018-01-31 20:27:14 -08:00
Chris Robinson
7256bc92fa Add a thread to marshal events from the mixer
To avoid having unknown user code running in the mixer thread that could
significantly delay the mixed output, a lockless ringbuffer is used for the
mixer to provide events that a secondary thread will pop off and process.
2018-01-31 20:21:54 -08:00
Chris Robinson
0394d5a44f Rename EventLock to make it more clear it's protecting the callback 2018-01-30 12:34:25 -08:00
Chris Robinson
e7217760f3 Don't bother with an explicit stop backend method 2018-01-29 01:00:53 -08:00