Commit Graph

6921 Commits

Author SHA1 Message Date
Chris Robinson 504745abec Use a standard bool instead of ALboolean 2020-03-28 18:15:05 -07:00
Chris Robinson e78cb9b77f Avoid using more unnecessary type aliases 2020-03-28 18:15:04 -07:00
kcat 3fce1c4217 Merge pull request #405 from aaronmjacobs/cmake-fixes
Fix find_package_handle_standard_args name mismatch warnings
2020-03-28 18:14:34 -07:00
Aaron Jacobs a3a2305d7a Fix find_package_handle_standard_args name mismatch warnings 2020-03-28 17:43:17 -07:00
kcat 6cfb4ec462 Merge pull request #404 from jhasse/cmake-no-cxx-compiler
Don't require a C++ compiler for native-tools
2020-03-27 12:35:23 -07:00
Jan Niklas Hasse 2a3c7ccd81 Don't require a C++ compiler for native-tools
"By default C and CXX are enabled if no language options are given."
https://cmake.org/cmake/help/v3.17/command/project.html
2020-03-27 20:14:25 +01:00
Chris Robinson 8731accd3f Make sure prebuf is filled when starting pulseaudio playback 2020-03-27 01:03:01 -07:00
Chris Robinson e73c0979a1 Use "zero-copy" writes with pulseaudio playback 2020-03-26 22:50:54 -07:00
Chris Robinson d344c5a228 Avoid some extraneous uses of AL type aliases 2020-03-25 22:39:45 -07:00
Chris Robinson e8149ec509 Move some setup to a more logical place 2020-03-25 22:24:09 -07:00
Chris Robinson a27096dd63 Dynamically allocate voice channel data
Rather than allocating for a full 8 channels for each voice, when the vast
majority will only need 1 or 2. The voice channel data is relatively big since
it needs to hold HRTF coefficients and history, and this will allow increasing
the maximum number of buffer channels without an obscene memory increase.
2020-03-25 21:06:24 -07:00
Chris Robinson cae78e79e8 Convert the examples from SDL_sound to libsndfile 2020-03-24 15:46:47 -07:00
Chris Robinson 586bc94d51 Use libsndfile for the alplay example 2020-03-24 13:36:49 -07:00
Chris Robinson c24d127229 Avoid non-namespace template specialization 2020-03-24 12:03:07 -07:00
Chris Robinson cc27bbb680 Clear the WASAPI device list when enumerating 2020-03-24 11:48:25 -07:00
Chris Robinson 62f17d8763 Don't send close messages for unopened WASAPI devices 2020-03-24 11:40:34 -07:00
Chris Robinson eed8407599 Remove some unused functions 2020-03-23 17:18:11 -07:00
Chris Robinson 7effad45c2 Clean up ALfilter some
Use inline methods instead of macros
Fix indentation
Add some consts
2020-03-23 16:31:08 -07:00
Chris Robinson 6a3b3b180b Add a macro to disable class-specific new/delete 2020-03-23 16:00:50 -07:00
Chris Robinson b53294e291 Use inline initialization more for sources 2020-03-23 15:04:26 -07:00
Chris Robinson 5d0f90fed0 Avoid ## in a macro
Cppcheck thinks it's an invalid use of it
2020-03-23 14:26:00 -07:00
Chris Robinson 41b4c06697 Simplify clamping the voice mix size 2020-03-23 11:35:08 -07:00
Chris Robinson 132a69c03d Use more appropriate types for bitfields 2020-03-22 21:34:50 -07:00
Chris Robinson 46234171d1 Clean up some C++11-isms 2020-03-22 21:15:12 -07:00
Chris Robinson dc8ccc06ce More cleanup for the pitch shifter 2020-03-22 20:48:02 -07:00
Chris Robinson 813d4ed566 Use make_unique instead of new'ing into a unique_ptr 2020-03-22 18:48:33 -07:00
Chris Robinson 49b2d703e7 Properly define the new[] and delete[] operators 2020-03-22 13:28:45 -07:00
Chris Robinson 3c631149e3 Update AppVeyor to VS 2017 for 32-bit 2020-03-22 11:41:57 -07:00
Chris Robinson be1584ab47 Avoid assigning in a conditional expression 2020-03-22 11:35:08 -07:00
Chris Robinson ef663f13c0 Properly allocate voices 2020-03-22 11:34:37 -07:00
Chris Robinson 3d09898d40 Use the correct include for al::fstream 2020-03-22 11:09:19 -07:00
Chris Robinson 2acdcba8d1 Silence a potential type truncation warning 2020-03-22 10:41:23 -07:00
Chris Robinson f3ff28fb2a Some type cleanup 2020-03-22 10:41:02 -07:00
Chris Robinson d30d9a2c9f Clean up the pitch and frequency shifter some 2020-03-22 10:06:23 -07:00
Chris Robinson 002d0eb6a0 Fix the frequency shifter channel panning 2020-03-22 08:51:59 -07:00
Chris Robinson 9ce182228d Avoid some pre-C++14 workarounds 2020-03-22 08:51:06 -07:00
Chris Robinson 040309b9f4 Add missing semicolon 2020-03-22 08:22:25 -07:00
Chris Robinson f6a0b004e0 Update to C++14 2020-03-22 08:05:22 -07:00
Chris Robinson adf28d87aa Remove the check for stat()
It's POSIX-2001 standard
2020-03-21 08:39:45 -07:00
Chris Robinson 12775513ae Cleanup some helper code 2020-03-20 15:48:27 -07:00
Chris Robinson 0d11de3e8d Move CPUCapFlags and FillCPUCaps to their own source 2020-03-20 15:30:41 -07:00
Chris Robinson f56ef433d8 Move the FPUCtl methods to its own source 2020-03-20 15:01:45 -07:00
Chris Robinson ad98895876 Avoid a function call to get the channel count 2020-03-18 04:08:26 -07:00
Chris Robinson 7805179313 Rename a method to be clearer 2020-03-18 03:17:14 -07:00
Chris Robinson 54e2eafcc9 Make the pulseaudio enumeration functions class methods 2020-03-18 03:07:54 -07:00
Chris Robinson 9f077d5f41 Remove a couple unused methods 2020-03-18 02:35:31 -07:00
Chris Robinson bf50f227b9 Use a busy-wait when synchronizing against the mixer
The mixer should have higher priority than any thread that can make AL calls,
so even on single-core systems, it shouldn't stall the mix. It will, however,
return back to the caller as soon as it can, while yielding will give up the
timeslice if there's any other thread waiting to process even if the mix is
almost done.
2020-03-16 01:05:14 -07:00
Chris Robinson 78251fd7e6 Fix voices being forced to update without valid properties
When starting a voice, the source ID was set before its first update struct was
provided, creating a small window where a listener or effect slot update could
force a voice to update without it having any valid properties to update with.
Supplying the update struct first would create a different race, where the
mixer could see a voice without a source but with an update struct, causing the
update struct to be 'freed' without being applied.

The fix here is to provide the update struct before setting the source ID, and
change the mixer to ignore update structs for voices without a source ID. This
can pseudo-orphan the updates that get set on a voice just as it stops, leaving
the struct unusable until the voice is used again, or the voice gets deleted
which will clear it. But it allows the update struct to stay in place and get
applied once the voice gets a source ID.
2020-03-04 23:18:05 -08:00
Chris Robinson 48b9b541ec Avoid redundantly setting voice members 2020-03-04 13:40:21 -08:00
Chris Robinson 971862a80c Don't change flags after InitVoice 2020-03-04 11:01:35 -08:00