Commit Graph

5007 Commits

Author SHA1 Message Date
Chris Robinson
22a7bcd5ad Avoid placing a 2K sample buffer on the stack 2018-03-21 09:01:32 -07:00
Chris Robinson
ecc51c8c55 Clean up some code formatting in the pitch shifter source
Clean up excessive newlines and extra-long comments, move static inline
definitions to their declarations.
2018-03-21 08:56:26 -07:00
Chris Robinson
55a73b8df9 Fix for older MSVC lacking strtof 2018-03-21 08:35:37 -07:00
kcat
c40b4ce3f2
Merge pull request #177 from Raulshc/Pitch-shifter
EFX:Pitch shifter
2018-03-21 08:35:09 -07:00
Chris Robinson
47260fc70b Update the multi-reverb example with improved transitions
This better calculates the environment coverage by correctly calculating the
portal's extents, improves the panning direction when close to the portal, and
applies attenuation based on contribution. Movement has changed to make the
listener move back and forth between environments with a stationary source,
rather than continually looping environments with a position-relative source.
2018-03-20 23:58:32 -07:00
Raulshc
c38854fe3d
EFX:Own size for pitch shifter buffers 2018-03-19 16:48:00 +01:00
Chris Robinson
df6e4617e4 Fix the reverb panning behavior to better fit the spec
Previously it would attenuate the response from direction opposite to the
vector, whereas the property descriptions say it should simply move all
reflections toward the given direction.
2018-03-19 06:41:38 -07:00
Raulshc
56423b9ef1
Alsoft-config: Add pitch shifter effect 2018-03-18 17:53:07 +01:00
Raulshc
6fd23f0984
EFX:Pitch Shifter implementation
Add pitch shifter effect using standard phase vocoder, based on work of Stephan Bernsee. Only mono signal processing by now.
2018-03-18 17:47:17 +01:00
Chris Robinson
325fca5215 Change the presets for the multireverb example 2018-03-16 05:01:00 -07:00
Chris Robinson
3fde27d890 Use a macro template to define similar functions 2018-03-15 00:28:49 -07:00
Chris Robinson
445f63f350 Remove an extraneous + 2018-03-14 23:59:20 -07:00
Chris Robinson
603e3e23ac Remove an outdated comment 2018-03-14 23:51:13 -07:00
Chris Robinson
2011421e18 Release the PulseAudio mainloop lock sooner 2018-03-14 23:48:46 -07:00
Chris Robinson
7c0e68a33e Store the filter history in local variables
Despite being marked as restrict (and const for src) to mark the pointers as
being non-aliased, it seems the compiler optimizes better this way.
2018-03-14 17:27:41 -07:00
Chris Robinson
f65e83c349 Avoid using pa_stream_begin_write with PulseAudio
It seems to actually have a negative performance impact when the system is
under load. Without having actual measurements for any potential benefits,
simply go with the recommended (and previous fallback) method of allocating
space for the write and passing the free method.

Ideally some kind of ring buffer could be used, so rather than constantly
allocating and freeing blocks of memory, it uses the same memory over again
with the callback marking each one as reusable. Unfortunately the callback
isn't given much information to work with, and the update size (minreq) can
potentially change during playback, which complicates things.
2018-03-14 03:21:26 -07:00
Chris Robinson
942abab8f9 Move a loop into a function 2018-03-13 03:45:24 -07:00
Chris Robinson
8eb7a94e1c Apply a distance decay on the source send for the reverb's DecayLFRatio 2018-03-11 22:40:08 -07:00
Chris Robinson
6b35a4534f Comment and clarify some code 2018-03-11 22:18:11 -07:00
Chris Robinson
dac9379449 Add methods to clean up althrd and altss data 2018-03-10 12:10:58 -08:00
Chris Robinson
a6ddeaf5f1 Rename the mmdevapi backend to wasapi 2018-03-09 18:56:24 -08:00
Chris Robinson
30821e978b Add extern "C" to some headers 2018-03-09 17:24:03 -08:00
Chris Robinson
c0e7a5b8b0 Prefix SDL2 device names on Windows 2018-03-09 11:41:28 -08:00
Chris Robinson
8b24255557 Request the device's sample type for SDL2 2018-03-09 10:53:03 -08:00
Chris Robinson
46e7e96eb3 Store the frame size for the SDL2 backend 2018-03-08 22:23:36 -08:00
Chris Robinson
41cc82e84b Print the unsupported values from SDL2 2018-03-08 22:09:30 -08:00
Chris Robinson
2866c6cf28 Init and quit the SDL2 audio subsystem with the factory 2018-03-08 18:59:22 -08:00
Chris Robinson
0c7fa1b955 Avoid deinitializing backends that never initialized 2018-03-08 18:53:49 -08:00
Chris Robinson
aa7df8183f Also save the update size with SDL2 2018-03-08 18:22:03 -08:00
Chris Robinson
58760e6184 Use the audio device lock for the SDL2 backend 2018-03-08 18:16:10 -08:00
Chris Robinson
52ca70d98e Properly close the SDL2 audio device 2018-03-08 18:12:14 -08:00
Chris Robinson
d4fc87fc9c Avoid calling SDL_GetNumAudioDevices multiple times 2018-03-08 18:07:49 -08:00
Chris Robinson
2187316bce Use function-like macros to call filter and effect vtable methods 2018-03-08 17:48:22 -08:00
Chris Robinson
52dee31270 Only calculate the modulation samples once for all 4 channels 2018-03-08 17:48:22 -08:00
Chris Robinson
22d3e3b563 Simplify modulator effect index updating 2018-03-08 17:48:21 -08:00
Chris Robinson
4e613c5d4b Rename UpdateContextSources for clarity 2018-03-08 17:48:21 -08:00
Chris Robinson
07c8857558 Fix struct forward declaration typo 2018-03-08 17:48:21 -08:00
Chris Robinson
9bd1678299 Fix adding to and removing from the active effect slots
It wasn't properly removing all duplicates on insertion, and didn't remove the
first effect slot when removing them.
2018-03-08 17:48:21 -08:00
Chris Robinson
19281868dc Properly limit the max number of effect slots to 2^31 - 1 2018-03-08 17:48:21 -08:00
kcat
5133fe5115
Merge pull request #175 from jhasse/sdl2-backend
Add SDL2 backend for playback, fix #173
2018-03-08 17:47:32 -08:00
Jan Niklas Hasse
2eb29d538b SDL2 backend: Reset device parameters 2018-03-08 20:42:47 +01:00
Jan Niklas Hasse
0af075b5ff SDL2 backend: Allow changes to channels and format 2018-03-08 20:27:02 +01:00
Jan Niklas Hasse
ef2b813776 SDL2 backend: Allow frequency changes 2018-03-08 10:17:02 +01:00
Jan Niklas Hasse
a6f93a501a Handle passing NULL to SDL_OpenAudioDevice as a special device
https://discourse.libsdl.org/t/changing-audio-output-when-the-default-audio-playback-device-changes/22399/2
2018-03-08 10:07:22 +01:00
Jan Niklas Hasse
767807cd22 SDL2 backend: Use callback instead of a timing loop
The system clock and audio clock aren't necessarily synchronized.
2018-03-08 09:51:44 +01:00
Jan Niklas Hasse
86319127e3 Add SDL2 backend for playback, fix #173 2018-03-07 20:57:53 +01:00
Chris Robinson
179e1c4dbc Don't check for space in the ringbuffer before trying to write
The write method already checks and returns how much it managed to fit in.
2018-03-03 21:57:42 -08:00
Chris Robinson
945d74cbc9 Avoid some code duplication 2018-03-03 14:04:10 -08:00
Chris Robinson
b8636a3dbf Add some missing locks to protect reading state 2018-03-03 13:54:21 -08:00
Chris Robinson
4e6c758daf Use a plain mutex for the property lock 2018-03-03 13:42:37 -08:00