4057 Commits

Author SHA1 Message Date
Chris Robinson
0f24f49a44 Allow specifying the device to open for the examples 2016-09-08 12:14:28 -07:00
Chris Robinson
b21e481827 Only WARN if GetProcPath fails to find the binary 2016-09-08 11:56:25 -07:00
Chris Robinson
958301d880 Try increasing the stack size if thread creation fails
Also increase the default stack size to 2MB.
2016-09-08 06:30:25 -07:00
kcat
4d91afb203 Merge pull request #64 from tpetazzoni/arm-neon-fix
Build NEON code with -mfpu=neon
2016-09-08 02:09:55 -07:00
Chris Robinson
c3c283a0b5 Properly check if /proc/cpuinfo opened 2016-09-08 02:02:09 -07:00
Chris Robinson
742f181595 Use a few more HRIRs for the HRTF B-Format decoder
14 in total, an 8-point cube and a 6-point diamond shape, to help improve sound
localization a bit. Incurs no real extra CPU cost once the IRs are built.
2016-09-07 16:26:13 -07:00
Chris Robinson
a52cfc8048 Check for run-time NEON support by reading /proc/cpuinfo
Less than ideal since documentations warn it may not list 'neon' even if it's
really supported. However, the "proper" APIs to check for NEON extensions don't
seem to exist in my toolchain.
2016-09-07 09:57:40 -07:00
Chris Robinson
ef67d17a84 Simplify mmdevapi's device name search
Avoids converting each enumerated devid from WSTR to UTF-8, and instead just
converts the device name from UTF-8 to WSTR once if needed.
2016-09-07 09:22:34 -07:00
kcat
64a8ad9711 Merge pull request #65 from Dmytry/dmytry_github_master
mmdevapi: Allow specifying output device by it's audio endpoint GUID …
2016-09-07 08:32:31 -07:00
Chris Robinson
3af1d5b722 Properly align 16-bit fields in the Hrtf struct 2016-09-07 05:38:22 -07:00
Chris Robinson
7973c5abf8 Use unsigned int shifts for device flags 2016-09-07 05:18:42 -07:00
Dmytry Lavrov
6b7e14f11f mmdevapi: Allow specifying output device by it's audio endpoint GUID or by the device id string (Oculus VR api requires you to play back on a specific device). 2016-09-06 19:25:44 -05:00
Chris Robinson
1d9d1958db Make the SelectMixer function sharable 2016-09-06 13:21:11 -07:00
Thomas Petazzoni
27916ce3db Build NEON code with -mfpu=neon
The ARM-specific NEON code needs to be built with -mfpu=neon to avoid
build failures when a difference FPU is used by default by the
compiler.

Fixes issue #54.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-09-06 22:19:14 +02:00
Chris Robinson
9cbe02fd85 Use the optimized mixing functions for reverb output 2016-09-06 12:16:49 -07:00
Chris Robinson
0558869d94 Use deinterlaced buffers for the intermediate reverb storage 2016-09-06 11:07:45 -07:00
Chris Robinson
a758cc8243 Remove use of DECL_CONST
No idea if it was really gaining us anything, but removing it fixes a crash I
was getting with libs built with Clang.
2016-09-06 09:09:25 -07:00
Chris Robinson
1541ff24b8 Do reverb modulation before band-pass filtering
Ideally the band-pass should probably happen closer to output, like gain is.
However, doing that would require 16 filters (4 early + 4 late channels, each
with a low-pass and high-pass filter), compared to the two needed to do it on
input.
2016-09-06 07:02:17 -07:00
Chris Robinson
b1f70b5b78 Rename some variables for clarity 2016-09-06 03:10:38 -07:00
Chris Robinson
564030ffa4 Use more correct cube decoder matrices 2016-09-05 10:33:52 -07:00
Chris Robinson
a20576bbd7 Do multiple samples at once for reverb modulation 2016-09-05 06:08:01 -07:00
Chris Robinson
8a64f07121 Use a predefined identity matrix 2016-09-05 02:02:14 -07:00
Chris Robinson
42452b7f79 Correct a comment about B-Format conversion 2016-09-05 00:38:41 -07:00
Chris Robinson
cf0ef500ec Rename MatrixMixerFunc to RowMixerFunc 2016-09-02 00:29:46 -07:00
Chris Robinson
17636a0c1c Calculate a variable closer to where it's used 2016-09-01 21:05:24 -07:00
Chris Robinson
7428636071 Use MixMatrixRow to upsample the split frequency bands to the output 2016-09-01 07:08:52 -07:00
Chris Robinson
6fb634c3e1 Remove unnecessary consts
They were causing GCC's built-in atomic cmpxchg to complain.
2016-08-31 09:26:57 -07:00
Chris Robinson
7a140b6912 Reorganize sample type conversion functions
To help avoid redundant manual definitions.
2016-08-31 08:30:52 -07:00
Chris Robinson
566d449e53 Always load HRTF files through memory pointers 2016-08-31 08:16:49 -07:00
Chris Robinson
e01c337921 Add some helper wrappers to mmap files 2016-08-31 08:14:50 -07:00
Chris Robinson
ccf90df072 Initialize some enums to dummy values 2016-08-31 04:56:10 -07:00
Chris Robinson
f791b8c517 Add a compile-time macro to use dual-band ambisonic HRTF processing
Use single-band processing for now, to see if dual-band is causing a drop in
quality at all.
2016-08-30 22:33:33 -07:00
Chris Robinson
8d3a286577 Simplify the ambisonic up-sampler
It still behaves the same, although now combines the separate decode+encode
matrices into a transcode matrix (one per frequency band).
2016-08-30 04:21:57 -07:00
Chris Robinson
6d7f9aacd6 Print whether direct channels are off or on to stdout in alffplay 2016-08-29 22:18:44 -07:00
Chris Robinson
4859984e33 Add an option to alffplay to toggle AL_DIRECT_CHANNELS_SOFT
Using the 'd' key will toggle the playback source's AL_DIRECT_CHANNELS_SOFT
property. Although there is no visual feedback showing when it's on or off.
2016-08-29 01:55:44 -07:00
Chris Robinson
54649851fa Remove the upper limit from AL_MIN_GAIN and AL_MAX_GAIN
As per the current AL_SOFT_gain_clamp_ex proposal.
2016-08-29 01:53:52 -07:00
Chris Robinson
5bf0c64258 Add a query for the maximum source gain limit 2016-08-28 18:21:09 -07:00
Chris Robinson
3d59021702 Clamp the maximum mixing gain boost to 16
The combined source and listener gains now can't exceed a multiplier of 16
(~24dB). This is to avoid mixes getting out of control with large volume
boosts, which reduces the effective precision given by floating-point.
2016-08-27 06:28:04 -07:00
Chris Robinson
4b153dade8 Allow sources to play while alcSuspendContext is in effect
This appears to be how Creative's Windows drivers handle it, and is necessary
for at least the Windows version of UT2k4 (otherwise it tries to play a source
while suspended, checks and sees it's stopped, then kills it before it's given
a chance to start playing).

Consequently, the internal properties it gets mixed with are determined by what
the source properties are at the time of the play call, and the listener
properties at the time of the suspend call.

This does not change alDeferUpdatesSOFT, which will still hold the play state
change until alProcessUpdatesSOFT.
2016-08-26 21:19:38 -07:00
Chris Robinson
ef03de3981 Avoid directly replacing the effect slot Update pointer 2016-08-25 18:19:13 -07:00
Chris Robinson
a16739f765 Properly defer effect slot changes
Note that this now also causes all playing sources to update when an effect
slot is updated. This is a bit wasteful, as it should only need to re-update
sources that are using the effect slot (and only when a relevant property is
changed), but it's good enough. Especially with deferring since all playing
sources are going to get updated on the process call anyway.
2016-08-25 06:17:36 -07:00
Chris Robinson
4e4e597fa5 Track all references for effect states
This allows us to not have to play around with trying to avoid duplicate state
pointers, since the reference count will ensure they're deleted as appropriate.
The only caveat is that the mixer is not allowed to decrement references, since
that can cause the object to be freed (which the mixer code is not allowed to
do).
2016-08-25 04:57:58 -07:00
Chris Robinson
0fbf34fb45 Add a ref count to ALeffectState
This is mostly just reorganizing the effects to call the Construct method which
initializes the ref count.
2016-08-25 03:49:57 -07:00
Chris Robinson
d8e9b3c621 Also rotate stereo sounds in the alhrtf example 2016-08-24 03:49:45 -07:00
Chris Robinson
849f85549d Consolidate duplicate code 2016-08-24 02:17:55 -07:00
Chris Robinson
8bf4a22876 Combine related members into a struct 2016-08-24 00:25:28 -07:00
Chris Robinson
e77de8b12a Make a function definition static 2016-08-23 23:57:55 -07:00
Chris Robinson
ea2fb38627 Hold updates for both listener and source updates 2016-08-23 19:37:26 -07:00
Chris Robinson
c7eb0b7393 Don't pass the context's distance model as the source's 2016-08-23 19:17:17 -07:00
Chris Robinson
dc8b7814c7 Avoid resupplying unneeded source updates
The source's voice holds a copy of the last properties it received, so listener
updates can make sources recalculate internal properties from that stored copy.
2016-08-23 18:56:01 -07:00